我正在创建一个高图,希望在其中启用滚动条。我的滚动条不工作了,你知道我可能错过了什么吗?
$('#add_trans').highcharts('StockChart', {
chart: {
borderColor: '#801500',
borderRadius: 20,
borderWidth: 1,
type: 'line',
events: {
load: function(chart) {
this.setTitle(null, {
});
}
},
zoomType: 'x'
},
exporting: {
enabled: true
},
legend: {
enabled: true
},
rangeSelector: {
buttons: [{
type: 'minute',
count: 60,
text: 'hourly'
}, {
type: 'all',
text: 'All'
}],
// selected: 1
},
scrollbar: {
enabled: true
},
navigator : {
enabled : true
},
xAxis: {
labels: {
enabled: true
}
},
yAxis : {
title : {
text : 'Response Time'
},
tickInterval: 100
},
});
错误可能出现的一些错误:
- 您的高图表代码中没有
series:{}
,因此代码中没有图表的数据 - 额外的逗号会导致问题,因此请删除:
代码:
yAxis : {
title : {
text : 'Response Time'
},
tickInterval: 100
},//comma from here if there is no section after it
和:
rangeSelector: {
buttons: [{
type: 'minute',
count: 60,
text: 'hourly'
}, {
type: 'all',
text: 'All'
}], //from here if next statement is commented
// selected: 1
},
如果你的代码仍然不起作用,你可以尝试更改这个:
<script type="text/javascript" src="js/highcharts.js"></script>
这个:
<script type="text/javascript" src="http://www.highcharts.com/js/highstock.js"></script>