A quick guide to mastering Gantt charts

Using the Ganttifry package: save time and keep your sanity intact

Camille Grasso

Using the Ganttifry package: save time and keep your sanity intact

Become a gantt wizard and install the magic package πŸ§™β€β™€οΈ

Make sure you have R and RStudio installed on your computer.

To install the development version of the package directly from GitHub, run the following command (in your r console):

# install.packages("remotes")
remotes::install_github("giocomai/ganttrify")

Or from R-universe:

install.packages("ganttrify",
  repos = c(
    "https://giocomai.r-universe.dev",
    "https://cloud.r-project.org"
  )
)

Let’s start: load relevant packages first πŸ€“

library(tidyverse) # for data manipulation, visualization, and analysis
library(ganttrify) # the package of interest here, to create Gantt charts
library(ggplot2)   # for data visualization, you need it because your gantt chart will be a ggplot2 object 
library(MetBrewer) # to have beautiful color palettes for your data visualizations

Optional: use pretty colors 🌈

The MetBrewer package is a tool for adding visually stunning color palettes to your projects. Inspired by art.

Why use MetBrewer?

  • Beautiful palettes inspired by artworks.
  • Supports discrete (categorical) or continuous (gradient) data.
  • A great way to make your charts stand out while staying colorblind-friendly.

How to install and use:

Install the package from CRAN or GitHub:

# Install from CRAN (in your r console)
install.packages("MetBrewer")

# Or install the development version from GitHub
devtools::install_github("BlakeRMills/MetBrewer")

Optional: use pretty colors 🌈

STEP1 - Create a dataframe

To use the ganttrify package, you first need to create a data frame that defines the structure of your Gantt chart. This table should include the following columns:

  • wp: specifies the work packages (WPs) in your project: as each WP can encompass multiple activities, you should have as many rows as there are distinct activities (within each WP).
  • activity: describes the specific activities / tasks
  • start_date and end_date: indicate the time frame for each activity. These columns will be used by ganttrify to position the activity bars on the gantt chart. The dates can be formatted as numbers or as actual dates in YYYY-MM-DD format.

Here is an example of how to create such df using tibble:

CBD_chart <- tibble::tribble(
  ~wp, ~activity, ~start_date, ~end_date,
  "WP1 - Admin", "First admin activity", 1, 2,
  "WP1 - Admin", "Another admin activity", 2, 6,
  "WP1 - Admin", "Last admin activity", 18, 24,
  "WP2 - Science", "Task development", 1, 3,
  "WP2 - Science", "Data acquisition",  3, 4,
  "WP2 - Science", "Data analysis",  3, 8,
  "WP2 - Science", "Paper writing",  6, 10,
  "WP2 - Science", "Task 2", 8, 12,
  "WP2 - Science", "Task 3",  11, 22,
  "WP3 - Dissemination", "International conferences",  4, 24,
  "WP3 - Dissemination", "Local events",  1, 24,
  "WP3 - Dissemination", "Workshop organization",  12, 24
)

STEP2 - Higlight key events with Spots

Spots in ganttrify allow you to mark key milestones or important events in your project timeline. Each spot is defined by:

  • activity: which activity is concerned (make sure to use the same activity name used in your gantt df)
  • spot_type: the type of event (e.g., milestones, deliverables, conferences).
  • spot_date: when the event occurs, relative to the event date. . If you want to add β€˜spots’ (optional), create another dataframe as follow:
CBD_spots <- tibble::tribble(
  ~activity, ~spot_type, ~spot_date,
  # here are the letters I am using: 
  # M: milestones 
  # D: deliverables 
  # IC: international conferences 
  # W: workshops 
  # C : local events 
  # you can choose yours, even a full word/sentence
  "First admin activity", "M", 2,
  "Another admin activity", "M", 6,
  "Last admin activity", "D", 24,
  "Data acquisition", "M", 4, 
  "Data analysis", "M", 5, 
  "Data analysis", "M", 7, 
  "International conferences", "IC", 6,
  "International conferences", "IC", 12,
  "International conferences", "IC", 23,
  "Local events", "C", 16,
  "Workshop organization", "W", 14,
  "Workshop organization", "W", 24
)

STEP3 - Create your gantt chart πŸ“Š

# use the function ganttrify to create your gantt chart (as a ggplot2 object)
ganttrify::ganttrify( 
  project = CBD_chart, # load your df that contain the gantt structure 
  spots = CBD_spots, # load the df defining your key events ('spots')
  project_start_date = "2025-07", # put here the start date of your project 
  font_family = "sans", 
  size_text_relative = 1.4, # relative size of the text (default=1) 
  mark_quarters = TRUE, # defaults to FALSE. 
  # If TRUE, vertical lines are added in correspondence of change of quarter 
  # (end of March, end of June, end of September, end of December). 
  # you can also use mark_years=TRUEto add vertical lines at the end of each year
  alpha_wp = 0.9, # transparency level for your WP bars (1: opaque)
  alpha_activity = 0.6, # transparency level for actitivy bars 
  line_end_wp = "round", # shape of the line ends for WPs (alternatives: "butt" or "square" or "round")
  line_end_activity = "round", # shape of line ends for actitivies 
  spot_size_text_relative = 1.5, # text size of the 'spots' labels
  spot_fill = ggplot2::alpha(c("white"), 0.7), # background color and transparency for the spots 
  spot_padding = ggplot2::unit(0.4, "lines"), # padding around the text in the spot
  colour_palette = MetBrewer::met.brewer("Cross", n=3, type = c("discrete")) # use the metbrewer palette [n=number of desired colors ; type either discrte or continuous, play with it :) ]
)

Refer to the documentation to see all the parckage arguments (type ??ganttrify in your r console).

STEP3 - Create your gantt chart πŸ“Š

STEP3 - Create your gantt chart πŸ“Š

Why using ganttrify ? ✨

  • Simple and intuitive code: easy to learn, even for beginners.
  • Quick to customize: add any change on your gantt chart effortlessly.
  • Save time: no more table headaches: forget about manually adjusting layouts every time you make a tiny/little update.
  • Flexible: with different data structures and customization options.

β€œEt voilΓ !!”

Other available tools for gantt chart creation

  • Lucidchart

  • TeamGantt from Trello

  • Microsoft Excel/Power point/Word (please don’t do that)

CBD Team meeting - 2025/01/28

1 / 14
A quick guide to mastering Gantt charts Using the Ganttifry package: save time and keep your sanity intact Camille Grasso

  1. Slides

  2. Tools

  3. Close
  • A quick guide to mastering Gantt charts
  • Using the Ganttifry package: save time and keep your sanity intact
  • Become a gantt wizard and install the magic package πŸ§™β€β™€οΈ
  • Let’s start: load relevant packages first πŸ€“
  • Optional: use pretty colors 🌈
  • Optional: use pretty colors 🌈
  • STEP1 - Create a dataframe
  • STEP2 - Higlight key events with Spots
  • STEP3 - Create your gantt chart πŸ“Š
  • STEP3 - Create your gantt chart πŸ“Š
  • STEP3 - Create your gantt chart πŸ“Š
  • Why using ganttrify ? ✨
  • β€œEt voilΓ !!”
  • Other available tools for gantt chart creation
  • f Fullscreen
  • s Speaker View
  • o Slide Overview
  • e PDF Export Mode
  • r Scroll View Mode
  • ? Keyboard Help