AddShadedRegion: Add Background Shaded Region to an dygraph

Description Usage Arguments Value Examples

View source: R/AddShadedRegion.R

Description

Specify the region of a dyGraph, this function will add a background shading of color at specified region

Usage

1
AddShadedRegion(dyGraph, highlight, color = "red")

Arguments

dyGraph

A dygraph object to add shading to

color

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

hightlight

A logical vector - must be of the same length as the time of dyGraph

Value

A dygraph with the specified shading

Examples

1
2
3
4
set.seed(1)
p <- PlotTimeSeries(ProcessorTime, "time", c("BN2", "CO4"))
highlight <- sample(c(T, F), length(ProcessorTime$time), replace = TRUE, prob = c(0.1, 0.9))
AddShadedRegion(p, highlight)

jingjin1018/anetimeseries documentation built on May 19, 2019, 10:35 a.m.