hoggardb has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to create some candlestick charts using DBD::Chart::Plot. According to the documentation I can do it by providing the min and max values in addition to my x axis values:
$img->setPoints(\@xdata, \@ymindata, \@ymaxdata, 'blue points');
Here is the code I'm using (in Mason but I don't think that is the issue):
my $img = DBD::Chart::Plot->new(400, 500); $img->setOptions ( horizMargin => 75, vertMargin => 100, title => 'Visual Analysis', yLog => 1, ); my @years = (1994 .. 2003); my @lows = (1..10); my @highs = (21..30); unless ($img->setPoints(\@years, \@lows, \@highs, 'black')) { die $img->error; } $r->content_type('image/jpeg'); $m->clear_buffer; $m->out($img->plot('jpeg')); $m->abort(OK);
I just get a line graph with the lows. Is anyone else using this module? Should I try something else for a chart that uses logarithmic scales and candlestick charts? They will be mixed with regular line plots as well.

Replies are listed 'Best First'.
Re: DBD::Chart::Plot and candlestick charts
by hoggardb (Acolyte) on Oct 14, 2003 at 01:09 UTC
    Updated: By looking at the source code I see I need to pass in "black candle" not just "black" even though the docs say otherwise. I'm still looking for a better way to do this if anyone has suggestions, since logarithmic candlestick doesn't seem to work, nor does mixing line graphs and candlestick.