Forum Discussion
Which API will allow users to click and drag my visual
Hi VizDataLtd ,
This is the related document, you can view this content:
https://blog.enterprisedna.co/power-bi-visuals-tutorial-how-to-easily-move-visuals/
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/pointer-events
Visual interactions in Power BI visuals - Power BI | Microsoft Learn
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- VizDataLtd2 years ago
Helper I
Thanks for your reply, but I remain confused. Is it possible for a custom visual to be clicked-and-dragged in the same way as a standard visual? In the screenshot, I am dragging a standard bar chart. I have clicked in the middle of the visual and then dragged it (you cannot see the arrow, but it is in the center).
Clicking and dragging a standard visual
As per your links, I have tried setting allowInteractions to false and I have tried changing pointer-events but these have not helped. I also tried event.stopPropagation() as the single line of code in an on click() event, following the bar chart example.
The link you provided on clicking the ellipses to move the visual suggests to me that it is not possible to create the same click-and-drag behaviour with custom visuals as with standard ones.
Every custom visual I download to test, cannot be clicked and dragged. Please save me some time and confirm my suspicion that this isn't possible. (This seems an enormous limitation - users will think the visual is broken.)