Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

qlikconsultant
Contributor II

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
Honored Contributor

Re: Conditional text color in combochart

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

11 Replies
Not applicable

Re: Conditional text color in combochart

Hi,

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

qlikconsultant
Contributor II

Re: Conditional text color in combochart

Didn't work.

It uses every time what was last picked fixed.

stigchel
Honored Contributor

Re: Conditional text color in combochart

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
Contributor II

Re: Conditional text color in combochart

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

stigchel
Honored Contributor

Re: Conditional text color in combochart

??? 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
Contributor II

Re: Conditional text color in combochart

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
Honored Contributor

Re: Re: Conditional text color in combochart

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

qlikconsultant
Contributor II

Re: Conditional text color in combochart

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

stigchel
Honored Contributor

Re: Conditional text color in combochart

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.

Community Browser