mjs_line {metricsgraphics} | R Documentation |
metricsgraphics.js linechart "geom"
Description
This function adds a line "geom" to a metricsgraphics.js html widget.
Usage
mjs_line(mjs, area = FALSE, animate_on_load = FALSE, color = NULL,
interpolate = "cardinal")
Arguments
mjs |
metricsgraphics plot object |
area |
fill in area under line? (default: |
animate_on_load |
animate the drawing of the plot on page load? (default: |
color |
line color (hex string or valid HTML color string). Use |
interpolate |
the interpolation function to use when rendering lines. possible values: ("cardinal", "linear", "linear-closed", "step", "step-before", "step-after", "basis", "basis-open", "basis-closed", "bundle", "cardinal-open", "cardinal-closed", "monotone", "basic") |
Value
metricsgraphics object
Note
If you plan on using cusom colors, all lines must have a color value or the result is non-deterministic.
Examples
data.frame(year=seq(1790, 1970, 10),
uspop=as.numeric(uspop)) %>%
mjs_plot(x=year, y=uspop) %>%
mjs_line()