Need Help with grids

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Joez
Forum Newbie
Posts: 4
Joined: Wed Jun 18, 2008 10:29 am

Need Help with grids

Post by Joez »

How do I display a curve in a grid and extract data from it for a PHP based web application?
I need to extract data such as the number of boxes in the grid that contains part of the curve.
Is JPGraph appropriate? If not, what should i use??
Please help!!
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Need Help with grids!! URGENT!!

Post by onion2k »

JPGraph would help you display a graph if that's what your curve is, but it won't help you analyse anything about the graph such as the number of grid squares the curve goes through. For that you'd need to write some custom GD code that analysed the output from JPGraph.

Best of luck if this really is urgent because that'd going to be very time consuming...
Joez
Forum Newbie
Posts: 4
Joined: Wed Jun 18, 2008 10:29 am

Re: Need Help with grids!! URGENT!!

Post by Joez »

Other than JPGraph, is there any thing else that can be of help?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Need Help with grids!! URGENT!!

Post by onion2k »

Any graphing class would help draw the graph (assuming it is a graph you want..). Besides that, there's not really anything that would apply by the sounds of it. You'll need to code it yourself.
Joez
Forum Newbie
Posts: 4
Joined: Wed Jun 18, 2008 10:29 am

Re: Need Help with grids!! URGENT!!

Post by Joez »

It is a grid that I need where i have to plot the curve or line. Then i have to extract the data such as the number of boxes in the grid that contains part of the curve or line.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Need Help with grids

Post by onion2k »

So it's not a graph then. In that case JPGraph won't help, not will any other graphing application. You're going to have to write a lot of code yourself.

If you need to draw a curve I wrote some bezier curve code once that might help... It's part of this script: http://www.phpgd.com/scripts.php?script=37 .. shouldn't be too hard to rip out the curve stuff.

As for calculating which grid elements have a bit of the curve in them, I think you might actually be better off going that mathematically rather than visually with GD. Depends hpw good your maths is really.
Post Reply