dyLimit: dygraph limit line

Description Usage Arguments Value Note Examples

View source: R/event.R

Description

Add a horizontal limit line to a dygraph

Usage

1
2
dyLimit(dygraph, limit, label = NULL, labelLoc = c("left", "right"),
  color = "black", strokePattern = "dashed")

Arguments

dygraph

Dygraph to add limit line to

limit

Numeric position of limit.

label

Label for limit. Defaults to blank.

labelLoc

Location for label (left or right).

color

Color of limit line. This can be of the form "#AABBCC" or "rgb(255,100,200)" or "yellow". Defaults to black.

strokePattern

A predefined stroke pattern type ("dotted", "dashed", "dotdash", or "solid") or a custom pattern array where the even index is a draw and odd is a space in pixels. Defaults to dashed.

Value

A dygraph with the specified limit line.

Note

See the online documentation for additional details and examples.

Examples

1
2
3
4
5
6
7
library(dygraphs)

dygraph(presidents, main = "Presidential Approval") %>%
  dyAxis("y", valueRange = c(0, 100)) %>% 
  dyLimit(max(presidents, na.rm = TRUE), "Max",
          strokePattern = "solid", color = "blue")
 

rstudio/dygraphs documentation built on May 28, 2019, 4:34 a.m.