diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-04-12 12:45:42 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-04-12 12:45:42 +0000 |
commit | e3c691c66bc360caae052a7387a258ac8af0c2a1 (patch) | |
tree | eda7c4184d615f590e20bf142b7dcd24bbe7f20c /src/element | |
parent | 40b5444276af768209c8a6b0df633b150da86ac8 (diff) | |
download | zetacomponents-graph-e3c691c66bc360caae052a7387a258ac8af0c2a1.zip zetacomponents-graph-e3c691c66bc360caae052a7387a258ac8af0c2a1.tar.gz |
- Added feature #10470: Add support for format callback functions on all axis
Diffstat (limited to 'src/element')
-rw-r--r-- | src/element/axis.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/element/axis.php b/src/element/axis.php index c3cab21..b57c75d 100644 --- a/src/element/axis.php +++ b/src/element/axis.php @@ -35,6 +35,11 @@ * Maximum Size used to draw arrow heads. * @property ezcGraphAxisLabelRenderer $axisLabelRenderer * AxisLabelRenderer used to render labels and grid on this axis. + * @property callback $labelCallback + * Callback function to format pie chart labels. + * Function will receive two parameters and should return a + * reformatted label. + * string function( label, step ) * * @package Graph */ @@ -67,6 +72,7 @@ abstract class ezcGraphChartElementAxis extends ezcGraphChartElement $this->properties['labelSize'] = 14; $this->properties['labelMargin'] = 2; $this->properties['maxArrowHeadSize'] = 8; + $this->properties['labelCallback'] = null; parent::__construct( $options ); @@ -186,6 +192,16 @@ abstract class ezcGraphChartElementAxis extends ezcGraphChartElement throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphAxisLabelRenderer' ); } break; + case 'labelCallback': + if ( is_callable( $propertyValue ) ) + { + $this->properties['labelCallback'] = $propertyValue; + } + else + { + throw new ezcBaseValueException( $propertyName, $propertyValue, 'callback function' ); + } + break; default: parent::__set( $propertyName, $propertyValue ); break; |