Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.8.0

Bug #13626 Bug with secondary axis and intersection point
Submitted: 2008-04-08 13:37 UTC
From: utopico Assigned:
Status: Open Package: Image_Graph (version 0.7.2)
PHP Version: 5.0.4 OS: Windows
Roadmaps: (Not assigned)    
Subscription  


 [2008-04-08 13:37 UTC] utopico (Jardar Maatje)
Description: ------------ Secondary axis ended up on right side of graph is value type axis was used (not category). Setting intersection point to 'max' does nothing to help this. Bug is located in: Axis::_intersectPoint($value) if (($value === 'min') || ( $value < $this->_getMinimum() )) { should be changed to if (($value === 'min') || ( is_numeric($value) && $value < $this->_getMinimum() )) { and } elseif (($value === 'max') || ($value > $this->_getMaximum())) { to } elseif (($value === 'max') || (is_numeric($value) && $value > $this->_getMaximum())) { Test script: --------------- <?php require_once 'Image/Graph.php'; $Graph =& Image_Graph::factory('graph', array(400, 300)); //$Plotarea =& $Graph->addNew('plotarea'); //Works correctly with categires $Plotarea =& $Graph->addNew('plotarea',array('axis','axis')); $Dataset1 = Image_Graph::factory('dataset'); $Dataset2 = Image_Graph::factory('dataset'); $i = 1; while ($i <= 10) { $Dataset1->addPoint($i, 10-$i); $Dataset2->addPoint($i, $i*$i); $i++; } $Plot1 =& $Plotarea->addNew('line', array(&$Dataset1)); $Plot2 =& $Plotarea->addNew('line', array(&$Dataset2),IMAGE_GRAPH_AXIS_Y_SECONDARY); $AxisY =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_Y); $AxisY =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_Y_SECONDARY); $Graph->done(); ?> Expected result: ---------------- Plot displaying two graphs with one axis on right side and one on the left side. Actual result: -------------- The graph should have the secondary axis printed on the left side instead of the right side.

Comments