/usr/share/doc/perl-GDGraph/samples
no strict; # TODO fix this use GD::Graph::bars; use GD::Graph::hbars; require 'save.pl'; # CONTRIB Edwin Hildebrand. # # See changes in bars.pm: Check for bar height rounding errors when # stacking bars. @dat = qw( 991006 991007 991114 991117 991118 991119 991120 991121 991122 991123 991124 991125 991126 991127 991128 991129 991130 991201 991204 991205 991206 991207 991208 ); @sub = qw(0 0 0 0 0 0 0 0 1 1 1 1 2 3 1 1 1 1 2 2 6 8 8); @def = qw(0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0); @rej = qw(0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0); @opn = qw(4 4 4 5 4 4 4 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3); @ass = qw(0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0); @wrk = qw(1 2 2 2 2 2 1 1 2 2 2 1 1 1 1 1 1 1 1 1 3 6 5); @fin = qw(0 0 0 0 0 0 1 0 0 0 0 1 1 1 2 2 2 2 2 2 2 2 2); @ver = qw(0 0 0 0 0 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1); @con = qw(0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0); @tst = qw(0 0 0 0 0 0 0 0 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1); @rev = qw(0 0 0 0 0 0 0 0 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1); @cco = qw(0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0); @cls = qw(0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0); @sld = qw(0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 2 2 3 3 3 4); # setup x data push(@data,\@dat); # push x labels into plot data push(@data,\@sub); push(@data,\@def); push(@data,\@rej); push(@data,\@opn); push(@data,\@ass); # push x values into plot data push(@data,\@wrk); # (push order must match legend label order) push(@data,\@fin); push(@data,\@ver); push(@data,\@con); push(@data,\@tst); push(@data,\@rev); push(@data,\@cco); push(@data,\@cls); push(@data,\@sld); # setup legend labels @legend = qw( Submitted Deferred Rejected Opened Assigned Work Finished Verified Configured Tested Reviewed Closed-CO Closed Sealed ); my @names = qw/sample18 sample18-h/; for my $graph (GD::Graph::bars->new(600, 400), GD::Graph::hbars->new(600, 400)) { my $name = shift @names; print STDERR "Processing $name\n"; # set graph legend $graph->set_legend(@legend); # set graph options $graph->set( 'dclrs' => [ qw(lblue lyellow blue yellow lgreen lred green red purple orange pink dyellow) ], 'title' => "States by Time", 'x_label' => "Time", 'y_label' => "# OF thingies", 'long_ticks' => 1, 'tick_length' => 0, 'x_ticks' => 0, 'x_label_position' => .5, 'y_label_position' => .5, 'cumulate' => 1, 'bgclr' => 'white', 'transparent' => 0, 'interlaced' => 1, 'y_tick_number' => 5, 'y_number_format' => '%d', #'y_max_value' => 25, #'y_min_value' => 0, 'y_plot_values' => 1, 'x_plot_values' => 1, 'zero_axis' => 1, ); $graph->set('x_labels_vertical'=> 1) unless $name =~/-h$/; $graph->plot(\@data); save_chart($graph, $name); } 1;
.
Edit
..
Edit
Makefile
Edit
error.pl
Edit
logo.gif
Edit
logo.png
Edit
make_index.pl
Edit
rgb.txt
Edit
sample11.pl
Edit
sample12.pl
Edit
sample13.pl
Edit
sample14.pl
Edit
sample15.pl
Edit
sample16.pl
Edit
sample17.pl
Edit
sample18.pl
Edit
sample19.pl
Edit
sample1A.pl
Edit
sample1B.pl
Edit
sample21.pl
Edit
sample22.pl
Edit
sample23.pl
Edit
sample29.pl
Edit
sample31.pl
Edit
sample41.pl
Edit
sample42.dat
Edit
sample42.pl
Edit
sample51.pl
Edit
sample52.pl
Edit
sample53.pl
Edit
sample54.dat
Edit
sample54.pl
Edit
sample55.pl
Edit
sample56.pl
Edit
sample57.pl
Edit
sample58.pl
Edit
sample61.pl
Edit
sample62.pl
Edit
sample63.pl
Edit
sample64.pl
Edit
sample71.pl
Edit
sample72.pl
Edit
sample91.pl
Edit
sample92.pl
Edit
sample93.pl
Edit
sample94.pl
Edit
sample95.pl
Edit
save.pl
Edit