mjs_bar: metricsgraphics.js bar chart "geom"

Description Usage Arguments Value Note Examples

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()

metricsgraphics documentation built on May 1, 2019, 8:07 p.m.