Re: create arrays for GD::Graph::lines



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
.



Relevant Pages

  • Re: Matlab Data Analysis
    ... I have been given the program with no documentation and have been ... Matlab, I am not too sure how to extract data from the program and to ... In what format should the data be exported from MATLAB? ... What types of graphs do you want to plot? ...
    (comp.soft-sys.matlab)
  • Re: advanced customization of plots and figures
    ... very important for me is the format of the "Box". ... the second problem is the grid and specially the minor ... I need this to implement the excel layout ... macro that format the plot. ...
    (comp.soft-sys.matlab)
  • Re: Excel 2003- Charts- date and time format on x-axis of XY chart
    ... changing this format so that excel reads it as date and time (ie: ... "David Biddulph" wrote: ... I am trying to plot an XY graph with x-axis data in date and time ... Excel keeps counting the x-axis data as "data labels". ...
    (microsoft.public.excel.charting)
  • Re: Finale (no spoilers)
    ... He was going over the previous material and picking out the plot from it. ... The Daleks were yet again killed off in the overuse of CGI. ... And thankfully the man behind blink is now in charge so hopefully Davis can blow out the Cybermen at Christmas, do his TV movies next year and leave Moffit alone to run the show to the brilliant he runs his episodes! ...
    (rec.arts.drwho)
  • Re: display dates on a plot
    ... To go for equal spacing on the x, ... If, though, your dates are in "serial date format", then ... also how to control the format in the plot since my dates ...
    (comp.soft-sys.matlab)