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

Dynamic legend in scatter plot based upon selected x and y axis measures

Hi there,

I have a scatter plot with several measures for the x and y axis. I want the legend to be coloured according to the value of x-axis value minus y-axis value.

If the user changes selects an alternative x / y axis measure then the legend is automatically updated to reflect this.

Any help much appreciated.

Thanks

Matt

1 Solution

Accepted Solutions
rubenmarin

Hi Matt, maybe setting color by expression and using column(1) to refer to x-axis and column(2) to y-axis, so it can be something like:

If(column(1)-column(2)>0, Red(), Green())

View solution in original post

2 Replies
rubenmarin

Hi Matt, maybe setting color by expression and using column(1) to refer to x-axis and column(2) to y-axis, so it can be something like:

If(column(1)-column(2)>0, Red(), Green())

mattcorke
Contributor II
Contributor II
Author

Thanks Ruben - that worked great! I added column 1 - column 2 as a measure and used the diverging classes colour scheme.

Thanks again

Matt