Forum Discussion
Custom Visual - How to get selected items from a dimension?
Hi dm-p ,
Let me try to explain it by an example:
| Product | Country |
| ProdA | Italy |
| ProdB | Germany |
| ProdC | Germany |
I'm passing both dimensions to my custom visual. I need to distinguish between "has data/connection" and "isUserSelected". For example, user selects Italy - custom visual is getting ProdA. BUT: This is not user selected, it just has a connection to Italy. I need only Italy. IF the user now selects also ProdA & Italy, I should get ProdA and Italy as both are selected. It's fine to get all possible elements, but I need to check somehow if the element is really user selected or just with data.
Hope this helps a bit?
(and sorry for the wrong section in the forum, didnt saw it yesterday 😞 Maybe some mod could move it to the custom visual dev. place 🙂 )
Hi Anonymous,
Thanks for clarifying - I'm still not 100% sure, but it sounds like you're after the ability to have partial highlighting support on your visual (where all data is passed, but the selected values are also indicated)? If so, you need to add supportsHighlight: true to your capabilities.json.
The previous link references a follow-up article on coding the support for highlights, which documents what you'll see in your dataView after enabling the capability. You will need to compare the entries from the highlights array with those in the values array to determine which data points are affected and write code accordingly to dim/hide (or however you want to represent visually) the visual representation of these data points.
I hope that this gets you moving in the right direction. Good luck!
Daniel