giocomai / ganttrify

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

Hide date label from axis of the project #14

Closed hasantahir closed 3 years ago

hasantahir commented 3 years ago

Hi,

Many thanks for this very helpful package. Is there a way to hide the project starting date from a figure like the one shown at the bottom of the figure below?

image

giocomai commented 3 years ago

Just to clarify: do you mean removing only the label for the first month (so, same as above, but without "Nov 2020", and everything as normal from "Dec 2020)), or all the dates on the x-axis, or something else completely?

hasantahir commented 3 years ago

Removing all the dates in the format (MMM YYYY) below the chart. The month number above the chart using the argument month_number = TRUE, does the job for me.

giocomai commented 3 years ago

Makes sense. I added a parameter. Update again the package from this repository and the following should work:

library("ganttrify")
ganttrify(project = ganttrify::test_project,
          month_number_label = TRUE,
          month_date_label = FALSE)


# if you prefer month labels on the lower side

ganttrify(project = ganttrify::test_project,
          month_number_label = TRUE,
          month_date_label = FALSE,
          x_axis_position = "bottom")

Created on 2020-11-05 by the reprex package (v0.3.0)

hasantahir commented 3 years ago

Many thanks for addressing this so promptly!

adityaa1729 commented 11 months ago

Hey! Many thanks for producing such a useful package!

As, my query is somewhat related. So thought to post it here.

I want to know if we can switch (interchange) the labels of x-axis i.e, Month number ( month_number_label = TRUE) can come to the bottom and Date (month_date_label = TRUE) to the top? As, by default Month number comes on top, when day number also exists. Ps: I have also gone through the Readme.md document. Unfortunately, no success.

Many thanks in advance, A.