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

Method _updateDatasets

src/core/core.controller.js:652–666  ·  view source on GitHub ↗

* Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate` * hook, in which case, plugins will not be called on `afterDatasetsUpdate`. * @private

(mode)

Source from the content-addressed store, hash-verified

650 * @private
651 */
652 _updateDatasets(mode) {
653 if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {
654 return;
655 }
656
657 for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {
658 this.getDatasetMeta(i).controller.configure();
659 }
660
661 for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {
662 this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);
663 }
664
665 this.notifyPlugins('afterDatasetsUpdate', {mode});
666 }
667
668 /**
669 * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`

Callers 1

updateMethod · 0.95

Calls 5

notifyPluginsMethod · 0.95
getDatasetMetaMethod · 0.95
_updateDatasetMethod · 0.95
isFunctionFunction · 0.85
configureMethod · 0.65

Tested by

no test coverage detected