Learn R Programming

metricsgraphics (version 0.9.0)

mjs_bar: metricsgraphics.js bar chart "geom"

Description

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

Usage

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

Examples

Run this code
data.frame(year=seq(1790, 1970, 10),
           uspop=as.numeric(uspop)) %>%
  mjs_plot(x=year, y=uspop, width=300, height=400) %>%
  mjs_bar()

Run the code above in your browser using DataLab