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

Request #4785 More descriptive error messages, use PEAR_Error or Exceptions
Submitted: 2005-07-11 07:41 UTC
From: nohn at php dot net Assigned:
Status: Open Package: Image_Graph
PHP Version: 5.0.4 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2005-07-11 07:41 UTC] nohn at php dot net
Description: ------------ Initalize an Image_Graph (0.4.0) object fails Reproduce code: --------------- <?php require_once 'Image/Graph.php'; $graph = Image_Graph::factory('graph', 300, 100); $plotarea = $graph->addNew('plotarea'); $daten = Image_Graph::factory('dataset'); $daten->addPoint('Test', 43.0); $daten->addPoint('Hans', 23.0); $daten->addPoint('Wurst', 12.0); $plot = $plotarea->addNew('bar', $daten); $graph->done(); ?> Expected result: ---------------- A graph is painted. Actual result: -------------- [client 82.83.253.83] PHP Warning: imagecreatetruecolor() [<a href='function.imagecreatetruecolor'>function.imagecreatetruecolor</a>]: Invalid image dimensions in /opt/php/lib/php/Image/Graph/Driver/GD.php on line 177

Comments

 [2005-07-11 16:58 UTC] pear dot nosey at veggerby dot dk
This a bug in your graph :) The factory method takes as second parameter an array of parameters to pass to the constructor of the object. This means that you should simply change your code from: $graph = Image_Graph::factory('graph', 300, 100); to $graph = Image_Graph::factory('graph', array(300, 100)); And you should get the expected result. regards Jesper
 [2005-07-12 07:42 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-07-27 21:17 UTC] pear dot nosey at veggerby dot dk
Well I guess that's a good idea - you know it's just one of these things that are at the end of the list (and seem to stay there :)) regards Jesper
 [2006-06-17 16:50 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!