diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-11-24 09:29:13 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-11-24 09:29:13 +0000 |
commit | bdf4fe9f610f6f41316ee161d7b1f3ab101f2d83 (patch) | |
tree | d19ff7a0064601ace8a64e452ee14a420f35e83c | |
parent | 5128c1511611ec40ed19ec1b342b0aeaffa3d552 (diff) | |
download | zetacomponents-graph-bdf4fe9f610f6f41316ee161d7b1f3ab101f2d83.zip zetacomponents-graph-bdf4fe9f610f6f41316ee161d7b1f3ab101f2d83.tar.gz |
- Fixed: #9583 (Data typecasting should only be done in axis)
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/datasets/array.php | 2 | ||||
-rw-r--r-- | tests/dataset_test.php | 21 |
3 files changed, 25 insertions, 3 deletions
@@ -1,3 +1,8 @@ +1.0 - [date] +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Fixed issue #9583: Data typecasting should only be done in axis + 1.0beta2 - Monday 20 November 2006 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/datasets/array.php b/src/datasets/array.php index 28a7cb9..50a794d 100644 --- a/src/datasets/array.php +++ b/src/datasets/array.php @@ -38,7 +38,7 @@ class ezcGraphArrayDataSet extends ezcGraphDataSet { foreach ( $data as $key => $value ) { - $this->data[$key] = (float) $value; + $this->data[$key] = $value; } } } diff --git a/tests/dataset_test.php b/tests/dataset_test.php index fc7827d..143a31c 100644 --- a/tests/dataset_test.php +++ b/tests/dataset_test.php @@ -53,11 +53,28 @@ class ezcGraphDataSetTest extends ezcTestCase $data = $this->getAttribute( $chart->data['example'], 'data' ); $this->assertSame( - 54., + 54, $data['monkey'] ); $this->assertSame( - 37., + 37, + $data['2001'] + ); + } + + public function testDataSetStringContent() + { + $chart = new ezcGraphPieChart(); + $chart->data['example'] = new ezcGraphArrayDataSet( array( 'monkey' => 'alive', 2001 => 'year' ) ); + + $data = $this->getAttribute( $chart->data['example'], 'data' ); + + $this->assertSame( + 'alive', + $data['monkey'] + ); + $this->assertSame( + 'year', $data['2001'] ); } |