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

Bug #6919 Isolated points in linegraphs with breaks drawn incorrectly
Submitted: 2006-02-24 08:20 UTC
From: dsier at g-point dot biz Assigned: nosey
Status: Closed Package: Image_Graph (version CVS)
PHP Version: 5.0.5 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2006-02-24 08:20 UTC] dsier at g-point dot biz (Darek Sieradzki)
Description: ------------ Isolated point in line graphs with breaks creates single vertex which is not used in polygon (polygons are drawn only when $numPoints > 1). If after that script starts to draw polygon based markers (triangle, circle, etc.) this single vertex is prepended to the first marker and additional line or filled area is drawn. This applies at least to GD Canvas. Test script: --------------- <?php require_once 'Image/Graph.php'; $Graph =& Image_Graph::factory('graph', array(400, 300)); $Font =& $Graph->addNew('font', 'Verdana'); $Font->setSize(10); $Graph->setFont($Font); $Graph->add( Image_Graph::vertical( Image_Graph::factory('title', array('Data \'Break\' Sample', 12)), Image_Graph::vertical( Image_Graph::vertical( $Plotarea1 = Image_Graph::factory('plotarea'), $Plotarea2 = Image_Graph::factory('plotarea'), 50 ), $Legend = Image_Graph::factory('legend'), 88 ), 5 ) ); $Legend->setPlotarea($Plotarea1); $Legend->setPlotarea($Plotarea2); $Dataset =& Image_Graph::factory('dataset'); $Dataset->addPoint('Jan', 10); $Dataset->addPoint('Feb', 12); $Dataset->addPoint('Mar', 3); $Dataset->addPoint('Apr', null); $Dataset->addPoint('May', 4); $Dataset->addPoint('Jun', 10); $Dataset->addPoint('Jul', null); $Dataset->addPoint('Aug', null); $Dataset->addPoint('Sep', 9); $Dataset->addPoint('Oct', 10); $Dataset->addPoint('Nov', null); $Dataset->addPoint('Dec', 14); $Marker1 =& Image_Graph::factory('Image_Graph_Marker_Circle'); $Plot1 =& $Plotarea1->addNew('line', array(&$Dataset)); $Plot1->setLineColor('red'); $Plot1->setMarker($Marker1); $Marker2 =& Image_Graph::factory('Image_Graph_Marker_Box'); $Plot2 =& $Plotarea2->addNew('line', array(&$Dataset)); $Plot2->setLineColor('red'); $Plot2->setMarker($Marker2); $Graph->done(); ?> Expected result: ---------------- Top graph shows error - additional line between first and last marker. Actual result: -------------- Lower graph shows good behaviour using another, not polygon based marker.

Comments

 [2006-02-24 08:25 UTC] dsier at g-point dot biz
fixed bug summary
 [2006-02-28 22:31 UTC] nosey
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.