in reply to Flat File Database & GD::Graph
I assume that by "replace" you mean to use data loaded dynamically, rather than statically.
Something along the lines of the following fragment should do. It assumes three comma-delimited numbers per row of data.
while ( <DATA> ) { chomp; my($a,$b,$c) = split; push @{$data[0]}, $a; push @{$data[1]}, $b; push @{$data[2]}, $c; } open(IMG, ">chart.png") or die("chart.png: $!"); binmode(IMG); print IMG $graph->plot(\@data); close(IMG);
|
|---|