You can do it without necessarily bothering with that module. Abigail-II told me how he does it, so here's a snippet I wrote.

# {{{ ->create graph method # sub create_graph { my $class = shift; open my $plot => "| /usr/local/bin/gnuplot" or die "Failed to open pipe: $!\n"; my $outfile = "/tmp/graph.png"; print $plot <<" --"; set terminal png color set out "$outfile" set format x "/%b%y/" set xdata time set key left top Left reverse samplen 2 title "Legend" box set timefmt "%s:" set grid xtics ytics set xtics nomirror set ytics nomirror set y3tics nomirror set autoscale set ylabel "ResponseTime" plot "$_[0]" using 1:2 smooth unique axis x1y1 title "Time in +ms" -- #set timefmt "%Y-%m-%d:" close $plot or die "Failed to close pipe: $!\n"; chmod 0644 => $outfile or die "Failed to chmod $outfile: $!\n" +; } # }}}
I just pass it a filename (which I had previously created with File::Temp). My::Class->create_graph( $filename );

--
"A long habit of not thinking a thing wrong, gives it a superficial appearance of being right." -- Thomas Paine
naChoZ


In reply to Re: Chart::Graph::Gnuplot Array Issue by naChoZ
in thread Chart::Graph::Gnuplot Array Issue by vbrtrmn

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.