to draw a pie chart you should use fillArc (x, y, width, height, start angle, arc angle)
draw different arcs connected to each other (the 1st left arc should be the same as the right side of the previous arc)
you need to make your own logic to set the starting angle ...
like
suppose u has only 12 products and you want to draw a pie chart for them (sale)
total 12 product sales = 1200
sale of individual products a = 120, b = 0, c = 500, .....
angle for an individual product a = (120 * 360) / 1200 b = 0 c = (500 * 360) /
and then set the relative angle of the arc
I think this will give you a pie chart
source share