วันพฤหัสบดีที่ 19 กันยายน พ.ศ. 2556

Parallel array





void setup() {  
  size (450, 450);
  background(25);
}
void draw () {
  int x = 50;
  int i = 0;
  int j = 0;
  int y = 50;
  float [][] B = { { 13.51, 14.74, 12.598, 32.65, 26.50 } ,
                         { 8.86, 11.75, 15.07, 39.32, 24.99  } };

  while (i < B[0].length) {
    textSize(10);
    fill(#23FC55);
    rect (x, 380, 20, -B[0][i]*10);
    text(B[0][i]+"%", x,400);
    fill(#FC7C03);
    rect (x+20, 380, 20, -B[1][j]*10);
    text(B[1][i]+"%", x+20,400+10);
    i = i + 1;
    x = x + 70;
  }
  textSize(15);
  fill (#FC0AA8);
  text("No. of marine fishery establishments ", 30, 30);
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น