Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with color in line graph/chart

Hi, I just started to use Qlik Sense and I want to personalize the colors in a line graph/chart, according to the value of the expression.

I want to change the color of the line depending on the value. If the value is lower than zero, I need one color, and if the value is higher than zero, I need another color. I only get the result of the picture, but it is not exactly what I want.

I have tried two different methods.

  • Color by measure

  • Color by expression. I used this expression: =IF(ExistenciaProducto < 0, RGB(255, 0, 0), RGB(40, 180, 220))

The table where I get the data has this structure:

Row NumberDate (MM/DD/YYYY)Movement unitsOn Inventory
101/01/20175050
201/10/2017-2525
301/10/2017-205
402/04/2017150155
502/05/2017-10055

The dates are not always the same, I have one row for each movement, and I can have more than one movement per day.

Thanks!

6 Replies
shraddha_g
Partner - Master III
Partner - Master III

In your expression --> IF(ExistenciaProducto < 0, RGB(255, 0, 0), RGB(40, 180, 220))

instead of ExistenciaProducto, put a expression you have used in Measure section of chart

Not applicable
Author

Hellor, the measure I'm using is the same, ExistenciaProducto.

Is this what you are referring to?

shraddha_g
Partner - Master III
Partner - Master III

Don't you think it should be an aggregation expression?

For Ex. Sum(FieldName)

Not applicable
Author

I changed it, "RangeSum(Above(Sum(Units), 0, RowNo()))" instead "Sum(Inventory)"

It works at the same way, even with this aggregation expression as the measure for the chart and for the colour condition.

shraddha_g
Partner - Master III
Partner - Master III

can you share sample app?

Not applicable
Author

This is the basic structure