I have two questions about my Gantt-chart
I'm plotting via Ggplot2
's geom_segment
function:
First of all, the time-axis is scaled based on the data points, which means sometimes one step counts for 1:15
hours and the other for like 15 minutes. How do I get a constant 00:00
- 24:00
scaled timeline?
Second, when a task starts at 23:50
and its has a duration of 30 minutes, which makes the ending time 00:20
, it is plotted from 00:20
- 23:50
(almost a whole day) instead of 23:50
till the end of the x-axis (which should be 24:00
). Because the data then reaches the next day and I'm plotting for only one day, the time after 24:00
is not required to be plotted.
This is the code I'm using now:
ggplot(GanttArrNBStairs1208) +
geom_segment(aes(x=Arr_GSE_Start, xend = Arr_GSE_End,
y=`Arrival Trip Number`, yend=`Arrival Trip Number`,
colour=LDA_Pier_Final),
size = 1) +
theme(axis.text.x = element_text(angle = 90, hjust = 1))
Here is a picture of my chart: