Author: Kore Nordmann
Date: 2007-04-26 14:51:55 +0200 (Thu, 26 Apr 2007)
New Revision: 4931

Log:
- 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

Added:
   trunk/Graph/src/interfaces/radar_renderer.php
Modified:
   trunk/Graph/src/charts/radar.php
   trunk/Graph/src/graph_autoload.php
   trunk/Graph/src/interfaces/renderer.php
   trunk/Graph/src/renderer/2d.php
   trunk/Graph/src/renderer/3d.php

Modified: trunk/Graph/src/charts/radar.php
===================================================================
--- trunk/Graph/src/charts/radar.php    2007-04-26 12:31:16 UTC (rev 4930)
+++ trunk/Graph/src/charts/radar.php    2007-04-26 12:51:55 UTC (rev 4931)
@@ -118,6 +118,16 @@
                     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 );
         }

Modified: trunk/Graph/src/graph_autoload.php
===================================================================
--- trunk/Graph/src/graph_autoload.php  2007-04-26 12:31:16 UTC (rev 4930)
+++ trunk/Graph/src/graph_autoload.php  2007-04-26 12:51:55 UTC (rev 4931)
@@ -37,6 +37,7 @@
     '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',

Added: trunk/Graph/src/interfaces/radar_renderer.php
===================================================================
--- trunk/Graph/src/interfaces/radar_renderer.php       2007-04-26 12:31:16 UTC 
(rev 4930)
+++ trunk/Graph/src/interfaces/radar_renderer.php       2007-04-26 12:51:55 UTC 
(rev 4931)
@@ -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
+    );
+}
+
+?>


Property changes on: trunk/Graph/src/interfaces/radar_renderer.php
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/Graph/src/interfaces/renderer.php
===================================================================
--- trunk/Graph/src/interfaces/renderer.php     2007-04-26 12:31:16 UTC (rev 
4930)
+++ trunk/Graph/src/interfaces/renderer.php     2007-04-26 12:51:55 UTC (rev 
4931)
@@ -189,40 +189,6 @@
     );
 
     /**
-     * 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 

Modified: trunk/Graph/src/renderer/2d.php
===================================================================
--- trunk/Graph/src/renderer/2d.php     2007-04-26 12:31:16 UTC (rev 4930)
+++ trunk/Graph/src/renderer/2d.php     2007-04-26 12:51:55 UTC (rev 4931)
@@ -14,7 +14,9 @@
  * @package Graph
  * @mainclass
  */
-class ezcGraphRenderer2d extends ezcGraphRenderer
+class ezcGraphRenderer2d 
+    extends ezcGraphRenderer
+    implements ezcGraphRadarRenderer
 {
 
     /**

Modified: trunk/Graph/src/renderer/3d.php
===================================================================
--- trunk/Graph/src/renderer/3d.php     2007-04-26 12:31:16 UTC (rev 4930)
+++ trunk/Graph/src/renderer/3d.php     2007-04-26 12:51:55 UTC (rev 4931)
@@ -14,7 +14,9 @@
  * @package Graph
  * @mainclass
  */
-class ezcGraphRenderer3d extends ezcGraphRenderer
+class ezcGraphRenderer3d 
+    extends ezcGraphRenderer
+    implements ezcGraphRadarRenderer
 {
 
     /**

-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to