summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2007-08-08 06:10:46 +0000
committerKore Nordmann <github@kore-nordmann.de>2007-08-08 06:10:46 +0000
commit8c2284477cd6a99d0bfa2174e1ae96d12739d497 (patch)
treef515bf45978b487b181bb404da8d854e8b9adb2c
parenta8676cf200437ba625af1fa9ea12df92f3ba89bc (diff)
downloadzetacomponents-graph-8c2284477cd6a99d0bfa2174e1ae96d12739d497.zip
zetacomponents-graph-8c2284477cd6a99d0bfa2174e1ae96d12739d497.tar.gz
- Fixed bug #11236: Legend is not properly linked in interactive 3d line and
bar charts.
-rw-r--r--ChangeLog2
-rw-r--r--src/renderer/3d.php2
-rw-r--r--tests/image_map_test.php37
3 files changed, 41 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 91922ed..df07a3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,8 @@
with index 1 and not zero in pie charts
- Fixed bug #11233: Path for circular arcs in SVG driver may break because of
locale settings
+- Fixed bug #11236: Legend is not properly linked in interactive 3d line and
+ bar charts.
1.1 - Monday 02 July 2007
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/renderer/3d.php b/src/renderer/3d.php
index 42cfd83..3ca1846 100644
--- a/src/renderer/3d.php
+++ b/src/renderer/3d.php
@@ -1432,6 +1432,8 @@ class ezcGraphRenderer3d
$labelPosition = new ezcGraphCoordinate( $boundings->x0, $boundings->y0 );
foreach ( $labels as $label )
{
+ $this->elements['legend_url'][$label['label']] = $label['url'];
+
$this->elements['legend'][$label['label']]['symbol'] = $this->drawSymbol(
new ezcGraphBoundings(
$labelPosition->x + $legend->padding,
diff --git a/tests/image_map_test.php b/tests/image_map_test.php
index 581ce5a..396ef5c 100644
--- a/tests/image_map_test.php
+++ b/tests/image_map_test.php
@@ -58,6 +58,8 @@ class ezcGraphImageMapTest extends ezcGraphTestCase
$chart->data['moreData'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) );
$chart->data['evenMoreData'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) );
+ $chart->data['sampleData']->url = 'http://example.com/';
+
$chart->render( 500, 200, $filename );
$reference = $chart->renderer->getElementReferences();
@@ -73,6 +75,11 @@ class ezcGraphImageMapTest extends ezcGraphTestCase
$this->assertSame( 2, count( $reference['legend']['moreData'] ), '2 elements for legend item expected.' );
$this->assertSame( 'ezcGraphCircle_6', $reference['legend']['moreData']['symbol'], 'ezcGraphCircle expected as legend symbol.' );
$this->assertSame( 'ezcGraphTextBox_7', $reference['legend']['moreData']['text'], 'ezcGraphTextBox expected for legend text.' );
+
+ // Check for legend URLs
+ $this->assertSame( 3, count( $reference['legend_url'] ), '3 legend url items expected.' );
+ $this->assertSame( null, $reference['legend_url']['moreData'], 'No link expected for "moreData".' );
+ $this->assertSame( 'http://example.com/', $reference['legend_url']['sampleData'], 'Link expected for "sampleData".' );
}
public function testReturnFrom2dSvgPieChart()
@@ -107,6 +114,10 @@ class ezcGraphImageMapTest extends ezcGraphTestCase
$this->assertSame( 2, count( $reference['legend']['IE'] ), '2 elements for legend item expected.' );
$this->assertSame( 'ezcGraphPolygon_5', $reference['legend']['IE']['symbol'], 'ezcGraphPolygon expected as legend symbol.' );
$this->assertSame( 'ezcGraphTextBox_6', $reference['legend']['IE']['text'], 'ezcGraphTextBox expected for legend text.' );
+
+ // Check for legend URLs
+ $this->assertSame( 5, count( $reference['legend_url'] ), '5 legend url items expected.' );
+ $this->assertSame( null, $reference['legend_url']['Mozilla'], 'No link expected for "moreData".' );
}
public function testReturnFrom2dGdLineChart()
@@ -122,6 +133,8 @@ class ezcGraphImageMapTest extends ezcGraphTestCase
$chart->data['moreData'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) );
$chart->data['evenMoreData'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) );
+ $chart->data['sampleData']->url = 'http://example.com/';
+
$chart->render( 500, 200, $filename );
$reference = $chart->renderer->getElementReferences();
@@ -151,6 +164,11 @@ class ezcGraphImageMapTest extends ezcGraphTestCase
$reference['legend']['moreData']['text'][2] instanceof ezcGraphCoordinate,
'Expected ezcGraphCoordinate objects.'
);
+
+ // Check for legend URLs
+ $this->assertSame( 3, count( $reference['legend_url'] ), '3 legend url items expected.' );
+ $this->assertSame( null, $reference['legend_url']['moreData'], 'No link expected for "moreData".' );
+ $this->assertSame( 'http://example.com/', $reference['legend_url']['sampleData'], 'Link expected for "sampleData".' );
}
public function testReturnFrom3dSvgLineChart()
@@ -165,6 +183,8 @@ class ezcGraphImageMapTest extends ezcGraphTestCase
$chart->data['moreData'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) );
$chart->data['evenMoreData'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => 21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) );
+ $chart->data['sampleData']->url = 'http://example.com/';
+
$chart->render( 500, 200, $filename );
$reference = $chart->renderer->getElementReferences();
@@ -180,6 +200,11 @@ class ezcGraphImageMapTest extends ezcGraphTestCase
$this->assertSame( 2, count( $reference['legend']['moreData'] ), '2 elements for legend item expected.' );
$this->assertSame( 'ezcGraphCircle_6', $reference['legend']['moreData']['symbol'], 'ezcGraphCircle expected as legend symbol.' );
$this->assertSame( 'ezcGraphTextBox_7', $reference['legend']['moreData']['text'], 'ezcGraphTextBox expected for legend text.' );
+
+ // Check for legend URLs
+ $this->assertSame( 3, count( $reference['legend_url'] ), '3 legend url items expected.' );
+ $this->assertSame( null, $reference['legend_url']['moreData'], 'No link expected for "moreData".' );
+ $this->assertSame( 'http://example.com/', $reference['legend_url']['sampleData'], 'Link expected for "sampleData".' );
}
public function testReturnFrom3dSvgPieChart()
@@ -214,6 +239,10 @@ class ezcGraphImageMapTest extends ezcGraphTestCase
$this->assertSame( 2, count( $reference['legend']['IE'] ), '2 elements for legend item expected.' );
$this->assertSame( 'ezcGraphCircle_6', $reference['legend']['IE']['symbol'], 'ezcGraphCircle expected as legend symbol.' );
$this->assertSame( 'ezcGraphTextBox_7', $reference['legend']['IE']['text'], 'ezcGraphTextBox expected for legend text.' );
+
+ // Check for legend URLs
+ $this->assertSame( 5, count( $reference['legend_url'] ), '5 legend url items expected.' );
+ $this->assertSame( null, $reference['legend_url']['Mozilla'], 'No link expected for "moreData".' );
}
public function testReturnFrom2dSvgPieChartWithGleam()
@@ -249,6 +278,10 @@ class ezcGraphImageMapTest extends ezcGraphTestCase
$this->assertSame( 2, count( $reference['legend']['IE'] ), '2 elements for legend item expected.' );
$this->assertSame( 'ezcGraphPolygon_5', $reference['legend']['IE']['symbol'], 'ezcGraphPolygon expected as legend symbol.' );
$this->assertSame( 'ezcGraphTextBox_6', $reference['legend']['IE']['text'], 'ezcGraphTextBox expected for legend text.' );
+
+ // Check for legend URLs
+ $this->assertSame( 5, count( $reference['legend_url'] ), '5 legend url items expected.' );
+ $this->assertSame( null, $reference['legend_url']['Mozilla'], 'No link expected for "moreData".' );
}
public function testReturnFrom3dSvgPieChartWithGleam()
@@ -284,6 +317,10 @@ class ezcGraphImageMapTest extends ezcGraphTestCase
$this->assertSame( 2, count( $reference['legend']['IE'] ), '2 elements for legend item expected.' );
$this->assertSame( 'ezcGraphPolygon_5', $reference['legend']['IE']['symbol'], 'ezcGraphPolygon expected as legend symbol.' );
$this->assertSame( 'ezcGraphTextBox_6', $reference['legend']['IE']['text'], 'ezcGraphTextBox expected for legend text.' );
+
+ // Check for legend URLs
+ $this->assertSame( 5, count( $reference['legend_url'] ), '5 legend url items expected.' );
+ $this->assertSame( null, $reference['legend_url']['Mozilla'], 'No link expected for "moreData".' );
}
}
OpenPOWER on IntegriCloud