我有一个demant!如图所示,我尝试在xAxis(highstocks的对象属性)中设置“maxPadding”,但我发现不能,因为你不能在highstocks中做到,只是在highcharts中~~~你能帮助我吗? ?谢谢
你怎么做这样的照片?我可以用什么属性
您可以使用xAxis.overscroll
在xAxis的右侧添加额外的范围。注意,对于chart.xAxis
和naviagtor.xAxis
,该值分别以毫秒为单位设置。
码:
Highcharts.stockChart('container', {
title: {
text: 'AAPL Stock Price'
},
xAxis: {
overscroll: 500000000
},
navigator: {
xAxis: {
overscroll: 500000000
}
},
series: [{
name: 'AAPL',
data: [
[1539264600000, 214.45],
[1539351000000, 222.11],
[1539610200000, 217.36],
[1539696600000, 222.15],
[1539783000000, 221.19],
[1539869400000, 216.02],
[1539955800000, 219.31],
[1540215000000, 220.65],
[1540301400000, 222.73],
[1540387800000, 215.09],
[1540474200000, 219.8],
[1540560600000, 216.3],
[1540819800000, 212.24],
[1540906200000, 213.3],
[1540992600000, 218.86],
[1541079000000, 222.22],
[1541165400000, 207.48],
[1541428200000, 201.59],
[1541514600000, 203.77],
[1541601000000, 209.95],
[1541687400000, 208.49],
[1541773800000, 204.47],
[1542033000000, 194.17],
[1542119400000, 192.23],
[1542205800000, 186.8]
]
}]
});
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<script src="https://code.highcharts.com/stock/modules/export-data.js"></script>
<div id="container" style="height: 400px; min-width: 310px"></div>
演示:
API参考: