Hi All,
I am new to Moxie charts and this is probably my first try of this.
I took the example scatter chart code from the showcase application and added a series selection handler. when i have a series selection handler
packagecom.example.moxieChart.client;importcom.google.gwt.core.client.EntryPoint;importcom.google.gwt.user.client.Window;importcom.google.gwt.user.client.ui.RootPanel;importorg.moxieapps.gwt.highcharts.client.*;importorg.moxieapps.gwt.highcharts.client.events.ChartSelectionEvent;importorg.moxieapps.gwt.highcharts.client.events.ChartSelectionEventHandler;publicclassMoxieChartimplementsEntryPoint{publicvoidonModuleLoad(){RootPanel.get().add(createChart());}publicChartcreateChart(){finalChartchart=newChart().setType(Series.Type.SCATTER).setZoomType(Chart.ZoomType.X_AND_Y);chart.setSelectionEventHandler(newChartSelectionEventHandler(){@OverridepublicbooleanonSelection(ChartSelectionEvente){rangeChange(e.getXAxisMin(),e.getXAxisMax());returntrue;}});chart.addSeries(chart.createSeries().setPoints(newNumber[][]{{161.2,51.6},{167.5,59.0},{159.5,49.2},{157.0,63.0},{155.8,53.6},}));returnchart;}privatevoidrangeChange(doublemin,doublemax){Stringmessage="Min ="+min+" Max ="+max;Window.alert(message);}}
So this one gives me alert message when ever i zoom in, but after that the reset zoom button doesn't work. But if remove the rangeChange function call in the onSelection event it works. What am i doing wrong here?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Interesting, I was able to reproduce this issue as well. It appears that when you click the "reset zoom" button the SelectionEventHandler is getting called again, which would be fine, except for the fact that the native event is missing the "xAxis" and "yAxis" properties. So, when you call "e.getXAxisMin()" method the browser is running into an "Object undefined" error. To work around the issue, you can use the following JSNI trick:
I have the same issue. i tried your work around but it didn't solve the problem. I sort of suspected it wouldn't. My listener is NOT getting called twice. The error must be in the library itself. It is unfortunate that the previous person never got back to you. Any other suggestions for how to resolve this? Surely others must be pro programmatically trying to zoom in on the charts.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
I am new to Moxie charts and this is probably my first try of this.
I took the example scatter chart code from the showcase application and added a series selection handler. when i have a series selection handler
So this one gives me alert message when ever i zoom in, but after that the reset zoom button doesn't work. But if remove the rangeChange function call in the onSelection event it works. What am i doing wrong here?
Interesting, I was able to reproduce this issue as well. It appears that when you click the "reset zoom" button the SelectionEventHandler is getting called again, which would be fine, except for the fact that the native event is missing the "xAxis" and "yAxis" properties. So, when you call "e.getXAxisMin()" method the browser is running into an "Object undefined" error. To work around the issue, you can use the following JSNI trick:
Let us know if approach will work for what you're trying to accomplish.
I have the same issue. i tried your work around but it didn't solve the problem. I sort of suspected it wouldn't. My listener is NOT getting called twice. The error must be in the library itself. It is unfortunate that the previous person never got back to you. Any other suggestions for how to resolve this? Surely others must be pro programmatically trying to zoom in on the charts.