Hi,
I'm using GD::Graph::mixed to create a graph of performance over time.
My time array has data 00:00, 00:30, 01:00, 01:30 etc.
The Summ array has data 0, 0, 0, 10.5, etc.
I am producing an area graph for the Summ array but I am getting a diagonal line for the period 1:00 to 1:30.
| /
| /
| /
|___/_________
1 1:30
I only have data at 1:30 onwards an want to try and get the area part of the graph to start with a vertical line, like below:
| |
| |
| |
|_____|_
1 1:30
Any ideas??
Thanks,
Tom
The code is below:
open (OUTFILE,'>'.$outfile) or die "Could not open file";
@data=(\@Time,\@Summ,\@Good,\@Ldrs);
use GD::Graph::mixed;
$mygraph = GD::Graph::mixed->new(600, 400);
$mygraph->set(
x_label => 'Time',
y_label => 'No. of Lifs',
title => 'Loader Performance',
# Draw datasets in 'solid', 'dashed' and 'dotted-dashed' lines
line_types => [1],
# Set the thickness of line
line_width => 2,
# Set colors for datasets
#long_ticks => 1,
types => ['area', 'lines', 'lines'],
dclrs => ['cyan', 'red', 'green'],
transparent => 0,
x_min_value => 0,
x_tick_length => -4,
) or warn $mygraph->error;
$mygraph->set_x_axis_font(GD::gdMediumBoldFont);
$mygraph->set_y_axis_font(GD::gdMediumBoldFont);
$mygraph->set_x_label_font(GD::gdMediumBoldFont);
$mygraph->set_y_label_font(GD::gdMediumBoldFont);
$mygraph->set_legend_font(GD::gdMediumBoldFont);
$mygraph->set_legend('Summaries Running', 'Good', 'No of Loaders');
$myimage = $mygraph->plot(\@data) or die $mygraph->error;
binmode OUTFILE;
print OUTFILE $myimage->png;
close(OUTFILE);
I'm using GD::Graph::mixed to create a graph of performance over time.
My time array has data 00:00, 00:30, 01:00, 01:30 etc.
The Summ array has data 0, 0, 0, 10.5, etc.
I am producing an area graph for the Summ array but I am getting a diagonal line for the period 1:00 to 1:30.
| /
| /
| /
|___/_________
1 1:30
I only have data at 1:30 onwards an want to try and get the area part of the graph to start with a vertical line, like below:
| |
| |
| |
|_____|_
1 1:30
Any ideas??
Thanks,
Tom
The code is below:
open (OUTFILE,'>'.$outfile) or die "Could not open file";
@data=(\@Time,\@Summ,\@Good,\@Ldrs);
use GD::Graph::mixed;
$mygraph = GD::Graph::mixed->new(600, 400);
$mygraph->set(
x_label => 'Time',
y_label => 'No. of Lifs',
title => 'Loader Performance',
# Draw datasets in 'solid', 'dashed' and 'dotted-dashed' lines
line_types => [1],
# Set the thickness of line
line_width => 2,
# Set colors for datasets
#long_ticks => 1,
types => ['area', 'lines', 'lines'],
dclrs => ['cyan', 'red', 'green'],
transparent => 0,
x_min_value => 0,
x_tick_length => -4,
) or warn $mygraph->error;
$mygraph->set_x_axis_font(GD::gdMediumBoldFont);
$mygraph->set_y_axis_font(GD::gdMediumBoldFont);
$mygraph->set_x_label_font(GD::gdMediumBoldFont);
$mygraph->set_y_label_font(GD::gdMediumBoldFont);
$mygraph->set_legend_font(GD::gdMediumBoldFont);
$mygraph->set_legend('Summaries Running', 'Good', 'No of Loaders');
$myimage = $mygraph->plot(\@data) or die $mygraph->error;
binmode OUTFILE;
print OUTFILE $myimage->png;
close(OUTFILE);