Let me explain how this works. the $image is of course the first thing we created the actual image object itself. Next is the X cord from the top left hand corner. This means the center of the chart.
Next is the Y cords for the center point of the chart. We have used the variable $i which starts at 160 and goes down till 150 so the Y value is moving up by 1 pixel every time. This gives us the layers to make the 3D pie chart.
Next the 200 & 100 values are the width and height. Of course we dont want the height to be the same as the width as we want it to look 3D and will make a oval shape instead of a perfect circle.
The next to values are the actual cords for plotting the pie chart. The first one is the start point. The second is the end point for the arc.
And then of course its the colour that will be used to fill in the arc.
Now we want to create the actual top layer with the normal colour.