I am trying to build a date range bar graph usins ggplot2 (R) in the spirit of:

I have followed a thread but I am completely unable to reproduce the results with dates.
If I understood it correctly, for each "id", the bar length is determined by the smallest and largest "value" in the database.
Here is a minimally working example of my data:
# Example dataframe
DF <- data.frame(Name = as.factor(c("1.Project1", "2.Project2", "3.Project3", "4.Project4")),
                 CreationTime = as.POSIXct(c("2019-12-10 13:22:20", "2019-12-17 12:25:48", "2020-01-02 13:02:57", "2020-01-14 08:37:10")),
                 LastActivity = as.POSIXct(c("2019-12-17 10:42:17 ", "2020-01-02 13:27:10", "2021-02-11 11:32:45", "2023-05-03 07:41:38")),
                 Status = as.factor(c("Prod", "Prod", "Dev", "Complete")))

# From wide to long
DFGather <- DF %>% tidyr::gather(key="Time", value="Value", 2:3)

# Generate plot
ggplot2::ggplot(DFGather, aes(x = Value, y = Name, fill = Status)) +
  ggplot2::geom_col() +
  ggplot2::coord_cartesian(xlim = c(min(DFGather$Value),max(DFGather$Value))) +
  ggplot2::scale_x_datetime(date_breaks = "3 months", labels = scales::label_date_short())

I have also tried converting POSIXct dates to integers but it didn't change my output:
DFGather$Value <- as.integer(format(DFGather$Value,"%Y%m%d"))

Thanks for the support,
C.

ggplot2: Date range bar graph
A quick and dirty approach using geom_segment.

ggplot2::ggplot(DF, ggplot2::aes(x = CreationTime, xend = LastActivity, y = Name, yend = Name, colour = Status)) +
  ggplot2::geom_segment(linewidth = 15) +
  ggplot2::coord_cartesian(xlim = c(min(DFGather$Value),max(DFGather$Value))) +
  ggplot2::scale_x_datetime(date_breaks = "3 months", labels = scales::label_date_short())


Created on 2023-06-01 with reprex v2.0.2
