Unfortunately I don't have it installed locally, so I can't give you code, but look in the installation directory for a directory known as "samples". It should have a few dozen sample scripts demonstrating various uses of GD::Graph. As you run into coding issues, those are useful to look at.

Anyways the two options you list will both solve your problem. The "cumulate" option "stacks" bars. If your first data set is 21 high, while your second is 35, the first bar will go from 0 to 21 and the second from 21 to 56. The "overwrite" option is just what it says, the later bars are drawn over the previous ones. So the first bar is drawn to height 21, then the second to height 35, hiding (oops) all of the first bar. (Advice, draw the tallest bars first, then you just overwrite the bottom of the bar.)

If you have multiple data sets, which appear in the same order every time, this means that either can be used. (When I faced this, it was more convenient to use the overwrite option.) If A is sometimes taller than B and B is sometimes taller than A, then I suspect you will have a lot of work ahead of you. I am going to just hope that you don't face that and not answer that question. :-)

An incidental note. Should your boss notice the two_axes option, say it doesn't work. I found very serious bugs with that option, I came up with a fix, but the maintainer never responded to my email and it has never been patched. If anyone knows how to reach the module author, or if someone else winds up taking over maintainance (I have no such intentions) then I will gladly recontribute the patch, but in the meantime consider that feature seriously broken.


In reply to Re (tilly) 1: GD::Graph Issues by tilly
in thread GD::Graph Issues by tradez

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.