LittleB Posted March 4, 2009 Share Posted March 4, 2009 Hello everybody, I am not sure whether I should use php, java or mysql forums to post my question so please forgive me if this is the wrong place for it Is it possible to create graphs using php? I have a database linked to a webpage (html) and php is used to allow data entry. I am familiar with Java, can Java have access to the database via php to draw graphs and charts e.g. pie charts. If not is there anyway graphs can be drawn using php? Any suggestions? Many thanks! Quote Link to comment Share on other sites More sharing options...
RussellReal Posted March 4, 2009 Share Posted March 4, 2009 php gd imagecreate however there is this opensource graphing flash application which I seen my friend's company use which looked really good, but I don't usually use opensource stuff, not even JQuery (But I'm debating whether I should lol) Quote Link to comment Share on other sites More sharing options...
kickstart Posted March 4, 2009 Share Posted March 4, 2009 Hi You can do it manually using imagecreate(), and for a very simple graph this may be easiest. I have done it this way for simple things (eg, a graph of posts by month on a forum I run). Since then I have started to write a php graph class. However this is a lot more difficult than I first thought it would be. Eg, if you have a line graph of values against dates, what do you do when there is no value for that date, either default the value to zero for that date or just draw a line from the value of the previous date to the value of the next date. I can forward you the graph class as it exists so far, but while is is basically all there for what I use it for I would not say it is fully debugged. And I have not done anything on pie charts in it yet. Basically I have used php to generate a page with an image tag on the page, with the source being another php script to generate the required graph. All the best Keith Quote Link to comment Share on other sites More sharing options...
ScotDiddle Posted March 4, 2009 Share Posted March 4, 2009 kickstart, The best there is: http://www.aditus.nu/jpgraph/ Discussion forum found here: http://jpgraph.intellit.nl/index.php Scot L. Diddle, Richmond VA Quote Link to comment Share on other sites More sharing options...
kickstart Posted March 4, 2009 Share Posted March 4, 2009 Hi Thanks, although part of the reason I did it was to try and get into doing some OO php. All the best Keith Quote Link to comment Share on other sites More sharing options...
LittleB Posted March 12, 2009 Author Share Posted March 12, 2009 Hello all and thanks very much for all your replies. I found some php libraries that generate graphs e.g. libChart and jpGraph (as suggested by ScottDiddle). the first line of the php code (for libChart) is include "libchart/libchart.php"; Is there a particular place/folder to store the library in? Any idea where? Many thanks!!!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.