Re: create arrays for GD::Graph::lines
- From: boyd <tbmoore9@xxxxxxxxxxx>
- Date: Wed, 22 Nov 2006 16:20:57 GMT
In article <4564694F.17549.26A21FD9@xxxxxxxxxxxxxxxxxxxxxxx>,
dermot@xxxxxxxxxxxxxxxx (Beginner) wrote:
Hi,
I am trying to create a line graph with GD::Graph::Lines.
I have data being passed by CGI in the format:
"ancode_1" = "ADV "
"ADV_2006" = "117216 "
"ADV_2005" = "104776 "
"ancode_2" = "BAP "
"BAP_2006" = "0 "
"BAP_2005" = "270 "
"ancode_3" = "BOO "
"BOO_2006" = "746854 "
"BOO_2005" = "673151 "
"ancode_4" = "BUS "
"BUS_2006" = "0 "
"BUS_2005" = "2476 "
"ancode_5" = "COM "
"COM_2006" = "87787 "
"COM_2005" = "97009 "
The number of years can vary so you might get data from 2006->1990.
Simplifying the problem, it seems to me you want a plot that will use
the years as the x values, and for each year you would have several y
values. Is that correct? If that is true, then I would think a
"manual" way of getting the plot would be:
@data = (
[ 2006, 2005 ],
[ 117216, 104776 ],
[ 0, 270 ],
[ 746854, 673151 ],
....
);
So this should be the output from your array-producing code.
Maybe you can give more details of your data structure. I'm not
following the presentation.
Boyd
.
- References:
- create arrays for GD::Graph::lines
- From: Beginner
- create arrays for GD::Graph::lines
- Prev by Date: Re: Killing a process that takes too long
- Next by Date: Re: create arrays for GD::Graph::lines
- Previous by thread: create arrays for GD::Graph::lines
- Next by thread: Re: create arrays for GD::Graph::lines
- Index(es):
Relevant Pages
|