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

Wrong labels and colours when activities in different wp have the same name #10

Closed
dvanic opened this issue Jul 22, 2020 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@dvanic
Copy link

dvanic commented Jul 22, 2020

Hi! I'm having a very weird issue which I don't understand - ganttrify seems to be choosing weird lines to bold for my projects!

For example,

mydata <- data.frame(
  stringsAsFactors = FALSE,
  wp = c("Bayesian","Bayesian",
         "Bayesian","Machine","Machine",
         "Machine","BSDSSS","BSDSSS","BSDSSS","BSDSSS","BSDSSS",
         "BSDSSS","FMH","FMH","FMH","FMH",
         "FMH","Short"),
  activity = c("Summarise survey results",
               "Course development","Pilot",
               "Revise","Deliver R","Deliver python",
               "Review2","Begin",
               "Call out",
               "Support","Actual",
               "Review","Begin",
               "Call out 2","Support2",
               "Actual3","Review2",
               "Ongoing"),
  start_date = c("2020-08","2020-09","2020-12",
                 "2020-09","2020-11","2020-11","2020-10","2020-11",
                 "2020-12","2021-01","2021-02","2021-03","2020-09",
                 "2020-12","2020-12","2021-02","2021-03","2020-09"),
  end_date = c("2020-08","2020-11","2020-12",
               "2020-11","2020-11","2020-11","2020-10","2020-11",
               "2021-01","2021-02","2021-02","2021-03","2020-12",
               "2021-01","2021-01","2021-02","2021-03","2020-12"))

ganttrify(mydata,
          project_start_date = "2020-08",
          size_text_relative = 1.2, 
          by_date = TRUE,
          mark_quarters = TRUE,
          font_family = "Roboto Condensed")

Results in this

image

Whereas I was expecting the wp project labels to be bold?

What's going on and how do I fix this?

@giocomai giocomai added the bug Something isn't working label Jul 22, 2020
@giocomai giocomai changed the title Strange choice of which lines to bold Wrong labels and colours when activities in different wp have the same name Jul 22, 2020
@giocomai
Copy link
Owner

I confirm this bug, which happens when activity names have the same name. I will fix it in a future version.

In the meantime, as a workaround, you may want to simply add a space before the name of the activities with the same name in one of the wp, or e.g. give a number to activities, so each of them will have a different name.

Again, this is obviously a bug, thanks for reporting, it will be fixed.

Here example with the workaround:

library("ganttrify")
mydata <- data.frame(
  stringsAsFactors = FALSE,
  wp = c("Bayesian","Bayesian",
         "Bayesian","Machine","Machine",
         "Machine","BSDSSS","BSDSSS","BSDSSS","BSDSSS","BSDSSS",
         "BSDSSS","FMH","FMH","FMH","FMH",
         "FMH","Short"),
  activity = c("Summarise survey results",
               "Course development","Pilot",
               "Revise","Deliver R","Deliver python",
               " Review2"," Begin",
               "Call out",
               "Support","Actual",
               "Review","Begin",
               "Call out 2","Support2",
               "Actual3","Review2",
               "Ongoing"),
  start_date = c("2020-08","2020-09","2020-12",
                 "2020-09","2020-11","2020-11","2020-10","2020-11",
                 "2020-12","2021-01","2021-02","2021-03","2020-09",
                 "2020-12","2020-12","2021-02","2021-03","2020-09"),
  end_date = c("2020-08","2020-11","2020-12",
               "2020-11","2020-11","2020-11","2020-10","2020-11",
               "2021-01","2021-02","2021-02","2021-03","2020-12",
               "2021-01","2021-01","2021-02","2021-03","2020-12"))

ganttrify(mydata,
          project_start_date = "2020-08",
          size_text_relative = 1.2, 
          by_date = TRUE,
          mark_quarters = TRUE,
          font_family = "Roboto Condensed")

Created on 2020-07-22 by the reprex package (v0.3.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants