I am trying to make a bar graph for the following data however my “i” integer is not being recognized.
String[] name = {
“1997:”,
“1998:”,
“1999:”,
“2000:”,
“2001:”,
“2002:”,
“2003:”,
“2004:”,
“2005:”,
“2006:”,
“2007:”,
“2008:”,
“2009:”,
“2010:”,
“2011:”,
“2012:”,
“2013:”,
“2014:”,
“2015:”,
“2016:”,
};
int[] fires = {
6,835 ,
5,227 ,
7,562 ,
5,177 ,
6,223 ,
5,759 ,
5,961 ,
5,574 ,
4,908 ,
4,805 ,
3,610 ,
3,593 ,
2,858 ,
2,434 ,
3,056 ,
2,922 ,
3,672 ,
2,920 ,
3,231 ,
2,816 ,
};
void setup(){
size(500,500);
}
void draw(){
int x =0;
for(int i=0; i<10; i++){
if(mouseX>x && mouseX<=x+40){
fill(255, 96, 79);
}else{
fill(255, 36, 13);
}
}
float h = map(fires[i], 2300, 7600, 36, 340);
rect(x+4, height-h, 32, h);
x+=8;
}
I am very new to processing and need some help.