各位大神,我通过highstock生成折线图,X轴数据过多,需要生成滚动条,但是我按照网上的操作,无论如何都不能生成滚动条,我按照网上一模一样的案例,直接将代码拷到vs工具中,都无法生成滚动条,麻烦大家帮我看看,谢谢了;附网上案例的地址:https://code.hcharts.cn/hcharts.cn/hhhGTX;我使用的是vs2015工具,是不是工具有问题?
另外附上拷到我vs工具中的代码:
<div id="container" style="min-width:800px;height:400px"></div>
<script type="text/javascript">
$(function() {
$('#container').highcharts({
title: {
text: 'Monthly Average Temperature',
x: -20 //center
},
subtitle: {
text: 'Source: WorldClimate.com',
x: -20
},
xAxis: {
categories: ["4.0", "4.1", "4.2", "4.3", "4.4", "4.5", "4.6", "4.7", "4.8", "4.9", "4.10", "4.11", "4.12", "4.13", "4.14", "4.15", "4.16", "4.17", "4.18", "4.19", "4.20", "4.21", "4.22", "4.23", "4.24", "4.25", "4.26", "4.27", "4.28", "4.29", "4.30", "4.31", "4.32", "4.33", "4.34", "4.35", "4.36", "4.37", "4.38", "4.39", "4.40", "4.41", "4.42", "4.43", "4.44", "4.45", "4.46", "4.47", "4.48", "4.49", "4.50", "4.51", "4.52", "4.53", "4.54", "4.55", "4.56", "4.57", "4.58", "4.59", "4.60", "4.61", "4.62", "4.63", "4.64", "4.65", "4.66", "4.67", "4.68", "4.69", "4.70", "4.71", "4.72", "4.73", "4.74", "4.75", "4.76", "4.77", "4.78", "4.79", "4.80", "4.81", "4.82", "4.83", "4.84", "4.85", "4.86", "4.87", "4.88", "4.89", "4.90", "4.91", "4.92", "4.93", "4.94", "4.95", "4.96", "4.97", "4.98", "4.99"],
min: 0,
max: 40
},
scrollbar: {
enabled: true
},
yAxis: {
title: {
text: 'Temperature (°C)'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: '°C'
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [{
name: 'Tokyo',
data: [876, 331, 101, 677000000, 974, 215, 915, 653, 949, 789, 400, 271, 529, 484, 881, 353, 269, 253, 10, 801, 965, 967, 885, 625, 811, 804, 823, 827, 333, 64, 481, 363, 16, 191, 971, 26, 911, 277, 621, 68, 142, 352, 451, 651, 439, 426, 112, 574, 225, 852, 906, 407, 381, 614, 180, 270, 91, 861, 961, 209, 694, 801, 760, 376, 792, 712, 764, 882, 332, 625, 502, 710, 802, 137, 329, 560, 428, 146, 498, 182, 288, 308, 865, 35, 369, 322, 238, 279, 750, 635, 601, 919, 727, 93, 50, 224, 234, 74, 767, 111]
}, {
name: 'New York',
data: [207, 989, 170, null, 98, 804, 783, 945, 40, 1666, 1549, 257, 970, 25, 1752, 203, 1396, 793, 1782, 1676, 1329, 1524, 1225, 1497, 942, 783, 835, 1159, 1130, 1983, 310, 155, 1996, 1261, 1509, 823, 1178, 38, 913, 749, 918, 514, 1408, 147, 1567, 959, 774, 497, 1411, 545, 1673, 11, 1897, 266, 1814, 958, 851, 1822, 1715, 213, 1621, 1622, 1359, 701, 689, 64, 742, 1365, 436, 1777, 176, 646, 1372, 622, 229, 387, 619, 449, 1301, 931, 1185, 1212, 91, 1969, 1814, 1651, 273, 769, 1316, 1914, 14, 1032, 1892, 289, 2, 558, 1811, 137, 651, 226]
}]
});
});
</script>