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

Function getAllScaleValues

src/controllers/controller.bar.js:7–18  ·  src/controllers/controller.bar.js::getAllScaleValues
(scale, type)

Source from the content-addressed store, hash-verified

5} from class="st">'../helpers/index.js';
6
7function getAllScaleValues(scale, type) {
8 if (!scale._cache.$bar) {
9 const visibleMetas = scale.getMatchingVisibleMetas(type);
10 let values = [];
11
12 for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {
13 values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));
14 }
15 scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));
16 }
17 return scale._cache.$bar;
18}
19
20/**
21 * Computes the class="st">"optimal" sample size to maintain bars equally sized while preventing overlap.

Callers 1

computeMinSampleSizeFunction · 0.85

Calls 3

_arrayUniqueFunction · 0.85
getAllParsedValuesMethod · 0.80

Tested by

no test coverage detected