嗨,我正在使用两个窗格图表http://www.highcharts.com/stock/demo/candlestick-and-volume 我然后在该图表上放了一个 plodBands,发生了什么是乐队影响两个 yAxis 就像在这里http:/ /jsfiddle.net/6sqEd/我注意到这张图表只有一个 xAxis 。
我怎样才能让这个 PlotBands 只解析第一个 yAxis 而不是 BOTH ???
这是代码:
$(function() {
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl- ohlcv.json&callback=?', function(data) {
// split the data set into ohlc and volume
var ohlc = [],
volume = [],
dataLength = data.length;
for (i = 0; i < dataLength; i++) {
ohlc.push([
data[i][0], // the date
data[i][1], // open
data[i][2], // high
data[i][3], // low
data[i][4] // close
]);
volume.push([
data[i][0], // the date
data[i][5] // the volume
])
}
// create the chart
chart = new Highcharts.StockChart({
chart: {
renderTo: 'container',
alignTicks: false
},
rangeSelector: {
selected: 5
},
title: {
text: 'AAPL Historical'
},
xAxis:[{
plotBands : [{
from : 1115856000000,
to : 1128384000000,
color : 'rgba(68, 170, 213, 0.2)',
label : {
text : 'Last quarter\'s value range'
}
}]
}],
yAxis: [{
title: {
text: 'OHLC'
},
height: 200,
lineWidth: 2
}, {
title: {
text: 'Volume'
},
top: 300,
height: 100,
offset: 0,
lineWidth: 2
}],
series: [{
type: 'candlestick',
name: 'AAPL',
data: ohlc,
}, {
type: 'column',
name: 'Volume',
data: volume,
yAxis: 1,
}]
});
});
});