I tried to use function setPoints in Series class as below:
sr.setPoints(new Point[] {}, true);
but it generated an exception:
com.google.gwt.core.client.JavaScriptException: (TypeError): Unable to get value of the property 'x': object is null or undefined
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
at org.moxieapps.gwt.highcharts.client.Series.nativeSetData(Series.java)
at org.moxieapps.gwt.highcharts.client.Series.setPoints(Series.java:720)
Setting the points of the series to an empty array should be the correct way to clear a series. Note that you can also remove a series completely from the chart if you'd like via "Chart.removeSeries(...) .
I tried the following and didn't run into any exceptions. There were some bug fixes in this area of the code over the past couple of releases though. Are you running the latest?
I tried to use function setPoints in Series class as below:
but it generated an exception:
now, I have to build a native funtion like below:
Does it invoke chart.redraw() automatically?
Is there any better way?
Thanks in advance!
Setting the points of the series to an empty array should be the correct way to clear a series. Note that you can also remove a series completely from the chart if you'd like via "Chart.removeSeries(...) .
I tried the following and didn't run into any exceptions. There were some bug fixes in this area of the code over the past couple of releases though. Are you running the latest?
If you are running the latest, can you boil your scenario down to a simple use case and post it here so we can determine if there's a bug?