首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >第二个Y轴在GWT高图表上的股票图表?

第二个Y轴在GWT高图表上的股票图表?
EN

Stack Overflow用户
提问于 2012-08-22 14:00:32
回答 1查看 1.5K关注 0票数 0

我试图在StockChart中添加第二个Y轴,并使用MoxieappsHigh图表包装器,但没有成功。我需要在图表的右侧添加一个新的轴,并期望下面的代码能够工作:

代码语言:javascript
复制
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轴,这可以告诉我这里做错了什么吗?提前谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-12-17 12:09:46

我也遇到了同样的问题,似乎GWT-高图表就是问题所在。您必须通过本机调用手动创建YAxises。这是解决办法;

HighCharts Stock Chart error code 18

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12074849

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档