8000 Too many month columns · Issue #34 · giocomai/ganttrify · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Too many month columns #34

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

Closed
RS-JS opened this issue Aug 24, 2022 · 3 comments
Closed

Too many month columns #34

RS-JS opened this issue Aug 24, 2022 · 3 comments

Comments

@RS-JS
Copy link
RS-JS commented Aug 24, 2022

I have an odd issue

I;ve tested it with two rows.

My data is as follows

Screenshot 2022-08-24 at 16 55 21

and the code I am using is as follows

`gantt_gg<-ganttrify(project = covRecords2,
hide_wp = TRUE,
project_start_date ="1918-01",
font_family = "Roboto Condensed")

ggplot2::ggsave(filename = "my_wide_gantt.png",
plot = gantt_gg,
width = 12,
height = 4,
bg = "white") #otherwise you'll get transparent background`

On the output, however, i have way more columns for months as you can see

my_wide_gantt

@giocomai
Copy link
Owner
giocomai commented Sep 3, 2022

Unfortunately (or, perhaps, fortunately), I cannot reproduce your issue.

However, I still see issues with your code. In particular, if you input dates as dates, rather than month numbers, you should set by_date to TRUE, as described in the Readme. See reprex below.

If this fixes your issues, you can close this issue. If not, please add more details (ideally, a piece of code I can use to reproduce the issue, similar to the code you see below).

library("ganttrify")

project_df <- tibble::tribble(~wp, ~activity, ~start_date, ~end_date,
                              "WW1 Journals", "Aussie", "1918-01-01", "1918-10-01",
                              "WW1 Journals", "Kia Ora", "1918-03-15", "1918-12-15")


gantt_gg <- ganttrify(project = project_df,
                      hide_wp = TRUE,
                      project_start_date ="1918-01-01",
                      by_date = TRUE,
                      month_number_label = FALSE,
                      font_family = "Roboto Condensed")

gantt_gg

ggplot2::ggsave(filename = "my_wide_gantt.png",
                plot = gantt_gg,
                width = 12,
                height = 4,
                bg = "white") 

Created on 2022-09-03 with reprex v2.0.2

@RS-JS
Copy link
Author
RS-JS commented Sep 8, 2022

I got it working; the problem was further up I had this line

#format Date
covRecords$Date <- as.Date(covRecords$Date)

I took it out and it now works

@giocomai
Copy link
Owner
giocomai commented Sep 8, 2022

I see. The reason why this column needs to be of class character, rather than date, is because it is made to accept also dates given as months (e.g. "2022-09" to refer to August 2022, without needing to say the exact day).

In brief, the issue here is that the package didn't give a meaningful error message, which would have made it easy for you to fix this in a few minutes. So this falls under issue 11: #11

Hopefully I'll deal with in the coming months.

@giocomai giocomai closed this as completed Sep 8, 2022
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

2 participants
0