Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
MVP
MVP

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
MVP
MVP

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