#!/usr/bin/perl -w use GD::Graph::lines; #my @xdataset = qw(791.312 809.298 825.259 842.510 855.028 861.120 870.554 870.977 877.036 893.436 1060.006 1066.030 1081.967 1270.989 2211.105 2225.178 2239.090); #my @ydataset = qw(1383.8 1863.9 1247 2191.4 2101.2 624.96 552.55 1050.3 690.71 538.11 705.84 566.41 397.68 133.13 158.5 91.587 82.42); @data = ( ["100","2nd","3rd","4th","5th","6th","7th", "8th", "9th"], [ 100, 200, 500, 600, 300, 150, 101, 301, 401], [ sort { $a <=> $b } (105, 205, 505, 605, 305, 155, 106, 306, 406) ] ); my $graph = GD::Graph::lines->new(400, 300); $graph->set( x_label => 'Day', y_label => 'No. Attacks', title => 'Number of Worm attacks per day by type', y_max_value => 8, y_tick_number => 1, y_label_skip => 2 ); my $gd = $graph->plot(\@data); #chdir "d:"; #chdir "d:/http/Pics"; open(IMG, '>days.png') or die $!; binmode IMG; print IMG $gd->png;