Hi !
I didn't clearly understand what you need :
do you need an algorithm to create the proper chart ?
do you need an algorithm to allocate a color to the different parts ?
For the colors :
--
String[] colors = {"FF0000","FFFF00","00FF00", ... };
// ...
To create the chart :
--
// Start point (in degrees)
int start = 0;
// For every element of your chart (in % , I guess)
for(int i=0; i <= numberOfElements ; i++){
int end = 0 + percentageOfElement /100*360;
/*Draw an arc from "start" to "end" with the color colors, and, for instance, add the value inside (I would insert it at ((end-start)/2) so that it is in the middle)
check how to do that with 2DGraphics, or with what you're building your applet with
...
*/
start = end;
}
It's somewhat theorical, but I hope it helps
stephmor