MCPcopy
hub / github.com/apache/echarts / getSum

Method getSum

src/data/DataStore.ts:496–508  ·  view source on GitHub ↗

* Get sum of data in one dimension

(dim: DimensionIndex)

Source from the content-addressed store, hash-verified

494 * Get sum of data in one dimension
495 */
496 getSum(dim: DimensionIndex): number {
497 const dimData = this._chunks[dim];
498 let sum = 0;
499 if (dimData) {
500 for (let i = 0, len = this.count(); i < len; i++) {
501 const value = this.get(dim, i) as number;
502 if (!isNaN(value)) {
503 sum += value;
504 }
505 }
506 }
507 return sum;
508 }
509
510 /**
511 * Get median of data in one dimension

Callers 4

chordLayoutFunction · 0.45
valueFunction · 0.45
getDataParamsMethod · 0.45
pieLayoutFunction · 0.45

Calls 2

countMethod · 0.95
getMethod · 0.95

Tested by

no test coverage detected