Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: GD Graph

by bar10der (Beadle)
on Sep 28, 2005 at 12:58 UTC ( #495718=note: print w/ replies, xml ) Need Help??


in reply to Re: GD Graph
in thread GD Graph

I did run the data extraction code and it returns the expected values from the database. No problem there.

When I print value of $projectname variable I get following (as expected)-

'RMG Escalation Management Tool','Dynamic Reconfiguration FY06 Initiative'

If I put this line -

$mygraph->set_legend('Dynamic reconfiguration FY06 Initiative','Rmg Escalation Management Tool');

The graph is generated.

However if I put this-

$mygraph->set_legend($projectname);

I get following err in server log

Wed Sep 28 13:49:24 2005 error client x.x.x Wed Sep 28 13:49:24 2005 barchart.pl: Illegal division by zero at ....GD/Graph/axestype.pm line 1962., referer: http://index1.html


Comment on Re^2: GD Graph
Re^3: GD Graph
by ghenry (Vicar) on Sep 28, 2005 at 13:25 UTC

    $projectname needs to be an ARRAY:

    Methods $graph->set_legend(@legend_keys); Sets the keys for the legend. The elements of @legend_keys corresp +ond to the data sets as provided to plot(). If a key is undef or an empty string, the legend entry will be ski +pped.

    So
    my @projectname = ('Dynamic reconfiguration FY06 Initiative','Rmg Escalation Management Tool');

    and

    $mygraph->set_legend(@projectname);

    HTH.

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!
      Hi,

      Thanks for your help. It worked!!

        Lesson learned, "Always Read The Docs" or RTFM and then when all else fails, read them again.

        After all, the author took the time to write them for you ;-)

        Walking the road to enlightenment... I found a penguin and a camel on the way.....
        Fancy a yourname@perl.me.uk? Just ask!!!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://495718]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2014-12-26 12:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (171 votes), past polls