Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

2 colored line in Line Chart

Is it possible to use the Colors tab and/or Background Color/Line Style attributes to assign multiple colors to a single line as shown in the attached chart?

Thanks!

1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

This is a continuous line chart (numeric / date dimension) and i've added a colormix1() color gradient with the following formula.

it takes a value between 0 and 1, so the date on the x axis  is a ratio of the min->max range. Left side is yellow() and right side is red().

is this helpful ?

ColorMix1(

(Date - min( total Date))

/

( max( total Date) - min(total Date) )

,yellow(),red())

Capture.PNG.png

View solution in original post

4 Replies
JonnyPoole
Former Employee
Former Employee

How about like this ? its a regular line chart  with 'multicolored' enabled and a line style of '<W8>'

Capture.PNG.png\\

or 3D ? 

Capture1.PNG.png

Not applicable
Author

I believe that each of those segments is a seperate line. If you look at my example, each line needs to to have two colors and they need to be in a gradient as they move across the line. I could create two lines for every line, but it wouldn't allow for the gradients and would not be ideal as every line in my data would be split in two.

JonnyPoole
Former Employee
Former Employee

This is a continuous line chart (numeric / date dimension) and i've added a colormix1() color gradient with the following formula.

it takes a value between 0 and 1, so the date on the x axis  is a ratio of the min->max range. Left side is yellow() and right side is red().

is this helpful ?

ColorMix1(

(Date - min( total Date))

/

( max( total Date) - min(total Date) )

,yellow(),red())

Capture.PNG.png

vgutkovsky
Master II
Master II

You can probably use colormix1 to accomplish what you need, assuming you have just 2 colors in your gradient (which it seems like you do from your screenshot):

ColorMix1(rand(),blue(),red())

You can use the first parameter to determine how much closer the color should be to the first color vs. the second.

Regards,

Vlad