MCPcopy
hub / github.com/chartjs/Chart.js / calculateTotal

Method calculateTotal

src/controllers/controller.doughnut.js:293–307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

291 }
292
293 calculateTotal() {
294 const meta = this._cachedMeta;
295 const metaData = meta.data;
296 let total = 0;
297 let i;
298
299 for (i = 0; i < metaData.length; i++) {
300 const value = meta._parsed[i];
301 if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {
302 total += Math.abs(value);
303 }
304 }
305
306 return total;
307 }
308
309 calculateCircumference(value) {
310 const total = this._cachedMeta.total;

Callers 1

updateMethod · 0.95

Calls 1

getDataVisibilityMethod · 0.80

Tested by

no test coverage detected