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

Bug #14551 forceMinimum screws up Axis span on logarithmic axis
Submitted: 2008-08-23 03:18 UTC
From: xulchris Assigned:
Status: Open Package: Image_Graph (version 0.7.2)
PHP Version: 5.2.6 OS: Fedora 9
Roadmaps: (Not assigned)    
Subscription  


 [2008-08-23 03:18 UTC] xulchris (Christopher Stone)
Description: ------------ When using forceMinimum and forceMaximum on a logarithmic axis, the axis span gets messed up. For example, on auto it will plot an axis from 1 to 100 in the sample code below, but if you set a minimum of 20, then the maximum gets cut off by 20 as well and it plots from 20 to 80 instead of 20 to 100. Test script: --------------- <?php require_once 'Image/Graph.php'; $d = Image_Graph::factory('dataset'); for($i=1; $i<=10; $i++) $d->addPoint($i,$i*$i); $g = Image_Graph::factory('graph', array(1024, 768)); $g->add($p = Image_Graph::factory('plotarea', array('Image_Graph_Axis_Category', 'Image_Graph_Axis_Logarithmic'))); $p->addNew('line', $d); $a = $p->getAxis(IMAGE_GRAPH_AXIS_Y); // HERE IS THE BUG, THE GRAPH PLOTS FROM 20 to 100 instead of 20 to 120. // IF WE REMOVE FORCE MAXIMUM OR SET IT TO 100, IT ONLY PLOTS TO 80. $a->forceMinimum(20); $a->forceMaximum(120); $g->done(array('filename' => "foo.png")); ?> Expected result: ---------------- setting forceMinimum should not affect the maximum in a log scale, for example: $a->forceMinimum(20); $a->forceMaximum(100); this should plot from 20 to 100, not 20 to 80 as it currently does. Actual result: -------------- Messed up axis and plots.

Comments