[guest - Mon Jan 2 06:42:41 2006]:
It's more complicated than that:
- when calculating ticks for y2 one has to be sure min & max comes from
$self->y_min[2] and $self->y_max[2] and *not* go via use_axis!
One solution is to supply negative argument when calculating ticks for y2:
GDGraph-1.4305/Graph/axestype.pm
1056c1056
< my ($x, $y) = $self->val_to_pixel(0, $value, $axis);
---
Show quoted text> my ($x, $y) = $self->val_to_pixel(0, $value, -$axis);
1883c1883,1885
< ? $self->{y_min}[$self->{use_axis}[$i-1]]
---
Show quoted text> ? $i < 0 ?
> $self->{y_min}[-$i]
> : $self->{y_min}[$self->{use_axis}[$i-1]]
1887c1889,1891
< ? $self->{y_max}[$self->{use_axis}[$i-1]]
---
Show quoted text> ? $i < 0
> ? $self->{y_max}[-$i]
> : $self->{y_max}[$self->{use_axis}[$i-1]]
Show quoted text> When drawing y-ticks the axis number is submitted as dataset number.
> This has to be adjusted by adding 1, otherwise the pixels will be
> calculated to way off the canvas.
>
> GDGraph-1.4305/Graph/axestype.pm
> 1056c1056
> < my ($x, $y) = $self->val_to_pixel(0, $value, $axis);
> ---
> > my ($x, $y) = $self->val_to_pixel(0, $value, $axis + 1);
>
> This is perl, v5.8.7 built for i386-linux
>
> Linux pc1183 2.6.12-12mdk #1 Fri Sep 9 18:15:22 CEST 2005 i686
> Intel(R) Pentium(R) 4 CPU 2.66GHz unknown GNU/Linux
>
> / Jan Sundberg