I have recently started experimenting with GANTT charts in Obsidian. It seems useful since you can create internal links, as per this post:
I understand from reading past posts that we may have the possibility to alter the dimensions of the GANTT in the future, or zoom in, etc.
Currently, I am fine with the display, since at this stage I would like it to be a part of some activity reports when exporting PDF. This is what it looks like:
I tried applying styling according to instructions here:
but with no success, since this does not seem to work with GANTT charts.
I also tried applying some CSS snippets, but I have 0 experience with CSS, HTML, etc. I took some inspiration from this post:
But was not successful in applying the styling as per the mermaid documentation:
I then thought about changing the Obsidian appearance, thinking that would affect the styling of the GANTT chart, and therefore making the rendered image in the PDF more readable. And voila!
As you can see, it helped fix the appearance upon exporting to PDF.
Remaining question
However, it would be nice not to have to change the Obsidian appearance every time I want to export. So the question remains: How do I style the GANTT chart? I can break down my question as follows:
Could someone provide a working CSS snippet for changing the following:
1.1 grid.tick
1.2 grid.path
1.3 .taskText
1.4 .taskTextOutsideRight
1.5 .taskTextOutsideLeft
1.6 todayMarker
Is it possible to change the section colors or task colors? If so, can this be done through a CSS snippet?
Is it possible to change the styling of specific sections, tasks, milestones, etc.?
Thank you very much for having the patience to read through this.
@ZKE , Have you seen through this by @mnvwvnm ? It does indeed seem to change most of the stuff you want changed, so it’s just a matter of adapting to your own color scheme?
Is there still any element you want changed, which he has targeted in that CSS file?
Do you know how to navigate the Developer tools sidepanel, and how to locate various elements of your document within that?
.mermaid #w3.done0 {
stroke: #4DAB9A !important;
fill: grey !important;
stroke-width: 1.5 !important;
opacity: 1 !important;
}
"""You could also write simply #w3 or #w5 - without .done0
You can also list multiple tasks in one go - #w3.done0, #w4, w5 {
You can also style milestones this way
You can style the text of individual tasks/milestones using:
I don’t know how to navigate the Developer tools sidepanel very well, but I have played around with the CSS supplied by @mnvwvnm , and it will indeed be sufficient for my purposes.