For sure you want to use shape painter for drawing chart
Next thing you want is same as HP calculation formula to get % of your current HP providing your max and current HP value
100 / MaxHealth * CurrentHealth
Where 100 here represents 100%
Now your equation would be 100 / Maximum value * Number from array var
You can now spit results to some other array vars
And now tricky part would be to draw each pie chart with shape painter on top of each other
BUT part i do not know how to do is to how to rotate other shape painter to end of previous shape painter so they line up like actual chart
For that someone else would need to come up with some idea
I would assume it would be something like equation 360 / Max value * Previous array var value
360 instead of 100 cause we want 360° here
And now we get what kind of angle we should rotate next shape painter object based on what was value of previous shape painter
You could use a string array to hold a list of colors and then change the fill color based on the Counter value or a player color.
Shape painter fill color = Colors[Counter]
The first event adds the array values, the for each child creates a total, the repeat draws the shapes. LastAngle is set to 0. So, the chart starts at 0. Be sure to reset the LastAngle each time.