ijingshan / gwt-charts

Automatically exported from code.google.com/p/gwt-charts
0 stars 0 forks source link

Unable to use setSelection() in PieCharts when using Java GWT #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

We have the following code:
final JsArray<Selection> selectionArray = Selection.createArray().cast();
selectionArray.setLength(1);

final Selection selection = Selection.create(1, null).cast();
selectionArray.set(0, selection);

What is the expected output? What do you see instead?
We keep getting the error:

com.google.gwt.core.client.JavaScriptException: (TypeError) 
@com.googlecode.gwt.charts.client.ChartObject::setSelection(Lcom/google/gwt/core
/client/JsArray;)([JavaScript object(10448)]): Cannot read property 'NaN' of 
undefined
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:299)
    at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
    at com.googlecode.gwt.charts.client.ChartObject$.setSelection$(ChartObject.java)
    at com.googlecode.gwt.charts.client.corechart.CoreChartWidget.setSelection(CoreChartWidget.java:90)

What operating system, browser and version are you using?
Any browser.

Original issue reported on code.google.com by atmbestp...@gmail.com on 7 Jan 2014 at 6:33

GoogleCodeExporter commented 9 years ago
Hi, does anyone have an explanation for this yet?

Original comment by atmbestp...@gmail.com on 10 Jan 2014 at 4:10

GoogleCodeExporter commented 9 years ago
Class Selection rewritten and tested.
Additionally, created method setSelection(Selection... ) which allow simpler 
selection such as:

chart.setSelection(Selection.create(1, null));

Note: don't forget you can't set a selection unless the chart is ready (see 
ReadyEvent).

Original comment by rglafo...@gmail.com on 27 Aug 2014 at 3:51

GoogleCodeExporter commented 9 years ago

Original comment by rglafo...@gmail.com on 28 Aug 2014 at 11:10

GoogleCodeExporter commented 9 years ago

Original comment by rglafo...@gmail.com on 3 Sep 2014 at 11:07