我有以下代碼的圖表顯示,我試圖捕捉被點擊的變焦按鈕的文本(這個特定的圖表有4個不同的縮放按鈕設置)來改變圖表標題。儘管智能感知提供了當前嘗試設置buttonText時顯示的每個選項,但我下面顯示的最新努力也失敗了。重置變焦按鈕上的圖表標題點擊高程圖
var buttonText = 60;
$('#chartContainer').highcharts('StockChart', {
events: {
click: function (event) {
buttonText = event.target.rangeSelector.buttons.selected.text;
}
},
rangeSelector: {
buttons: [{
type: 'day',
count: 15,
text: '15D'
}, {
type: 'day',
count: 30,
text: '30D'
}, {
type: 'day',
count: 45,
text: '45D'
}, {
type: 'all',
count: 1,
text: 'All'
}],
selected: 3,
inputEnabled: false
},
title: {
text: symbol + ' -- Last '+ buttonText +' Days'
},
yAxis: [{
title: {
text: 'Price'
},
height: 200,
lineWidth: 2
}, {
title: {
text: 'Volume'
},
top: 300,
height: 100,
offset: 0,
lineWidth: 2
}],
series: [{
type: 'candlestick',
name: symbol,
data: ohlc,
}]
});
我已經移動到重繪事件,但仍無法得到它的工作,感謝您的幫助 – dinotom
@dinotom上面的例子有什麼問題? –