Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Plotly lines : make a graph line break even if there are no records for that gap

Hi all,

I’m facing an issue plotting a time series with plotly in R.
Basically I have my data in a data frame structured like this:

datetime            | measure
2018-04-09 00:40:05 | 3.4
2018-04-09 00:41:00 | 3.9
2018-04-09 00:42:07 | 3.8
2018-04-09 00:43:00 | 3.7
2018-04-09 00:44:00 | 4.2
2018-04-09 00:45:00 | 5.8
2018-04-09 01:15:00 | 5.8

Observations are unevenly spaced, I have one observation at each minute but just roughly, there may be a difference of few seconds.
Then I have larger gaps between observations, in the example I’ve put here there is a 30’ min gap between the last observation and the previous one.
Plotly is obviously connecting these two last observations in the line chart, what I would like to have is actually a blank gap between them instead.

Thank you for your help and consideration!