4

How do I exclude weekends in the visual output? (see circled area below).

I would like to exclude weekends both in counting and visually. Is there a way to do that?

Here is my code,

gantt
    title blabla
    dateFormat  YYYY-DD-MM
    axisFormat %W
    excludes weekends saturday,sunday
    
    section Section
    Task     :a1, 2020-23-03, 5d
    Another task     :after a1  , 15d
    
    section Another
    Task in sec      :2020-20-03  , 12d
    another task      : 24d

Output of code with marked gap

Eric Fail
  • 8,191
  • 8
  • 72
  • 128
klaushipp
  • 75
  • 6

1 Answers1

1

Seems like the newer versions exclude weekends by default

Running this code,

# library(DiagrammeR)
gantt
 dateFormat  YYYY-DD-MM
 title blabla
 # axisFormat %d/%m
 # excludes weekends saturday,sunday

section Section
Task     :a1, 2020-23-03, 5d
Another task     :after a1  , 15d

section Another
Task in sec      :2020-20-03  , 12d
another task      : 24d

I get this,

gantt mermadi

Eric Fail
  • 8,191
  • 8
  • 72
  • 128
  • I interpret the request that they want to exclude weekends in counting then `Monday + 5d = next Monday`. Then the desire is to have the week markers 5 days apart. The solution here includes weekends in counting (see "Another task" starting before the week marker). I cannot find a solution to this problem. – severecci Mar 16 '23 at 12:35
  • I came to this question because I had a related issue where the styling of the excluded days was making milestone and section text illegible. My way around that was to style the excluded sections: `gantt %%{init: {'theme': 'dark','themeVariables': {'excludeBkgColor': '#333'}}}%% title blabla`. – severecci Mar 16 '23 at 13:03