summaryrefslogtreecommitdiffstats
path: root/tests/labeled_axis_test.php
diff options
context:
space:
mode:
authorKore Nordmann <github@kore-nordmann.de>2006-06-19 19:34:53 +0000
committerKore Nordmann <github@kore-nordmann.de>2006-06-19 19:34:53 +0000
commit92a19bdd0c69dfa780f23fc4c38b64ad6f1d4ce9 (patch)
treee1ecd474afcc6676015bd1888e455264ea75d56d /tests/labeled_axis_test.php
parent229b7cdfcc1e95ea45041bbad0fe2d4f6ad36e37 (diff)
downloadzetacomponents-graph-92a19bdd0c69dfa780f23fc4c38b64ad6f1d4ce9.zip
zetacomponents-graph-92a19bdd0c69dfa780f23fc4c38b64ad6f1d4ce9.tar.gz
- Added option for maximum size for arrow heads
- Made possible to define custom labels for axis - Made unused method ezcGraphChartElementAxis::drawLabels
Diffstat (limited to 'tests/labeled_axis_test.php')
-rw-r--r--tests/labeled_axis_test.php62
1 files changed, 60 insertions, 2 deletions
diff --git a/tests/labeled_axis_test.php b/tests/labeled_axis_test.php
index a31e1c7..19c3a3f 100644
--- a/tests/labeled_axis_test.php
+++ b/tests/labeled_axis_test.php
@@ -327,8 +327,8 @@ class ezcGraphLabeledAxisTest extends ezcTestCase
->with(
$this->equalTo( array(
new ezcGraphCoordinate( 500, 190 ),
- new ezcGraphCoordinate( 490, 185 ),
- new ezcGraphCoordinate( 490, 195 ),
+ new ezcGraphCoordinate( 492, 186 ),
+ new ezcGraphCoordinate( 492, 194 ),
) ),
$this->equalTo( ezcGraphColor::fromHex( '#2E3436' ) ),
$this->equalTo( true )
@@ -502,6 +502,64 @@ class ezcGraphLabeledAxisTest extends ezcTestCase
$chart->render( 500, 200 );
}
+ public function testRenderNumericAxisCustomLabels()
+ {
+ $chart = ezcGraph::create( 'Line' );
+ $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(
+ 'drawTextBox',
+ ) );
+
+ // X-Axis
+ $mockedRenderer
+ ->expects( $this->at( 2 ) )
+ ->method( 'drawTextBox' )
+ ->with(
+ $this->equalTo( new ezcGraphCoordinate( 122, 192 ) ),
+ $this->equalTo( 'test' ),
+ $this->equalTo( 88 ),
+ $this->equalTo( 8 ),
+ $this->equalTo( ezcGraph::LEFT | ezcGraph::TOP )
+ );
+ $mockedRenderer
+ ->expects( $this->at( 3 ) )
+ ->method( 'drawTextBox' )
+ ->with(
+ $this->equalTo( new ezcGraphCoordinate( 212, 192 ) ),
+ $this->equalTo( 'test' ),
+ $this->equalTo( 88 ),
+ $this->equalTo( 8 ),
+ $this->equalTo( ezcGraph::CENTER | ezcGraph::TOP )
+ );
+ $mockedRenderer
+ ->expects( $this->at( 4 ) )
+ ->method( 'drawTextBox' )
+ ->with(
+ $this->equalTo( new ezcGraphCoordinate( 303, 192 ) ),
+ $this->equalTo( 'test' ),
+ $this->equalTo( 88 ),
+ $this->equalTo( 8 ),
+ $this->equalTo( ezcGraph::CENTER | ezcGraph::TOP )
+ );
+ $mockedRenderer
+ ->expects( $this->at( 5 ) )
+ ->method( 'drawTextBox' )
+ ->with(
+ $this->equalTo( new ezcGraphCoordinate( 393, 192 ) ),
+ $this->equalTo( 'test' ),
+ $this->equalTo( 88 ),
+ $this->equalTo( 8 ),
+ $this->equalTo( ezcGraph::RIGHT | ezcGraph::TOP )
+ );
+
+ $chart->renderer = $mockedRenderer;
+
+ $chart->render( 500, 200 );
+ }
+
public function testRenderLabeledAxisWithManyPoints()
{
$data = array();
OpenPOWER on IntegriCloud