Which is the best way to work with two different parameters bound to the legend? #9057
-
I have a line chart and I want to group the lines using different fields. I've achieved this using a If I select a group in the legend and then switch fields the chart goes blank. I understand that it's because the signal holds the values selected using the previous field and that I just need to select the groups in the new legend to show the lines, but I want to show all the lines (clear the values in the signal) when I change fields. I thought about dividing the visualization in layers, create a param in each one to hold each legend values and set the whole visualization opacity to 0 if it's field is not selected, but the signals are bound to the same legend, so clicking on it adds or removes values from both signals. I tried setting Is this the best way to handle this? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Does this work better if you instead change your data to long form (tidy from) and then switch the data using a selection over a field that switches between the two datasets? |
Beta Was this translation helpful? Give feedback.
-
I've managed to solve it with help from another forum, here's the solution:
Kudos to Marco Liberati |
Beta Was this translation helpful? Give feedback.
I've managed to solve it with help from another forum, here's the solution:
view
-click
event add an additionaldimention
event to the listener, and in that case returnnull
Solved example
Kudos to Marco Liberati