For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > October 2006 > GD::Graph and integer on the Y-axis









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author GD::Graph and integer on the Y-axis
John

2006-10-02, 6:59 pm

Do you know how to define that all the numbers on the Y axis should be
integers?


Greg Sabino Mullane

2006-10-02, 6:59 pm

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> Do you know how to define that all the numbers on the Y
> axis should be integers?


You have to set the format of the y-axis like so:

$graph->set(y_number_format => '%d');

Where '$graph' is the GD::Graph object you previously
created via the new method.

- --
Greg Sabino Mullane greg@turnstep.com
End Point Corporation
PGP Key: 0x14964AC8 200610021303
http://biglumber.com/x/web? pk=2529...14964
AC8

-----BEGIN PGP SIGNATURE-----

iD8DBQFFIUdevJuQZxSWSsgRAjL0AKCnIBO/bdFgeOnDv2kBnYmv7/6eAwCeJm01
Hcr25pjfGQM6M9yQMgWRPpE=
=0Ixs
-----END PGP SIGNATURE-----
John

2006-10-03, 4:00 am

Hi I used the formula

$Y_max=(int($Y_max/8)+2)/8;


And it worked, so the Y_max is higher than the actual Y_max of the dataset



-----Original Message-----
From: Greg Sabino Mullane [mailto:greg@endpoint.com]
Sent: Monday, October 02, 2006 8:08 PM
To: john
Cc: beginners@perl.org
Subject: Re: GD::Graph and integer on the Y-axis

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> Do you know how to define that all the numbers on the Y
> axis should be integers?


You have to set the format of the y-axis like so:

$graph->set(y_number_format => '%d');

Where '$graph' is the GD::Graph object you previously
created via the new method.

- --
Greg Sabino Mullane greg@turnstep.com
End Point Corporation
PGP Key: 0x14964AC8 200610021303
http://biglumber.com/x/web? pk=2529...14964
AC8

-----BEGIN PGP SIGNATURE-----

iD8DBQFFIUdevJuQZxSWSsgRAjL0AKCnIBO/bdFgeOnDv2kBnYmv7/6eAwCeJm01
Hcr25pjfGQM6M9yQMgWRPpE=
=0Ixs
-----END PGP SIGNATURE-----

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com