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

Method getLabelAndValue

src/controllers/controller.scatter.js:52–64  ·  view source on GitHub ↗

* @protected

(index)

Source from the content-addressed store, hash-verified

50 * @protected
51 */
52 getLabelAndValue(index) {
53 const meta = this._cachedMeta;
54 const labels = this.chart.data.labels || [];
55 const {xScale, yScale} = meta;
56 const parsed = this.getParsed(index);
57 const x = xScale.getLabelForValue(parsed.x);
58 const y = yScale.getLabelForValue(parsed.y);
59
60 return {
61 label: labels[index] || categoryLabel(meta, parsed),
62 value: '(' + x + ', ' + y + ')'
63 };
64 }
65
66 update(mode) {
67 const meta = this._cachedMeta;

Callers

nothing calls this directly

Calls 3

getParsedMethod · 0.80
categoryLabelFunction · 0.70
getLabelForValueMethod · 0.65

Tested by

no test coverage detected