Hi Sojamo,
Yep, sure - many thanks for taking a look. I can send you a working example if it would help but couldn't see how to attach one to this post.
In
setup() I have:
Code:
controlP5 = new ControlP5(this);
Radio rCountry = controlP5.addRadio("radioCountry",20,20);
rCountry.add("All",0);
rCountry.add("DE",1);
rCountry.add("FR",2);
rCountry.add("UK",3);
Radio rChannel = controlP5.addRadio("radioChannel",60,20);
rChannel.add("All",0);
rChannel.add("Acquisition email",1);
rChannel.add("Online / Affiliate",2);
rChannel.add("Organic search",3);
rChannel.add("Paid search",4);
rChannel.add("Retention email",5);
Radio rPageType = controlP5.addRadio("radioPageType",160,20);
rPageType.add("All",0);
rPageType.add("Homepage",1);
rPageType.add("Splash",2);
rPageType.add("Product",3);
rPageType.add("Gallery",4);
rPageType.add("Studio",5);
rPageType.add("Sign in",6);
rPageType.add("Order pipeline",7);
rPageType.add("Other",8);
My
functions are:
Code:
void radioCountry(int theID) {
switch(theID) {
case(0):
selectedCountry = "All";
break;
case(1):
selectedCountry = "DE";
break;
case(2):
selectedCountry = "FR";
break;
case(3):
selectedCountry = "UK";
break;
}
}
void radioChannel(int theID) {
switch(theID) {
case(0):
selectedChannel = "All";
break;
case(1):
selectedChannel = "Acquisition email";
break;
case(2):
selectedChannel = "Online / Affiliate";
break;
case(3):
selectedChannel = "Organic search";
break;
case(4):
selectedChannel = "Paid search";
break;
case(5):
selectedChannel = "Retention email";
break;
}
}
void radioPageType(int theID) {
switch(theID) {
case(0):
selectedPageType = "All";
break;
case(1):
selectedPageType = "Homepage";
break;
case(2):
selectedPageType = "Splash";
break;
case(3):
selectedPageType = "Product";
break;
case(4):
selectedPageType = "Gallery";
break;
case(5):
selectedPageType = "Studio";
break;
case(6):
selectedPageType = "Sign in";
break;
case(7):
selectedPageType = "Order pipeline";
break;
case(8):
selectedPageType = "Other";
break;
}
}
And in
draw() I have:
Code:
if((selectedCountry.equals("All") || selectedCountry.equals(sCountry))
&& (selectedChannel.equals("All") || selectedChannel.equals(sChannel))
&& (selectedPageType.equals("All") || selectedPageType.equals(sPageType))
&& (x <= axisMaxX)
&& (y <= axisMaxY)) {
// draw data
}
- David