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

Method constructor

src/core/core.datasetController.js:267–290  ·  view source on GitHub ↗

* @param {Chart} chart * @param {number} datasetIndex

(chart, datasetIndex)

Source from the content-addressed store, hash-verified

265 * @param {number} datasetIndex
266 */
267 constructor(chart, datasetIndex) {
268 this.chart = chart;
269 this._ctx = chart.ctx;
270 this.index = datasetIndex;
271 this._cachedDataOpts = {};
272 this._cachedMeta = this.getMeta();
273 this._type = this._cachedMeta.type;
274 this.options = undefined;
275 /** @type {boolean | object} */
276 this._parsing = false;
277 this._data = undefined;
278 this._objectData = undefined;
279 this._sharedOptions = undefined;
280 this._drawStart = undefined;
281 this._drawCount = undefined;
282 this.enableOptionSharing = false;
283 this.supportsDecimation = false;
284 this.$context = undefined;
285 this._syncList = [];
286 this.datasetElementType = new.target.datasetElementType;
287 this.dataElementType = new.target.dataElementType;
288
289 this.initialize();
290 }
291
292 initialize() {
293 const meta = this._cachedMeta;

Callers

nothing calls this directly

Calls 2

getMetaMethod · 0.95
initializeMethod · 0.95

Tested by

no test coverage detected