Home » Images » Image_Canvas » Bug #7454
Vertical axis title is shifted 180 degrees between SVG and PNG output
Details
| Submitted | 2006-04-21 13:02 UTC |
|---|---|
| From | wayne at ptaff dot ca |
| Assigned | nosey |
| Status | Closed |
| Package | Image_Canvas |
| PHP Version | 4.4.0 |
| OS | GNU/Linux |
| Roadmaps | (Not assigned) |
Comments
[2006-04-21 13:02 UTC] wayne at ptaff dot ca
Description:
------------
Using Image_Graph-0.72, Image_Canvas-0.3.0, php-4.4.0 with bundled gd with all options compiled in (freetype too).
When generating a graph with PNG output and SVG output, the graphs are similar but the vertical axis title is reversed (I need to use a 90 degrees angle when generating PNG and 270 degrees when I generate SVG).
This could be a bug in Image_Canvas, I'm not really sure.
Test script:
---------------
<?php
$driver = 'png';
//$driver = 'svg';
include 'Image/Graph.php';
$canvas =& Image_Canvas::factory($driver, array('width' => 448, 'height' => 336, 'antialias' => 'driver'));
$graph =& Image_Graph::factory('graph', $canvas);
$dataset =& Image_Graph::factory('dataset');
$font =& $graph->addNew('font', 'verdana.ttf');
$graph->setFont($font);
$graph->add(Image_Graph::vertical(
Image_Graph::factory('title', array('foo', 12)),
$plotarea = Image_Graph::factory('plotarea'),
5
));
$axisx =& $plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
$axisx->setTitle('Bar');
$axisy =& $plotarea->getAxis(IMAGE_GRAPH_AXIS_Y);
$axisy->setTitle('Baz', array('angle' => 90));
$dataset->addPoint(0, 0);
$dataset->addPoint(1, 1);
$plot =& $plotarea->addNew('line', &$dataset);
$graph->done();
?>
Expected result:
----------------
This script works fine but when uncommenting line 3, the SVG output has the vertical axis title rotated 180 degrees. If I change the '90' to '270' in line 19, both graphs are similar.
Actual result:
--------------
Both graphs should look the same when given the same parameters.