Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

commifying charts generated from GD::Graph::lines?

by Anonymous Monk
on Dec 13, 2008 at 02:33 UTC ( [id://730097]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am graphing some large numbers with GD::Graph::lines which caused GD::Graph to extrapolate y-axis values such as "10000000".

It sure would be swell if I could get these values commified as in "10,000,000". Is there a way to get GD::Graph to commify the values it auto-generates to label the axes?

Thanks for any candor shared.

Replies are listed 'Best First'.
Re: commifying charts generated from GD::Graph::lines?
by roboticus (Chancellor) on Dec 13, 2008 at 12:56 UTC
    Anonymous Monk:

    GD::Graph offers you the x_number_format and y_number_format hooks in which you could plug the commifying code. Read the docs under the 'Options for graphs with axes' section for an example.

    Disclaimer: I have never used GD::Graph, so this is just what I can guess from a quick look at the documentation for the module...

    ...roboticus

      Thanks for your reply!

      y_number_format worked as advertized.

Re: commifying charts generated from GD::Graph::lines?
by n3toy (Hermit) on Dec 13, 2008 at 04:53 UTC
    I came across Tie::Comma the other day just browsing CPAN. Not sure if it will work, but maybe a good place to start.

    Jamie

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://730097]
Approved by almut
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (6)
As of 2024-03-28 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found