Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have an embedded report with multiple charts. It's possible to select multiple data points accros multiple charts using Ctrl+click. I would like to catch such multiple data selected events using the javascript SDK. When adding an event listener "dataSelected" I can just catch the latest data selected event, not the multiple data selected events. I can catch multiple data selected events in one single chart but not accros multiple charts. Is there a way to do it ?
I'm also interested in this, but do not see a solution.. has any been found?
Thanks!
On embedded report with multiple charts, it's possible, since February 2018 release, to select multiple data points accros multiple charts using Ctrl+click. It should be possible to catch such multiple data selected events using the javascript SDK by adding an event listener "dataSelected". Unfortunately, it seems it's not the case today.
How you define the DataSelected Events here?
If you would like to get the history data, then you may need to create an array to hold the data selected previously.
I believe the DataSelected Event captures every click, but in your code it only returns the last Event information.
You may consider add a log function similar to the Power BI Embed sample, which would log every steps with user interaction.
Code example:
// Get a reference to the embedded report HTML element var embedContainer = $('#embedContainer')[0]; // Get a reference to the embedded report. report = powerbi.get(embedContainer); // Report.off removes a given event listener if it exists. report.off("dataSelected"); // Report.on will add an event listener. report.on("dataSelected", function(event) { var data = event.detail; Log.log(data); }); // Select Run and select an element of a visualization. // For example, a bar in a bar chart. You should see an entry in the Log window. Log.logText("Select data to see events in Log window.");
Regards,
Michael
Thank you Michael for your answer!
I catch all the DataSelected events using code similar to the Power BI sample. I can store the full events history but this doesn't help me as I don't know if it was a simple click or a ctrl-click which throw the event. With a simple click, only the last data point is selected. But with a ctrl-click, multiple data points are selected (with AND logic between data points on different charts. This is visible graphically on the embedded report).
I compared the JSON returned in events and could see no differences between a click event and a ctrl-click event (on multiple charts).
Best regards,
François