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, maxH, barW, barH, lastX; float x, y; 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); maxH = height; lastX = 0; barW = maxW*0.5; }//setup void draw(){ for(int i=0; i