summaryrefslogtreecommitdiffstats
path: root/tests/numeric_axis_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2009-09-28 13:53:59 +0000
committerKore Nordmann <github@kore-nordmann.de>2009-09-28 13:53:59 +0000
commita33a0b5ce41af2eb5ba9636ac2a749f1e6261592 (patch)
treef41b3278c4f2642990924045c627cc64be81182a /tests/numeric_axis_test.php
parentf796ddc606c36350ada71a11c7acc703b98437d7 (diff)
downloadzetacomponents-graph-a33a0b5ce41af2eb5ba9636ac2a749f1e6261592.zip
zetacomponents-graph-a33a0b5ce41af2eb5ba9636ac2a749f1e6261592.tar.gz
- Fixed #15578: formatString not working with numeric axis
Diffstat (limited to 'tests/numeric_axis_test.php')
-rw-r--r--tests/numeric_axis_test.php32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/numeric_axis_test.php b/tests/numeric_axis_test.php
index 087d318..4448f4c 100644
--- a/tests/numeric_axis_test.php
+++ b/tests/numeric_axis_test.php
@@ -1090,6 +1090,38 @@ class ezcGraphNumericAxisTest extends ezcTestCase
);
}
}
+
+ public function testRenderedLabelsWithLabelFormatString()
+ {
+ try
+ {
+ $chart = new ezcGraphLineChart();
+
+ $chart->yAxis->formatString = '%d $';
+
+ $chart->data['sampleData'] = new ezcGraphArrayDataSet( array( 'sample 1' => 234, 'sample 2' => -21, 'sample 3' => 324, 'sample 4' => 120, 'sample 5' => 1) );
+ $chart->render( 500, 200 );
+ }
+ catch ( ezcGraphFontRenderingException $e )
+ {
+ // Ignore
+ }
+
+ $steps = $chart->yAxis->getSteps();
+
+ $expectedLabels = array(
+ '-100 $', '0 $', '100 $', '200 $', '300 $', '400 $',
+ );
+
+ foreach ( $steps as $nr => $step )
+ {
+ $this->assertSame(
+ $step->label,
+ $expectedLabels[$nr],
+ 'Label not as expected'
+ );
+ }
+ }
}
?>
OpenPOWER on IntegriCloud