This works fine (FreeBSD 4.9, perl 5.8.0, gd-2.0.33_4, GD 2.34):
#!/usr/bin/perl use strict; use warnings; use Data::Dumper 'Dumper'; use GD::Graph::linespoints; my @month = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); my $data= [ [ '1155279600', '1156366000', '1157452400', ], [ '88', '93', '23', ] ]; my %arg = ( marker_size => 1, x_label => 'Date', x_min_value => $data->[0]->[0], x_max_value => $data->[0]->[-1], x_tick_number => 7, x_tick_offset => 1, x_number_format => \&convert_date, y_label => 'Inventory Count', y_tick_number => 5, ); # create graph my $graph = GD::Graph::linespoints->new(750,450); $graph->set(%arg) or die $graph->error.Dumper(\%arg); my $gd = $graph->plot($data) or die $graph->error.Dumper($data); # write graph to disk open(my $graphfile, '>', "/home/clive/public_html/tmp2.png") || di +e $!;; binmode $graphfile; print {$graphfile} $gd->png; close($graphfile); sub convert_date { my $epoch_time = shift; my @t = localtime($epoch_time); return sprintf("%02d %s %d", $t[3], $month[ $t[4] ], $t[5]+1900); }

Creating this image. However, if I switch to GD::Graph::area (which is what I need to use), I get this empty one.

If I then change the data to this:

my $data= [ [ '1', '2', '3', ], [ '1', '2', '3', ] ];

I get a real graph.

No error messages appear at all. I've been scratching my head on this one for an hour. Anyone got any idea what's up?


In reply to GD::Graph::area failing with no error... by cLive ;-)

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.