giocomai / ganttrify

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

Enable customisations of order of wp/activity #12

Closed giocomai closed 5 months ago

giocomai commented 4 years ago

Choice could be between alphabetical, and order in which wp/activities provided in input files.

krzyklo commented 3 years ago

I was thinking it might be done via additional columns: eg. Sequence, where user could put integer numbers, of how he would like to structure/sequence, and column Bold, where 0 would mean plain, and 1 would be bold, and hence circumvent this customization issues by giving the user ability to tweak manually..

giocomai commented 3 years ago

Next time I work on this I will likely integrate it with the ggtext package and all such customisations should become much easier.

Tuna-92 commented 5 months ago

Is is possible to manually choose the order of wp/activities on the y-axis?

giocomai commented 5 months ago

The order in which wp/activities first appear is the one that is used. Adding an additional column for reorder is the feature requested here, which I may add, but it should be trivial in most cases to reorder before passing this to ganttrify.

Make sure you have the latest version, as for a brief time between updates this didn't work as expected.

remotes::install_github("giocomai/ganttrify")

library("ganttrify")

project <- tibble::tribble(
  ~wp, ~activity, ~start_date, ~end_date, 
  "b", "bb", 1, 5, 
  "b", "aa", 3, 6,
  "a", "cc", 2, 4, 
  "a", "dd", 5,6
)

ganttrify(
  project = project,
  project_start_date = "2024-04"
)

Created on 2024-04-08 with reprex v2.1.0

giocomai commented 5 months ago

Actually, consistently keeping the order of the input is realistically the best default, so I'll close this one, unless someone sees a good reason to have it.

Tuna-92 commented 5 months ago

Thansk @giocomai update solved my problems