Despite the COVID-19 outbreak, our team continues operating at full speed. We are always here to support and answer all your questions.

Feel free to reach out by filling this quick form.

Fill the form
Get Free Trial

Chart Measure change event?

Answered
Yusuf Yildiz asked on June 23, 2020

Hi,
I’m trying to replace only the chart section of flexmonster with highcharts. But at the same, I will keep fm-header toolbar. The screenshot should give you a better idea.
Since I keep the measures dropdown, is there a way listen to changes and update the chart with the selected measure? I’ve tried to see if update or reportchange events were triggered and they weren’t.
In other words, is there an event, listener, or a method to detect fm-chart-measures-dropdown selection changes?
Best,
Yusuf

Attachments:
ScreenHunter 2176.png

3 answers

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster June 23, 2020

Hi Yusuf,
 
Thank you for posting your question.
 
At the moment, Flexmonster API does not offer a dedicated event to track the change of measure displayed in the chart – still, the chart is automatically updated once a new measure has been selected to be displayed.
 
Perhaps you could tell us a little bit more about your use case so that we can see whether there is a better solution to your situation? 
 
Looking forward to your reply.
 
Regards,
Mykhailo

Public
Yusuf Yildiz June 23, 2020

Mykhailo
FM’s own charts(which I don’t use) are updated but I’m not notified to call .getData one more or pass that slice information to Highcharts. If there was a specific event letting me know that the selection changed, I could’ve easily changed my chart.
Is there any way to get that information so I can update my own chart? What would be a better solution in my case? I can only think of a hacky way of finding that dropdown in the dom and replacing it with my own dropdown so I can listen to the changes. I don’t like this solution but it may be the only way if you can’t give me another way to detect that change in the dropdown.
Best,
Yusuf

Public
Mykhailo Halaida Mykhailo Halaida Flexmonster June 24, 2020

Hi Yusuf,
 
Thank you for your swift response.
 
Please note that once you’ve updated the slice, both the built-in Flexmonster charts and the 3rd party charting library instance are updated as well.
 
However, it is important to understand that the mentioned measure drop-down in the chart toolbar does not modify the slice in any way – it simply lets you choose which of the active measures is displayed in the built-in Flexmonster charts. Naturally, this means that the updateHandle() function of the getData() API call is never called after such measure drop-down manipulations.
 
What complicates this situation further is the fact that in Highcharts all the active measures available in the slice are displayed at the same time by default. Therefore, nothing is changed in Highcharts when you select different measures in the mentioned drop-down, as they all are already there. 
 
Please let us know if you find our response helpful.
 
Regards,
Mykhailo

Please login or Register to Submit Answer