Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable range selection buttons?

Tags:

highcharts

I am using highstock charts for stock charts. In my charts i have a buttons like 1D,5D, 6M, 3YR, 10YR and YTD. When i resize the chart (ipad portrait mode), 3yr,10yr and YTD buttons are coming out of the chart. there is no enough room for buttons in chart.So i need to disable few buttons and show only 1D,5D and YTD buttons in chart.

on desktop mode: enter image description here

On ipad portrait mode:

enter image description here

Can you suggest me how to do this?

Thanks in Advance.

like image 595
user2333363 Avatar asked Jan 19 '26 10:01

user2333363


1 Answers

To disable the range selector, you can use this code:

rangeSelector: {
    enabled: false
}

and to modify it's buttons, you can use this code;

rangeSelector: {
    buttons: [{
        type: 'day',
        count: 3,
        text: '3d'
     }, {
        type: 'week',
        count: 1,
        text: '1w'
     }, {
        type: 'month',
        count: 1,
        text: '1m'
     }, {
        type: 'year',
        count: 1,
        text: '1y'
     }, {
        type: 'all',
        text: 'All'
     }],
     selected: 3
}

Maybe less number of buttons can resolve your issue.

like image 175
Navid Farhadi Avatar answered Jan 21 '26 01:01

Navid Farhadi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!