Author: Kore Nordmann
Date: 2006-06-27 11:18:13 +0200 (Tue, 27 Jun 2006)
New Revision: 3156

Log:
- Applied API change for accessing datasets to be able to distinguish easier
  between chart elements and datasets
# Changes the way datasets are accessed for charts
# Old:
#  $chart->dataset = array( ... );
# New:
#  $chart['dataset'] = array( ... );

Added:
   trunk/Graph/src/exceptions/no_such_element.php
Modified:
   trunk/Graph/TODO
   trunk/Graph/design/design.txt
   trunk/Graph/src/graph_autoload.php
   trunk/Graph/src/interfaces/chart.php
   trunk/Graph/tests/background_image_test.php
   trunk/Graph/tests/dataset_test.php
   trunk/Graph/tests/font_test.php
   trunk/Graph/tests/labeled_axis_test.php
   trunk/Graph/tests/legend_test.php
   trunk/Graph/tests/line_test.php
   trunk/Graph/tests/numeric_axis_test.php
   trunk/Graph/tests/palette_test.php
   trunk/Graph/tests/pie_test.php
   trunk/Graph/tests/text_test.php

Modified: trunk/Graph/TODO
===================================================================
--- trunk/Graph/TODO    2006-06-27 08:33:20 UTC (rev 3155)
+++ trunk/Graph/TODO    2006-06-27 09:18:13 UTC (rev 3156)
@@ -10,6 +10,8 @@
 Next steps:
  - 3D-Renderer
  - SVG-Driver
+ - Return datapoinnt positions for imagemap and / or adding additional 
+   information with div overlays
  - TextElement to add copyright info etc.
  - GD-Driver
    - Antialiasing of lines

Modified: trunk/Graph/design/design.txt
===================================================================
--- trunk/Graph/design/design.txt       2006-06-27 08:33:20 UTC (rev 3155)
+++ trunk/Graph/design/design.txt       2006-06-27 09:18:13 UTC (rev 3156)
@@ -101,24 +101,24 @@
        $pie->options->border->color = '#ff0000';
        $pie->title = 'Apple Pie';
 
-       $pie->humanoids = array( 'monkey' => 54, 'ape' => 37, 'human' => 9 ); 
// adds a new data set
-       $pie->humanoids->color['monkey'] = 'blueish'; // setting datapoint color
-       $pie->humanoids->highlight( 'monkey' );       // chart type dependent
+       $pie['humanoids'] = array( 'monkey' => 54, 'ape' => 37, 'human' => 9 ); 
// adds a new data set
+       $pie['humanoids']->color['monkey'] = 'blueish'; // setting datapoint 
color
+       $pie['humanoids']->highlight( 'monkey' );       // chart type dependent
 
 
        $line = ezcGraph::create( 'Line' );
        $line->options->backgroundColor = 'pink';
 
-       $line->income = array( 1990 => 5, 5.1, 5.4, 5.3, 6.9 );
-       $line->income->color = 'blue';
-       $line->income->symbol = ezcGraph::diamond;
+       $line['income'] = array( 1990 => 5, 5.1, 5.4, 5.3, 6.9 );
+       $line['income']->color = 'blue';
+       $line['income']->symbol = ezcGraph::diamond;
 
-       $line->incomeWithTax = array( 1990 => 4.9, 5.0, 5.2, 5.1, 6.4 );
-       $line->incomeWithTax->color = 'red';
-       $line->incomeWithTax->symbol = ezcGraph::squareWithChupi;
+       $line['incomeWithTax'] = array( 1990 => 4.9, 5.0, 5.2, 5.1, 6.4 );
+       $line['incomeWithTax']->color = 'red';
+       $line['incomeWithTax']->symbol = ezcGraph::squareWithChupi;
 
        // Create a new averaging line
-       $line->averageIncome = ezcDataSetAverage::createFrom($line->income[, 
options]);
+       $line['averageIncome'] = ezcDataSetAverage::createFrom($line->income[, 
options]);
 
        $line->renderer = new ezcGraphRenderer2D();
        $line->driver = new ezcGraphGDDriver();

Added: trunk/Graph/src/exceptions/no_such_element.php
===================================================================
--- trunk/Graph/src/exceptions/no_such_element.php      2006-06-27 08:33:20 UTC 
(rev 3155)
+++ trunk/Graph/src/exceptions/no_such_element.php      2006-06-27 09:18:13 UTC 
(rev 3156)
@@ -0,0 +1,25 @@
+<?php
+/**
+ * File containing the ezcGraphNoSuchElementException class
+ *
+ * @package Graph
+ * @version //autogen//
+ * @copyright Copyright (C) 2005, 2006 eZ systems as. All rights reserved.
+ * @license http://ez.no/licenses/new_bsd New BSD License
+ */
+/**
+ * ezcGraphUnknownChartTypeException is the exception which is thrown when the
+ * factory method tries to return an instance of an unknown chart type
+ *
+ * @package Graph
+ * @version //autogen//
+ */
+class ezcGraphNoSuchElementException extends ezcGraphException
+{
+    public function __construct( $name )
+    {
+        parent::__construct( "No chart element with name <{$name}> found." );
+    }
+}
+
+?>


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

