in reply to Chart::Graph::Gnuplot Array Issue

I've done it another way from the one already suggested.

I use LWP::UserAgent to get data from a URL, save it to a file because it is a very large dataset I use more than once, do a bunch of manipulations, ultimately putting the data into arrays (@dates and @atemp in the code below) for various graphs, then graph.

gnuplot({ "title" => "", "output type" => "png", "output file" => "temp.png", "x-axis label" => "$day.$month.$year $time - $eday.$emonth.$ey +ear $etime", "y-axis label" => "", "xdata" => "time", "format" => ["x", "%d.%m"], "timefmt" => "%Y-%m-%d-%H:%M", "xrange" => "[\"$dates[$index]\" : \"$dates[$j]\"]", "extra_opts" => join("\n","set grid", "set nokey", "set linest +yle 1 lt 3 l w 10","set lmargin 10","set rmargin 10","set tmargin 9","set bmargin 9 +" )}, [{ "style" => "lines ls 1", "type" => "columns"}, [@dates],[@atemp] ],); my $type = "AirTemp.png"; my $ftype = "Days" . "$days" . "ATemp.png"; my $finalgraph = printGraph($station,$type,$ftype); }
In case anyone notices/wonders/tries to use this, some things are intentionally left blank and the file is called temp because I ultimately use GD to splice this onto a background image using the subroutine at the end called printGraph - I just thought I'd include the whole code block because I know it works.