我正在开展长期项目,在新版本的开头,我将Highstock版本从1.3.8更新为2.1.2。我没有在StockChart配置中进行任何重大更改,但我注意到导航的最小和最大设置不能像以前版本的Highstock一样工作。所以,这里是图表与旧版本和新版本的比较:
您可以在新版本中看到导航不会为导航应用 min 值。
此外,我在jsfiddle中重现了这个问题,这里是代码:
$(function () {
var chart = new Highcharts.StockChart({
chart: {
renderTo: 'container'
},
navigator: {
xAxis: {
type: 'datetime',
ordinal: false,
min: Date.UTC(2015, 0, 28),
max: Date.UTC(2015, 1, 26)
},
series: {
data: [
[Date.UTC(2015, 0, 21), 0.1],
[Date.UTC(2015, 0, 30), 2.84],
[Date.UTC(2015, 1, 2), 2.79],
[Date.UTC(2015, 1, 3), 2.79],
[Date.UTC(2015, 1, 4), 3.04],
[Date.UTC(2015, 1, 5), 3.04],
[Date.UTC(2015, 1, 10), 1.70],
[Date.UTC(2015, 1, 11), 1.67]
]
}
},
xAxis: {
type: 'datetime',
ordinal: false,
min: Date.UTC(2015, 0, 28),
max: Date.UTC(2015, 1, 26)
},
series: [{
name: 'Serie1',
data: [
[Date.UTC(2015, 0, 21), 0.1],
[Date.UTC(2015, 0, 30), 2.84],
[Date.UTC(2015, 1, 2), 2.79],
[Date.UTC(2015, 1, 3), 2.79],
[Date.UTC(2015, 1, 4), 3.04],
[Date.UTC(2015, 1, 5), 3.04],
[Date.UTC(2015, 1, 10), 1.70],
[Date.UTC(2015, 1, 11), 1.67]
]
}]
});
});

<div id="container"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="http://code.highcharts.com/stock/modules/exporting.js"></script>
<script type="text/javascript" src="http://www.highcharts.com/samples/data/usdeur.js"></script>
&#13;
你能帮我配置一下Highstock的行为与以前的版本一样吗?我错过了一些配置参数吗?这是新版本的正常行为还是一个错误?