diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-09-05 08:50:23 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-09-05 08:50:23 +0000 |
commit | d0370fe7c59d1a70c527c413389679b1d42bab10 (patch) | |
tree | c27888abb8b22ef28d51037269a8909947e4937b /src/charts | |
parent | 59192857ba65c14388bbe5b1633a4f1ac346e9d1 (diff) | |
download | zetacomponents-graph-d0370fe7c59d1a70c527c413389679b1d42bab10.zip zetacomponents-graph-d0370fe7c59d1a70c527c413389679b1d42bab10.tar.gz |
- Implemented feature #11325: Allow values of 0 to be added to pie charts, to
be included in the legend and not rendered in the actual pie.
Diffstat (limited to 'src/charts')
-rw-r--r-- | src/charts/pie.php | 10 |
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: |