mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
72.2k stars 6.57k forks source link

Gantt graph not showing a bar if ending year is before 1000AD #5184

Open duffercn opened 10 months ago

duffercn commented 10 months ago

Description

I tried to place some historical events on the gantt chart to facilitate understanding, but I find that only when the ending year is greater than 1000AD, the bar will show, otherwise, only text will show in the beginning of the position, but no bar is shown. examples as below: I tried many different platforms, and all are the same.

image

Steps to reproduce

just put this code into any interpreter.

gantt
    dateFormat  YYYY
    title       years

    section celebrity
    Event1          :done, p1, 998, 999
        Event2          :done, p2, 998, 1000
    Event3          :done, p3, 1000, 1001
    Event4          :done, p4, 1000, 1002

Screenshots

image

Code Sample

No response

Setup

Suggested Solutions

No response

Additional Context

No response

damascene commented 7 months ago

I can confirm this issue:

gantt
    title A Gantt Diagram
    dateFormat YYYY
    section Section
        Mr. Hanif           :a1, 0699, 1000
        Mr. Malek           :a2, 0715, 1000
    section Another
        Mr. Hanif           :a1, 0699, 0999
        Mr. Malek           :a2, 0715, 0999
        Mr. Malek           :a2, 990, 1000