summaryrefslogtreecommitdiffstats
path: root/tests/renderer_2d_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2009-05-28 14:33:36 +0000
committerKore Nordmann <github@kore-nordmann.de>2009-05-28 14:33:36 +0000
commiteb36eb0b72d1e0b01b46f4570c2f6e77ba723e63 (patch)
tree4cf08c70237495df7c39cd2a828515e2c59895d1 /tests/renderer_2d_test.php
parentb24c848560db8723e04cffe2d04c0a6f7089181e (diff)
downloadzetacomponents-graph-eb36eb0b72d1e0b01b46f4570c2f6e77ba723e63.zip
zetacomponents-graph-eb36eb0b72d1e0b01b46f4570c2f6e77ba723e63.tar.gz
- Fixed #14857: Highlight text misplaced in charts with multiple bar data
sets.
Diffstat (limited to 'tests/renderer_2d_test.php')
-rw-r--r--tests/renderer_2d_test.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/renderer_2d_test.php b/tests/renderer_2d_test.php
index 4faa6ca..4a4a73b 100644
--- a/tests/renderer_2d_test.php
+++ b/tests/renderer_2d_test.php
@@ -2261,6 +2261,64 @@ class ezcGraphRenderer2dTest extends ezcGraphTestCase
$chart->data['Line 1']->highlight = true;
$chart->data['Line 2']->highlight['sample 5'] = true;
+
+ $chart->options->highlightSize = 12;
+ $chart->options->highlightFont->color = ezcGraphColor::fromHex( '#3465A4' );
+ $chart->options->highlightFont->background = ezcGraphColor::fromHex( '#D3D7CF' );
+ $chart->options->highlightFont->border = ezcGraphColor::fromHex( '#888A85' );
+
+ $chart->xAxis->axisLabelRenderer = new ezcGraphAxisBoxedLabelRenderer();
+
+ $chart->render( 500, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
+
+ public function testRenderBarChartWithHighlightedData3Bars()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcGraphBarChart();
+ $chart->palette = new ezcGraphPaletteBlack();
+
+ $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => -21, 'sample 3' => 324, 'sample 4' => -120, 'sample 5' => 1) );
+ $chart->data['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613) );
+ $chart->data['Line 3'] = new ezcGraphArrayDataSet( array( 'sample 2' => 42, 'sample 3' => 398, 'sample 4' => -15, 'sample 5' => 244) );
+
+ $chart->data['Line 1']->highlight = true;
+ $chart->data['Line 2']->highlight['sample 5'] = true;
+ $chart->data['Line 3']->highlight = true;
+
+ $chart->options->highlightSize = 12;
+ $chart->options->highlightFont->color = ezcGraphColor::fromHex( '#3465A4' );
+ $chart->options->highlightFont->background = ezcGraphColor::fromHex( '#D3D7CF' );
+ $chart->options->highlightFont->border = ezcGraphColor::fromHex( '#888A85' );
+
+ $chart->xAxis->axisLabelRenderer = new ezcGraphAxisBoxedLabelRenderer();
+
+ $chart->render( 500, 200, $filename );
+
+ $this->compare(
+ $filename,
+ $this->basePath . 'compare/' . __CLASS__ . '_' . __FUNCTION__ . '.svg'
+ );
+ }
+
+ public function testRenderBarChartWithHighlightedData()
+ {
+ $filename = $this->tempDir . __FUNCTION__ . '.svg';
+
+ $chart = new ezcGraphBarChart();
+ $chart->palette = new ezcGraphPaletteBlack();
+
+ $chart->data['Line 1'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => -21, 'sample 3' => 324, 'sample 4' => -120, 'sample 5' => 1) );
+ $chart->data['Line 2'] = new ezcGraphArrayDataSet( array( 'sample 1' => 543, 'sample 2' => 234, 'sample 3' => 298, 'sample 4' => 5, 'sample 5' => 613) );
+
+ $chart->data['Line 1']->highlight = true;
+ $chart->data['Line 2']->highlight['sample 5'] = true;
$chart->data['Line 1']->displayType = ezcGraph::BAR;
OpenPOWER on IntegriCloud