* changed t31tic_color.t to check against different images based on the presence...
[imager-graph.git] / lib / Imager / Graph / Line.pm
CommitLineData
dfd889da 1package Imager::Graph::Line;
2
3=head1 NAME
4
5 Imager::Graph::Line - a tool for drawing line charts on Imager images
6
7=head1 SYNOPSIS
8
267997be 9 use Imager::Graph::Line;
10 use Imager::Font;
11
12 my $font = Imager::Font->new(file => '/path/to/font.ttf') || die "Error: $!";
13
14 my $graph = Imager::Graph::Line->new();
15 $graph->set_image_width(900);
16 $graph->set_image_height(600);
17 $graph->set_font($font);
18 $graph->use_automatic_axis();
19 $graph->show_legend();
20
21 my @data = (1, 2, 3, 5, 7, 11);
22 my @labels = qw(one two three five seven eleven);
23
24 $graph->add_data_series(\@data, 'Primes');
25 $graph->set_labels(\@labels);
26
27 my $img = $graph->draw() || die $graph->error;
28
29 $img->write(file => 'lines.png');
dfd889da 30
31=cut
32
33use strict;
34use vars qw(@ISA);
2eac77fc 35use Imager::Graph::Vertical;
36@ISA = qw(Imager::Graph::Vertical);
dfd889da 37
2eac77fc 38sub _get_default_series_type {
39 return 'line';
dfd889da 40}
41
dfd889da 421;
43