Niceley
Posts: 47
Joined: Fri May 06, 2022 7:28 am

Change the Label when zoomed

Hi, i wanted to know if it was possible to change the label of a timeline when ur zoomed ?
With zoom :
Image
Without zoom :
Image

I would like to have the same label every tick ?
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Change the Label when zoomed

Hello,

If you would like to display only years on your timeline, you can use this API option: https://api.highcharts.com/highcharts/x ... belFormats

Just change the default code to this one:

Code: Select all

dateTimeLabelFormats: {
          millisecond: '%Y',
          second: '%Y',
          minute:'%Y',
          hour: '%Y',
          day: '%Y',
          week: '%Y',
          month: '%Y',
          year: '%Y'
        }
Best regards!
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Usage”