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

Method getLabelAndValue

src/controllers/controller.bubble.js:106–119  ·  view source on GitHub ↗

* @protected

(index)

Source from the content-addressed store, hash-verified

104 * @protected
105 */
106 getLabelAndValue(index) {
107 const meta = this._cachedMeta;
108 const labels = this.chart.data.labels || [];
109 const {xScale, yScale} = meta;
110 const parsed = this.getParsed(index);
111 const x = xScale.getLabelForValue(parsed.x);
112 const y = yScale.getLabelForValue(parsed.y);
113 const r = parsed._custom;
114
115 return {
116 label: labels[index] || categoryLabel(meta, parsed),
117 value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'
118 };
119 }
120
121 update(mode) {
122 const points = this._cachedMeta.data;

Callers

nothing calls this directly

Calls 3

getParsedMethod · 0.80
categoryLabelFunction · 0.70
getLabelForValueMethod · 0.65

Tested by

no test coverage detected