Page 1 of 1
[SOLVED] Creating dynamic graphs
Posted: Mon Apr 18, 2005 10:56 am
by Burrito
I'm certain that php must have some kind of graphing capability but I know nothing about it.
Cold Fusion has a nice little tag called <cfgraph> which can create dynamic graphs (bar, line, pie....mmm pie).
Here's what I need:
I have a table that is tracking information about when a form is being filled out online. My people here want to see a graph that will display the peak hours of when the form is being filled out.
I'm just using a timestamp on my form action page to capture when it was submitted so I'll just need to do a count between certain ranges (hours, minutes..whatever), but how can I put that data into a nice little graph?
please advise...btw, I alraedy have GD enabled on the server so don't let be a stumbling block in your answer (assuming I"m going to need some GD to do this).

Posted: Mon Apr 18, 2005 10:59 am
by JayBird
Posted: Mon Apr 18, 2005 11:44 am
by phpScott
quick google search revealed
http://www.builderau.com.au/webdev/scri ... 455,00.htm
looks like a good start after skimming it.
lots of tut's and docs online on how to use php and the gd2 lib.
Posted: Mon Apr 18, 2005 5:45 pm
by pickle
JPGraph is the best PHP graphing library that I've found. The documentation is a bit tricky, but it's still pretty easy.
Posted: Mon Apr 18, 2005 5:51 pm
by Burrito
yes pickle, I found that earlier today and have been playing with it all day. So far I've created some pretty good stuff. But as you mentioned, the docs are tough to plow through and not super intuitive. Fortunately, there are some good examples (that are decently commented) to assist.
thx everyone for the responses...jpgraph is what I'm going to use.
Burr
Posted: Tue Apr 19, 2005 12:31 pm
by Burrito
ok, just ran into to somethign that I think is kinda weird and not so good with jpgraph.
I set it to generate jpg files (which it seems to be doing), but when I rt click and save image as, it only offers to save it as a bmp file??? when I save the file, it's over 600K. I'm pretty sure it really is a jpg because it looks like a poor quality jpg image, but it saves it as a bmp (a very large one) and when I open it with my image viewer, it opens just fine (as a bitmap).
any ideas here?
I can't be having 600K images...
Posted: Tue Apr 19, 2005 12:34 pm
by vigge89
Burrito wrote:ok, just ran into to somethign that I think is kinda weird and not so good with jpgraph.
I set it to generate jpg files (which it seems to be doing), but when I rt click and save image as, it only offers to save it as a bmp file??? when I save the file, it's over 600K. I'm pretty sure it really is a jpg because it looks like a poor quality jpg image, but it saves it as a bmp (a very large one) and when I open it with my image viewer, it opens just fine (as a bitmap).
any ideas here?
I can't be having 600K images...
Known problem

:
http://support.microsoft.com/default.as ... -us;810978
Posted: Tue Apr 19, 2005 12:40 pm
by Burrito
hmm....thanks for the link, I tried what it suggested and still having the same problem. I don't really care so much if I can't d/l the file what I'm concerned about is the image size. I tried it in FF and low and behold, the images size is really only 30K. I assume that is the same for IE?
thanks again.
Burr
Posted: Tue Apr 19, 2005 12:44 pm
by vigge89
Burrito wrote:hmm....thanks for the link, I tried what it suggested and still having the same problem. I don't really care so much if I can't d/l the file what I'm concerned about is the image size. I tried it in FF and low and behold, the images size is really only 30K. I assume that is the same for IE?
thanks again.
Burr
Yes, that's right

Doesn't matter which browser you're using, the image is still the same image

Posted: Tue Apr 19, 2005 12:53 pm
by pickle
I've had this problem in the past and usually it's because the headers aren't being sent properly. Consequently, IE just defaults to BMP.
If you're having trouble with JPgraph specifically, I'd suggest using their forums. They are extremely helpful and if you're problem is technical enough, there's a good chance you'll get a message from the programmer himself.
Posted: Tue Apr 19, 2005 1:56 pm
by feyd
there's actually a very simple fix for it in IE.. If you send the Content-length header, they work perfectly.. last time I had to deal with it anyways.