我正在创建一个高图,我希望启用滚动条。我的滚动条不起作用,有什么想法,我可能会在这里缺少什么?
$('#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
},
});
答案 0 :(得分:1)
错误可能导致错误:
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>