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

Function categoryLabel

src/controllers/controller.scatter.js:10–14  ·  view source on GitHub ↗

* The label of the point's own category: from the index axis when it is a category axis, * else from the value axis when that one is.

({iScale, vScale}, parsed)

Source from the content-addressed store, hash-verified

8 * else from the value axis when that one is.
9 */
10function categoryLabel({iScale, vScale}, parsed) {
11 const scale = iScale.type === 'category' ? iScale : vScale.type === 'category' ? vScale : null;
12 const value = scale ? parsed[scale.axis] : null;
13 return isFinite(value) ? scale.getLabelForValue(value) : '';
14}
15
16export default class ScatterController extends DatasetController {
17

Callers 1

getLabelAndValueMethod · 0.70

Calls 1

getLabelForValueMethod · 0.65

Tested by

no test coverage detected