summaryrefslogtreecommitdiffstats
path: root/src/charts/pie.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/charts/pie.php')
-rw-r--r--src/charts/pie.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/charts/pie.php b/src/charts/pie.php
index 8396492..85bf7a2 100644
--- a/src/charts/pie.php
+++ b/src/charts/pie.php
@@ -87,13 +87,17 @@ class ezcGraphPieChart extends ezcGraphChart
switch ( $dataset->displayType->default )
{
case ezcGraph::PIE:
+ $displayLabel = ( $this->options->labelCallback !== null
+ ? call_user_func( $this->options->labelCallback, $label, $value, $value / $sum )
+ : sprintf( $this->options->label, $label, $value, $value / $sum * 100 ) );
+
$renderer->drawPieSegment(
$boundings,
new ezcGraphContext( $datasetName, $label ),
$dataset->color[$label],
$angle,
$angle += $value / $sum * 360,
- sprintf( $this->options->label, $label, $value, $value / $sum * 100 ),
+ $displayLabel,
$dataset->highlight[$label]
);
break;
OpenPOWER on IntegriCloud