Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changeing Y-axis in GD Graph

Status
Not open for further replies.

frasernm

Programmer
Aug 7, 2001
25
GB
Hi,

I've changed the y-axis minimum to be 95% instead of 0%, but while the bottom of the graph is 95%, the bars are still drawing from zero (ie disappearing off down the bottom of the canvas, covering the labels).

Does anyone know how to only draw the bars from y = 95?

Thanks in advance,

Fraser

excerpt from code:

while (my @row = $sth->fetchrow_array)
{
$data->add_point(@row);
}

$chart->set_legend_font(GD::gdSmallFont);
$chart->set_x_label_font(GD::gdMediumBoldFont);
$chart->set_y_label_font(GD::gdMediumBoldFont);
$chart->set_legend(@labels);

$chart->set(
fgclr => 'lgray',
'dclrs' => @colors,
borderclrs => @colors,
textclr => 'red',
x_label => 'Month',
x_label_position => 0.5,
x_labels_vertical => 1,
y_label => $y_label,
show_values => 1,
y_max_value => $max,
y_min_value => 95,
y_long_ticks => 1,
y_tick_number => $y_tick_number,
y_label_skip => 1,
cumulate => 0,
bar_spacing => 4,
transparent => 0,
legend_placement => 'CC',
legend_marker_width => 20,
legend_marker_height => 15,
legend_spacing => 8,
t_margin => 40,
b_margin => 15,
l_margin => 15,
r_margin => 15,
y_number_format => "%d%",
values_format => "%.1f%%"
);

print "Content-type: image/png\n\n";
binmode STDOUT;
print $chart->plot($data)->png();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top