Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

pbaenen
New Contributor III

Variable Color for Line Chart

Is it possible to dynamically change the color of the line in a line chart?

For example, can I have the first x values be red, and the rest be black?

1 Solution

Accepted Solutions
Not applicable

Variable Color for Line Chart

One other option:

Go to Expression Tab.

Expand the expression.

Select the Background color

Add a condition if(rowno()<10 ,RGB(0,236,0),RGB(255,100,255))

Note: This won't work if the graph is sorted according to y value.

4 Replies
Not applicable

Variable Color for Line Chart

Yes, go to the Colors tab of your chart properties, click on one of the colors and put in a calculated color. You have a separate color for the first 18 lines, so you would have to define all the ones you wanted as red to be red and the rest black. You could use a variable to make the number of red lines be dynamic,

pbaenen
New Contributor III

Variable Color for Line Chart

I've tried the Calculated color, but I'm not sure what to put in for the formula to give me, for example, the first 5 values of the chart.

I assume I should be using an If statement here.

Not applicable

Variable Color for Line Chart

One other option:

Go to Expression Tab.

Expand the expression.

Select the Background color

Add a condition if(rowno()<10 ,RGB(0,236,0),RGB(255,100,255))

Note: This won't work if the graph is sorted according to y value.

pbaenen
New Contributor III

Variable Color for Line Chart

Thank you, this was exactly what I was looking for.

Community Browser