programatically fire a click event for a point on highchart scatter plot

家住魔仙堡 提交于 2019-12-10 15:03:33

问题


Actually I am in a small requirement where in there is a scatter chart with a list of points and drop down list. When I select an item from the drop down list its corresponding data point click should be fired. And when I select a data point on the chart, some actions has to happen and the drop down list should get updated according to the selection.

Is there any way we can do this?

I've tried firePointClick, the event is coming as undefined, I want the event same as the event which we get when a manual click happens, is there any other way?? or any improvements


回答1:


It's not part of the API, but could be done using internal API function called firePointEvent that way:

chart.series[0].data[0].firePointEvent('click', event);

To do something similar for dropdown, you can use point.events.click event handler.




回答2:


I think you may be able to do what you want using the select event on the points. You can add an event handler to the select event in the chart (http://api.highcharts.com/highcharts#series.data.events.select) but you can also trigger it using the API: http://api.highcharts.com/highcharts#Point.select().



来源:https://stackoverflow.com/questions/16233681/programatically-fire-a-click-event-for-a-point-on-highchart-scatter-plot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!