Stacked-area is a graphing component for creating stacked area visualizations of data.
To instantiate a graph, you need to provide
-
A target dom element
-
A list of data series
-
An options object (optional)
var graph = new StackedGraph(elem, series, { /*options*/ } );
The series data should be and array of series objects each having the following attributes
- name {String, optional}
- color {String, optional}
- highlightColor {String, optional}
- points {Array}
The points array contains the actual data for the series. Each point should have the attributes
- x {Number}
- y {Number}
Once you have instantiated a graph, there is a set of methods available for zooming, getting values etc.
Set the data series and redraw the graph
Get the value of the currently highlighted region at position {x}
Pan to x value
Zoom to x range
Get which series is currently highlighted
Highlight a contiguous subset of the domain of the graph
Draw or redraw the graph