username000
Posts: 13
Joined: Tue Mar 01, 2022 4:26 pm

change timeline / add background color

hey guys thanks so much for providing highcharts!

my boss

im currently using https://www.highcharts.com/demo/gantt/r ... grid-light

quick questions:

1. can i apply backgorund color to certain days of the week & background color only to the first column of my grid?

i found that this code provides background color to every 1 in 2 columns

gridLineWidth: 1,
alternateGridColor: 'lightblue',
dateTimeLabelFormats: {
week: {
list: ['Uke %W', 'U%W']
}
}

but id like to apply it to only the very first column( ex. blue) and columns of certains days of the week( ex) weekends (lightgrey) )

2. how can i change the timeline so that the first row shows the month and date? id like to have it to show for every 7days(1week)
ex) oct 14 oct 21 oct 28 and so on...

the image below is a reference of what id like to show!

thank you so much guys. this library is really a life saver!
Attachments
Screen Shot 2022-03-02 at 1.30.26 AM.png
Screen Shot 2022-03-02 at 1.30.26 AM.png (23.82 KiB) Viewed 686 times
Screen Shot 2022-03-02 at 1.30.26 AM.png
Screen Shot 2022-03-02 at 1.30.26 AM.png (23.82 KiB) Viewed 686 times
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: change timeline / add background color

Hi username000,

Thanks for contacting us with your questions.

I'll start with 2). Date in first row can be formatted with dateTimeLabelFormats option. In this case:

Code: Select all

    dateTimeLabelFormats: {
      week: {
        list: ['%b %e']
      }
    }
Because you want to format the top row of x axes, dateTimeLabelFormats option has to be set for second axis in axes array.

When it comes to 1) question, I'm not quite sure what do you want to change. Do you want to set color for x axis labels with specific days of the week?
Demo: https://jsfiddle.net/BlackLabel/u52mxjn6/

Let me know if that was what you were looking for!

One more thing, I said it already in one of your topics, but please avoid creating duplicates, we work as a single support team across all support channels and we're doing our best to answer asap. Do not duplicate questions in multiple topics too. Thanks in advance.

Regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Gantt”