Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: DBD::Chart: unable to create a 3 levels stacked barchart

by renodino (Curate)
on Dec 10, 2007 at 16:27 UTC ( #656165=note: print w/ replies, xml ) Need Help??


in reply to DBD::Chart: unable to create a 3 levels stacked barchart

The stacked range values must be applied in a single tuple; see the following code:

#!/usr/bin/perl -w use DBI; use DBD::Chart; $dbh = DBI->connect('dbi:Chart:'); $dbh->do('create table stackbar (name varchar(10), y1 integer, y2 inte +ger, y3 integer, y4 integer)'); $sth = $dbh->prepare('insert into stackbar values(?, ?, ?, ?, ?)'); $sth->execute('foo', 20, 30, 50, 80); $sth->execute('bar', 30, 40, 70, 90); $sth = $dbh->prepare("select barchart from stackbar where WIDTH=500 AND HEIGHT=500 AND X_AXIS='Some Domain' AND Y_AXIS='Some Range' AND TITLE='Stacked Barchart Test' AND FORMAT='PNG' AND STACK=1 AND SHOWVALUES=1 AND COLORS IN ('green', 'yellow', 'red', 'blue')"); $sth->execute; $row = $sth->fetchrow_arrayref; open(OUTF, ">badfloatbar.png"); binmode OUTF; print OUTF $$row[0]; close OUTF; $sth->finish; $dbh->disconnect;

Perl Contrarian & SQL fanboy


Comment on Re: DBD::Chart: unable to create a 3 levels stacked barchart
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://656165]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-12-21 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (106 votes), past polls