in reply to GD::Graph::area failing with no error...

From the GD docs:

For bar and area graphs, the range (y_min_value..y_max_value) has to include 0. If it doesn't, the values will be adapted before attempting to draw the graph.

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: GD::Graph::area failing with no error...

Replies are listed 'Best First'.
Re^2: GD::Graph::area failing with no error...
by cLive ;-) (Prior) on Nov 13, 2006 at 23:56 UTC

    Give that man a cookie! Thanks. I was going nuts there. Time for a quick map and amend of the date_format sub...

    Well, this is slightly better. Now all I have to do is work out how to stretch it to the right. Weird.

    Aha! Adding back in x_max_value is looking almost there.

      One trick you might use, though it is definitely a trick, is to produce your graph much wider than you eventually want it, and then use the GD::Image copying methods to crop out and peice together the pieces you want. Eg.

      | -| | -| ### ### ##### #### | ####### ####### #### -| ##################### | ###################### -+------------------------------'-'-'-'-'-'-'-'-'-'-'-' 0

      then copy the interesting bits of the graph to a new image leaving out the boring bit between the left hand scale and the actual data.

      Hmm. All in all, mapping the data to zero and then mapping it back in the number formating routine makes much more sense :)


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.