gwt - Add handler to chart to fire when any pixel on chart is clicked -
i using gwt wrapper moxiegroup highcharts. how can make click anywhere on chart fire event. thought might right starting point
chart.adddomhandler(new clickhandler() { @override public void onclick(clickevent event) { window.alert("clicked"); } }, clickevent.gettype());
it seems highcharts has trouble passing events through it, either design or because of conflict svg. said moxiegroup has couple methods should out.
this method should use add click handler background of chart. clicking on series, or near series won't fire handler.
chart.setclickeventhandler(new chartclickeventhandler() { @override public boolean onclick(chartclickevent chartclickevent) { gwt.log("chart click"+chartclickevent.getclientx()); return false; } });
the following handler allow capture click events when click on series.
chart.setseriesplotoptions(new seriesplotoptions() .setseriesclickeventhandler(new seriesclickeventhandler() { public boolean onclick(seriesclickevent clickevent) { gwt.log("series click"); return true; } }) );
between 2 of them should able capture of click events on chart.
Comments
Post a Comment