Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Define specific colors in Pie chart for Calculated Dimension

Hi,

Is there a way to define specific colors in a Pie chart for one calculated dimesion

For example the formula i use is

if( (-<=5), '0-5%', if( (- >5 and -<=10), '5-10%' , if( (->10), '>10%' )))

I want 0 - 5 to be display as "Orange"

          5 - 10 to be display as "Yellow"

          > 10 to be display as "Green"

3 Replies
Not applicable
Author

Hi,

You can do this in expressions>background, then enter the following:

if( (-<=5), rgb(255, 102, 0 ), if( (- >5 and -<=10), rgb(255, 204, 0 ), if( (->10), rgb(0, 255, 0 ) )))

See attached example.

Hope that helps.

Matt

Not applicable
Author

Matt,

Thanks for your reply. I have gone through your qvw file and it looks good. But have one question. In your file the dimesion is not calculated field so you can set the background for the specific dimesion field but in my case i have calculated dimesion.

So, when I enter the formula what you have specified in a expression>background

Mattsies wrote:

Hi,

You can do this in expressions>background, then enter the following:

if( (-<=5), rgb(255, 102, 0 ), if( (- >5 and -<=10), rgb(255, 204, 0 ), if( (->10), rgb(0, 255, 0 ) )))

See attached example.

Hope that helps.

Matt

then all the blocks in a chart became "Black" color. Am i missing something?

Not applicable
Author

Perhaps add the formula in dimension>background ?

Can you attach an example qvw, may be easier to work out a solution that way.

Best,

Matt