2 Replies Latest reply on May 30, 2012 12:56 AM by Emma Whyte

# Color Bar by Average Score

Hello,

I am working with data that contains satisfaction questions on a 1-7 scale. I am trying to colour bars in a bar chart by their mean score within a range.

For example:

If the score is <5.9 then red

If the score is 5.9 - 6.2 then yellow

If the score is 6.2 - 6.5 then light green

If the score is 6.5 - 6.8 then dark green

If the score is > 6.8 then purple

I have attempted to do this using Edit Colours (placing the pill on the colour shelf in the marks menu) and using a stepped colour scale with start and end points defined. I have set the start point as 5.6 and the end point as 7.1. I came to this conclusion by using the standard deviation to work out a scale that matched the range I wanted, as well as some other factors. I quite like this way of doing it, but have a question:

If I put the Start point on the Edit Colours menu as 5.6 will it colour everything below 5.6 as red also?

Is there an easier way of defining a colour range for scores than using stepped colours on Edit Colours?

Thanks

Emma

• ###### 1. Re: Color Bar by Average Score

Hi Emma,

- Yes, everything below the Start gets the same color.

- For scale situations like this I find I get more control by using a calculated field with an IF statement to create a discrete set of colors, for example:

IF [results] < 5.9 THEN "<5.9"

ELSEIF [results] <= 6.2 THEN "5.9 to 6.2"

ELSE ">6.2"

END

Then the color legend will be able to display the exact gradations rather than the bands.

Cheers,

Jonathan

• ###### 2. Re: Color Bar by Average Score

Hi Jonathan,

Thanks for the reply. I tested last night with some dummy data and can see that everything below or above gets coloured, which is great.

I had thought about using an IF statement and your answer is very useful, thanks. I didn't know that this would let the colour legend display the exact gradients.

Thanks

Emma