Lines Matching refs:self

47     my $self = shift;
57 unless ( $self->{'opts'} )
59 $self->{'opts'} = {};
65 $self->{$_} = $opts{$_};
66 $self->{'opts'}{$_} = $opts{$_};
84 my $self = shift;
91 unless ( ( $self->true( $self->{'imagemap'} ) ) && $self->{'imagemap_data'} )
98 for $i ( 1 .. $#{ $self->{'sub_0'}->{'imagemap_data'} } )
100 for $j ( 0 .. $#{ $self->{'sub_0'}->{'imagemap_data'}->[$i] } )
102 $map[$i][$j] = \@{ $self->{'sub_0'}->{'imagemap_data'}->[$i][$j] };
108 for $i ( 1 .. $#{ $self->{'sub_1'}->{'imagemap_data'} } )
110 for $j ( 0 .. $#{ $self->{'sub_1'}->{'imagemap_data'}->[$i] } )
112 $map[ $i + $dataset_count ][$j] = \@{ $self->{'sub_1'}->{'imagemap_data'}->[$i][$j] };
151 my $self = shift;
155 unless ( ( $self->{'composite_info'} ) && ( $#{ $self->{'composite_info'} } == 1 ) )
162 if ( $self->{'y_ticks'} == 1 )
164 $self->{'y_ticks'} = 2;
169 $self->{'num_datasets'} = $#{ $self->{'dataref'} };
172 $self->{'num_datapoints'} = 0;
173 for ( 0 .. $self->{'num_datasets'} )
175 if ( scalar( @{ $self->{'dataref'}[$_] } ) > $self->{'num_datapoints'} )
177 $self->{'num_datapoints'} = scalar( @{ $self->{'dataref'}[$_] } );
182 for ( @{ $self->{'dataref'}[0] } )
189 $self->{'x_tick_label_length'} = $length;
192 $self->_split_data;
205 my $self = shift;
206 my @types = ( $self->{'composite_info'}[0][0], $self->{'composite_info'}[1][0] );
220 $self->{'sub_0'} = ( "Chart::" . $types[0] )->new();
221 $self->{'sub_1'} = ( "Chart::" . $types[1] )->new();
227 $self->{'sub_0'}->set( %{ $self->{'opts'} } );
228 $self->{'sub_1'}->set( %{ $self->{'opts'} } );
229 if ( defined( $self->{'opts'}{'min_val1'} ) )
231 $self->{'sub_0'}->set( 'min_val' => $self->{'opts'}{'min_val1'} );
233 if ( defined( $self->{'opts'}{'max_val1'} ) )
235 $self->{'sub_0'}->set( 'max_val' => $self->{'opts'}{'max_val1'} );
237 if ( defined( $self->{'opts'}{'min_val2'} ) )
239 $self->{'sub_1'}->set( 'min_val' => $self->{'opts'}{'min_val2'} );
241 if ( defined( $self->{'opts'}{'max_val2'} ) )
243 $self->{'sub_1'}->set( 'max_val' => $self->{'opts'}{'max_val2'} );
245 if ( $self->{'opts'}{'y_ticks1'} )
247 $self->{'sub_0'}->set( 'y_ticks' => $self->{'opts'}{'y_ticks1'} );
249 if ( $self->{'opts'}{'y_ticks2'} )
251 $self->{'sub_1'}->set( 'y_ticks' => $self->{'opts'}{'y_ticks2'} );
253 if ( $self->{'opts'}{'brush_size1'} )
255 $self->{'sub_0'}->set( 'brush_size' => $self->{'opts'}{'brush_size1'} );
257 if ( $self->{'opts'}{'brush_size2'} )
259 $self->{'sub_1'}->set( 'brush_size' => $self->{'opts'}{'brush_size2'} );
262 if ( $self->{'opts'}{'brushStyle1'} )
264 $self->{'sub_0'}->set( 'brushStyle' => $self->{'opts'}{'brushStyle1'} );
266 if ( $self->{'opts'}{'brushStyle2'} )
268 $self->{'sub_1'}->set( 'brushStyle' => $self->{'opts'}{'brushStyle2'} );
272 if ( defined( $self->{'opts'}{'f_y_tick1'} ) )
274 $self->{'sub_0'}->set( 'f_y_tick' => $self->{'opts'}{'f_y_tick1'} );
276 if ( defined( $self->{'opts'}{'f_y_tick2'} ) )
278 $self->{'sub_1'}->set( 'f_y_tick' => $self->{'opts'}{'f_y_tick2'} );
282 $self->{'sub_0'}->{'gd_obj'} = $self->{'gd_obj'};
283 $self->{'sub_1'}->{'gd_obj'} = $self->{'gd_obj'};
286 $self->{'sub_0'}->{'component'} = 'true';
287 $self->{'sub_1'}->{'component'} = 'true';
290 $self->{'component_datasets'} = [];
294 $self->{'component_datasets'}[$i] = $self->{'composite_info'}[$i][1];
295 push @{$ref}, $self->{'dataref'}[0];
296 for $j ( @{ $self->{'composite_info'}[$i][1] } )
298 $self->_color_role_to_index( 'dataset' . ( $j - 1 ) ); # allocate color index
299 push @{$ref}, $self->{'dataref'}[$j];
301 $self->{ 'sub_' . $i }->_copy_data($ref);
305 $self->{'sub_0'}->_check_data;
306 $self->{'sub_1'}->_check_data;
309 if ( $self->true( $self->{'same_y_axes'} ) )
311 if ( $self->{'sub_0'}{'min_val'} < $self->{'sub_1'}{'min_val'} )
313 $self->{'sub_1'}{'min_val'} = $self->{'sub_0'}{'min_val'};
317 $self->{'sub_0'}{'min_val'} = $self->{'sub_1'}{'min_val'};
320 if ( $self->{'sub_0'}{'max_val'} > $self->{'sub_1'}{'max_val'} )
322 $self->{'sub_1'}{'max_val'} = $self->{'sub_0'}{'max_val'};
326 $self->{'sub_0'}{'max_val'} = $self->{'sub_1'}{'max_val'};
329 $self->{'sub_0'}->_check_data;
330 $self->{'sub_1'}->_check_data;
334 $self->{'y_tick_label_length1'} = $self->{'sub_0'}->{'y_tick_label_length'};
335 $self->{'y_tick_label_length2'} = $self->{'sub_1'}->{'y_tick_label_length'};
347 my $self = shift;
352 if ( ( $#{ $self->{'legend_labels'} } >= 0 )
353 && ( ( scalar( @{ $self->{'legend_labels'} } ) ) != $self->{'num_datasets'} ) )
359 unless ( $self->{'max_legend_label'} )
361 $self->{'max_legend_label'} = 0;
365 for ( 1 .. $self->{'num_datasets'} )
367 unless ( $self->{'legend_labels'}[ $_ - 1 ] )
369 $self->{'legend_labels'}[ $_ - 1 ] = "Dataset $_";
371 $length = length( $self->{'legend_labels'}[ $_ - 1 ] );
372 if ( $length > $self->{'max_legend_label'} )
374 $self->{'max_legend_label'} = $length;
379 if ( $self->{'legend'} eq 'bottom' )
381 $self->_draw_bottom_legend;
383 elsif ( $self->{'legend'} eq 'right' )
385 $self->_draw_right_legend;
387 elsif ( $self->{'legend'} eq 'left' )
389 $self->_draw_left_legend;
391 elsif ( $self->{'legend'} eq 'top' )
393 $self->_draw_top_legend;
395 elsif ( $self->{'legend'} eq 'none' )
397 $self->_draw_none_legend;
416 my $self = shift;
417 my @labels = @{ $self->{'legend_labels'} };
422 my $font = $self->{'legend_font'};
428 $self->_sub_update;
431 $self->_legend_example_height_init;
444 my ( $n0, $n1 ) = map { scalar @{ $self->{'composite_info'}[$_][1] } } 0 .. 1;
447 …$self->{'sub_1'}{'color_table'}{ 'dataset' . $_ } = $self->{'color_table'}{ 'dataset' . ( $_ + $n0…
451 @datasets = @{ $self->{'composite_info'}[0][1] };
455 $colors{ $datasets[$_] - 1 } = $self->{'color_table'}{ 'dataset' . ($i) };
458 @datasets = @{ $self->{'composite_info'}[1][1] };
462 $colors{ $datasets[$_] - 1 } = $self->{'color_table'}{ 'dataset' . ( $i + $n0 ) };
477 $self->{'curr_x_min'} +
478 $self->{'graph_border'} +
479 $self->{'y_tick_label_length1'} * $self->{'tick_label_font'}->width +
480 $self->{'tick_len'} +
481 ( 3 * $self->{'text_space'} );
483 $self->{'curr_x_max'} -
484 $self->{'graph_border'} -
485 $self->{'y_tick_label_length2'} * $self->{'tick_label_font'}->width -
486 $self->{'tick_len'} -
487 ( 3 * $self->{'text_space'} );
488 if ( $self->{'y_label'} )
490 $x1 += $self->{'label_font'}->height + 2 * $self->{'text_space'};
492 if ( $self->{'y_label2'} )
494 $x2 -= $self->{'label_font'}->height + 2 * $self->{'text_space'};
499 $empty_width = $x2 - $x1 - ( 2 * $self->{'legend_space'} );
501 …$self->{'max_legend_label'} * $self->{'legend_font'}->width + 4 * $self->{'text_space'} + $self->{…
510 $rows = int( $self->{'num_datasets'} / $cols );
511 unless ( ( $self->{'num_datasets'} % $cols ) == 0 )
519 $row_height = $h + $self->{'text_space'};
522 $y1 = $self->{'curr_y_min'};
523 …$y2 = $self->{'curr_y_min'} + $self->{'text_space'} + ( $rows * $row_height ) + ( 2 * $self->{'leg…
524 $self->{'gd_obj'}->rectangle( $x1, $y1, $x2, $y2, $self->_color_role_to_index('misc') );
529 $x1 += $self->{'legend_space'} + $self->{'text_space'};
530 $x2 -= $self->{'legend_space'};
531 $y1 += $self->{'legend_space'} + $self->{'text_space'};
532 $y2 -= $self->{'legend_space'} + $self->{'text_space'};
541 for $j ( 0 .. $#{ $self->{'component_datasets'}[$i] } )
545 $color = $self->{ 'sub_' . $i }->{'color_table'}{ 'dataset' . $j };
546 … $index = $self->{'component_datasets'}[$i][$j] - 1; # index in label list
555 if ( $self->{ 'legend_example_height' . $yi } < $max_legend_example )
557 $yh = $self->{ 'legend_example_height' . $yi };
566 if ( $self->{ 'legend_example_height' . $yi } < $row_height )
568 $yh = $self->{ 'legend_example_height' . $yi };
578 $self->{'gd_obj'}->line( $x, $y, $x + $self->{'legend_example_size'}, $y, $color );
585 …$self->{'gd_obj'}->filledRectangle( $x, $y - $yh, $x + $self->{'legend_example_size'}, $y + $yh, $…
589 $x += $self->{'legend_example_size'} + 2 * $self->{'text_space'};
593 $self->{'gd_obj'}->string( $font, $x, $y, $labels[$index], $color );
605 …$self->{'curr_y_min'} += $rows * $row_height + $self->{'text_space'} + 2 * $self->{'legend_space'};
618 my $self = shift;
619 my @labels = @{ $self->{'legend_labels'} };
622 my $font = $self->{'legend_font'};
627 $self->_sub_update;
630 $self->_legend_example_height_init;
641 my ( $n0, $n1 ) = map { scalar @{ $self->{'composite_info'}[$_][1] } } 0 .. 1;
645 …$self->{'sub_1'}{'color_table'}{ 'dataset' . $_ } = $self->{'color_table'}{ 'dataset' . ( $_ + $n0…
649 @datasets = @{ $self->{'composite_info'}[0][1] };
653 $colors{ $datasets[$_] - 1 } = $self->{'color_table'}{ 'dataset' . ($_) };
657 @datasets = @{ $self->{'composite_info'}[1][1] };
661 $colors{ $datasets[$_] - 1 } = $self->{'color_table'}{ 'dataset' . ( $i + $n0 ) };
675 $misccolor = $self->_color_role_to_index('misc');
679 ( 2 * $self->{'text_space'} ) +
680 ( $self->{'max_legend_label'} * $w ) +
681 $self->{'legend_example_size'} +
682 ( 2 * $self->{'legend_space'} );
685 $x1 = $self->{'curr_x_max'} - $width;
686 $x2 = $self->{'curr_x_max'};
687 $y1 = $self->{'curr_y_min'} + $self->{'graph_border'};
689 $self->{'curr_y_min'} +
690 $self->{'graph_border'} +
691 $self->{'text_space'} +
692 ( $self->{'num_datasets'} * ( $h + $self->{'text_space'} ) ) +
693 ( 2 * $self->{'legend_space'} );
694 $self->{'gd_obj'}->rectangle( $x1, $y1, $x2, $y2, $misccolor );
697 $x1 += $self->{'legend_space'};
698 $y1 += $self->{'legend_space'} + $self->{'text_space'};
708 $max_legend_example = $self->{'legend_space'} + $h;
712 $x3 = $x2 + $self->{'legend_example_size'};
713 $y2 = $y1 + ( $_ * ( $self->{'text_space'} + $h ) ) + $h / 2;
716 if ( $self->{ 'legend_example_height' . $_ } < $max_legend_example )
718 $yh = $self->{ 'legend_example_height' . $_ };
726 $self->{'gd_obj'}->line( $x2, $y2, $x3, $y2, $color );
731 $self->{'gd_obj'}->filledRectangle( $x2, $y2 - $yh, $x3, $y2 + $yh, $color );
735 $x2 = $x3 + ( 2 * $self->{'text_space'} );
737 $self->{'gd_obj'}->string( $font, $x2, $y2, $labels[$_], $color );
741 $self->{'curr_x_max'} -= $width;
755 my $self = shift;
756 my @labels = @{ $self->{'legend_labels'} };
759 my $font = $self->{'legend_font'};
764 $self->_sub_update;
767 $self->_legend_example_height_init;
778 my ( $n0, $n1 ) = map { scalar @{ $self->{'composite_info'}[$_][1] } } 0 .. 1;
781 …$self->{'sub_1'}{'color_table'}{ 'dataset' . $_ } = $self->{'color_table'}{ 'dataset' . ( $_ + $n0…
785 @datasets = @{ $self->{'composite_info'}[0][1] };
789 $colors{ $datasets[$_] - 1 } = $self->{'color_table'}{ 'dataset' . ($i) };
792 @datasets = @{ $self->{'composite_info'}[1][1] };
796 $colors{ $datasets[$_] - 1 } = $self->{'color_table'}{ 'dataset' . ( $i + $n0 ) };
810 $misccolor = $self->_color_role_to_index('misc');
814 ( 2 * $self->{'text_space'} ) +
815 ( $self->{'max_legend_label'} * $w ) +
816 $self->{'legend_example_size'} +
817 ( 2 * $self->{'legend_space'} );
820 $x1 = $self->{'curr_x_min'};
821 $x2 = $self->{'curr_x_min'} + $width;
822 $y1 = $self->{'curr_y_min'} + $self->{'graph_border'};
824 $self->{'curr_y_min'} +
825 $self->{'graph_border'} +
826 $self->{'text_space'} +
827 ( $self->{'num_datasets'} * ( $h + $self->{'text_space'} ) ) +
828 ( 2 * $self->{'legend_space'} );
831 $self->{'gd_obj'}->rectangle( $x1, $y1, $x2, $y2, $misccolor );
834 $x1 += $self->{'legend_space'};
835 $y1 += $self->{'legend_space'} + $self->{'text_space'};
845 $max_legend_example = $self->{'legend_space'} + $h;
849 $x3 = $x2 + $self->{'legend_example_size'};
850 $y2 = $y1 + ( $_ * ( $self->{'text_space'} + $h ) ) + $h / 2;
853 if ( $self->{ 'legend_example_height' . $_ } < $max_legend_example )
855 $yh = $self->{ 'legend_example_height' . $_ };
863 $self->{'gd_obj'}->line( $x2, $y2, $x3, $y2, $color );
870 $self->{'gd_obj'}->filledRectangle( $x2, $y2 - $yh, $x3, $y2 + $yh, $color );
874 $x2 = $x3 + ( 2 * $self->{'text_space'} );
876 $self->{'gd_obj'}->string( $font, $x2, $y2, $labels[$_], $color );
880 $self->{'curr_x_min'} += $width;
894 my $self = shift;
895 my @labels = @{ $self->{'legend_labels'} };
899 my $font = $self->{'legend_font'};
905 $self->_sub_update;
908 $self->_legend_example_height_init;
919 my ( $n0, $n1 ) = map { scalar @{ $self->{'composite_info'}[$_][1] } } 0 .. 1;
922 …$self->{'sub_1'}{'color_table'}{ 'dataset' . $_ } = $self->{'color_table'}{ 'dataset' . ( $_ + $n0…
925 @datasets = @{ $self->{'composite_info'}[0][1] };
929 $colors{ $datasets[$_] - 1 } = $self->{'color_table'}{ 'dataset' . ($i) };
932 @datasets = @{ $self->{'composite_info'}[1][1] };
936 $colors{ $datasets[$_] - 1 } = $self->{'color_table'}{ 'dataset' . ( $i + $n0 ) };
951 $self->{'curr_x_min'} +
952 $self->{'graph_border'} +
953 $self->{'y_tick_label_length1'} * $self->{'tick_label_font'}->width +
954 $self->{'tick_len'} +
955 ( 3 * $self->{'text_space'} );
957 $self->{'curr_x_max'} -
958 $self->{'graph_border'} -
959 $self->{'y_tick_label_length2'} * $self->{'tick_label_font'}->width -
960 $self->{'tick_len'} -
961 ( 3 * $self->{'text_space'} );
962 if ( $self->{'y_label'} )
964 $x1 += $self->{'label_font'}->height + 2 * $self->{'text_space'};
966 if ( $self->{'y_label2'} )
968 $x2 -= $self->{'label_font'}->height + 2 * $self->{'text_space'};
970 $empty_width = $x2 - $x1 - ( 2 * $self->{'legend_space'} );
972 …$self->{'max_legend_label'} * $self->{'legend_font'}->width + 4 * $self->{'text_space'} + $self->{…
981 $rows = int( $self->{'num_datasets'} / $cols );
982 unless ( ( $self->{'num_datasets'} % $cols ) == 0 )
990 $row_height = $h + $self->{'text_space'};
993 …$y1 = $self->{'curr_y_max'} - $self->{'text_space'} - ( $rows * $row_height ) - ( 2 * $self->{'leg…
994 $y2 = $self->{'curr_y_max'};
995 $self->{'gd_obj'}->rectangle( $x1, $y1, $x2, $y2, $self->_color_role_to_index('misc') );
1000 $x1 += $self->{'legend_space'} + $self->{'text_space'};
1001 $x2 -= $self->{'legend_space'};
1002 $y1 += $self->{'legend_space'} + $self->{'text_space'};
1003 $y2 -= $self->{'legend_space'} + $self->{'text_space'};
1011 for $j ( 0 .. $#{ $self->{'component_datasets'}[$i] } )
1013 $color = $self->{ 'sub_' . $i }->{'color_table'}{ 'dataset' . $j };
1014 $index = $self->{'component_datasets'}[$i][$j] - 1;
1022 if ( $self->{ 'legend_example_height' . $yi } < $max_legend_example )
1024 $yh = $self->{ 'legend_example_height' . $yi };
1033 if ( $self->{ 'legend_example_height' . $yi } < $row_height )
1035 $yh = $self->{ 'legend_example_height' . $yi };
1045 $self->{'gd_obj'}->line( $x, $y, $x + $self->{'legend_example_size'}, $y, $color );
1052 …$self->{'gd_obj'}->filledRectangle( $x, $y - $yh, $x + $self->{'legend_example_size'}, $y + $yh, $…
1055 $x += $self->{'legend_example_size'} + 2 * $self->{'text_space'};
1057 $self->{'gd_obj'}->string( $font, $x, $y, $labels[$index], $color );
1069 …$self->{'curr_y_max'} -= ( $rows * $row_height ) + 2 * $self->{'text_space'} + 2 * $self->{'legend…
1082 my $self = shift;
1085 $self->_sub_update();
1093 my ( $n0, $n1 ) = map { scalar @{ $self->{'composite_info'}[$_][1] } } 0 .. 1;
1096 …$self->{'sub_1'}{'color_table'}{ 'dataset' . $_ } = $self->{'color_table'}{ 'dataset' . ( $_ + $n0…
1110 my $self = shift;
1113 if ( $self->true( $self->{'xy_plot'} ) )
1115 $self->_find_x_scale;
1121 $self->{'y_tick_label_length'} = $self->{'y_tick_label_length1'};
1122 $self->_draw_x_number_ticks;
1126 $self->_draw_x_ticks;
1130 $self->_boundary_update( $self, $self->{'sub_0'} );
1131 $self->_boundary_update( $self, $self->{'sub_1'} );
1134 $self->_draw_y_ticks;
1148 my $self = shift;
1149 my $data = $self->{'dataref'};
1150 my $font = $self->{'tick_label_font'};
1151 my $textcolor = $self->_color_role_to_index('text');
1152 my $misccolor = $self->_color_role_to_index('misc');
1158 $self->{'grid_data'}->{'x'} = [];
1179 …$self->{'curr_x_min'} + ( $w * $self->{'y_tick_label_length1'} ) + ( 3 * $self->{'text_space'} ) +…
1181 …$self->{'curr_x_max'} - ( $w * $self->{'y_tick_label_length2'} ) - ( 3 * $self->{'text_space'} ) -…
1182 $y1 = $self->{'curr_y_max'} - $h - $self->{'text_space'};
1186 $delta = $width / ( $self->{'num_datapoints'} > 0 ? $self->{'num_datapoints'} : 1 );
1187 if ( $delta <= ( $self->{'x_tick_label_length'} * $w ) )
1189 unless ( $self->{'x_ticks'} =~ /^vertical$/i )
1191 $self->{'x_ticks'} = 'staggered';
1196 if ( $self->{'x_ticks'} =~ /^normal$/i )
1198 if ( $self->{'skip_x_ticks'} )
1200 for ( 0 .. int( ( $self->{'num_datapoints'} - 1 ) / $self->{'skip_x_ticks'} ) )
1205 ( $delta * ( $_ * $self->{'skip_x_ticks'} ) ) -
1206 … ( $w * length( $self->{'f_x_tick'}->( $data->[0][ $_ * $self->{'skip_x_ticks'} ] ) ) ) / 2;
1207 $self->{'gd_obj'}
1208 …->string( $font, $x2, $y1, $self->{'f_x_tick'}->( $data->[0][ $_ * $self->{'skip_x_ticks'} ] ), $t…
1211 elsif ( $self->{'custom_x_ticks'} )
1213 for ( @{ $self->{'custom_x_ticks'} } )
1215 …$x2 = $x1 + ( $delta / 2 ) + ( $delta * $_ ) - ( $w * length( $self->{'f_x_tick'}->( $data->[0][$_…
1216 … $self->{'gd_obj'}->string( $font, $x2, $y1, $self->{'f_x_tick'}->( $data->[0][$_] ), $textcolor );
1221 for ( 0 .. $self->{'num_datapoints'} - 1 )
1223 …$x2 = $x1 + ( $delta / 2 ) + ( $delta * $_ ) - ( $w * length( $self->{'f_x_tick'}->( $data->[0][$_…
1224 … $self->{'gd_obj'}->string( $font, $x2, $y1, $self->{'f_x_tick'}->( $data->[0][$_] ), $textcolor );
1228 elsif ( $self->{'x_ticks'} =~ /^staggered$/i )
1230 if ( $self->{'skip_x_ticks'} )
1233 for ( 0 .. int( ( $self->{'num_datapoints'} - 1 ) / $self->{'skip_x_ticks'} ) )
1238 ( $delta * ( $_ * $self->{'skip_x_ticks'} ) ) -
1239 … ( $w * length( $self->{'f_x_tick'}->( $data->[0][ $_ * $self->{'skip_x_ticks'} ] ) ) ) / 2;
1242 $y1 -= $self->{'text_space'} + $h;
1244 $self->{'gd_obj'}
1245 …->string( $font, $x2, $y1, $self->{'f_x_tick'}->( $data->[0][ $_ * $self->{'skip_x_ticks'} ] ), $t…
1248 $y1 += $self->{'text_space'} + $h;
1253 elsif ( $self->{'custom_x_ticks'} )
1256 for ( sort ( @{ $self->{'custom_x_ticks'} } ) )
1258 …$x2 = $x1 + ( $delta / 2 ) + ( $delta * $_ ) - ( $w * length( $self->{'f_x_tick'}->( $data->[0][$_…
1261 $y1 -= $self->{'text_space'} + $h;
1263 … $self->{'gd_obj'}->string( $font, $x2, $y1, $self->{'f_x_tick'}->( $data->[0][$_] ), $textcolor );
1266 $y1 += $self->{'text_space'} + $h;
1273 for ( 0 .. $self->{'num_datapoints'} - 1 )
1275 …$x2 = $x1 + ( $delta / 2 ) + ( $delta * $_ ) - ( $w * length( $self->{'f_x_tick'}->( $data->[0][$_…
1278 $y1 -= $self->{'text_space'} + $h;
1280 … $self->{'gd_obj'}->string( $font, $x2, $y1, $self->{'f_x_tick'}->( $data->[0][$_] ), $textcolor );
1283 $y1 += $self->{'text_space'} + $h;
1288 elsif ( $self->{'x_ticks'} =~ /^vertical$/i )
1290 $y1 = $self->{'curr_y_max'} - $self->{'text_space'};
1291 if ( defined( $self->{'skip_x_ticks'} ) && $self->{'skip_x_ticks'} > 1 )
1293 for ( 0 .. int( ( $self->{'num_datapoints'} - 1 ) / $self->{'skip_x_ticks'} ) )
1295 $x2 = $x1 + ( $delta / 2 ) + ( $delta * ( $_ * $self->{'skip_x_ticks'} ) ) - $h / 2;
1298 $self->{'x_tick_label_length'} -
1299 … length( $self->{'f_x_tick'}->( $data->[0][ $_ * $self->{'skip_x_ticks'} ] ) )
1302 $self->{'gd_obj'}
1303 … ->stringUp( $font, $x2, $y2, $self->{'f_x_tick'}->( $data->[0][ $_ * $self->{'skip_x_ticks'} ] ),
1307 elsif ( $self->{'custom_x_ticks'} )
1309 for ( @{ $self->{'custom_x_ticks'} } )
1312 …$y2 = $y1 - ( ( $self->{'x_tick_label_length'} - length( $self->{'f_x_tick'}->( $data->[0][$_] ) )…
1313 …$self->{'gd_obj'}->stringUp( $font, $x2, $y2, $self->{'f_x_tick'}->( $data->[0][$_] ), $textcolor …
1318 for ( 0 .. $self->{'num_datapoints'} - 1 )
1321 …$y2 = $y1 - ( ( $self->{'x_tick_label_length'} - length( $self->{'f_x_tick'}->( $data->[0][$_] ) )…
1322 …$self->{'gd_obj'}->stringUp( $font, $x2, $y2, $self->{'f_x_tick'}->( $data->[0][$_] ), $textcolor …
1332 if ( $self->{'x_ticks'} =~ /^normal$/i )
1334 $self->{'curr_y_max'} -= $h + ( 2 * $self->{'text_space'} );
1336 elsif ( $self->{'x_ticks'} =~ /^staggered$/i )
1338 $self->{'curr_y_max'} -= ( 2 * $h ) + ( 3 * $self->{'text_space'} );
1340 elsif ( $self->{'x_ticks'} =~ /^vertical$/i )
1342 … $self->{'curr_y_max'} -= ( $w * $self->{'x_tick_label_length'} ) + ( 2 * $self->{'text_space'} );
1346 $y1 = $self->{'curr_y_max'};
1347 $y2 = $self->{'curr_y_max'} - $self->{'tick_len'};
1348 if ( $self->{'skip_x_ticks'} )
1350 for ( 0 .. int( ( $self->{'num_datapoints'} - 1 ) / $self->{'skip_x_ticks'} ) )
1352 $x2 = $x1 + ( $delta / 2 ) + ( $delta * ( $_ * $self->{'skip_x_ticks'} ) );
1353 $self->{'gd_obj'}->line( $x2, $y1, $x2, $y2, $misccolor );
1354 if ( $self->true( $self->{'grid_lines'} )
1355 or $self->true( $self->{'x_grid_lines'} ) )
1357 $self->{'grid_data'}->{'x'}->[$_] = $x2;
1361 elsif ( $self->{'custom_x_ticks'} )
1363 for ( @{ $self->{'custom_x_ticks'} } )
1366 $self->{'gd_obj'}->line( $x2, $y1, $x2, $y2, $misccolor );
1367 if ( $self->true( $self->{'grid_lines'} )
1368 or $self->true( $self->{'x_grid_lines'} ) )
1370 $self->{'grid_data'}->{'x'}->[$_] = $x2;
1376 for ( 0 .. $self->{'num_datapoints'} - 1 )
1379 $self->{'gd_obj'}->line( $x2, $y1, $x2, $y2, $misccolor );
1380 if ( $self->true( $self->{'grid_lines'} )
1381 or $self->true( $self->{'x_grid_lines'} ) )
1383 $self->{'grid_data'}->{'x'}->[$_] = $x2;
1389 $self->{'curr_y_max'} -= $self->{'tick_len'};
1403 my $self = shift;
1406 $self->{'sub_0'}->_draw_y_ticks('left');
1409 $self->_boundary_update( $self->{'sub_0'}, $self );
1410 $self->_boundary_update( $self->{'sub_0'}, $self->{'sub_1'} );
1413 $self->{'sub_1'}->_draw_y_ticks('right');
1416 $self->_boundary_update( $self->{'sub_1'}, $self );
1417 $self->_boundary_update( $self->{'sub_1'}, $self->{'sub_0'} );
1427 my $self = shift;
1430 if ( $self->true( $self->{'grey_background'} ) )
1432 $self->_grey_background;
1433 $self->{'sub_0'}->{'grey_background'} = 'false';
1434 $self->{'sub_1'}->{'grey_background'} = 'false';
1438 unless ( !$self->true( $self->{grey_background} ) )
1440 $self->_draw_grid_lines if ( $self->true( $self->{grid_lines} ) );
1441 $self->_draw_x_grid_lines if ( $self->true( $self->{x_grid_lines} ) );
1442 $self->_draw_y_grid_lines if ( $self->true( $self->{y_grid_lines} ) );
1443 $self->_draw_y2_grid_lines if ( $self->true( $self->{y2_grid_lines} ) );
1447 $self->_boundary_update( $self, $self->{'sub_0'} );
1448 $self->_boundary_update( $self, $self->{'sub_1'} );
1451 if ( $self->true( $self->{'imagemap'} ) )
1453 $self->{'imagemap_data'} = [];
1458 $self->{'sub_0'}->_draw_data;
1459 $self->{'sub_1'}->_draw_data;
1470 my $self = shift;
1471 my $sub0 = $self->{'sub_0'};
1472 my $sub1 = $self->{'sub_1'};
1475 $self->_boundary_update( $self, $sub0 );
1476 $self->_boundary_update( $self, $sub1 );
1479 $sub0->{'color_table'} = { %{ $self->{'color_table'} } };
1480 $sub1->{'color_table'} = { %{ $self->{'color_table'} } };
1492 my $self = shift;
1510 my ($self) = shift;
1511 $self->{'sub_0'}->_draw_y_grid_lines();
1521 my ($self) = shift;
1522 $self->{'sub_1'}->_draw_y2_grid_lines();
1531 my $self = shift;
1532 my $a = $self->{'num_datasets'};
1536 if ( $self->false( $self->{'legend_example_height'} ) )
1540 $self->{ 'legend_example_height' . $i } = 1;
1544 if ( $self->true( $self->{'legend_example_height'} ) )
1548 if ( defined( $self->{ 'legend_example_height' . $i } ) ) { }
1551 ( $self->{ 'legend_example_height' . $i } ) = 1;
1560 if ( defined( $self->{ 'legend_example_height' . $anh } ) )
1568 … $self->{ 'legend_example_height' . $n } = $self->{ 'legend_example_height' . $anh };