Drawing reference lines with GD::Graph

Discussion in 'Perl Misc' started by Phil, Jan 21, 2004.

  1. Phil

    Phil Guest

    Hello - I have a pretty PNG:
    http://dodgeit.com/temp/file.png

    created with this code:

    my $chart = GD::Graph::lines->new(1000,480);
    $chart->set(x_label => "time", # no axes for pie chart
    x_labels_vertical => 1,
    x_label_skip => 50,
    y_label => "price",
    title => "misc stock",
    long_ticks => 0, # make a grid of all the ticks
    );
    my $plot = $chart->plot($dataref) or die $chart->error;


    I'd like to draw a horizontal reference line right at the number 11.

    Any ideas? I looked through the /samples dir that came with the
    GD::Graph dist and didn't find anything promising and have also
    googled around quite a bit.

    TIA -> Phil
     
    Phil, Jan 21, 2004
    #1
    1. Advertising

  2. Phil

    smackdab Guest

    > I'd like to draw a horizontal reference line right at the number 11.
    >
    > Any ideas? I looked through the /samples dir that came with the
    > GD::Graph dist and didn't find anything promising and have also
    > googled around quite a bit.
    >


    I am also going to need to do this soon...
    I think you could create another dataset with all values equal to 11, a
    little wastful though..
    Or you could look into 'mixed' graphs...haven't looked yet myself ;-)

    If you find a good solution, post it ;-)
     
    smackdab, Jan 23, 2004
    #2
    1. Advertising

  3. On Thu, 22 Jan 2004 17:47:18 -0800,
    smackdab <> wrote:
    >> I'd like to draw a horizontal reference line right at the number 11.
    >>
    >> Any ideas? I looked through the /samples dir that came with the
    >> GD::Graph dist and didn't find anything promising and have also
    >> googled around quite a bit.
    >>

    >
    > I am also going to need to do this soon...
    > I think you could create another dataset with all values equal to 11, a
    > little wastful though..


    At the moment that is the only way.

    It's not that wasteful. Compared to all the other work that goes on,
    drawing one extra data set isn't going to be significant.

    > Or you could look into 'mixed' graphs...haven't looked yet myself ;-)


    If your "real" data sets are not lines, then that's what you'l need to
    use, yes.

    > If you find a good solution, post it ;-)


    I'll put it o the Todo list.

    Martien
    --
    |
    Martien Verbruggen |
    | Curiouser and curiouser, said Alice.
    |
     
    Martien Verbruggen, Jan 24, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    646
    Kevin Spencer
    Jan 9, 2006
  2. Newbie

    drawing a graph

    Newbie, May 14, 2005, in forum: Java
    Replies:
    8
    Views:
    583
    Amit Chatterjee
    May 18, 2005
  3. matt

    Drawing Graph In VC++

    matt, Feb 11, 2004, in forum: C++
    Replies:
    2
    Views:
    7,143
    Howard
    Feb 11, 2004
  4. defn noob
    Replies:
    1
    Views:
    403
    Mark Space
    Jun 28, 2008
  5. Emilio Mayorga
    Replies:
    6
    Views:
    342
    Martien Verbruggen
    Oct 8, 2003
Loading...

Share This Page