I am trying to create a traffic light indicator based on a 5-star value. For instance, I want values 4-5 to show as green, 2-3 as yellow, and 0-1 as red. I am having trouble figuring out what values to put as the lower bounds to make this happen. I currently have the min value setting as 0 and the max as 5. I have 3 segments, green's lower bound set to 4, yellow set to 2, and red set to 0. This is not giving me my desired results.
Thanks, John. I thought my logic was correct but I'm not getting the correct results. Could it be because I'm using an expression to determine the value? And the value is likely not going to be a single digit, but rather a decimal. Please see my expression to determine the star's value below. Do I need to use a rounding function?
You could try round(), floor(), or ceil() if any of those are appropriate. With the autowidth segments, I have problems with some fractional values, but it seems to work fine for the segments with the specified starting points. But I can imagine cases where you might have 3.999999999 for instance, and since it's below 4, it still shows yellow, even though it displays on the screen as 4 to any reasonable number of digits.