Skip to contents

https://echarts.apache.org/en/option.html#series-bar

Usage

ec_bar(df, ...)

Arguments

df

A dataframe that can be referenced via ... arguments

...

Additional arguments to be passed to the series

Details

Generates a single bar series or list of series from a dataframe.

See also

Examples


# Including x-value in series data
data <- tibble::tibble(x = 1:5, y = rnorm(5))
series <- ec_bar(data, x, y)

echartr(option = list(
  xAxis = list(type = "value"),
  yAxis = list(type = "value"),
  legend = list(show = TRUE),
  series = series
))
# Including x-value in axis data - requires category type axis data <- tibble::tibble(x = 1:5, y = rnorm(5)) series <- ec_bar(data, y) echartr(option = list( xAxis = list(type = "category", data = data$x), yAxis = list(type = "value"), legend = list(show = TRUE), series = series ))