Subject: | x_tick_number ignored |
Date: | Sun, 3 Dec 2006 10:03:21 -0800 |
To: | <bug-GDGraph [...] rt.cpan.org> |
From: | "Jeff Janes" <jjanes [...] gnf.org> |
In GD::Graph::axestype, in the sub set_max_min, the x axes _best_ends
are set using the values of y_tick_number and y_min_range, rather than
the values for x_tick_number and x_min_range.
if (defined($self->{x_tick_number}))
{
if (defined($self->{x_min_value}) &&
defined($self->{x_max_value}))
{
$self->{true_x_min} = $self->{x_min_value};
$self->{true_x_max} = $self->{x_max_value};
}
else
{
($self->{true_x_min}, $self->{true_x_max}) =
$self->{_data}->get_min_max_x;
($self->{x_min}, $self->{x_max}, $self->{x_tick_number}) =
_best_ends($self->{true_x_min}, $self->{true_x_max},
@$self{'y_tick_number','y_min_range'});
}
}
I think the last line there should instead be:
@$self{'x_tick_number','x_min_range'});
This change makes some of my graphs look better (without the change,
often all of the data points are crowded into the left half of the
charting area, because it always uses 5 ticks even when that is a bad
choice.) Of course I can't be sure that this change doesn't break other
things in other types of graphs.
Thanks,
Jeff Janes