Drawing reference lines with GD::Graph

P

Phil

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
 
S

smackdab

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 ;-)
 
M

Martien Verbruggen

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,056
Messages
2,570,443
Members
47,091
Latest member
IsaacLuna

Latest Threads

Top