line_chart {visachartR}R Documentation

line_chart

Description

R wrapper for @visa/line-chart via htmlwidgets.

Here is an example of line-chart in action:

example line chart

Usage

line_chart(
  data,
  ordinalAccessor,
  valueAccessor,
  seriesAccessor,
  mainTitle = "",
  subTitle = "",
  accessibility = list(),
  props = list(),
  ...
)

Arguments

data

required to be a valid, R data frame. Data used to create chart, an array of objects which includes keys that map to chart accessors.

ordinalAccessor

String. Key used to determine line's categorical property. (similar to x in ggplot)

valueAccessor

String. Key used to determine line's numeric property. (similar to y in ggplot)

seriesAccessor

String. Key used to determine series (e.g., color/texture).

mainTitle

String. The dynamic tag of title for the map (or you can create your own separately). See highestHeadingLevel prop for how tags get assigned.

subTitle

String. The dynamic tag for a sub title for the map (or you can create your own separately). See highestHeadingLevel prop for how tags get assigned.

accessibility

List(). Manages messages and settings for chart accessibility, see object definition

props

List(). A valid R list with additional property configurations, see all props for @visa/line-chart

...

All other props passed into the function will be passed through to the chart, see all props for @visa/line-chart.

Details

To see all available options for the chart properties/API see @visa/line-chart.

Value

a visaChart htmlwidget object for plotting a line chart

Examples

library(dplyr)
ChickWeight %>%
  filter(Chick==1 | Chick == 4) %>%
  line_chart("Time", "weight", "Chick",
             showBaselineX=FALSE,
             xAxis=list(label="Time",format="0a", visible=TRUE),
             yAxis=list(label="Weight", visible=TRUE, gridVisible=TRUE),
             mainTitle = "Selected chick weight over time")

[Package visachartR version 3.3.0 Index]