Set the width of a rendered gantt diagram #4188
Replies: 3 comments 4 replies
-
100 upvotes. |
Beta Was this translation helpful? Give feedback.
-
yuzutech/kroki#1413 It may be useful, but I am still confused about how to use it |
Beta Was this translation helpful? Give feedback.
-
After doing some digging I found a way to set the width of any chart using the config. So the config of the gantt diagram is declared here: mermaid/packages/mermaid/src/config.type.ts Line 1207 in 31a287b It doesn't have any implementation for max width or height like the xyChart has, but it does extend the mermaid/packages/mermaid/src/config.type.ts Lines 190 to 199 in 31a287b And here there's a So knowing that I made a config for the default gantt chart example which looks like this: config:
gantt:
useWidth: 100 This seems to be working in the editor but doesn't here on GitHub as you can see below. So I'm not sure if this will work for you, but trying never hurt anyone :p ---
config:
gantt:
useWidth: 500
---
gantt
title A Gantt Diagram
dateFormat YYYY-MM-DD
section Section
A task :a1, 2014-01-01, 30d
Another task :after a1 , 20d
section Another
Task in sec :2014-01-12 , 12d
another task : 24d
|
Beta Was this translation helpful? Give feedback.
-
If I render a gantt diagram with mermaid or kroki it has different widths. How can I specify the width of the rendered image?
Beta Was this translation helpful? Give feedback.
All reactions