Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Table table;
- PFont f;
- PShape leaf;
- color [] c = {color(225, 50, 50), color(225, 100, 0), color(225, 225, 0), color(0, 150, 0), color(0), color(125)};
- int i=0;
- void setup() {
- size(1100, 500);
- background(255);
- table=loadTable("P3_data.csv", "header");
- leaf= loadShape("leaf.svg");
- leaf.disableStyle();
- }
- void draw() {
- stroke(255);
- strokeWeight(0.1);
- for (TableRow row : table.rows()) {
- int friend= (row.getInt("Friend"));
- int travel= (row.getInt("Travel"));
- int selfimprovement= (row.getInt("Self-improvement"));
- int club= (row.getInt("Club"));
- int schoolwork= (row.getInt("Schoolwork"));
- int money= (row.getInt("Money"));
- int total= 0;
- int [] Daily= {friend, travel, selfimprovement, club, schoolwork, money};
- for (int k=0; k<6; k++) {
- total +=Daily[k];
- }
- println (total);
- for (int j=0; j<6; j++) {
- for (int m=0; m< Daily[j]; m++) {
- fill(c[j]);
- ellipse((i%120)*10+10, (i/120)*40+10, 3*total, 4*total);
- //shape(leaf, (i%120)*10+10, (i/120)*40+10, 3*total, 3*total);
- total --;
- }
- }
- if (i>1095) {
- break;
- }
- i++;
- }
- save("sketch.png");
- }
Add Comment
Please, Sign In to add comment