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

Method update

src/controllers/controller.radar.js:53–79  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

51 }
52
53 update(mode) {
54 const meta = this._cachedMeta;
55 const line = meta.dataset;
56 const points = meta.data || [];
57 const labels = meta.iScale.getLabels();
58
59 // Update Line
60 line.points = points;
61 // In resize mode only point locations change, so no need to set the points or options.
62 if (mode !== 'resize') {
63 const options = this.resolveDatasetElementOptions(mode);
64 if (!this.options.showLine) {
65 options.borderWidth = 0;
66 }
67
68 const properties = {
69 _loop: true,
70 _fullLoop: labels.length === points.length,
71 options
72 };
73
74 this.updateElement(line, undefined, properties, mode);
75 }
76
77 // Update Points
78 this.updateElements(points, 0, points.length, mode);
79 }
80
81 updateElements(points, start, count, mode) {
82 const scale = this._cachedMeta.rScale;

Callers

nothing calls this directly

Calls 4

updateElementsMethod · 0.95
updateElementMethod · 0.80
getLabelsMethod · 0.65

Tested by

no test coverage detected