Change Gantt Skins Dynamically


#1

I am using the Gantt chart pro version within our Angular project and I would like to be able to change the theme based on the theme of our angular project. So if our angular app is in dark mode then the gantt should change to the contrast black skin. I tried changing the skin by doing this.gantt.skin = 'contrast_black' and then calling this.gantt.render() but the skin does not change.


#2

Hello,
The gantt.skin property only specifies some parameters for the Gantt skin and for the export modules. Actual styles are specified in the CSS files. If you include several files on the page, the last one will override the changes from the previous ones. But it will not work as you expect.
The solution here is to replace the CSS files. You can see how it works in the official sample:


https://docs.dhtmlx.com/gantt/samples/06_skins/06_dynamic_skin.html


#3

Is the source code available for that example?


#4

Hello,
It seems that the image I attached is displayed properly in the preview form.
I updated the message.
You can check the source code of that page by using the browser tools: