lineFocusChart {Rnvd3} | R Documentation |
Line chart with focus
Description
Create a HTML widget displaying a line chart with a focus tool.
Usage
lineFocusChart(
data,
xAxisTitle = "x",
yAxisTitle = "y",
margins = list(l = 90),
duration = 500,
useInteractiveGuideline = FALSE,
xAxisTickFormat = ".0f",
yAxisTickFormat = ".02f",
xLabelsFontSize = "0.75rem",
yLabelsFontSize = "0.75rem",
legendPosition = "top",
interpolate = "linear",
xRange = NULL,
yRange = NULL,
rightAlignYaxis = FALSE,
tooltipFormatters = list(value = NULL, header = NULL, key = NULL),
tooltipTransitions = TRUE,
tooltipShadow = TRUE,
width = "100%",
height = NULL,
elementId = NULL
)
Arguments
data |
data used for the chart; it must be a list created with
|
xAxisTitle |
string, the title of the x-axis |
yAxisTitle |
string, the title of the y-axis |
margins |
a named list defining the margins, with names |
duration |
transition duration in milliseconds |
useInteractiveGuideline |
Boolean, a guideline and synchronized tooltips |
xAxisTickFormat |
a d3 formatting string for the ticks on the x-axis; a d3 time formatting string if the x-values are dates, see d3.time.format |
yAxisTickFormat |
a d3 formatting string for the ticks on the y-axis |
xLabelsFontSize |
a CSS measure, the font size of the labels on the x-axis |
yLabelsFontSize |
a CSS measure, the font size of the labels on the y-axis |
legendPosition |
string, the legend position, |
interpolate |
interpolation type, a string among |
xRange |
the x-axis range, a length two vector of the same type as the
x-values, or |
yRange |
the y-axis range, a numeric vector of length 2, or
|
rightAlignYaxis |
Boolean, whether to put the y-axis on the right side instead of the left |
tooltipFormatters |
formatters for the tooltip; each formatter must
be
|
tooltipTransitions |
Boolean, whether to style the tooltip with a fade effect |
tooltipShadow |
Boolean, whether to style the tooltip with a shadow |
width |
width of the chart container, must be a valid CSS measure |
height |
height of the chart container, must be a valid CSS measure |
elementId |
an id for the chart container, usually useless |
Value
A HTML widget displaying a line chart with a focus tool.
Examples
library(Rnvd3)
dat1 <-
lineChartData(x = ~ 1:100, y = ~ sin(1:100/10), key = "Sine wave", color = "lime")
dat2 <-
lineChartData(x = ~ 1:100, y = ~ sin(1:100/10)*0.25 + 0.5,
key = "Another sine wave", color = "red")
dat <- list(dat1, dat2)
lineFocusChart(dat)