【发布时间】:2014-04-22 11:46:15
【问题描述】:
我有一个现有的 Highstock 图表,其中包含一个 xAxis 和一个 yAxis。我的目标是在按下按钮时添加第二个带有数据的 xAxis。 我的代码如下所示:
showDrehzahl: function() {
console.log('add axis function called');
var chart = $('#mycontainer').highcharts();
//Second xAxis
chart.addAxis({
id: 'drehzahl',
title: {
text: 'Drehzahl'
},
lineWidth: 2,
lineColor: '#000000',
opposite: true
},true);
console.log('add series');
console.log(chart);
chart.addSeries({
name: 'Drehzahl',
type: 'spline',
color: '#000000',
xAxis: 'drehzahl',
data: [49.9, 9, 10.4, 12.2, 14.0, 16.0, 13.6, 14.5, 6.4, 14.1, 9.6, 5.4]
});
}
添加系列数据时,找不到 xAxis 对象。我在 id 以及数组长度“xAxis:1”的帮助下尝试了绑定。 甚至可以在 Highstock 图表上应用 addAxis 方法,还是只对 Highcharts 应用?
非常感谢任何帮助!
【问题讨论】:
标签: javascript highcharts axis highstock