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: 
matrix123
Contributor III
Contributor III

how to change the alternate segments color of single line chart in qlikview

Hi,

Does anyone know how to change the color of alternate segments in a single line chart ?

I have datetime on X axis and text value on measure, I want to change the color of the segment based on the comparison of current to next value  (if they are same then use one color, otherwise another color)or altleast alternate segments to different color.

 

Thanks,

Matrix

 

 

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Check the attached file. You would need one additional expression with only symbol presentation and background expression something like:

Color(FieldIndex('vlaue', vlaue))

tresesco_0-1597213042830.png

 

 

 

View solution in original post

6 Replies
tresesco
MVP
MVP

Try to share a sample app to work on.

matrix123
Contributor III
Contributor III
Author

Hi treseco,

Attaching you a sample qvw file..I want to see segments ABC1234 in green color (it is appearing 2 times) and XYZ1234 is a different value, so different color.

Can this be done in qlikview?

I mean it is a single line but i want to show the segments (symbols) on the data values with different color...usually i have toggling values 2, and i dnt want to code in inline table...

for example in straight table we can change the alternate rows color by using something like

=if(mod(rowno(total),2)=0,red(),green())

i want to change alternate symbols in line with different color..

thanks.

tresesco
MVP
MVP

Check the attached file. You would need one additional expression with only symbol presentation and background expression something like:

Color(FieldIndex('vlaue', vlaue))

tresesco_0-1597213042830.png

 

 

 

matrix123
Contributor III
Contributor III
Author

Thank you Tresesco..

It worked well for me..:-)

aamirSiddiquee1
Contributor
Contributor

 You would need one additional expression with only symbol presentation and background expression something like:
Color(FieldIndex('vlaue', vlaue)) .

 

Also you can add conditional color expression in the Main expression.

matrix123
Contributor III
Contributor III
Author

And also it can be done in the single expression as well (by selecting both line and symbol), works well.

I accepted your solution as Color using Fieldindex given me what i was looking for...