我正在尝试使用 gwt-highchart(使用最新的 gwt-highchart 1.6.0 和 Highstock 2.3.4 版本)将系列添加到我的图表应用程序中。在第三季之前一切似乎都很好。当我尝试添加第三个时,出现此错误:
com.google.gwt.core.client.JavaScriptException: (String)
@org.moxieapps.gwt.highcharts.client.BaseChart::nativeAddSeries(Lcom/google/gwt/core
/client/JavaScriptObject;Lcom/google/gwt/core/client/JavaScriptObject;ZZ)([JavaScript
object(4953), JavaScript object(5135), bool: true, bool: true]): Highcharts error #18:
www.highcharts.com/errors/18
这是我的代码(在循环中运行):
// Create a new serie with a new yAxis
Series newSeries = chart.createSeries().setYAxis(index).setPlotOptions(new LinePlotOptions().setColor(tag.getColor()));
// Set new yAxis options
chart.getYAxis(index).setPlotLines(chart.getYAxis(index).createPlotLine().setValue(0).setWidth(1).setColor(tag.getColor())).setLabels(new YAxisLabels().setEnabled(false)).setTickLength(0).setOffset(60).setStartOnTick(false)
.setEndOnTick(false).setGridLineWidth(0).setMaxPadding(DEFAULT_YAXIS_MAX_PADDING).setMinPadding(DEFAULT_YAXIS_MIN_PADDING)
.setAxisTitle(new AxisTitle().setText(null).setStyle(new Style().setColor(tag.getColor())));
// Add the serie to the chart
chart.addSeries(newSeries.setName("Test " + index));
正如我之前所说,前两个系列没问题,但第三个系列抛出上述异常(当我调试应用程序时,我可以看到新创建的 yAxis 引用)。
这是引发异常的行:
chart.addSeries(newSeries.setName("Test " + index));
谢谢