Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
imark
Contributor III
Contributor III

Setting conditional formatting in color tab

I have a very basic chart, one dimension (date) and one metric , Contribution = SUM(a) - SUM(b) , which can take both positive and negative values.

I would like to have a conditional coloring of the bars so that if the value of Contriution on a given date (bar) is positive, we have it green, else red.

This works if I set the conditional colouring in the Expression tab. However I would also like to use two-colour bars, which to my knowledge I can only achieve in the colour tab. But here, the formula IF(SUM(a)-SUM)(b) > 0, RGB(0,255,0), RGB(255,0,0)) seems to be evaluated over the whole set, and not per each dimension point (date). Is there any way to achieve it?

2 Replies
lockematthewp
Creator II
Creator II

That should work if you put it in the Background color under the expression. =if (Sum(A) > Sum(B), green(), red())

imark
Contributor III
Contributor III
Author

Just went through my OP and realised that the most important bit of information is also the least clear one. Sorry, my bad.

I would like to have the bars in two-colour gradients, so that positive values are shaded in, say, RGB(0,255,0) and RGB(0, 150, 0) and negatives in RGB(255,0,0) and RGB(150,0,0). 

As far as I know it is not possible to create gradients in Expressions/Background Color so the question is whether it is possible to have a conditional that is "sensitive" to the dimension points in the Colors tab.