hmadhi has asked for the wisdom of the Perl Monks concerning the following question:

I have the following defined, however the resulted plot shows date (01/01) on x axis (time axis). I want the time axis to only show time eg 14:00
my $chart = Chart::Gnuplot->new( output => "/home/hmadhi/workspace/CommsNet/www/Plots/$kpi.png" +, title => {text=>"$kpi Success Rate on $node/$ran ($interface) + $date", }, xlabel => {text=>"Time",}, ylabel => "$kpi Succ_Rate", timeaxis => "x", ); # Create dataset object and specify the properties of the dataset my $dataSet1 = Chart::Gnuplot::DataSet->new( xdata => \@time, ydata => \@succ_rate, timefmt => '%H:%M', );

Replies are listed 'Best First'.
Re: Chart::Gnuplot Time Axis output
by broomduster (Priest) on Mar 10, 2011 at 22:23 UTC
    See Example 7 in the docs. All you need to do is define xtics with the labelfmt of your choice. Something like the following (untetsted, I don't have Chart::Gnuplot on this machine):
    my $chart = Chart::Gnuplot->new( output => "/home/hmadhi/workspace/CommsNet/www/Plots/$kpi.png" +, title => {text=>"$kpi Success Rate on $node/$ran ($interface) + $date", }, xlabel => {text=>"Time",}, ylabel => "$kpi Succ_Rate", timeaxis => "x", xtics => { labelfmt => '%H:%M', }, );
      Thanks, it is working as expected.