question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add tick interval option to Gantt charts

See original GitHub issue

Problem and why

I have recently started using mermaid to create Gantt charts for project management. One frustration is that I can’t control how the x axis ticks are drawn. I would like to see weekly ticks on every Friday, but my Gantt chart renders weekly ticks on Sunday instead.

Solution

A simple solution is to allow the user to pass an optional setting to set the scale of the x axis using d3 time intervals. This solution can support other time intervals such as hours, days, weeks, months, etc.

Alternatives

I have not considered any alternatives at this time. I have however looked through the mermaid docs to see if there is an existing way of doing this. I have not found any such method.

Proposed sample

Here is a screenshot of a sample Gantt chart with the current rendering capabilities, and with the proposed changes using the d3.timeFriday interval.

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:29
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
DarkNamicommented, Oct 25, 2022

I have implemented tickInterval in mermaid. But I can’t speak English very well, so I can’t finish section of ‘Content of a pull request’ in CONTRIBUTING.md. ‘Add documentation for it’ is hard for me.

Supported: minute, hour, day, week, month

gantt
    title A Gantt Diagram
    dateFormat  YYYY-MM-DD
    axisFormat  %m-%d
    tickInterval 1day
    excludes    weekends
    section Section
    A task           :a1, 2022-10-01, 30d
    Another task     :after a1  , 20d
    section Another
    Task in sec      :2022-10-20  , 12d
    another task      : 24d

TickOneDay TickOneWeek

2reactions
hikerpigcommented, Apr 21, 2022

I’ve implemented an axisInterval in my pintora’s gantt diagram

It would be useful if mermaid has this - or named tickInterval whatever, too.

axisInterval  1w %% week
axisInterval  1M %% month
Read more comments on GitHub >

github_iconTop Results From Across the Web

xAxis.tickInterval | gantt API Reference - Highcharts API
When using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or...
Read more >
Add tick interval option to Gantt charts - Bountysource
I have recently started using mermaid to create Gantt charts for project management. One frustration is that I can't control how the x...
Read more >
Change the scale of the horizontal (category) axis in a chart
Important: The following scaling options are available only when a category axis is selected. To change the interval between tick marks, in the...
Read more >
Gantt Chart with Nice Date Axis - Peltier Tech
We can use that same data to create a line chart, with the same 7-day axis spacing. The horizontal axis in a line...
Read more >
How to make a Gantt chart in Excel - Office Timeline
In the same Axis Options window under the header Units, you can adjust the spacing between the dates listed at the top of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found