Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dyHighlight

dygraph series mouse-over highlighting


Description

Configure options for data series mouse-over highlighting. Note that highlighting is always enabled for dygraphs so this function is used to customize rather than enable highlighting.

Usage

dyHighlight(dygraph, highlightCircleSize = 3,
  highlightSeriesBackgroundAlpha = 0.5, highlightSeriesOpts = list(),
  hideOnMouseOut = TRUE)

Arguments

dygraph

Dygraph to configure highlighting behavior for.

highlightCircleSize

The size in pixels of the dot drawn over highlighted points.

highlightSeriesBackgroundAlpha

Fade the background while highlighting series. 1=fully visible background (disable fading), 0=hidden background (show highlighted series only).

highlightSeriesOpts

When set, the options from this list are applied to the series closest to the mouse pointer for interactive highlighting. Example: list(strokeWidth = 3). See the documentation on dySeries for additional details on options that can be set.

hideOnMouseOut

Whether to hide the highlighting effects when the mouse leaves the chart area. Note that this also affects the hiding of the dyLegend on mouse out.

Value

A dygraph with customized highlighting options

Note

See the online documentation for additional details and examples.

Examples

library(dygraphs)
lungDeaths <- cbind(ldeaths, mdeaths, fdeaths)
dygraph(lungDeaths, main = "Deaths from Lung Disease (UK)") %>%
  dyHighlight(highlightCircleSize = 5, 
              highlightSeriesBackgroundAlpha = 0.2,
              hideOnMouseOut = FALSE)

dygraphs

Interface to 'Dygraphs' Interactive Time Series Charting Library

v1.1.1.6
MIT + file LICENSE
Authors
Dan Vanderkam [aut, cph] (dygraphs library in htmlwidgets/lib, http://dygraphs.com/), Petr Shevtsov [cre, cph], JJ Allaire [aut], RStudio [cph], Jonathan Owen [aut, cph], Daniel Gromer [aut, cph], Benoit Thieurmel [aut, cph], Kent Laukhuf [ctb], jQuery Foundation [cph] (jQuery library), jQuery contributors [ctb, cph] (jQuery library; authors listed in inst/htmlwidgets/lib/jquery/AUTHORS.txt)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.