Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
A Good practice I have found while working with GD Graphs is that when setting a max value for the y-axis, do it with a little more intuitiveness. Useually when building you @yAxis structures, you do it in a loop, like you are. Try adding a little flare. Also While looking at this I am seeing a discrepency in your logic, if I see this correctly you will not be getting the output I suspect you want. With this you will get a graph with just one point. I would expect you when a linespoints graph with all of the data from the flat file plotted. maybe something like this.
my $largestValue = 0; my (@xAxisOfDates,@yAxisOfPartners,@yAxisOfArfi, @data) = (); open(HANDLE,"integrate.dat"); while (<HANDLE>) { chomp; @temp1 = split(/\|/, $_); $domain = unpack ("A5", $temp1[17]); push(@xAxisOfDates, $temp1[1]); push(@yAxisOfPartners, $temp1[4]); push(@yAxisOfArf, $temp1[5]); if ($temp1[4] > $largestValue){ $largetValue = $temp1[4]; } if ($temp1[5] > $largestValue){ $largestValue = $temp1[5]; } } close(HANDLE); @data = (\@xAxisOfDates, \@yAxisOfPartners, \@yAxisOfArf);
and then this in your setup of graph parameters set your y_max_value => $largestValue
Hopefully this helps and I was able to see why you were not getting what you expected with output, if I was offtarget, /tell me in the talk window and I will help, I am pretty knowledgable when it comes to GD applications.

Tradez
"Never underestimate the predicability of stupidity"
- Bullet Tooth Tony, Snatch (2001)

In reply to Re: Flat File Database & GD::Graph (REVISITED) by tradez
in thread Flat File Database & GD::Graph (REVISITED) by suggus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-23 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found