I am trying to add a chart to a Panel, but I keep getting the same error and I can't find anything on what is causing or how to fix it. Has anyone run into this issue?
chart.addSeries(chart.createSeries()
.setName("Browser share")
.setPoints(new Point[]{
new Point("Firefox", 45.0),
new Point("IE", 26.8),
new Point("Chrome", 12.8)
.setSliced(true)
.setSelected(true),
new Point("Safari", 8.5),
new Point("Opera", 6.2),
new Point("Others", 0.7)
})
);
All I am doing is adding it to a Panel and I get the error above. Just can't pinpoint where the problem is exactly
Last edit: Jaren Damm 2015-09-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looks like you potentially haven't included either the "highcharts.js" or "highstocks.js" file in the main page that is housing your GWT widget. Double check and make sure you've setup the JS files noted in the "Installation" steps:
I am trying to add a chart to a Panel, but I keep getting the same error and I can't find anything on what is causing or how to fix it. Has anyone run into this issue?
Exception caught: Exception caught: Exception caught: Exception caught: (TypeError) @org.moxieapps.gwt.highcharts.client.BaseChart::nativeRenderChart(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;ZZLcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;)([string: 'Chart', JavaScript object(1855), bool: true, bool: false, JavaScript object(2098), JavaScript object(2099), JavaScript object(2100), JavaScript object(2092), JavaScript object(2095), JavaScript object(2091), JavaScript object(2093), JavaScript object(2094), JavaScript object(2096), JavaScript object(2097)]): Unable to get property 'Chart' of undefined or null reference
Here is my chart building code just using dummy data to get it to work.
chart = new Chart()
.setType(Series.Type.PIE)
.setChartTitle(null)
.setPlotBackgroundColor((String) null)
.setPlotBorderWidth(null)
.setPlotShadow(false)
.setPiePlotOptions(new PiePlotOptions()
.setAllowPointSelect(true)
.setCursor(PlotOptions.Cursor.POINTER)
)
.setToolTip(new ToolTip()
.setFormatter(new ToolTipFormatter() {
public String format(ToolTipData toolTipData) {
return "" + toolTipData.getPointName() + ": " + NumberUtils.applyPercentageFormat(toolTipData.getPercentage())
+ "
" + NumberUtils.applyCurrencyFormat(toolTipData.getYAsDouble());
}
})
);
All I am doing is adding it to a Panel and I get the error above. Just can't pinpoint where the problem is exactly
Last edit: Jaren Damm 2015-09-18
Looks like you potentially haven't included either the "highcharts.js" or "highstocks.js" file in the main page that is housing your GWT widget. Double check and make sure you've setup the JS files noted in the "Installation" steps:
http://www.moxiegroup.com/moxieapps/gwt-highcharts/userguide.jsp#installation