summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/graph.php47
-rw-r--r--src/interfaces/chart.php4
2 files changed, 2 insertions, 49 deletions
diff --git a/src/graph.php b/src/graph.php
index a9e97ab..fa4555a 100644
--- a/src/graph.php
+++ b/src/graph.php
@@ -14,7 +14,6 @@
*/
class ezcGraph
{
-
const NO_SYMBOL = 0;
const DIAMOND = 1;
const BULLET = 2;
@@ -30,52 +29,6 @@ class ezcGraph
const RIGHT = 8;
const CENTER = 16;
const MIDDLE = 32;
-
- static protected $chartTypes = array(
- 'pie' => 'ezcGraphPieChart',
- 'line' => 'ezcGraphLineChart',
- );
-
- /**
- * create
- *
- * @param string $type Type of chart to create
- * @param array $options Options to create the chart with
- * @throws ezcGraphUnknownChartTypeException
- * @return ezcGraphChart
- */
- static public function create( $type, $options = array() )
- {
- $type = strtolower( $type );
- if ( isset( self::$chartTypes[$type] ) )
- {
- $className = self::$chartTypes[$type];
- return new $className( $options );
- }
- else
- {
- throw new ezcGraphUnknownChartTypeException($type);
- }
- }
-
- /**
- * Creates a palette from given name
- *
- * @param string $name Name of the palette
- * @return ezcGraphPalette Created palette
- */
- static public function createPalette( $name )
- {
- $className = 'ezcGraphPalette' . $name;
- if ( class_exists( $className ) )
- {
- return new $className();
- }
- else
- {
- throw new ezcGraphUnknownPaletteException( $name );
- }
- }
}
?>
diff --git a/src/interfaces/chart.php b/src/interfaces/chart.php
index 0bef62b..ddcc184 100644
--- a/src/interfaces/chart.php
+++ b/src/interfaces/chart.php
@@ -66,7 +66,7 @@ abstract class ezcGraphChart implements ArrayAccess
public function __construct( array $options = array() )
{
- $this->__set( 'palette', 'Tango' );
+ $this->__set( 'palette', new ezcGraphPaletteTango() );
// Add standard elements
$this->addElement( 'title', new ezcGraphChartElementText() );
@@ -144,7 +144,7 @@ abstract class ezcGraphChart implements ArrayAccess
}
else
{
- $this->palette = ezcGraph::createPalette( $propertyValue );
+ throw new ezcBaseValueException( "palette", $propertyValue, "instanceof ezcGraphPalette" );
}
$this->setFromPalette( $this->palette );
OpenPOWER on IntegriCloud