Last chance! 50% off unlimited learning
Sale ends in
Configure options for the dygraph series legend.
dyLegend(dygraph, show = c("auto", "always", "onmouseover", "follow",
"never"), width = 250, showZeroValues = TRUE, labelsDiv = NULL,
labelsSeparateLines = FALSE, hideOnMouseOut = TRUE)
Dygraph to configure legend options for.
When to display the legend. Specify "always" to always show the legend. Specify "onmouseover" to only display it when a user mouses over the chart. Specify "follow" to have the legend show as overlay to the chart which follows the mouse. The default behavior is "auto", which results in "always" when more than one series is plotted and "onmouseover" when only a single series is plotted.
Width (in pixels) of the div which shows the legend.
Show zero value labels in the legend.
Show data labels in an external div, rather than on the graph. This value should be a div element id.
Put a <br/> between lines in the label string.
Often used in conjunction with labelsDiv
.
Whether to hide the legend when the mouse leaves the
chart area. This option applies when show
is set to "onmouseover".
Note that this also affects the hiding of the dyHighlight
on
mouse out.
A dygraph with customized legend options
# NOT RUN {
library(dygraphs)
dygraph(nhtemp, main = "New Haven Temperatures") %>%
dySeries("V1", label = "Temperature (F)") %>%
dyLegend(show = "always", hideOnMouseOut = FALSE)
# }
Run the code above in your browser using DataLab