var table; var gdp; var networth; var the_name; function preload(){ table = loadTable('billionaires.csv', 'csv','header'); } function setup() { createCanvas(800, 600); the_name = []; networth =[]; gdp=[]; for(var r=0; r<500;r++){ if(!(table.getString(r,"gdp")==0)){ networth.push(table.getString(r, "worth in billions")); print(table.getString(r, "worth in billions")); the_name.push(table.getString(r,"name")); gdp.push(table.getString(r, "age")); } } textSize(10); textAlign(CENTER); fill(0); } function draw() { // var year = [1996, 2001, 2014]; // var networth = [18.5, 58.7, 76]; var count=gdp.length; background(204); stroke(153); //11 line(60,60,60,260); line(60,260,340,260); //21 line(60,360,60,540); line(60,540,340,540); //12 line(460,60,460,260); line(460,260,740,260); //22 line(460,360,460,540); line(460,540,740,540); //11 fill(0,0,0); strokeWeight(1); text("Net Worth/B", 50, 60); fill(0,0,0); strokeWeight(1); text("Age", 350, 270); fill(0,0,0); strokeWeight(1); fill(0,0,0); strokeWeight(1); text("Networth vs Age", 200, 80); //21 fill(0,0,0); strokeWeight(1); text("Age", 50, 360); fill(0,0,0); strokeWeight(1); text("Age", 350, 550); fill(0,0,0); strokeWeight(1); text("Age vs Age", 200, 380); //12 fill(0,0,0); strokeWeight(1); text("Net Worth/B", 750, 270); fill(0,0,0); strokeWeight(1); text("Net Worth/B", 450, 60); fill(0,0,0); strokeWeight(1); text("Networth vs Networth", 600, 80); //22 fill(0,0,0); strokeWeight(1); text("Age", 450, 360); fill(0,0,0); strokeWeight(1); text("Networth/B", 750, 550); fill(0,0,0); strokeWeight(1); text("Age vs Networth", 600, 380); for(var i=0; i<5; i++){ fill(0,0,0); var num = max(m_networth)+4-i*20; text(num, 50, max(m_networth)+4+115*i); } for(var i=0; i<8; i++){ fill(0,0,0); var num = min(m_age)-10+i*13; text(num, 60+38*i, 560); } for(var i=0; i<5; i++){ fill(0,0,0); var num = max(m_networth)+4-i*20; text(num, 450, max(m_networth)+4+115*i); } for(var i=0; i<8; i++){ fill(0,0,0); var num = min(m_age)-10+i*13; text(num, 460+38*i, 560); } for(var i=0; i