giocomai / ganttrify

Create beautiful Gantt charts with ggplot2
https://ganttrify.europeandatajournalism.eu/
GNU General Public License v3.0
658 stars 62 forks source link

Show only wp through `hide_activity`? #32

Closed andreranza closed 9 months ago

andreranza commented 2 years ago

It might be useful to add a hide_activity parameter similarly to what already in place with hide_wp.

dmkaplan2000 commented 2 years ago

I support this enhancement. As a workaround you can call wp activity and use hide_wp, but in that case you need to modify the line widths and find a way to bold the activity text (which I haven't figured out yet).

diegogradosb commented 1 year ago

I support this enhancement. Is there any workaround or quick hack to hide the activities?

dmkaplan2000 commented 1 year ago
library(tidyverse)
library(ganttrify)

tasks$wp = factor(tasks$wp,levels = unique(tasks$wp))

synth.tasks = tasks |> group_by(wp) |> 
  summarize(activity = wp, 
            start_date = min(start_date),end_date=max(end_date))

synth.spots = spots |> mutate(activity = wp)

ganttrify::ganttrify(project = synth.tasks,spots=synth.spots,
        hide_wp = TRUE,
        project_start_date = project_start,
        font_family = "sans",
        size_activity=8,size_text_relative=1.7)
diegogradosb commented 1 year ago

@dmkaplan2000 Thank you very much! It worked like a charm. To preserve the bold feature, I overwrote the aesthetics: ... + theme(axis.text.y.left = element_text(face="bold"))