| 1 |
define(["dojo/_base/declare", "dojo/_base/lang", "./Default", "./commonStacked"], |
| 2 |
function(declare, lang, Default, commonStacked){ |
| 3 |
|
| 4 |
return declare("dojox.charting.plot2d.Stacked", Default, { |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
getSeriesStats: function(){ |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
var stats = commonStacked.collectStats(this.series, lang.hitch(this, "isNullValue")); |
| 15 |
return stats; |
| 16 |
}, |
| 17 |
|
| 18 |
buildSegments: function(i, indexed){ |
| 19 |
var run = this.series[i], |
| 20 |
min = indexed?Math.max(0, Math.floor(this._hScaler.bounds.from - 1)):0, |
| 21 |
max = indexed?Math.min(run.data.length-1, Math.ceil(this._hScaler.bounds.to)):run.data.length-1, |
| 22 |
rseg = null, segments = [], isNullValue = lang.hitch(this, "isNullValue"); |
| 23 |
|
| 24 |
|
| 25 |
for(var j = min; j <= max; j++){ |
| 26 |
var value = indexed ? commonStacked.getIndexValue(this.series, i, j, isNullValue) : commonStacked.getValue(this.series, i, run.data[j] ?run.data[j].x: null, isNullValue); |
| 27 |
if(!isNullValue(value[0]) && (indexed || value[0].y != null)){ |
| 28 |
if(!rseg){ |
| 29 |
rseg = []; |
| 30 |
segments.push({index: j, rseg: rseg}); |
| 31 |
} |
| 32 |
rseg.push(value[0]); |
| 33 |
}else{ |
| 34 |
if(!this.opt.interpolate || indexed){ |
| 35 |
|
| 36 |
rseg = null; |
| 37 |
} |
| 38 |
} |
| 39 |
} |
| 40 |
return segments; |
| 41 |
} |
| 42 |
|
| 43 |
}); |
| 44 |
}); |