I need to plot a area chart, it contains financial data and I am using plotly to do so. The problem is, plotly has a feature of detecting the time series format and plots even the missing dates by simply extending a linear line until the next available data input. Is it possible to disable this feature and plot only the time series where data is available?
library(plotly)
Datetime <- c(
"2016-01-05 00:00:00",
"2016-01-06 00:00:00",
"2016-01-07 00:00:00",
"2016-01-08 00:00:00",
"2016-01-11 00:00:00",
"2016-01-12 00:00:00",
"2016-01-13 00:00:00",
"2016-01-14 00:00:00",
"2016-01-15 00:00:00",
"2016-01-18 00:00:00",
"2016-01-19 00:00:00",
"2016-01-20 00:00:00",
"2016-01-21 00:00:00",
"2016-01-22 00:00:00",
"2016-01-25 00:00:00",
"2016-01-26 00:00:00",
"2016-01-27 00:00:00",
"2016-01-28 00:00:00",
"2016-01-29 00:00:00",
"2016-02-01 00:00:00")
plotdata <- c(93763,110023,134873,138780,117038,117890,120025,140715,48567,87592,
115852,145189,162258,121456,93643,128475,119310,105771,134946,90386)
volume_data <- data.frame(Datetime, plotdata)
plot_ly(volume_data, x = Datetime, y = plotdata, type = "bar")
This is a basic sample data, If you execute this, you will notice that there are blank spaces in the graph. Though in my execution, I am using area chart, I have presented a sample data with bar chart so that the blank spaces are easier noticed. I understand that plotly recognises the x axis data as timeseries and auto completes the missing data. Is it possible to disable this and plot only the date and time where the data is available?