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

Function _getLabelForValue

src/scales/scale.category.js:25–32  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

23const validIndex = (index, max) => index === null ? null : _limitValue(Math.round(index), 0, max);
24
25function _getLabelForValue(value) {
26 const labels = this.getLabels();
27
28 if (value >= 0 && value < labels.length) {
29 return labels[value];
30 }
31 return value;
32}
33
34export default class CategoryScale extends Scale {
35

Callers

nothing calls this directly

Calls 1

getLabelsMethod · 0.65

Tested by

no test coverage detected