Assuming your data files hold the values in the more natural 'lines of pairs' arrangement, something like this might work for you:

#!/usr/bin/perl use strict; use GD::Graph::bars3d; use Date::Calc qw(:all); use GD::Graph::Data; my ($d,$m,$y) = (localtime)[3,4,5]; my $mdy = sprintf '%02d-%02d-%02d', $d, $m+1, $y+1900; my $title="IPTV - Video Server Bandwidth Report del "."$mdy"; my @data; while( <DATA> ) { my @pair = split; push @{ $data[0] }, $pair[0]; push @{ $data[1] }, $pair[1]; } my $graph = new GD::Graph::bars3d( 1000, 500 ); $graph->set( x_label => 'Intervallo Orario', y_label => 'Traffico in Mbit/s', title => $title, x_labels_vertical => 1, x_label_position => 1/2, y_tick_number => 10, y_label_skip => 1, x_label_skip => 1, x_all_ticks => 1, x_labels_vertical => 1, box_axis => 0, y_long_ticks => 1, dclrs => [ qw(green) ], borderclrs => [ qw(black) ], #white,lgray,gray,dgray,black,lblue,blue,dblue,gold,lyellow,yellow,dye +llow,lgreen,green,dgreen,lred,red,dred,lpurple,purple,dpurple,lorange +,orange,pink,dpink,marine,cyan,lbrown,dbrown show_values => 1, values_vertical => 1, values_space => 15, bar_spacing => 10, ); my $gd = $graph->set_values_font(GD::gdGiantFont); my $gd = $graph->set_title_font(GD::gdGiantFont); my $gd = $graph->set_x_label_font(GD::gdGiantFont); my $gd = $graph->set_y_label_font(GD::gdGiantFont); my $gd = $graph->set_x_axis_font(GD::gdGiantFont); my $gd = $graph->set_y_axis_font(GD::gdGiantFont); my $gd = $graph->plot( \@data ); open(IMG, '>file.jpeg') or die $!; binmode IMG; print IMG $gd->jpeg; close IMG; __DATA__ 00:00 2585.54 01:00 Z095.44 02:00 1748.02 03:00 1454.55 04:00 1290.86 05:00 1235.33 06:00 1151.04 07:00 1160.86 08:00 1191.82 09:00 1343 10:00 1514.33 11:00 1693.67 12:00 1773.7 13:00 1897.82 14:00 2733.04 15:00 3257.12 16:00 3375.69 17:00 2949.53 18:00 2573.52 19:00 2139.65 20:00 1697.83 21:00 1989.94 22:00 2746.92 23:00 2998.7

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re: GD::Graph input file by BrowserUk
in thread GD::Graph input file by lorenzob

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.