1 
  2 /**
  3  * A stacked graph with special baseline properties
  4  * 
  5  * @class
  6  * @param target
  7  * @augments StackedGraph
  8  * @returns
  9  */
 10 function Streamgraph(target){
 11 	StackedGraph.call(this, target);
 12 }
 13 
 14 Streamgraph.prototype = new StackedGraph();
 15 
 16 Streamgraph.prototype.baselineAt = function(x){
 17 	var value = this._baselineY[x];
 18 	if(value == null){
 19 		value = 0;
 20 		var n = this.timeSeries.length;
 21 		for(var i = 0; i < n; i++){
 22 			for(var j = 1; j <= i; j++){
 23 				value += this.timeSeries[j].valueAt(x);
 24 			}
 25 		}
 26 		value = - value / (n+1);
 27 		this._baselineY[x] = value;
 28 	}
 29 	
 30 	return value;
 31 };
 32 
 33 Streamgraph.prototype.toOrderedSeriesIndex = function(index){
 34 	return this.toInsideOutOrderIndex(index);
 35 };
 36 
 37 
 38 
 39 
 40 
 41