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

Function afterDatasetsUpdate

src/plugins/plugin.filler/index.js:15–49  ·  src/plugins/plugin.filler/index.js::afterDatasetsUpdate
(chart, _args, options)

Source from the content-addressed store, hash-verified

13 id: class="st">'filler',
14
15 afterDatasetsUpdate(chart, _args, options) {
16 const count = (chart.data.datasets || []).length;
17 const sources = [];
18 let meta, i, line, source;
19
20 for (i = 0; i < count; ++i) {
21 meta = chart.getDatasetMeta(i);
22 line = meta.dataset;
23 source = null;
24
25 if (line && line.options && line instanceof LineElement) {
26 source = {
27 visible: chart.isDatasetVisible(i),
28 index: i,
29 fill: _decodeFill(line, i, count),
30 chart,
31 axis: meta.controller.options.indexAxis,
32 scale: meta.vScale,
33 line,
34 };
35 }
36
37 meta.$filler = source;
38 sources.push(source);
39 }
40
41 for (i = 0; i < count; ++i) {
42 source = sources[i];
43 if (!source || source.fill === false) {
44 continue;
45 }
46
47 source.fill = _resolveTarget(sources, i, options.propagate);
48 }
49 },
50
51 beforeDraw(chart, _args, options) {
52 const draw = options.drawTime === class="st">'beforeDraw';

Callers

nothing calls this directly

Calls 4

_decodeFillFunction · 0.90
_resolveTargetFunction · 0.90
getDatasetMetaMethod · 0.80
isDatasetVisibleMethod · 0.80

Tested by

no test coverage detected