版权声明:本文为博主原创文章,未经博主允许不得转载。
1.将引用的highcharts.js地址修改为histock.js的地址
<script type="text/JavaScript" src="http://code.highcharts.com/stock/highstock.js"></script>
2.追加scrollbar属性
scrollbar:{ enabled:true //是否产生滚动条 },
var chart = new Highcharts.Chart({ chart: { renderTo: 'container', type:'line' }, xAxis:{ min:0, //别忘了这里 max:10 }, //设置滚动条 scrollbar: { enabled: true }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4,29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4,29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4,29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }] });