* changed t31tic_color.t to check against different images based on the presence...
[imager-graph.git] / lib / Imager / Graph / Column.pm
index 5aa9e31b5205155b3cfdcf225496245f94fc28bb..69b2a6f81166a57fc015e2358f5f3360b8712165 100644 (file)
@@ -6,7 +6,28 @@ package Imager::Graph::Column;
 
 =head1 SYNOPSIS
 
-  This subclass is still in green development.
+  use Imager::Graph::Column;
+  use Imager::Font;
+
+  my $font = Imager::Font->new(file => '/path/to/font.ttf') || die "Error: $!";
+
+  my $graph = Imager::Graph::Column->new();
+  $graph->set_image_width(900);
+  $graph->set_image_height(600);
+  $graph->set_font($font);
+  $graph->use_automatic_axis();
+  $graph->show_legend();
+
+  my @data = (1, 2, 3, 5, 7, 11);
+  my @labels = qw(one two three five seven eleven);
+
+  $graph->add_data_series(\@data, 'Primes');
+  $graph->set_labels(\@labels);
+
+  my $img = $graph->draw() || die $graph->error;
+
+  $img->write(file => 'columns.png');
+
 
 =cut