use GD::Graph::lines; use GD::Graph::Map; use GD::Graph::Data; my ( @hyd,@aut,@fil,@cli,@mis,@days,@std,@files ); @data = (); @files = ( "work_days.dat","std.dat","hyd_daily.dat","aut_daily.dat"," +cli_daily.dat","mis_daily.dat"); sub split_file_line { my $file = shift; open IN, "<$file" || die "cannot open $file: $!"; my $temp = <IN>; my @items = ( split /,/,$temp ); close IN; return \@items; } foreach (@files) { push @data, split_file_line($_); } $my_graph = GD::Graph::lines->new(600,600); $my_graph->set( x_label => 'Working Days ', y_label => '% Percentage', title => 'Orders on Time ', y_max_value => 200, y_min_value => 0, y_tick_number => 20, y_label_skip => 1, box_axis => 0, line_width => 5 ); open PNG, ">p.png"; binmode PNG; #only for Windows like platforms print PNG $my_graph->plot(\@data)->png; close PNG; $map = new GD::Graph::Map($my_graph, info => '%l'); open HTML, ">p.html"; print HTML "<HTML><BODY BGCOLOR=white><CENTER>\n". ($map->imagemap("parker.png", $ref)). "</CENTER></BODY></HTML>"; close HTML; __END__
In reply to Re: Re: Graphing basics..
by Anonymous Monk
in thread Graphing basics..
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |