Plotting a graph with GD

Posted by Nayena on Stack Overflow See other posts from Stack Overflow or by Nayena
Published on 2011-02-13T14:43:46Z Indexed on 2011/02/13 15:25 UTC
Read the original article Hit count: 222

Filed under:
|
|
|

Here it goes.

I have been thinking about this for a long time, and havent really been able to put up a proper way to do it yet. I havent implemented anything yet, as im still designing the thing.

The idea is that i crawl a website for internal links, i got this settled, its easy, but after the crawling, i end up with an array with lots of links, and how many times those particular link appears on the site that i crawled (and how they're connected).

With this huge array, i want to draw a graph somehow. Assuming i can handle the data correctly, the real question here is how i can draw this in a image by the use of the GD library.

I figured if theres less than 12 elements, i can align them up on a unit circle spacing them up as a circle and then connecting them accordingly, so anything up to 12 elements shouldn't be a problem, but if theres more than 12, it could be awesome getting them lined up like this Or well, thats just a rough drawing, but i guess its just to prove a point.

So i'm here looking for guidance or tips towards getting the math down to getting the stuff lined up in a good way.

I have previously made bar-graphs, so i have little experience doing math with GD. If possible, id prefer not using some plotter-library - in the end, it gives me a better understanding on how things are supposed to be.

© Stack Overflow or respective owner

Related posts about php

Related posts about math