Peter Tiny
Posts: 3
Joined: Wed May 13, 2020 10:54 am

Gantt translation of dateTimeLabelFormats.week

Hi,
I know how to translate 'Week' on xAxis og the Gantt : using

Code: Select all

dateTimeLabelFormats: {
                week: {
                    list: ['Semaine %W', 'S%W' ]
                    }
                },
But it doesn't work on the top header line 'week' when you zoom to a day view.
The upper header line still display "Week xx".

Maybe another entry, like 'list' exists in the week property of dateTimeLabelFormats ?

Thanks a lot for the support
Peter T
karolkolodziej
Posts: 895
Joined: Mon Mar 02, 2020 10:11 am

Re: Gantt translation of dateTimeLabelFormats.week

HI Peter!
Welcome to our forum and thanks for contacting us with your question!

There is no need to add this list array, you can simply leave it in this object as I did it in the demo below.
Here you can read more about formating data: https://api.highcharts.com/gantt/xAxis. ... belFormats

Live demo: https://jsfiddle.net/BlackLabel/2k5vz0xp/

Let me know if that was what you were looking for!
Regards!
Peter Tiny
Posts: 3
Joined: Wed May 13, 2020 10:54 am

Re: Gantt translation of dateTimeLabelFormats.week

Hi Karol,
Thanks for your response but it's not the same.
For less than 2 months : it will display "Semaine %W" : https://jsfiddle.net/yhrckoas/
But if you add 1 month, it will show you the shortcut version "S%W"

But if you zoom on TWO WEEKS period, it will show you "Week %W" and days !!! (no translation for that ?)

Regards
karolkolodziej
Posts: 895
Joined: Mon Mar 02, 2020 10:11 am

Re: Gantt translation of dateTimeLabelFormats.week

Now I get it!

When you would like to change the upper part of this x-axis you have to create an array with two objects.
Inside the second object, using the label formatter function you can change the text "Week" based on some if statement.
Here you can read about this function: https://api.highcharts.com/gantt/xAxis.labels.formatter
Live demo: https://jsfiddle.net/BlackLabel/ub40s6kj/

Feel free to contact us if further needed.
Regards!

Return to “Highcharts Usage”