File: dyGroup.Rd

package info (click to toggle)
r-cran-dygraphs 1.1.1.6%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,232 kB
  • sloc: javascript: 10,787; sh: 19; makefile: 15
file content (105 lines) | stat: -rw-r--r-- 4,363 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/group.R
\name{dyGroup}
\alias{dyGroup}
\title{dygraph series group}
\usage{
dyGroup(dygraph, name = NULL, label = NULL, color = NULL, axis = "y",
  stepPlot = NULL, stemPlot = NULL, fillGraph = NULL, drawPoints = NULL,
  pointSize = NULL, pointShape = NULL, strokeWidth = NULL,
  strokePattern = NULL, strokeBorderWidth = NULL,
  strokeBorderColor = NULL, plotter = NULL)
}
\arguments{
\item{dygraph}{Dygraph to add a series definition to}

\item{name}{character vector of the series within data set. If no name is specified then 
series are bound to implicitly based on their order within the underlying 
time series object. This parameter can also be a character vector of length
3 that specifies a set of input column names to use as the lower, value,
and upper for a series with a shaded bar drawn around it.}

\item{label}{Labels to display for series (uses name if no label defined)}

\item{color}{Color for series. These can be of the form "#AABBCC" or 
"rgb(255,100,200)" or "yellow", etc. If not specified then the global 
colors option (typically based on equally-spaced points around a color wheel).}

\item{axis}{Y-axis to associate the series with ("y" or "y2")}

\item{stepPlot}{When set, display the graph as a step plot instead of a line 
plot.}

\item{stemPlot}{When set, display the graph as a stem plot instead of a line
plot.}

\item{fillGraph}{Should the area underneath the graph be filled? This option 
is not compatible with error bars.}

\item{drawPoints}{Draw a small dot at each point, in addition to a line going
through the point. This makes the individual data points easier to see, but
can increase visual clutter in the chart.}

\item{pointSize}{The size of the dot to draw on each point in pixels. A dot 
is always drawn when a point is "isolated", i.e. there is a missing point 
on either side of it. This also controls the size of those dots.}

\item{pointShape}{The shape of the dot to draw. Can be one of the following:
"dot" (default), "triangle", "square", "diamond", "pentagon", "hexagon",
"circle", "star", "plus" or "ex".}

\item{strokeWidth}{The width of the lines connecting data points. This can be
used to increase the contrast or some graphs.}

\item{strokePattern}{A predefined stroke pattern type ("dotted", "dashed", or
"dotdash") or a custom pattern array where the even index is a draw and odd
is a space in pixels. If \code{NULL} then it draws a solid line. The array 
should have an even length as any odd length array could be expressed as 
a smaller even length array.}

\item{strokeBorderWidth}{Draw a border around graph lines to make crossing 
lines more easily distinguishable. Useful for graphs with many lines.}

\item{strokeBorderColor}{Color for the line border used if 
\code{strokeBorderWidth} is set.}

\item{plotter}{A function which plots the series group. See the 
\href{http://dygraphs.com/tests/plotters.html}{dygraphs documentation} for 
additional details on plotting functions.}
}
\value{
Dygraph with additional series
}
\description{
Add a data series group to a dygraph plot. Note that options will use the default 
global setting (as determined by \code{\link{dyOptions}}) when not specified 
explicitly. Importantly, any dySeries options passed can be passed as a vector of values 
and will be replicated across all series named as part of the group. If arguments differ in
length than the number of series named, then the argument vector will be 
cycled across the named series.
}
\details{
NOTE: dyGroup will turn off \code{stackedGraph}, as the option will calculated cumulatives using
all series in the underlying dygraph, not just a subset.

The dyGroup function can also replicated similar arguments across multiple series, or 
be used to apply a grouped custom plotter - i.e., multi-column plotter - to a subset of the
dygraph data series.
}
\note{
See the 
  \href{https://rstudio.github.io/dygraphs/gallery-series-options.html}{online
  documentation} for additional details and examples.
}
\examples{
\dontrun{
library(dygraphs)

lungDeaths <- cbind(ldeaths, mdeaths, fdeaths)

dygraph(lungDeaths, main = "Deaths from Lung Disease (UK)") \%>\%
  dySeries("fdeaths", stepPlot = TRUE, color = "red") \%>\% 
  dyGroup(c("mdeaths", "ldeaths"), drawPoints = TRUE, color = c("blue", "green"))
}   

}