3 Replies Latest reply: Apr 17, 2013 12:36 PM by matthew thompson

# 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( ([a]-[b]<=5), '0-5%', if( ([a]-[b] >5 and [a]-[b]<=10), '5-10%' , if( ([a]-[b]>10), '>10%' )))

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

5 - 10 to be display as "Yellow"

> 10 to be display as "Green"

• ###### Re: Define specific colors in Pie chart for Calculated Dimension

Hi,

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

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

See attached example.

Hope that helps.

Matt

• ###### Re: Define specific colors in Pie chart for Calculated Dimension

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( ([a]-[b]<=5), rgb(255, 102, 0 ), if( ([a]-[b] >5 and [a]-[b]<=10), rgb(255, 204, 0 ), if( ([a]-[b]>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?

• ###### Re: Define specific colors in Pie chart for Calculated Dimension

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