Modified: trunk/Graph/src/graph_autoload.php
===================================================================
--- trunk/Graph/src/graph_autoload.php  2006-06-27 08:33:20 UTC (rev 3155)
+++ trunk/Graph/src/graph_autoload.php  2006-06-27 09:18:13 UTC (rev 3156)
@@ -46,6 +46,7 @@
     'ezcGraphUnknownPaletteException'           => 
'Graph/exceptions/unknown_palette.php',
 
     'ezcGraphChartElement'                      => 
'Graph/interfaces/element.php',
+    'ezcGraphNoSuchElementException'            => 
'Graph/exceptions/no_such_element.php',
     'ezcGraphFontOptions'                       => 'Graph/options/font.php',
     'ezcGraphChartElementText'                  => 'Graph/element/text.php',
     'ezcGraphChartElementLegend'                => 'Graph/element/legend.php',

Modified: trunk/Graph/src/interfaces/chart.php
===================================================================
--- trunk/Graph/src/interfaces/chart.php        2006-06-27 08:33:20 UTC (rev 
3155)
+++ trunk/Graph/src/interfaces/chart.php        2006-06-27 09:18:13 UTC (rev 
3156)
@@ -12,7 +12,7 @@
  *
  * @package Graph
  */
-abstract class ezcGraphChart
+abstract class ezcGraphChart implements ArrayAccess
 {
 
     /**
@@ -161,7 +161,7 @@
                     throw new ezcBaseValueException( "options", 
$propertyValue, "instanceof ezcGraphOptions" );
                 }
             default:
-                return $this->addDataSet($propertyName, $propertyValue);
+                throw new ezcBasePropertyNotFoundException( $propertyName );
                 break;
         }
     }
@@ -235,21 +235,46 @@
             return $this->elements[$propertyName];
         }
 
-        if ( isset( $this->data[$propertyName] ) )
-        {
-            return $this->data[$propertyName];
-        }
-
         if ( $propertyName === "options" )
         {
             return $this->options;
         }
         else
         {
-            throw new ezcGraphNoSuchDatasetException( $propertyName );
+            throw new ezcGraphNoSuchElementException( $propertyName );
         }
     }
 
+    public function offsetExists( $key )
+    {
+        return isset( $this->data[$key] );
+    }
+
+    public function offsetGet( $key )
+    {
+        if ( !isset( $key ) )
+        {
+            throw new ezcGraphNoSuchDatasetException( $key );
+        }
+
+        return $this->data[$key];
+    }
+
+    public function offsetSet( $key, $value )
+    {
+        return $this->addDataset( $key, $value );
+    }
+
+    public function offsetUnset( $key )
+    {
+        if ( !isset( $key ) )
+        {
+            throw new ezcGraphNoSuchDatasetException( $key );
+        }
+
+        unset( $this->data[$key] );
+    }
+
     public function setOptions( $options )
     {
         if ( is_array( $options ) )

Modified: trunk/Graph/tests/background_image_test.php
===================================================================
--- trunk/Graph/tests/background_image_test.php 2006-06-27 08:33:20 UTC (rev 
3155)
+++ trunk/Graph/tests/background_image_test.php 2006-06-27 09:18:13 UTC (rev 
3156)
@@ -56,7 +56,7 @@
     public function testRenderStandard()
     {
         $chart = ezcGraph::create( 'line' );
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
         $chart->options->backgroundImage = $this->basePath . 
$this->testFiles['png'];
         $chart->options->background = '#000000FF';
 
@@ -81,7 +81,7 @@
     public function testRenderPieBottomRight()
     {
         $chart = ezcGraph::create( 'pie' );
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
         $chart->options->backgroundImage = $this->basePath . 
$this->testFiles['png'];
         $chart->options->backgroundImage->position = ezcGraph::BOTTOM | 
ezcGraph::RIGHT;
         $chart->options->background = '#000000FF';
@@ -107,7 +107,7 @@
     public function testRenderTop()
     {
         $chart = ezcGraph::create( 'line' );
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
         $chart->options->backgroundImage = $this->basePath . 
$this->testFiles['png'];
         $chart->options->backgroundImage->position = ezcGraph::TOP;
         $chart->options->background = '#000000FF';
@@ -133,7 +133,7 @@
     public function testRenderLeft()
     {
         $chart = ezcGraph::create( 'line' );
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
         $chart->options->backgroundImage = $this->basePath . 
$this->testFiles['png'];
         $chart->options->backgroundImage->position = ezcGraph::LEFT;
         $chart->options->background = '#000000FF';
@@ -161,7 +161,7 @@
         $filename = $this->tempDir . __FUNCTION__ . '.png';
 
         $chart = ezcGraph::create( 'line' );
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
         $chart->palette = 'Black';
         $chart->options->backgroundImage = $this->basePath . 
$this->testFiles['png'];
         $chart->options->background = '#2E343655';

Modified: trunk/Graph/tests/dataset_test.php
===================================================================
--- trunk/Graph/tests/dataset_test.php  2006-06-27 08:33:20 UTC (rev 3155)
+++ trunk/Graph/tests/dataset_test.php  2006-06-27 09:18:13 UTC (rev 3156)
@@ -44,7 +44,7 @@
     public function testCreateDatasetFromArray()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->humanoids = array( 'monkey' => 54, 'ape' => 37, 'human' => 9 );
+        $chart['humanoids'] = array( 'monkey' => 54, 'ape' => 37, 'human' => 9 
);
 
         $datasets = $this->getNonPublicProperty( $chart, 'data' );
         $this->assertTrue(
@@ -56,10 +56,10 @@
     public function testGetDataset()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->humanoids = array( 'monkey' => 54, 'ape' => 37, 'human' => 9 );
+        $chart['humanoids'] = array( 'monkey' => 54, 'ape' => 37, 'human' => 9 
);
 
         $this->assertTrue(
-            $chart->humanoids instanceof ezcGraphDataset,
+            $chart['humanoids'] instanceof ezcGraphDataset,
             'No ezcGraphDataset was created.'
         );
     }
@@ -67,9 +67,9 @@
     public function testDatasetContent()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->example = array( 'monkey' => 54, 2001 => 37 );
+        $chart['example'] = array( 'monkey' => 54, 2001 => 37 );
 
-        $data = $this->getNonPublicProperty( $chart->example, 'data' );
+        $data = $this->getNonPublicProperty( $chart['example'], 'data' );
 
         $this->assertSame( 
             54.,
@@ -84,8 +84,8 @@
     public function testCreateMultipleDatasetsFromArray()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->spending = array( 2000 => 2347.2, 2458.3, 2569.4 );
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['spending'] = array( 2000 => 2347.2, 2458.3, 2569.4 );
 
         $datasets = $this->getNonPublicProperty( $chart, 'data' );
         $this->assertTrue(
@@ -103,8 +103,8 @@
         try 
         {
             $chart = ezcGraph::create( 'Pie' );
-            $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-            $chart->spending = array( 2000 => 2347.2, 2458.3, 2569.4 );
+            $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+            $chart['spending'] = array( 2000 => 2347.2, 2458.3, 2569.4 );
         }
         catch ( ezcGraphTooManyDatasetsExceptions $e )
         {
@@ -117,116 +117,116 @@
     public function testDatasetLabel()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
 
         $this->assertEquals(
             'income',
-            $chart->income->label->default
+            $chart['income']->label->default
         );
     }
 
     public function testDatasetSetLabel()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->income->label = 'Income Label';
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['income']->label = 'Income Label';
 
         $this->assertEquals(
             'Income Label',
-            $chart->income->label->default
+            $chart['income']->label->default
         );
     }
 
     public function testDatasetSetColor()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->income->color = '#FF0000';
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['income']->color = '#FF0000';
 
         $this->assertEquals(
             ezcGraphColor::fromHex( '#FF0000' ),
-            $chart->income->color->default
+            $chart['income']->color->default
         );
     }
 
     public function testDatasetSetHighlight()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->income->highlight = true;
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['income']->highlight = true;
 
         $this->assertEquals(
             true,
-            $chart->income->highlight->default
+            $chart['income']->highlight->default
         );
     }
 
     public function testDatasetGetHighlight()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
 
         $this->assertEquals(
             false,
-            $chart->income->highlight[2001]
+            $chart['income']->highlight[2001]
         );
 
         $this->assertEquals(
             false,
-            $chart->income->highlight->default
+            $chart['income']->highlight->default
         );
     }
 
     public function testDatasetSetHighlightSingle()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->income->highlight[2001] = true;
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['income']->highlight[2001] = true;
 
         $this->assertEquals(
             false,
-            $chart->income->highlight[2000]
+            $chart['income']->highlight[2000]
         );
 
         $this->assertEquals(
             true,
-            $chart->income->highlight[2001]
+            $chart['income']->highlight[2001]
         );
     }
 
     public function testDatasetSetSingleColor()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->income->color[2001] = '#FF0000';
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['income']->color[2001] = '#FF0000';
 
         $this->assertEquals(
             ezcGraphColor::fromHex( '#FF0000' ),
-            $chart->income->color[2001]
+            $chart['income']->color[2001]
         );
     }
 
     public function testDatasetSetSingleSymbol()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->income->symbol[2001] = ezcGraph::DIAMOND;
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['income']->symbol[2001] = ezcGraph::DIAMOND;
 
         $this->assertEquals(
             ezcGraph::DIAMOND,
-            $chart->income->symbol[2001]
+            $chart['income']->symbol[2001]
         );
     }
 
     public function testDatasetPropertyValueFallback()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->income->symbol = ezcGraph::DIAMOND;
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['income']->symbol = ezcGraph::DIAMOND;
 
         $this->assertEquals(
             ezcGraph::DIAMOND,
-            $chart->income->symbol[2001]
+            $chart['income']->symbol[2001]
         );
     }
 
@@ -235,8 +235,8 @@
         try
         {
             $chart = ezcGraph::create( 'Pie' );
-            $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-            $chart->income->symbol[2006] = ezcGraph::DIAMOND;
+            $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+            $chart['income']->symbol[2006] = ezcGraph::DIAMOND;
         }
         catch ( ezcGraphNoSuchDataException $e )
         {
@@ -249,23 +249,23 @@
     public function testDatasetGetSingleData()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
 
         $this->assertSame(
             2345.2,
-            $chart->income[2000]
+            $chart['income'][2000]
         );
     }
 
     public function testDatasetSetSingleData()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->income[2005] = 234.21;
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['income'][2005] = 234.21;
 
         $this->assertSame(
             234.21,
-            $chart->income[2005]
+            $chart['income'][2005]
         );
     }
 }

Modified: trunk/Graph/tests/font_test.php
===================================================================
--- trunk/Graph/tests/font_test.php     2006-06-27 08:33:20 UTC (rev 3155)
+++ trunk/Graph/tests/font_test.php     2006-06-27 09:18:13 UTC (rev 3156)
@@ -117,7 +117,7 @@
     public function testSetFontForElementWithRendering()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
         $chart->options->font = $this->basePath . 'font.ttf';
         $chart->legend->font = $this->basePath . 'font2.ttf';
         $chart->render( 500, 200 );

Modified: trunk/Graph/tests/labeled_axis_test.php
===================================================================
--- trunk/Graph/tests/labeled_axis_test.php     2006-06-27 08:33:20 UTC (rev 
3155)
+++ trunk/Graph/tests/labeled_axis_test.php     2006-06-27 09:18:13 UTC (rev 
3156)
@@ -53,7 +53,7 @@
     public function testAutomaticLabelingSingle()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 20, 70, 12, 130 );
+        $chart['sample'] = array( 2000 => 20, 70, 12, 130 );
         $chart->render( 500, 200 );
 
         $this->assertSame(
@@ -70,8 +70,8 @@
     public function testAutomaticLabelingMultiple()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2002 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2002 => 1270, 1170, 1610, 1370 );
         $chart->render( 500, 200 );
 
         $this->assertSame(
@@ -90,8 +90,8 @@
     public function testAutomaticLabelingMultipleMixed()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 2001 => 1300, 2004 => 1012, 2006 
=> 1450 );
-        $chart->sample2 = array( 2001 => 1270, 1170, 1610, 1370, 1559 );
+        $chart['sample'] = array( 2000 => 1045, 2001 => 1300, 2004 => 1012, 
2006 => 1450 );
+        $chart['sample2'] = array( 2001 => 1270, 1170, 1610, 1370, 1559 );
         $chart->render( 500, 200 );
 
         $this->assertSame(
@@ -111,7 +111,7 @@
     public function testPositionLeft()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->xAxis->position = ezcGraph::LEFT;
         $chart->render( 500, 200 );
 
@@ -155,7 +155,7 @@
     public function testPositionRight()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->xAxis->position = ezcGraph::RIGHT;
         $chart->render( 500, 200 );
 
@@ -199,7 +199,7 @@
     public function testPositionTop()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->xAxis->position = ezcGraph::TOP;
         $chart->render( 500, 200 );
 
@@ -243,7 +243,7 @@
     public function testPositionBottom()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->xAxis->position = ezcGraph::BOTTOM;
         $chart->render( 500, 200 );
 
@@ -287,8 +287,8 @@
     public function testRenderLabeledAxisBase()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2000 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2000 => 1270, 1170, 1610, 1370 );
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawLine',
@@ -313,8 +313,8 @@
     public function testRenderLabeledAxisArrowHead()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2000 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2000 => 1270, 1170, 1610, 1370 );
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawPolygon',
@@ -342,8 +342,8 @@
     public function testRenderLabeledAxisMajor()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2000 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2000 => 1270, 1170, 1610, 1370 );
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawLine',
@@ -395,7 +395,7 @@
     public function testRenderNumericAxisMajorGrid()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->xAxis->grid = '#BBBBBB';
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
@@ -448,8 +448,8 @@
     public function testRenderLabeledAxisLabels()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2000 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2000 => 1270, 1170, 1610, 1370 );
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawTextBox',
@@ -505,8 +505,8 @@
     public function testRenderNumericAxisCustomLabels()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2000 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2000 => 1270, 1170, 1610, 1370 );
         $chart->xAxis->formatString = 'test';
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
@@ -568,7 +568,7 @@
             $data[$i] = 25 * sin( $i / 50 );
         }
         $chart = ezcGraph::create( 'Line' );
-        $chart->sinus = $data;
+        $chart['sinus'] = $data;
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawTextBox',

Modified: trunk/Graph/tests/legend_test.php
===================================================================
--- trunk/Graph/tests/legend_test.php   2006-06-27 08:33:20 UTC (rev 3155)
+++ trunk/Graph/tests/legend_test.php   2006-06-27 09:18:13 UTC (rev 3156)
@@ -43,14 +43,14 @@
 
     protected function addSampleData( ezcGraphChart $chart )
     {
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
-        $chart->sampleData->color = '#0000FF';
-        $chart->sampleData->symbol = ezcGraph::DIAMOND;
-        $chart->moreData = array( 'sample 1' => 234, 'sample 2' => 21, 'sample 
3' => 324, 'sample 4' => 120, 'sample 5' => 1);
-        $chart->moreData->color = '#FF0000';
-        $chart->evenMoreData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
-        $chart->evenMoreData->color = '#FF0000';
-        $chart->evenMoreData->label = 'Even more data';
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['sampleData']->color = '#0000FF';
+        $chart['sampleData']->symbol = ezcGraph::DIAMOND;
+        $chart['moreData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['moreData']->color = '#FF0000';
+        $chart['evenMoreData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['evenMoreData']->color = '#FF0000';
+        $chart['evenMoreData']->label = 'Even more data';
     }
 
     public function testFactoryLegend()

Modified: trunk/Graph/tests/line_test.php
===================================================================
--- trunk/Graph/tests/line_test.php     2006-06-27 08:33:20 UTC (rev 3155)
+++ trunk/Graph/tests/line_test.php     2006-06-27 09:18:13 UTC (rev 3156)
@@ -51,10 +51,9 @@
 
     protected function addSampleData( ezcGraphChart $chart )
     {
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => -21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
-        $chart->moreData = array( 'sample 1' => 112, 'sample 2' => 54, 'sample 
3' => 12, 'sample 4' => -167, 'sample 5' => 329);
-        $chart->evenMoreData = array( 'sample 1' => 300, 'sample 2' => -30, 
'sample 3' => 220, 'sample 4' => 67, 'sample 5' => 450);
-        $chart->evenMoreData->label = 'Even more data';
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => -21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['moreData'] = array( 'sample 1' => 112, 'sample 2' => 54, 
'sample 3' => 12, 'sample 4' => -167, 'sample 5' => 329);
+        $chart['Even more data'] = array( 'sample 1' => 300, 'sample 2' => 
-30, 'sample 3' => 220, 'sample 4' => 67, 'sample 5' => 450);
     }
 
     public function testElementGenerationLegend()
@@ -99,9 +98,9 @@
     public function testRenderChartLines()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1 );
-        $chart->sampleData->color = '#CC0000';
-        $chart->sampleData->symbol = ezcGraph::DIAMOND;
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1 );
+        $chart['sampleData']->color = '#CC0000';
+        $chart['sampleData']->symbol = ezcGraph::DIAMOND;
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawLine',
@@ -152,7 +151,7 @@
     public function testRenderChartFilledLines()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => -46, 'sample 4' => 120 );
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => -46, 'sample 4' => 120 );
         $chart->palette = 'Black';
         $chart->options->fillLines = 100;
 
@@ -231,7 +230,7 @@
     public function testRenderChartFilledLinesZero()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sampleData = array( 'sample 1' => 0, 'sample 2' => 0 );
+        $chart['sampleData'] = array( 'sample 1' => 0, 'sample 2' => 0 );
         $chart->palette = 'Black';
         $chart->options->fillLines = 100;
 
@@ -261,9 +260,9 @@
     public function testRenderChartLinesModifiedThickness()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
-        $chart->sampleData->color = '#CC0000';
-        $chart->sampleData->symbol = ezcGraph::DIAMOND;
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['sampleData']->color = '#CC0000';
+        $chart['sampleData']->symbol = ezcGraph::DIAMOND;
         $chart->options->lineThickness = 1;
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
@@ -315,9 +314,9 @@
     public function testRenderChartSymbols()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
-        $chart->sampleData->color = '#CC0000';
-        $chart->sampleData->symbol = ezcGraph::DIAMOND;
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['sampleData']->color = '#CC0000';
+        $chart['sampleData']->symbol = ezcGraph::DIAMOND;
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawSymbol',

Modified: trunk/Graph/tests/numeric_axis_test.php
===================================================================
--- trunk/Graph/tests/numeric_axis_test.php     2006-06-27 08:33:20 UTC (rev 
3155)
+++ trunk/Graph/tests/numeric_axis_test.php     2006-06-27 09:18:13 UTC (rev 
3156)
@@ -115,7 +115,7 @@
     public function testAutomagicScalingSingle()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 20, 70, 12, 130 );
+        $chart['sample'] = array( 2000 => 20, 70, 12, 130 );
         $chart->render( 500, 200 );
 
         $this->assertEquals(
@@ -146,7 +146,7 @@
     public function testAutomagicScalingSingle2()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1, 4.3, .2, 3.82 );
+        $chart['sample'] = array( 2000 => 1, 4.3, .2, 3.82 );
         $chart->render( 500, 200 );
 
         $this->assertEquals(
@@ -177,7 +177,7 @@
     public function testAutomagicScalingSingle3()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => -1.8, 4.3, .2, 3.82 );
+        $chart['sample'] = array( 2000 => -1.8, 4.3, .2, 3.82 );
         $chart->render( 500, 200 );
 
         $this->assertEquals(
@@ -208,7 +208,7 @@
     public function testAutomagicScalingSingle4()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->render( 500, 200 );
 
         $this->assertEquals(
@@ -239,8 +239,8 @@
     public function testAutomagicScalingMultiple()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2000 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2000 => 1270, 1170, 1610, 1370 );
         $chart->render( 500, 200 );
 
         $this->assertEquals(
@@ -271,7 +271,7 @@
     public function testMixedAutomagicAndManualScaling()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->yAxis->majorStep = 50;
         $chart->render( 500, 200 );
 
@@ -303,7 +303,7 @@
     public function testMixedAutomagicAndManualScaling2()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->yAxis->min = 0;
         $chart->render( 500, 200 );
 
@@ -335,7 +335,7 @@
     public function testMixedAutomagicAndManualScaling3()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->yAxis->max = 2000;
         $chart->render( 500, 200 );
 
@@ -367,7 +367,7 @@
     public function testMixedAutomagicAndManualScaling4()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->yAxis->min = 0;
         $chart->yAxis->max = 2000;
         $chart->render( 500, 200 );
@@ -400,7 +400,7 @@
     public function testPositionLeft()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->yAxis->position = ezcGraph::LEFT;
         $chart->render( 500, 200 );
 
@@ -438,7 +438,7 @@
     public function testPositionRight()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->yAxis->position = ezcGraph::RIGHT;
         $chart->render( 500, 200 );
 
@@ -476,7 +476,7 @@
     public function testPositionTop()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->yAxis->position = ezcGraph::TOP;
         $chart->render( 500, 200 );
 
@@ -514,7 +514,7 @@
     public function testPositionBottom()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->yAxis->position = ezcGraph::BOTTOM;
         $chart->render( 500, 200 );
 
@@ -552,7 +552,7 @@
     public function testPositionLeftNegativMinimum()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => -300, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => -300, 1300, 1012, 1450 );
         $chart->yAxis->majorStep = 500;
         $chart->yAxis->position = ezcGraph::LEFT;
         $chart->render( 500, 200 );
@@ -591,9 +591,9 @@
     public function testNullPositionMultipleDatasets()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => -21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
-        $chart->moreData = array( 'sample 1' => 112, 'sample 2' => 54, 'sample 
3' => 12, 'sample 4' => -167, 'sample 5' => 329);
-        $chart->evenMoreData = array( 'sample 1' => 300, 'sample 2' => -30, 
'sample 3' => 220, 'sample 4' => 67, 'sample 5' => 450);
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => -21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['moreData'] = array( 'sample 1' => 112, 'sample 2' => 54, 
'sample 3' => 12, 'sample 4' => -167, 'sample 5' => 329);
+        $chart['evenMoreData'] = array( 'sample 1' => 300, 'sample 2' => -30, 
'sample 3' => 220, 'sample 4' => 67, 'sample 5' => 450);
         $chart->render( 500, 200 );
 
         $testBoundings = new ezcGraphBoundings();
@@ -612,8 +612,8 @@
     public function testRenderNumericAxisBase()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2000 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2000 => 1270, 1170, 1610, 1370 );
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawLine',
@@ -639,8 +639,8 @@
     public function testRenderNumericAxisArrowHead()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2000 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2000 => 1270, 1170, 1610, 1370 );
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawPolygon',
@@ -668,8 +668,8 @@
     public function testRenderNumericAxisMajor()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2000 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2000 => 1270, 1170, 1610, 1370 );
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawLine',
@@ -723,7 +723,7 @@
     public function testRenderNumericAxisMajorGrid()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->yAxis->grid = ezcGraphColor::fromHex( '#BBBBBB' );
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
@@ -767,8 +767,8 @@
     public function testRenderNumericAxisMinor()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2000 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2000 => 1270, 1170, 1610, 1370 );
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawLine',
@@ -823,7 +823,7 @@
     public function testRenderNumericAxisMinorGrid()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
         $chart->yAxis->minorGrid = '#BBBBBB';
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
@@ -869,8 +869,8 @@
     public function testRenderNumericAxisLabels()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2000 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2000 => 1270, 1170, 1610, 1370 );
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawTextBox',
@@ -916,8 +916,8 @@
     public function testRenderNumericAxisCustomLabels()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 1045, 1300, 1012, 1450 );
-        $chart->sample2 = array( 2000 => 1270, 1170, 1610, 1370 );
+        $chart['sample'] = array( 2000 => 1045, 1300, 1012, 1450 );
+        $chart['sample2'] = array( 2000 => 1270, 1170, 1610, 1370 );
         $chart->yAxis->formatString = 'test';
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
@@ -971,7 +971,7 @@
 
         $chart = ezcGraph::create( 'Line' );
         $chart->xAxis = new ezcGraphChartElementNumericAxis();
-        $chart->sinus = $sin;
+        $chart['sinus'] = $sin;
 
         $mockedRenderer = $this->getMock( 'ezcGraphRenderer2D', array(
             'drawTextBox',
@@ -1025,7 +1025,7 @@
     public function testValueZeroAmplitude()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 70, 70, 70, 70 );
+        $chart['sample'] = array( 2000 => 70, 70, 70, 70 );
         $chart->render( 500, 200 );
 
         $this->assertEquals(
@@ -1056,7 +1056,7 @@
     public function testValueAllZero()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 2000 => 0, 0 );
+        $chart['sample'] = array( 2000 => 0, 0 );
         $chart->render( 500, 200 );
 
         $this->assertEquals(

Modified: trunk/Graph/tests/palette_test.php
===================================================================
--- trunk/Graph/tests/palette_test.php  2006-06-27 08:33:20 UTC (rev 3155)
+++ trunk/Graph/tests/palette_test.php  2006-06-27 09:18:13 UTC (rev 3156)
@@ -289,18 +289,18 @@
     public function testDatasetAutomaticColorization()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->spending = array( 2000 => 2347.2, 2458.3, 2569.4 );
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['spending'] = array( 2000 => 2347.2, 2458.3, 2569.4 );
 
         $this->assertEquals(
             ezcGraphColor::fromHex( '#3465A4' ),
-            $chart->income->color->default,
+            $chart['income']->color->default,
             'Wrong automatic color set.'
         );
 
         $this->assertEquals(
             ezcGraphColor::fromHex( '#4E9A06' ),
-            $chart->spending->color->default,
+            $chart['spending']->color->default,
             'Wrong automatic color set.'
         );
     }
@@ -308,8 +308,8 @@
     public function testChartBackground()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->spending = array( 2000 => 2347.2, 2458.3, 2569.4 );
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['spending'] = array( 2000 => 2347.2, 2458.3, 2569.4 );
 
         $this->assertEquals(
             ezcGraphColor::fromHex( '#EEEEEC' ),
@@ -321,8 +321,8 @@
     public function testChartElementBorder()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->spending = array( 2000 => 2347.2, 2458.3, 2569.4 );
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['spending'] = array( 2000 => 2347.2, 2458.3, 2569.4 );
 
         $this->assertEquals(
             ezcGraphColor::fromHex( '#000000FF' ),
@@ -334,8 +334,8 @@
     public function testChartElementBorderWidth()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->spending = array( 2000 => 2347.2, 2458.3, 2569.4 );
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['spending'] = array( 2000 => 2347.2, 2458.3, 2569.4 );
 
         $this->assertEquals(
             0,
@@ -347,8 +347,8 @@
     public function testChartElementAxisColor()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->income = array( 2000 => 2345.2, 2456.3, 2567.4 );
-        $chart->spending = array( 2000 => 2347.2, 2458.3, 2569.4 );
+        $chart['income'] = array( 2000 => 2345.2, 2456.3, 2567.4 );
+        $chart['spending'] = array( 2000 => 2347.2, 2458.3, 2569.4 );
 
         $this->assertEquals(
             ezcGraphColor::fromHex( '#2E3436' ),

Modified: trunk/Graph/tests/pie_test.php
===================================================================
--- trunk/Graph/tests/pie_test.php      2006-06-27 08:33:20 UTC (rev 3155)
+++ trunk/Graph/tests/pie_test.php      2006-06-27 09:18:13 UTC (rev 3156)
@@ -52,7 +52,7 @@
     public function testElementGenerationLegend()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->sampleData = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
+        $chart['sampleData'] = array( 'sample 1' => 234, 'sample 2' => 21, 
'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1);
         $chart->render( 500, 200 );
         
         $legend = $this->getNonPublicProperty( $chart->legend, 'labels' );
@@ -85,7 +85,7 @@
     public function testPieRenderPieSegments()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->sample = array(
+        $chart['sample'] = array(
             'Mozilla' => 4375,
             'IE' => 345,
             'Opera' => 1204,
@@ -160,7 +160,7 @@
     public function testPieRenderPieLables()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->sample = array(
+        $chart['sample'] = array(
             'Mozilla' => 4375,
             'IE' => 345,
             'Opera' => 1204,
@@ -230,7 +230,7 @@
     public function testPieRenderPieLablesWithoutSymbols()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->sample = array(
+        $chart['sample'] = array(
             'Mozilla' => 4375,
             'IE' => 345,
             'Opera' => 1204,
@@ -301,7 +301,7 @@
     public function testPieRenderPieLableIdentifiers()
     {
         $chart = ezcGraph::create( 'Pie' );
-        $chart->sample = array(
+        $chart['sample'] = array(
             'Mozilla' => 4375,
             'IE' => 345,
             'Opera' => 1204,
@@ -354,7 +354,7 @@
 
         $chart = ezcGraph::create( 'Pie' );
 
-        $chart->sample = array(
+        $chart['sample'] = array(
             'Mozilla' => 4375,
             'IE' => 345,
             'Opera' => 1204,
@@ -384,7 +384,7 @@
 
         $chart = ezcGraph::create( 'Pie' );
 
-        $chart->sample = array(
+        $chart['sample'] = array(
             'Mozilla' => 4375,
             'IE' => 345,
             'Opera' => 1204,
@@ -415,14 +415,14 @@
 
         $chart = ezcGraph::create( 'Pie' );
 
-        $chart->sample = array(
+        $chart['sample'] = array(
             'Mozilla' => 4375,
             'IE' => 345,
             'Opera' => 1204,
             'wget' => 231,
             'Safari' => 987,
         );
-        $chart->sample->highlight['Safari'] = true;
+        $chart['sample']->highlight['Safari'] = true;
 
         $chart->driver = new ezcGraphGdDriver();
         $chart->options->font = $this->basePath . 'font.ttf';
@@ -447,14 +447,14 @@
         $chart = ezcGraph::create( 'Pie' );
         $chart->options->showSymbol = false;
 
-        $chart->sample = array(
+        $chart['sample'] = array(
             'Mozilla' => 4375,
             'IE' => 345,
             'Opera' => 1204,
             'wget' => 231,
             'Safari' => 987,
         );
-        $chart->sample->highlight['Safari'] = true;
+        $chart['sample']->highlight['Safari'] = true;
 
         $chart->driver = new ezcGraphGdDriver();
         $chart->options->font = $this->basePath . 'font.ttf';

Modified: trunk/Graph/tests/text_test.php
===================================================================
--- trunk/Graph/tests/text_test.php     2006-06-27 08:33:20 UTC (rev 3155)
+++ trunk/Graph/tests/text_test.php     2006-06-27 09:18:13 UTC (rev 3156)
@@ -44,7 +44,7 @@
     public function testRenderTextTop()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 'foo' => 1, 'bar' => 10 );
+        $chart['sample'] = array( 'foo' => 1, 'bar' => 10 );
 
         $chart->title = 'Title of a chart';
 
@@ -83,7 +83,7 @@
     public function testRenderTextBottom()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 'foo' => 1, 'bar' => 10 );
+        $chart['sample'] = array( 'foo' => 1, 'bar' => 10 );
 
         $chart->title = 'Title of a chart';
         $chart->title->position = ezcGraph::BOTTOM;
@@ -112,7 +112,7 @@
     public function testRenderTextTopMargin()
     {
         $chart = ezcGraph::create( 'Line' );
-        $chart->sample = array( 'foo' => 1, 'bar' => 10 );
+        $chart['sample'] = array( 'foo' => 1, 'bar' => 10 );
 
         $chart->title = 'Title of a chart';
         $chart->title->position = ezcGraph::TOP;

-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to