Creates Gantt charts with ggplot2.
ganttrify(
project,
spots = NULL,
by_date = FALSE,
exact_date = FALSE,
project_start_date = Sys.Date(),
colour_palette = wesanderson::wes_palette("Darjeeling1"),
font_family = "sans",
mark_quarters = FALSE,
mark_years = FALSE,
size_wp = 6,
hide_wp = FALSE,
size_activity = 4,
size_text_relative = 1,
month_number_label = TRUE,
month_date_label = TRUE,
x_axis_position = "top",
colour_stripe = "lightgray",
alpha_wp = 1,
alpha_activity = 1,
line_end = "round",
month_breaks = 1,
show_vertical_lines = TRUE,
axis_text_align = "right"
)
A data frame. See `ganttrify::test_project` for an example.
A data frame. See `ganttrify::test_spots` for an example.
Logical, defaults to FALSE If FALSE, the the start and end columns in the data frame should correspond to month numbers from the beginning of the project. If TRUE, dates in the format ("2020-10" or "2020-10-01") should be given.
Logical, defaults to FALSE. If FALSE, then periods are always understood to include full months. If FALSE, then exact dates can be given.
The date when the project starts. It can be a date, or a string in the format "2020-03" or "2020-03-01". Ignored if `month_number_date` is set to FALSE.
A character vector of colours or a colour palette.
A character vector of length 1, defaults to "sans". It is recommended to use a narrow/condensed font such as Roboto Condensed for more efficient use of text space.
Logical, 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).
Logical, defaults to FALSE. If TRUE, vertical lines are added in correspondence of change of year (1 January).
Numeric, defaults to 6. It defines the thickness of the line used to represent WPs.
Logical, defaults to FALSE. If TRUE, the lines of the WP are hidden and only activities are shown.
Numeric, defaults to 4. It defines the thickness of the line used to represent activities.
Numeric, defaults to 1. Changes the size of all textual elements relative to their default size. If you set this to e.g. 1.5 all text elements will be 50% bigger.
Logical, defaults to TRUE. If TRUE, it includes month numbering on x axis.
Logical, defaults to TRUE. If TRUE, it includes month names and dates on the x axis.
Logical, defaults to "top". Can also be "bottom". Used only when only one of `month_number_label` and `month_date_label` is TRUE, otherwise ignored.
Character, defaults to "lightgray". This is the stripe colour in the background used in alternate months.
Numeric, defaults to 1. Controls transparency of the line used to represent WPs.
Numeric, defaults to 1. Controls transparency of the line used to represent activities.
Character, defaults to "round". One of "round", "butt", "square". Controls line ends.
Numeric, defaults to 1. It defines if labels for all months are shown or only once every x months. Useful for longer projects.
Logical, defaults to TRUE. If set to FALSE, it hides the thin vertical lines corresponding to month numbers. Useful in particular for longer projects.
Character, defaults to "right". Defines alignment of text on the y-axis is left. Accepted values are "left", "right", "centre", or "center".
A Gantt chart as a ggplot2 object.
# NOT RUN {
ganttrify(ganttrify::test_project)
# }
Run the code above in your browser using DataLab