//Pie chart //Data Variables: sun, mon, tue, wed, thu, fri, sat int[] data = {3,1,4,3,3,4,5}; String[] labels = { "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" }; int total; float[] perc = new float[7]; //The sketch variables float cx, cy, diameter; float startAngle, stopAngle; color [] colors = { color(238, 118, 0), // sunday color(123, 165, 248), color(7, 57, 1), color(255, 246, 63), color(255, 0, 0), color(0, 255, 0), color(0, 0, 255) // saturday }; 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; } // pie variables cx = width/2; cy = height/2; diameter = 250; }//setup void draw(){ startAngle = 0; stopAngle = 0; for(int i=0; i