From 24cd80089bcdc9c8ef484d1016581a8b52b84150 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Sep 2008 14:00:23 +0200 Subject: [PATCH] Added support for percentage display in pie chart --- src/chartgenerator.php | 16 +++++++++++----- src/templates/statistics.html | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/chartgenerator.php b/src/chartgenerator.php index a876958..37863ef 100644 --- a/src/chartgenerator.php +++ b/src/chartgenerator.php @@ -109,7 +109,7 @@ if ( isset($_GET['showpercent']) ) $content['showpercent'] = 0; } else - $content['maxrecords'] = 10; + $content['showpercent'] = 0; // --- // --- BEGIN CREATE TITLE @@ -200,10 +200,16 @@ if ( !$content['error_occured'] ) // $p1->SetCSIMTargets($targ,$alts); // Set label format - $p1->SetLabelType(0); - $p1->value->SetFormat("%d%%"); -// $p1->SetLabelType(1); -// $p1->value->SetFormat("%d"); + if ( $content['showpercent'] == 1 ) + { + $p1->SetLabelType(0); + $p1->value->SetFormat("%d%%"); + } + else + { + $p1->SetLabelType(1); + $p1->value->SetFormat("%d"); + } // Set label properties $p1->SetLabelPos(1.0); diff --git a/src/templates/statistics.html b/src/templates/statistics.html index 0f410ea..35cf859 100644 --- a/src/templates/statistics.html +++ b/src/templates/statistics.html @@ -49,7 +49,7 @@  {showpercent_display} - +