Skip to content Skip to sidebar Skip to footer

How To Customize Google Gantt Chart Bar Color In React ??

below is my code where i am caluclating the days based on the start and end dates and I want to customize the bar colors based on the number of days like if its above 15 I need the

Solution 1:

So, firstly you really need to break down your code into functions it's very difficult to read :P

But to answer your question, if you refer to the docs for Google Charts you can see all the available options for setting the colours:

https://developers.google.com/chart/interactive/docs/gallery/ganttchart

what it doesn't mention is there's a palette option where you define an array of colours for it to use.

Also can refer to this thread, even though it doesn't directly use react-google-charts

Customize the bar colors in Google Gantt Charts

Post a Comment for "How To Customize Google Gantt Chart Bar Color In React ??"