Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gantt x-axis display #510

Closed
pubmania opened this issue Apr 10, 2017 · 6 comments
Closed

gantt x-axis display #510

pubmania opened this issue Apr 10, 2017 · 6 comments

Comments

@pubmania
Copy link

Hi,

First off many thanks for such useful tool.

I was using the online live editor and I encountered a weird issue. The gantt I was trying to create was as shown below:

gantt 
dateFormat DD/MM/YY
title PostNord Deployment Plan

Section Common
Task 1 :done,10/03/17, 13/03/17
Task 2 :done, 02/12/16, 13/03/17
Task 3 :done, 02/12/16, 13/12/16
Section Section_1
Design :02/12/16, 22/02/17
Design 2 :crit, 02/12/16, 06/03/17
Design 3 :crit, 02/12/16, 18/03/17

Order wave 1 :20/03/17, 14/04/17
Order wave 2 :crit, 27/03/17, 21/04/17
Order wave 3 :crit, 03/04/17, 28/04/17

Deployment Wave 1 :17/04/17, 23/06/17
Deployment Wave 2 :24/04/17, 09/06/17
Deployment Wave 3 :crit,01/05/17, 07/07/17

Section Section_2
Design :crit, 23/02/17, 15/03/17
Order and Deliver : 20/03/17, 28/04/17
Deployment :01/05/17, 16/08/17

When I use this the Week changes to year for first tick of x-axis (Jan) and then changes to mm-yy for March and April, then changes back to W-17 for May and then again to mm-yy for rest of the months.

I also found that changing the duration of last task to June or July changes everything back to W-nn format. I am also trying to find out a way to change the resulting image to show whole of x-axis as just mmm (Jan, Feb, Mar etc.) and reading some of the previous issues but haven't really understood the axisFormat thing that people have referred to and would really appreciate some guidance on it.

@ydprtm
Copy link

ydprtm commented Apr 12, 2017

+1

@pubmania
Copy link
Author

pubmania commented Apr 12, 2017

@knsv

actually while I was not getting anywhere with my problem, I came across timeline from vis js library which appears to be doing the same thing and then an R-markdown package based on this js library called timevis which can help create a timeline fairly easily. I was able to create some really nice visuals of gantt using variations of text below on rstudio:

{r echo = FALSE}
library(timevis)

dataGroups <- read.csv(header = TRUE, text = "
id,content,group,start,end,style
1,Task 1,Common,2016-12-02,2017-03-17,NA
2,Task 2,Common,2016-12-02,2017-02-17,background-color: red;color: white
3,Task 3,Common,2016-12-02,2017-03-17,NA
4,Task 4,Section 1,2016-12-02,2017-02-17,background-color: red
5,Task 5,Section 1,2017-03-17,2017-04-07,NA,NA
6,Task 6,Section 2,2017-03-17,2017-04-27,NA,NA
7,Task 7,Section 2,2017-04-07,2017-04-27,NA,NA
8,Task 8,Section 2,2017-05-07,2017-05-17,background-color: red
9,Task 9,Section 2,2017-06-07,2017-06-20,NA,NA
10,Task 10,Section 3,2017-07-07,2017-07-31,background-color: red
")

groups <- read.delim(header = TRUE, sep = ":", text = "
id: content
Common:Common
Section 1:Section 1
Section 2:Section 2
Section 3:Section 3
")
  
timevis(
  dataGroups,
  groups, 
  showZoom = TRUE,
  zoomFactor = 1,
  fit = TRUE
)

Now as it is all being done using javascript library much like mermaid does using phantomjs, I was wondering if someone can look into creating the solution / fork of timevis into mermaid but using vis.js to create the gantt.

My apologies in advance if this is a very naive expectation or makes no sense but I would much rather be able to use mermaid on atom than open R-Studio.

Thanks again!!!

@knsv
Copy link
Collaborator

knsv commented Apr 13, 2017 via email

@pubmania
Copy link
Author

Hi, with my extremely limited knowledge I did manage to create an html page where if I put CSV for data it will create Gantt chart using timeline module of vis js. I used papaparse js to parse CSV and create json dataset. Code is here and demo is here.

I am hoping someone knowledgeable can now help integrate it with mermaid or atleast give me some pointers on how to go about doing it.

@tylerlong
Copy link
Collaborator

@pubmania I like the work you have done and I created a new issue to track it: #640

mgenereu pushed a commit to mgenereu/mermaid that referenced this issue Jun 25, 2022
Bumps [postcss](https://github.com/postcss/postcss) from 8.3.11 to 8.4.1.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](postcss/postcss@8.3.11...8.4.1)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants