bar_chart {visachartR} | R Documentation |
bar_chart
Description
R wrapper for @visa/bar-chart via htmlwidgets.
Here is an example of bar-chart in action:
Usage
bar_chart(
data,
ordinalAccessor,
valueAccessor,
groupAccessor = "",
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 bar's categorical property. (similar to x in ggplot) |
valueAccessor |
String. Key used to determine bar's numeric property. (similar to y in ggplot) |
groupAccessor |
String. Key used to determine bar group encoding (e.g., color/texture). |
mainTitle |
String. The dynamic tag of title for the map (or you can create your own separately). See |
subTitle |
String. The dynamic tag for a sub title for the map (or you can create your own separately). See |
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/bar-chart |
... |
All other props passed into the function will be passed through to the chart, see all props for @visa/bar-chart. |
Details
To see all available options for the chart properties/API see @visa/bar-chart.
Value
a visaChart htmlwidget object for plotting a bar chart
Examples
library(dplyr)
bar_chart(BOD, "Time", "demand")
mtcars %>%
sample_n(5) %>%
tibble::rownames_to_column() %>%
bar_chart("rowname", "mpg")