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

Function getAllScaleValues

src/controllers/controller.bar.ts:84–95  ·  view source on GitHub ↗
(scale: BarScale, type: string)

Source from the content-addressed store, hash-verified

82type BarEdgeOptions = Pick<BarOptions, 'borderSkipped' | 'inflateAmount'>;
83
84function getAllScaleValues(scale: BarScale, type: string): number[] {
85 if (!scale._cache.$bar) {
86 const visibleMetas = scale.getMatchingVisibleMetas(type);
87 let values: number[] = [];
88
89 for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {
90 values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));
91 }
92 scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));
93 }
94 return scale._cache.$bar;
95}
96
97/**
98 * Returns the grouped metasets of the given type on the index scale, in sorted order.

Callers 1

computeMinSampleSizeFunction · 0.85

Calls 3

_arrayUniqueFunction · 0.85
getAllParsedValuesMethod · 0.80

Tested by

no test coverage detected