mjs_bar: metricsgraphics.js bar chart "geom"

Description Usage Arguments Value Note Examples

View source: R/bar.r

Description

This function adds a bar "geom" to a metricsgraphics.js html widget.

Usage

1
mjs_bar(mjs, bar_height = 20, binned = TRUE)

Arguments

mjs

metricsgraphics plot object

bar_height

width of bars

binned

is data already binned? (default: TRUE - yes)

Value

metricsgraphics object

Note

metricsgraphics.js currently has "meh" support for bar charts

Examples

1
2
3
4
data.frame(year=seq(1790, 1970, 10),
           uspop=as.numeric(uspop)) %>%
  mjs_plot(x=year, y=uspop, width=300, height=400) %>%
  mjs_bar()

hrbrmstr/metricsgraphics documentation built on May 17, 2019, 5:10 p.m.