tags:

views:

118

answers:

6
+4  A: 

I don't know what you're trying to display in that image but it looks like some kind of graph, so I'd look for a chart-library, e.g. JpGraph, before coding it all again:

http://jpgraph.net/

Select0r
+6  A: 

Do not handcode it yourself as that would be very painful. I once had to code a pie-chart generator.

There are plenty of graph engines out there:

  1. JpGraph
  2. GraPHPite
  3. Google Chart Tools

Have a look at what they offer you. Might not be the exact same but something very close.

Kau-Boy
+1  A: 

your probably looking for an SVG library.

raphael is also a good choice

ebt
Although raphael is pretty nice, it needs JavaScript and a SVG capable browser (as with IE it is extremly laggy).
Kau-Boy
+2  A: 

This looks like a bar chart converted to polar coordinates.

Here's an easy way to generate such a picture:

  • Draw your bars (either using a chart library or on your own) without any gaps between the bars. Make sure there is no whitespace to the left and right of your bars.

  • Transform the image to polar coordinates using GD's gdImageSquareToCircle() function

You probably might have to rotate your bars by 180° (i.e. the bars should grow from top to bottom) before transforming the image.

gclj5
+1  A: 

imagefilledarc is your friend!

Mark
+1  A: 

This:

$im = imagecreatetruecolor(500, 500);
imagefill($im, 0, 0, imagecolorallocate($im, 255, 255, 255));


imagefilledarc($im, 250, 250, 500, 500, -90, -80, 0xFF0000, IMG_ARC_PIE);
imagefilledarc($im, 250, 250, 400, 400, -80, -40, 0xFFFF00, IMG_ARC_PIE);
imagefilledarc($im, 250, 250, 150, 150, -40,  0,  0xFF00FF, IMG_ARC_PIE);
imagefilledarc($im, 250, 250, 450, 450,   0,  20, 0x00FFFF, IMG_ARC_PIE);
imagefilledarc($im, 250, 250, 350, 350,  20, 50,  0x1276A9, IMG_ARC_PIE);
imagefilledarc($im, 250, 250, 100, 100,  50, 95,  0x000000, IMG_ARC_PIE);
imagefilledarc($im, 250, 250, 400, 400,  95, 125, 0x1E1FFF, IMG_ARC_PIE);
imagefilledarc($im, 250, 250, 150, 150, 125, 160, 0x45ABAB, IMG_ARC_PIE);
imagefilledarc($im, 250, 250, 500, 500, 160, 180, 0xFFA7F1, IMG_ARC_PIE);
imagefilledarc($im, 250, 250, 300, 300, 180, 235, 0xA91234, IMG_ARC_PIE);
imagefilledarc($im, 250, 250, 240, 240, 235, 255, 0xA13ACE, IMG_ARC_PIE);
imagefilledarc($im, 250, 250, 300, 300, 255, 270, 0x00FF00, IMG_ARC_PIE);

header("Content-type: image/png");
imagepng($im);

Makes this:

alt text

Mark