mjs_line

0th

Percentile

metricsgraphics.js linechart "geom"

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: FALSE - no)
animate_on_load
animate the drawing of the plot on page load? (default: FALSE - no)
color
line color (hex string or valid HTML color string). Use NULL (the default) to use the default Metrics Graphics colors or if you plan on controlling the colors with CSS.
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.

Aliases
  • mjs_line
Examples
data.frame(year=seq(1790, 1970, 10),
           uspop=as.numeric(uspop)) %>%
  mjs_plot(x=year, y=uspop) %>%
  mjs_line()

Documentation reproduced from package metricsgraphics, version 0.9.0, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.