Learn R Programming

dygraphs (version 1.1.1.6)

dyCrosshair: The dyCrosshair plugin draws a crosshair line over the point closest to the mouse when the user hovers over the graph. It has a "direction" option which is provided in the R wrapper function and then forwarded to the plugin using the "options" argument to dyPlugin.

Description

The dyCrosshair plugin draws a crosshair line over the point closest to the mouse when the user hovers over the graph. It has a "direction" option which is provided in the R wrapper function and then forwarded to the plugin using the "options" argument to dyPlugin.

Usage

dyCrosshair(dygraph, direction = c("both", "horizontal", "vertical"))

Arguments

dygraph

Dygraph to add plugin to

direction

Crosshair direction. Valid options are: "both", "horizontal", "vertical"

Value

Dygraph with Crosshair plugin enabled

Examples

Run this code
# NOT RUN {
library(dygraphs)
dygraph(ldeaths) %>%
  dyRangeSelector() %>%
  dyCrosshair(direction = "vertical")

# }

Run the code above in your browser using DataLab