Features, discussions, tips, tricks, questions, problems and feedback

How to change color of a Column in a Column chart using Color Member

Hi,
I would like to ask if is possible to change the color of a bar based on a value, if the value is above the standard value, it should be Red, if less than, it should be Green.
I was trying to do that using the dataset and using a color member; however, it does not work, there is a way to do that using this?
I tried to query the colors in different formats from SQL and connect to color Member field, like:

  • color.Red
  • ‘255,0,0’
  • 255
  • #FF0000

They didn’t work.

Any sugestions?

Hi Roldan,

Very good question.

You can use the ARGB hex value without the hash in the front i.e. FFFF0000 for Red. This will need to be stored in a nvarchar type column in you table as like below:

Screenshot%202024-09-26%20093749

Screenshot%202024-09-26%20093802

On the chart below my bars are Green (ff00ff00) if they are lower than 50, otherwise they are Red (ffff0000)

You can use the color field of your table as the Bar Series ColorMember as below:

Make sure you have checked the Color Each setting for the Bar Series as below:

2 Likes

This solution worked perfectly.

Thanks Diego!

1 Like