Hello shanta,
Welcome to the Monastery. Well I am not sure why you want to export your data perldsc/ARRAYS OF ARRAYS when the module GD::Graph::Data loads the data directly into the plot.
Sample code from the GD::Graph::Data/EXAMPLES:
use DBI; # do DBI things, like connecting to the database, statement # preparation and execution use GD::Graph::Data; use GD::Graph::bars; my $data = GD::Graph::Data->new(); while (@row = $sth->fetchrow_array) { $data->add_point(@row); } my $chart = GD::Graph::bars->new(); my $gd = $chart->plot($data);
So in your case if you are sure the data that you exporting is the necessary data from the plot something like that should work out of the box (code untested):
use GD::Graph::Data; use GD::Graph::bars; my $data = GD::Graph::Data->new(); my $sth = $dbh->prepare("SELECT time, mastuntemp, LineTemp, spargtemp +FROM brew_temp_tb WHERE sitename = 'Brew' AND batchnumber = '$batchnu +mber' ORDER BY time";"); if (!$sth->execute()) { die "Error: ". $sth->errstr ."\n"; } my @row; while (@row = $sth->fetchrow_array) { $data->add_point(@row); }
We can not test your code, be we need a minimum working sample of code that replicates the table and some demo data to insert for experimentation purposes. Alternatively you can test it and let us know if it worked.
Looking forward to your update, BR.
In reply to Re: Getting mysql data into gd
by thanos1983
in thread Getting mysql data into gd
by shanta
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |