1use strict; 2use Chart::Composite; 3 4my $png_name = 'samples/mapcomp.png'; 5my @legend_keys = ( "Actual ", "Goal" ); 6 7# 8my $Graph = new Chart::Composite( 600, 400 ); 9 10print "1..1\n"; 11 12# 13$Graph->add_dataset( "Oct 01", "Nov 01", "Dec 01", "Jan 02", "Feb 02", "Mar 02" ); 14$Graph->add_dataset( 95.1, 84.4, 90.2, 94.4, 93.8, 95.5 ); 15$Graph->add_dataset( 93.0, 83.0, 94.0, 94.0, 94.0, 94.0 ); 16 17# 18$Graph->set( 19 composite_info => [ [ 'Bars', [1] ], [ 'Lines', [2] ] ], 20 colors => { 21 dataset0 => 'green', 22 dataset1 => 'red' 23 }, 24 title_font => GD::Font->Giant, 25 label_font => GD::Font->Small, 26 legend_font => GD::Font->Large, 27 tick_label_font => GD::Font->Large, 28 grid_lines => 'true', 29 graph_border => 0, 30 imagemap => 'true', 31 legend => 'bottom', 32 legend_labels => \@legend_keys, 33 max_val => 100, 34 min_val => 80, 35 png_border => 4, 36 same_y_axes => 'true', 37 spaced_bars => 'true', 38 title => "Yield 2004", 39 text_space => 5, 40 transparent => 'true', 41 x_ticks => 'vertical', 42 integer_ticks_only => 'true', 43 skip_int_ticks => 5, 44); 45 46$Graph->png("$png_name"); 47 48# 49my $imagemap_data = $Graph->imagemap_dump(); 50 51# 52foreach my $ds ( 1 .. 1 ) 53{ 54 foreach my $pt ( 0 .. 5 ) 55 { 56 if ( defined( $imagemap_data->[$ds]->[$pt] ) ) 57 { 58 my @i = @{ $imagemap_data->[$ds]->[$pt] }; # ** 59 print "Dataset:$ds - Point: $pt ---- VALUES: @i \n"; 60 } 61 } 62} 63 64print "ok\n"; 65 66exit 0; 67