Jump to content

php , Java and graphs


LittleB

Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!!!!!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.