Try this. I will say, that you are going to run into a problem of having too many x values for the width of the graph, then you need to adjust this x_label_skip value to condense it. A Tk canvas would be a nice way to do this. You could plot every value on a scrolled canvas, and scroll to the current time(or time of interest). Of course if it's for the web, Tk won't help.
#!/usr/bin/perl use warnings; use GD::Graph::lines; use strict; my @time; my @temp; my @rad; while(my $line = <DATA>){ chomp $line; my ($celcius, $radiation, $time) = split(/ /, $line); push @temp, $celcius; push @rad, $radiation; push @time, $time; } my $graph_data = [ [@time], # X-values [@rad], # Y-value 1 [@temp], #Y-value 2 reference line ]; my $mygraph = GD::Graph::lines->new(600, 300); $mygraph->set( transparent => '0', bgclr => 'white', boxclr => 'lgray', fgclr => 'white', x_label => 'Time', y_label => 'Value', title => 'Temperature and Radiation', x_labels_vertical => 1, # x_label_skip => 1, # line_types => [1, 1], line_width => 2, dclrs => ['blue', 'green'], ) or warn $mygraph->error; $mygraph->set_legend_font(GD::gdLargeFont); $mygraph->set_legend('Radiation','Temperature'); my $myimage = $mygraph->plot($graph_data) or die $mygraph->error; open(GRAPH, ">$0.png"); print GRAPH $myimage->png; close(GRAPH); __END__ 36 85 13:37 36 86 13:38 37 85 13:39 37 86 13:40 38 85 13:41 38 86 13:42 38 85 13:43 39 86 13:44 39 85 13:45 39 88 13:46 39 88 13:47 39 88 13:48 39 88 13:49 39 88 13:50 39 88 13:51 38 87 13:52 38 85 13:53 38 86 13:54 38 85 13:55 38 86 13:56 38 85 13:57 38 86 13:58 37 85 13:59 37 86 14:00 37 85 14:01 37 86 14:02 37 85 14:03 37 86 14:04 37 85 14:05 36 86 14:06 36 85 14:07 36 86 14:08

I'm not really a human, but I play one on earth. flash japh

In reply to Re^3: Help with GD::Graph by zentara
in thread Help with GD::Graph by jeiku

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.