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

Method _updateDatasets

src/core/core.controller.js:727–741  ·  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

725 * @private
726 */
727 _updateDatasets(mode) {
728 if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {
729 return;
730 }
731
732 for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {
733 this.getDatasetMeta(i).controller.configure();
734 }
735
736 for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {
737 this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);
738 }
739
740 this.notifyPlugins('afterDatasetsUpdate', {mode});
741 }
742
743 /**
744 * 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