我试图在StockChart中添加第二个Y轴,并使用MoxieappsHigh图表包装器,但没有成功。我需要在图表的右侧添加一个新的轴,并期望下面的代码能够工作:
StockChart chart = new StockChart();
YAxis firstYAxis = chart.getYAxis(0);
firstYAxis.setAxisTitleText("First Y axis");
Series firstSeries = chart.createSeries();
firstSeries.setPoints(/* Imagine lots of points. */);
firstSeries.setYAxis(0); // Not required since 0 is the default Y axis.
chart.addSeries(firstSeries);
YAxis secondYAxis = chart.getYAxis(1);
secondAxis.setOpposite(true); // *Should* put the axis on the right side.
secondYAxis.setAxisTitleText("Second Y axis");
Series secondSeries = chart.createSeries();
secondSeries.setPoints(/* Imagine lots of points. */);
secondSeries.setYAxis(1); // *Should* add the series to the second Y axis.
chart.addSeries(secondSeries);
// Somehow the second series ends up being in the navigator...
chart.setOption("navigator/enabled", true);
chart.setOption("scrollbar/enabled", true);
add(chart);第二个Y轴甚至不呈现。如果我不将第二个系列添加到第二个Y轴,它将显示(如预期的)第一个Y轴上的值。
有人成功地在 StockChart上添加了多个Y轴,这可以告诉我这里做错了什么吗?提前谢谢!
发布于 2013-12-17 12:09:46
我也遇到了同样的问题,似乎GWT-高图表就是问题所在。您必须通过本机调用手动创建YAxises。这是解决办法;
https://stackoverflow.com/questions/12074849
复制相似问题