summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/charts/pie.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/charts/pie.php b/src/charts/pie.php
index f99766b..ff611a7 100644
--- a/src/charts/pie.php
+++ b/src/charts/pie.php
@@ -96,9 +96,9 @@ class ezcGraphPieChart extends ezcGraphChart
$sum = 0;
foreach ( $dataset as $name => $value )
{
- if ( $value <= 0 )
+ if ( $value < 0 )
{
- throw new ezcGraphInvalidDataException( "Values > 0 required, '$name' => '$value'." );
+ throw new ezcGraphInvalidDataException( "Values >= 0 required, '$name' => '$value'." );
}
$sum += $value;
@@ -116,6 +116,12 @@ class ezcGraphPieChart extends ezcGraphChart
$angle = 0;
foreach ( $dataset as $label => $value )
{
+ // Skip rendering values which equals 0
+ if ( $value <= 0 )
+ {
+ continue;
+ }
+
switch ( $dataset->displayType->default )
{
case ezcGraph::PIE:
OpenPOWER on IntegriCloud