From 37b1ea7ea2aec77c398dc55aad0067bba8968b22 Mon Sep 17 00:00:00 2001 From: Mark Oudsen Date: Fri, 12 Mar 2021 15:38:46 +0100 Subject: [PATCH] Added Stacked,Pie and Exploded graph type support (v1.23) --- mailGraph.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/mailGraph.php b/mailGraph.php index c480d57..e3dc956 100644 --- a/mailGraph.php +++ b/mailGraph.php @@ -28,6 +28,7 @@ // 1.21 2021/03/09 - Mark Oudsen - Reverted graph.get code back to original code as it was not a bug but // a wrongly typed requested (should be ARRAY, not comma separated)! // 1.22 2021/03/10 - Mark Oudsen - Added ability to embed multiple periods (1-4) of the same graph + // 1.23 2021/03/12 - Mark Oudsen - Added graph support for 'Stacked', 'Pie' and 'Exploded' // ------------------------------------------------------------------------------------------------------ // // (C) M.J.Oudsen, mark.oudsen@puzzl.nl @@ -50,7 +51,7 @@ // CONSTANTS - $cVersion = 'v1.22'; + $cVersion = 'v1.23'; $cCRLF = chr(10).chr(13); $maskDateTime = 'Y-m-d H:i:s'; @@ -147,7 +148,22 @@ // Relative web calls $z_url_index = $z_server ."index.php"; - $z_url_graph = $z_server ."chart2.php"; + + switch($graphType) + { + // 0: Normal + // 1: Stacked + case 0,1: + $z_url_graph = $z_server ."chart2.php"; + break; + + // 2: Pie + // 3: Exploded + case 2,3: + $z_url_graph = $z_server ."chart6.php"; + break; + } + $z_url_fetch = $z_url_graph ."?graphid=" .$graphid ."&width=" .$width ."&height=" .$height . "&graphtype=".$graphType."&legend=".$showLegend."&profileIdx=web.graphs.filter". "&from=now-".$period."&to=now";