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.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.