I'm trying to make a gantt like chart in R with the code the below code, however when I use plotly the bars won't seem to show (if i hover with my mouse over it I do see the tooltip). I'm trying to use plotly as it gives the option of zooming in and out and shows the tooltips.
############### Library Declarations ###############
libraryRequireInstall("ggplot2");
libraryRequireInstall("plotly");
libraryRequireInstall("scales")
libraryRequireInstall("htmlwidgets")
####################################################
################### Actual code ####################
dataset <- Values
dataset$`Start Time` <- as.POSIXct(dataset$`Time_Move`,format="%Y-%m-%dT%H:%M:%OS", tz ="GMT")
dataset$`End Time`<- as.POSIXct(dataset$`end_move`,format="%Y-%m-%dT%H:%M:%OS", tz="GMT")
g =ggplot(Values ,aes(x=dataset$`Start Time`, y=dataset$`CHEID`, color= dataset$`HNDTYP`)) +
geom_segment(aes(x=dataset$`Start Time`,xend=dataset$`End Time` ,yend=dataset$`CHEID`),size=15) +
scale_colour_discrete(guide=guide_legend(override.aes=list(size=10))) +
scale_x_datetime(breaks = date_breaks("2 hour"), labels=date_format("%m-%d %Hh"))+
theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 1)) +
ggtitle("Time_Move and end_move") + xlab("Time") + ylab("Crane") + theme_bw();
####################################################
############# Create and save widget ###############
p = ggplotly(g);
internalSaveWidget(p, 'out.html');
####################################################
################ Reduce paddings ###################
ReadFullFileReplaceString('out.html', 'out.html', ',"padding":[0-9]*,', ',"padding":1,')
####################################################
what I want is this to show like this but then with the ability to zoom, does anyone has any ideas how I to solve this?
Kind regards,
Mars