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

Function categoryLabel

src/controllers/controller.bubble.js:8–12  ·  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

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

Callers 1

getLabelAndValueMethod · 0.70

Calls 1

getLabelForValueMethod · 0.65

Tested by

no test coverage detected