R/plot.R

Defines functions plot_history

#' @import dplyr
#' @export
plot_history <- function(con = sqlite_connection()) {
  y <- read_db(con)
  plotly::plot_ly(y, x = ~time, y = ~temp, color = ~name,
                  type = "scatter", mode = "line") %>%
    plotly::layout(hovermode = "x unified",
                   title = list(text = "Room Temperature"),
                   xaxis = list(title = NA),
                   yaxis = list(title = NA, fixedrange = TRUE)) %>%
      plotly::config(modeBarButtonsToRemove = c("zoomIn2d", "zoomOut2d"))
}
itkonen/rally documentation built on Feb. 14, 2022, 5:45 p.m.