float x = 100; float y = 100; float lastx = 100; float lasty = 100; int[] temparray1 = new int[600]; String[] temparray2 = new String[600]; int[] temparray3 = new int[600]; int[] temparray4 = new int[600]; int[] temparray5 = new int[600]; float[] temparray6 = new float[600]; int tempint=101; String str="original"; String str2="original2"; String str3="original2"; String str4="original2"; void setup() { size(471, 280); smooth(); strokeWeight(4.0); stroke(0, 20); String[] lines; String[] lines2; background(226); lines = loadStrings("http://www.briem.com/data/rawdata2.txt"); for(int i=0; i<520; i++) { String[] pieces = split(lines[i], '\t'); temparray1[i] = int(pieces[0]) ; temparray2[i] = pieces[1] ; temparray3[i] = int(pieces[2]) ; temparray4[i] = int(pieces[3]) ; temparray5[i] = int(pieces[4]) ; temparray6[i] = float(pieces[5]) ; } background(226); stroke(10); line(0,0,0,300); line(0,250,470,250); for(int i=0; i<38; i++) { stroke(10); line(12*i,240,12*i,250); } for(int i=0; i<470; i++) { stroke(20); line(i,250-10*temparray6[i],(i+1),250-10*temparray6[i+1]); } PFont fontA = loadFont("TheSans-Plain-12.vlw"); textFont(fontA, 20); stroke(0); fill(0); str = "Pittsburgh MSA Unemployment Rate "; text(str, 40, 20); fill(0); rect(0, 250,120,270); fill(150); rect(120, 250,240,270); fill(0); rect(240, 250,260,270); fill(150); rect(360, 250,451,270); textFont(fontA, 14); fill(200); str = "1970s"; text(str, 40, 270); str = "1990s"; text(str, 280, 270); fill(0); str = "1980s"; text(str, 160, 270); str = "2000s"; text(str, 380, 270); } void draw() { //background(226); PFont fontA = loadFont("TheSans-Plain-12.vlw"); lastx=x; lasty=y; x = mouseX ; y = mouseY ; // fill(400, 102, 0); strokeWeight(0); stroke(226); fill(226); rect(170, 30,300,80); strokeWeight(1); stroke(226); line(lastx,240, lastx,60); strokeWeight(1); stroke(0); line(x,240, x,60); line(lastx,250-10*temparray6[int(lastx)],lastx,250-10*temparray6[int(lastx)]); fill(0); textFont(fontA, 20); str = Float.toString(temparray6[int(x)]); text(str, 190, 60); str2 = temparray2[int(x)]; text(str2, 190, 80); str3 = Integer.toString(temparray1[int(x)]); text(str3, 287, 80); str4 = "%"; text(str4, 225, 60); }