Get new jQuery plugins just once a week
July 5, 2012
Morris-js | Draw time-series graphs easily
Morris-js is a lightweight library that uses jQuery and Raphaël to make drawing time-series graphs easy.
The public API of Morris-js is terribly simple. It’s just one function: Morris.Line(options), where options is an object containing some of the following configuration options :-
- data The data to plot. This is an array of objects, containing x and y attributes as described by the xkey and ykeys options.
- xkey A string containing the name of the attribute that contains date (X) values.
- Timestamps are accepted in the form of millisecond timestamps (as returned by Date.getTime().
- ykeys A list of strings containing names of attributes that contain Y values (one for each series of data to be plotted).
- labels A list of strings containing labels for the data series to be plotted (corresponding to the values in the ykeys option).
- lineWidth Width of the series lines, in pixels.
- pointSize Diameter of the series points, in pixels.
- lineColors Array containing colors for the series lines/points
Created by Olly Smith
Morris.js is a lightweight library that uses jQuery and Raphaël to make drawing time-series graphs easy.
Sign up for our weekly newsletter.