matthewhaworth Posted August 25, 2007 Share Posted August 25, 2007 Has it been done before and is it possible? Quote Link to comment https://forums.phpfreaks.com/topic/66591-creating-graphs-in-php/ Share on other sites More sharing options...
trq Posted August 25, 2007 Share Posted August 25, 2007 Yes, and yes. Quote Link to comment https://forums.phpfreaks.com/topic/66591-creating-graphs-in-php/#findComment-333623 Share on other sites More sharing options...
matthewhaworth Posted August 25, 2007 Author Share Posted August 25, 2007 Graphs are maths! I do not see why my thread was moved. Quote Link to comment https://forums.phpfreaks.com/topic/66591-creating-graphs-in-php/#findComment-333624 Share on other sites More sharing options...
AndyB Posted August 25, 2007 Share Posted August 25, 2007 Graphs are maths! I do not see why my thread was moved. because you're going to need more help with GD commands than math (or so whoever moved it thought - I tend to agree) Quote Link to comment https://forums.phpfreaks.com/topic/66591-creating-graphs-in-php/#findComment-333627 Share on other sites More sharing options...
cooldude832 Posted August 25, 2007 Share Posted August 25, 2007 There are a lot of tutorials out there, but basically there are abotu 5-6 steps to making line graphs step 1 Draw a shape (define the area with a box/gridlines) step 2 Generate an array of values i.e ($nodes = array(1,4,6,2,3,5,7,65,2,34,1,23,) this array is going to be graphed with respect to their array index. This is like saying each point was say a server load in mb at a given time taken at uniform intervals step 3 a step distance ( i.e nodes/width of graph-20 pixel (padding)); step 4 now this is the tricky part the way you do this is with a dual counter function so basically you are drawing a point from $nodes[$i] to $nodes[$j] where $j = $i +1; The second trick to this is you need to know your spacing based on step 3 for you x distance and your Y distance is the 2 nodes step 5 add on extras/tweak it to your needs. Quote Link to comment https://forums.phpfreaks.com/topic/66591-creating-graphs-in-php/#findComment-333633 Share on other sites More sharing options...
dbo Posted August 25, 2007 Share Posted August 25, 2007 Look at some of the tutorials on this website. I've not personally tested them but they seem to look pretty good. Specifically the one about jpgraph. Quote Link to comment https://forums.phpfreaks.com/topic/66591-creating-graphs-in-php/#findComment-333635 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.