Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikconsultant
Creator III
Creator III

Conditional text color in combochart

I have a combochart with 3 bars and one line. The dimension axes is myday (a date).

I the settings Axes -> Font -> Color -> Calculated

I tried the following code:

if(WeekDay(myday)='So' or WeekDay(myday)='Sa',RGB(35,125,215))

But nothing changes.

My goal is that on every Sun or Saturday the text color is different.

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

Unfortunately the axes font settings do not evaluate over the dimension. A work around is to remove the labels of the dimension and ADD an expression in the expression tab where you set the display option to text on axis. Now you can add the color expression to the text color of that new expression by clicking on the + sign of the expression. (image shows bg color, but text color is straight under)

BGColor.png

View solution in original post

11 Replies
Not applicable

Hi,

If(weekday(myday)='sun' or weekday(myday)='sat', RGB(35,125,215),RGB(90,125,215));

qlikconsultant
Creator III
Creator III
Author

Didn't work.

It uses every time what was last picked fixed.

stigchel
Partner - Master
Partner - Master

Unfortunately the axes font settings do not evaluate over the dimension. A work around is to remove the labels of the dimension and ADD an expression in the expression tab where you set the display option to text on axis. Now you can add the color expression to the text color of that new expression by clicking on the + sign of the expression. (image shows bg color, but text color is straight under)

BGColor.png

qlikconsultant
Creator III
Creator III
Author

Thanks for the information. I tried your workaround but it didn't work in a combo chart with 3 bars and one line.

stigchel
Partner - Master
Partner - Master

??? You marked my answer correct, did you get it working after you placed the comment that it didn't work?

I have found examples of this use in my qv's also with combo charts with lines and bars, do you need an example?

qlikconsultant
Creator III
Creator III
Author

I marked your answer correct because you answered my question, correct.  Your alternative is a bonus for me.

Please give me an example for your solution.

stigchel
Partner - Master
Partner - Master

Example of Two bars, one line in combo chart with different text color for Sat and Sun on the x-axis:

qlikconsultant
Creator III
Creator III
Author

Nice solution it has only one disadvantage the dimension grid is for some reason no longer working.

stigchel
Partner - Master
Partner - Master

Well, you can even work around that . Put the dimension label back on again, now it will display two rows with labels (Expression and Dimension). Then on the axes tab set the dimension axes font color to 100% transparent. Now you have one (visible) row of labels from the expression. The extra invisible row may take up some space at the bottom of the chart, but you can correct that by holding Ctrl+Shift on the active chart object and 'pull' the x-axis down.