MCPcopy Create free account
hub / github.com/chartjs/Chart.js / calculateTotal

Method calculateTotal

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

Source from the content-addressed store, hash-verified

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

Callers 1

updateMethod · 0.95

Calls 1

getDataVisibilityMethod · 0.80

Tested by

no test coverage detected