int[] data = {6, 14, 6, 14}; String[] labels = {"Spring", "Summer", "Fall", "Winter"}; int total; float[] perc = new float[data.length]; color[] colors = {color(255,165,0), color(255,255,0), color(20,220,50), color(135,165,235)}; // The sketch variables float maxW, maxArea, cx, cy, lastX, w; void setup(){ size(500,500); background(255); smooth(); noLoop(); // process // compute the total population total = 0; for (int i=0; i < data.length; i++) { total += data[i]; } // compute percentages for (int i=0; i < data.length; i++) { perc[i] = float(data[i])/total; } // sketch variables maxW = width/(1+data.length); maxArea = PI*maxW/2*maxW/2; // max area of bubble cy = height/2; lastX = 0; }//setup void draw(){ for(int i=0; i