Exported in PDF format, the gantt diagram does not show color


Exported in PDF format, the gantt diagram does not show color
I also configured raw: true, but the export still has no color

This is my example on github:


Hello Qian,
You need to include the styles inside the header or footer parameter:
Here are examples:


wao~thank you so much~
Export is now normal


hello,i have a another question

When I want to drag left and right to adjust the width, I find that it is not good. How should I set it? The example is still the gitbug example above


Hello Qian,
The issue occurs because of the layout configuration. It can be reproduced even in our snippets:

You made the grid scrollable but didn’t specify the horizontal scrollbar (scrollX). If you don’t need it, you can disable the scrollable parameter.
Here is an example:


Thanks, I tried it and it worked. But I have another question. I want to set a width for the left side. Why is gantt.config.grid_width not working? Because the content on the left is too long, I want to set a width, a horizontal scroll bar appears, but it seems that gantt.config.grid_width does not work


Hello Qian,
The grid width depends on several parameters, each of them has a different priority:
• When initializing gantt via gantt.init(), the width of the column is a priority.
• When rendering gantt via gantt.render(), the grid_width is a priority.
• When initializing gantt via gantt.init() and either the width of the column is not specified or is set to ‘*’, the grid_width is a priority.

So, you need to manually increase the width of the columns in the configuration.

Here is the updated snippet:

The horizontal scrollbar in the snippet is attached to the timeline views, so, the grid won’t be scrolled.
If you want to set the scrollbar for each view, you need to create a complex layout:
Unfortunately, if you have complex layouts, there is no way to synchronize both the width and height of the views. The dev team will fix that bug in the future, but I cannot give you any ETA.


Thank you very much for your answer, the current function meets my current needs.
The bug you mentioned is that when I adjust the height up and down, the adjustment cannot be synchronized. Is this a bug?


Hello Qian,
Yes, it is that bug that you cannot synchronize the width or height of the views if you have a complex layout.


Thank you, after this bug is fixed, would you mind sending me a new version? Our company no longer continues to purchase this product, can I enjoy the follow-up guarantee service?


Hello Qian,
Please, contact the Sales team to discuss that question:
They will also need your license ID.


Thank you, I will consult later


Hello, I have a question for advice. When the width and height of my external div change, how does gantt adapt the width and height according to the change of the external div size?


Hello Qian,
Gantt will try to adapt to the sizes of its container.
In the following snippet, you can try resizing the horizontal part between the code and the result. That will change the horizontal container size and Gantt will shrink or expand horizontally:
In the following snippet, you can change the vertical size of the Gantt container: