Highstocks - How to change the default Zoom

半世苍凉 提交于 2019-11-30 08:21:55

You can change it by the following code:

new Highcharts.StockChart({
    .
    .
    .
    rangeSelector: {
        selected: 0
    }
});

You can take a look the following example: http://jsfiddle.net/QnvrR/.

The default buttons are:

buttons: [{
    type: 'month',
    count: 1,
    text: '1m'
}, {
    type: 'month',
    count: 3,
    text: '3m'
}, {
    type: 'month',
    count: 6,
    text: '6m'
}, {
    type: 'ytd',
    text: 'YTD'
}, {
    type: 'year',
    count: 1,
    text: '1y'
}, {
    type: 'all',
    text: 'All'
}]

So, you have to change the number of the selected according to what you want.

Reference

The zoom Links are index of an array, so if you want select the default render, set this params: rangeSelector: { selected: index_of_array }, in my case for select "all" have setted selected: 5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!