For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > April 2005 > Help with displaying graph









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help with displaying graph
Dale

2005-04-25, 3:55 am

Hi,

I've written a script to read in a csv file, sort the data and then
display a chosen set of data in a table. This works (though I could
probably have cleaner code - it's my first real script) so I wanted to
add a graph using GD::Graph::Lines.

The problems I have are :

1) How do I add my own data into the graph? The test data is set up
with :

my @data = (['Fall 01', 'Spr 01', 'Fall 02', 'Spr 02' ],
[80, 90, 85, 75],
[76, 55, 75, 95]);

However, I tried to add my own using :

my @data = (@agentdate,
@agentincoming,
@teamincoming);

When I do this I start to get a 500 error saying "Premature end of
script headers"

2) How do I draw the graph and the table?

The graph uses :

print "Content-type: image/png\n\n";
print $myimage->png;

but I also want to print a table - how would I print both?

My script is at http://www.webeye.myby.co.uk/data.txt - it's quite long.

If anyone can make sense of my script, I'd really appreciate the help as
I've just spent 3 hours searching for an answer and I've not got much
hair left to pull out! :)

Thanks in advance to anyone who has an idea what I'm talking about! ;)
--
Dale - Liverpool, England

A menace to society - apparently!

Spam block: Please don't mail me with "abuse" - use my name instead!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com