void drawLabels(){ for (int i = 0; i < 8; i++){ float time = map( i, 0, 7 , 0, (float)maxDur*(1.0 - (float)(hs2.getPos()-4*XI)/(XI*28))); //(i*XI*4)+4*XI, 15*YI, (i*XI*4)+4*XI, 15*YI+YI/4) // -1, maxDur*((1080 - bottomPos)/(1080)), 200, 1280); textFont(mainFont, 24); fill(255); textAlign(CENTER); if(time>=1 || time == 0) text(round(time), (i*XI*4)+XI*4, YI*16); else if (time <0) text(0, (i*XI*4)+XI*4, YI*16); else text(time, (i*XI*4)+XI*4, YI*16); textAlign(CENTER,BOTTOM); textFont(mainFont, 12); text("Checkout Duration (Days)", TBGX+8*XI, YI*17) ; textAlign(LEFT,TOP); text(" Timeline Adjust", 4*XI, 15*YI+2) ; translate(width/2,height/2); rotate(-HALF_PI); textAlign(CENTER,TOP); text("Size Adjust", -2*YI-YI/2, - 14*XI-XI/4) ; rotate(HALF_PI); translate(-width/2,-height/2); } } void drawStaticLabels(){ char[] wk = new char[] { 'M', 'T', 'W' , 'R' , 'F', 'S', 'S' }; for(int i = 0; i< 7; i++){ textFont(mainFont, 24); textAlign(CENTER,CENTER); fill(255); text(wk[6-i], XI*4 -XI/2 ,i*YI*2+YI); // line(XI*4, (i*YI*2)+YI, XI*4 - XI/4,(i*YI*2)+YI); textAlign(CENTER,TOP); textFont(mainFont, 12); text("Weekday Distribution", XI*4 -XI/2, YI/4) ; } fill(120); textAlign(RIGHT); text("Most Common Day: ", TBGX+16*XI, TBGY+2*YI);// Avg Duration: Most Common Day: ", 200,700); text( "Type: ", TBGX+8*XI, TBGY+2*YI); // Type: Format: Category:", 200, 775); text("Avg Duration: ", TBGX+8*XI, TBGY+YI*1);// text("Label: ", TBGX+8*XI, TBGY);// text("Checked Out: ", TBGX+16*XI, TBGY+YI*1);// text("Format: ", TBGX+16*XI, TBGY);// text("Category: ", TBGX+8*XI, TBGY+3*YI);// } void drawGrid() { stroke(160); strokeWeight(1); for(int i = 0; i < width; i = i + XI) { line(i,0,i,height); for(int k = 0; k < height; k = k + YI) { line(0,k,width,k); } } } //void drawPlot() //{ // noStroke(); // fill(70); // rectMode(CORNERS); // rect(PLOTX1,PLOTY1,PLOTX2,PLOTY2); //} // //void drawAxisLabels() { // fill(70); // textLeading(15); // textFont(font); // textAlign(CENTER, CENTER); // // Use \n (enter/linefeed) to break the text into separate lines // text("Y-AXIS\nLABEL", LABELX, (PLOTY1+PLOTY2)/2); // textAlign(CENTER, CENTER); // text("X-AXIS LABEL", (PLOTX1+PLOTX2)/2, LABELY); //} // //void drawTitle() { // fill(70); // textAlign(LEFT); // textFont(font); // text("SPL DATA VISUALIZATION", PLOTX1, PLOTY1 - 5); // textAlign(RIGHT); // text("MAT 259", PLOTX2, PLOTY1 - 5); //} // // //