Page 1 of 1

$indicator->bullet = If?

Posted: 2022-09-01 14:37
by AhmedBR
Hi Jan,

Is it possible to use IF the define bullet color based on $indicator->value?
Something like:

Code: Select all

$indicator->bullet = if( $indicator->value > 5, "red, "green");
Thanks

Re: $indicator->bullet = If?

Posted: 2022-09-01 18:18
by AhmedBR
Found the solution, actually quite easy!

Since we are in global hook, use IF normally using this format:
if(condition)[ blah blah];

Re: $indicator->bullet = If?

Posted: 2022-09-01 19:01
by jsetzer
Exactly. It is pure PHP with all options.