my @fill = $self->_area_data_fill($series_counter, [$left, $bottom, $right, $top]);
$img->polygon(points => [@polygon_points], @fill);
- push @marker_positions, [$x2, $y2];
- foreach my $position (@marker_positions) {
- $self->_draw_line_marker($position->[0], $position->[1], $series_counter);
+ if ($self->_feature_enabled("areamarkers")) {
+ push @marker_positions, [$x2, $y2];
+ foreach my $position (@marker_positions) {
+ $self->_draw_line_marker($position->[0], $position->[1], $series_counter);
+ }
}
$series_counter++;
}
return 1;
}
+=item show_area_markers()
+
+Feature: areamarkers.
+
+Draw line markers along the top of area data series.
+
+=cut
+
+sub show_area_markers {
+ my ($self) = @_;
+
+ $self->{custom_style}{features}{areamarkers} = 1;
+
+ return 1;
+}
+
+
=item use_automatic_axis()
Automatically scale the Y axis, based on L<Chart::Math::Axis>. If
return 1;
}
-
=item set_y_tics($count)
Set the number of Y tics to use. Their value and position will be
);
my @labels = qw(alpha beta gamma delta epsilon phi gi);
-plan tests => 7;
+plan tests => 8;
{
my $area = Imager::Graph::Area->new;
$area->use_automatic_axis();
my $img2 = $area->draw
(
- features => [ "horizontal_gridlines" ],
+ features => [ "horizontal_gridlines", "areamarkers" ],
labels => \@labels,
font => $font,
hgrid => { style => "dashed", color => "#888" },
ok($img2, "made second area chart image");
ok($img2->write(file => "testout/t40area2.ppm"),
"save to file");
+
+ cmpimg($img2, "testimg/t40area2.png");
}
END {