1
votes

I am trying to make 5M as my default rangeSelector but it seems that it keeps on insisting the 'all' on the selector.

   rangeSelector: {
            enabled: true,
            buttons: [{
                    count: 2,
                    type: 'minute',
                    text: '2M'
                }, {
                    count: 5,
                    type: 'minute',
                    text: '5M'
                }, {
                    count: 15,
                    type: 'minute',
                    text: '15M'
                }, {
                    count: 30,
                    type: 'minute',
                    text: '30M'
                }, {
                    count: 3,
                    type: 'hour',
                    text: '3H'
                }, {
                    count: 1,
                    type: 'day',
                    text: '1D'
                }, {
                    count: 30,
                    type: 'day',
                    text: '30D'
                }, {
                    type: 'all',
                    text: 'All'
                }],
            selected: 5,
        },

Can someone tell me where my code goes wrong ? Appreciate your help.

1

1 Answers

3
votes

I have fixed my problem by adding allButtonsEnabled: true and changing selected: 1. I just got a bit confused a while ago

   rangeSelector: {
            enabled: true,
            allButtonsEnabled: true,
            buttons: [{
                    count: 2,
                    type: 'minute',
                    text: '2M'
                }, {
                    count: 5,
                    type: 'minute',
                    text: '5M'
                }, {
                    count: 15,
                    type: 'minute',
                    text: '15M'
                }, {
                    count: 30,
                    type: 'minute',
                    text: '30M'
                }, {
                    count: 3,
                    type: 'hour',
                    text: '3H'
                }, {
                    count: 1,
                    type: 'day',
                    text: '1D'
                }, {
                    count: 30,
                    type: 'day',
                    text: '30D'
                }, {
                    type: 'all',
                    text: 'All'
                }],
            selected: 1,
        },