diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2007-04-26 12:51:55 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2007-04-26 12:51:55 +0000 |
commit | 6f37572b09e427428c9c50f2a325163ad29ba0a2 (patch) | |
tree | 2242bd28f3cfed0460cb01ed9933ffcd273b4cdf /src | |
parent | 1f98a107eef3f2208f7b409f085057cf78662991 (diff) | |
download | zetacomponents-graph-6f37572b09e427428c9c50f2a325163ad29ba0a2.zip zetacomponents-graph-6f37572b09e427428c9c50f2a325163ad29ba0a2.tar.gz |
- Created an interface ezcGraphRadarRenderer to be implemented by renderers
which are able to render radar charts.
# Interface required to not break BC with custom user renderers
Diffstat (limited to 'src')
-rw-r--r-- | src/charts/radar.php | 10 | ||||
-rw-r--r-- | src/graph_autoload.php | 1 | ||||
-rw-r--r-- | src/interfaces/radar_renderer.php | 54 | ||||
-rw-r--r-- | src/interfaces/renderer.php | 34 | ||||
-rw-r--r-- | src/renderer/2d.php | 4 | ||||
-rw-r--r-- | src/renderer/3d.php | 4 |
6 files changed, 71 insertions, 36 deletions
diff --git a/src/charts/radar.php b/src/charts/radar.php index d545697..a3913ba 100644 --- a/src/charts/radar.php +++ b/src/charts/radar.php @@ -118,6 +118,16 @@ class ezcGraphRadarChart extends ezcGraphChart throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphChartElementAxis' ); } break; + case 'renderer': + if ( $propertyValue instanceof ezcGraphRadarRenderer ) + { + parent::__set( $propertyName, $propertyValue ); + } + else + { + throw new ezcBaseValueException( $propertyName, $propertyValue, 'ezcGraphRadarRenderer' ); + } + break; default: parent::__set( $propertyName, $propertyValue ); } diff --git a/src/graph_autoload.php b/src/graph_autoload.php index db1dc42..c089191 100644 --- a/src/graph_autoload.php +++ b/src/graph_autoload.php @@ -37,6 +37,7 @@ return array( 'ezcGraphUnknownColorDefinitionException' => 'Graph/exceptions/unknown_color_definition.php', 'ezcGraphRenderer' => 'Graph/interfaces/renderer.php', + 'ezcGraphRadarRenderer' => 'Graph/interfaces/radar_renderer.php', 'ezcGraphRendererOptions' => 'Graph/options/renderer.php', 'ezcGraphRenderer2d' => 'Graph/renderer/2d.php', 'ezcGraphRenderer2dOptions' => 'Graph/options/renderer_2d.php', diff --git a/src/interfaces/radar_renderer.php b/src/interfaces/radar_renderer.php new file mode 100644 index 0000000..a8978d1 --- /dev/null +++ b/src/interfaces/radar_renderer.php @@ -0,0 +1,54 @@ +<?php +/** + * File containing the ezcGraphRadarRenderer interface + * + * @package Graph + * @version //autogentag// + * @copyright Copyright (C) 2005-2007 eZ systems as. All rights reserved. + 2006 eZ systems as. All rights reserved. + * @license http://ez.no/licenses/new_bsd New BSD License + */ +/** + * Interface which adds the methods required for rendering radar charts to a + * renderer + * + * @package Graph + */ +interface ezcGraphRadarRenderer +{ + /** + * Draw radar chart data line + * + * Draws a line as a data element in a radar chart + * + * @param ezcGraphBoundings $boundings Chart boundings + * @param ezcGraphContext $context Context of call + * @param ezcGraphColor $color Color of line + * @param ezcGraphCoordinate $center Center of radar chart + * @param ezcGraphCoordinate $start Starting point + * @param ezcGraphCoordinate $end Ending point + * @param int $dataNumber Number of dataset + * @param int $dataCount Count of datasets in chart + * @param int $symbol Symbol to draw for line + * @param ezcGraphColor $symbolColor Color of the symbol, defaults to linecolor + * @param ezcGraphColor $fillColor Color to fill line with + * @param float $thickness Line thickness + * @return void + */ + public function drawRadarDataLine( + ezcGraphBoundings $boundings, + ezcGraphContext $context, + ezcGraphColor $color, + ezcGraphCoordinate $center, + ezcGraphCoordinate $start, + ezcGraphCoordinate $end, + $dataNumber = 1, + $dataCount = 1, + $symbol = ezcGraph::NO_SYMBOL, + ezcGraphColor $symbolColor = null, + ezcGraphColor $fillColor = null, + $thickness = 1 + ); +} + +?> diff --git a/src/interfaces/renderer.php b/src/interfaces/renderer.php index 1014330..a9908f5 100644 --- a/src/interfaces/renderer.php +++ b/src/interfaces/renderer.php @@ -189,40 +189,6 @@ abstract class ezcGraphRenderer ); /** - * Draw radar chart data line - * - * Draws a line as a data element in a radar chart - * - * @param ezcGraphBoundings $boundings Chart boundings - * @param ezcGraphContext $context Context of call - * @param ezcGraphColor $color Color of line - * @param ezcGraphCoordinate $center Center of radar chart - * @param ezcGraphCoordinate $start Starting point - * @param ezcGraphCoordinate $end Ending point - * @param int $dataNumber Number of dataset - * @param int $dataCount Count of datasets in chart - * @param int $symbol Symbol to draw for line - * @param ezcGraphColor $symbolColor Color of the symbol, defaults to linecolor - * @param ezcGraphColor $fillColor Color to fill line with - * @param float $thickness Line thickness - * @return void - */ - abstract public function drawRadarDataLine( - ezcGraphBoundings $boundings, - ezcGraphContext $context, - ezcGraphColor $color, - ezcGraphCoordinate $center, - ezcGraphCoordinate $start, - ezcGraphCoordinate $end, - $dataNumber = 1, - $dataCount = 1, - $symbol = ezcGraph::NO_SYMBOL, - ezcGraphColor $symbolColor = null, - ezcGraphColor $fillColor = null, - $thickness = 1 - ); - - /** * Draws a highlight textbox for a datapoint. * * A highlight textbox for line and bar charts means a box with the current diff --git a/src/renderer/2d.php b/src/renderer/2d.php index 7663ddb..2fdda9b 100644 --- a/src/renderer/2d.php +++ b/src/renderer/2d.php @@ -14,7 +14,9 @@ * @package Graph * @mainclass */ -class ezcGraphRenderer2d extends ezcGraphRenderer +class ezcGraphRenderer2d + extends ezcGraphRenderer + implements ezcGraphRadarRenderer { /** diff --git a/src/renderer/3d.php b/src/renderer/3d.php index a93f740..93e287c 100644 --- a/src/renderer/3d.php +++ b/src/renderer/3d.php @@ -14,7 +14,9 @@ * @package Graph * @mainclass */ -class ezcGraphRenderer3d extends ezcGraphRenderer +class ezcGraphRenderer3d + extends ezcGraphRenderer + implements ezcGraphRadarRenderer { /** |