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

Method getLabelAndValue

src/controllers/controller.bar.js:364–377  ·  src/controllers/controller.bar.js::BarController.getLabelAndValue

* @protected

(index)

Source from the content-addressed store, hash-verified

362 * @protected
363 */
364 getLabelAndValue(index) {
365 const meta = this._cachedMeta;
366 const {iScale, vScale} = meta;
367 const parsed = this.getParsed(index);
368 const custom = parsed._custom;
369 const value = isFloatBar(custom)
370 ? class="st">'[' + custom.start + class="st">', ' + custom.end + class="st">']'
371 : class="st">'' + vScale.getLabelForValue(parsed[vScale.axis]);
372
373 return {
374 label: class="st">'' + iScale.getLabelForValue(parsed[iScale.axis]),
375 value
376 };
377 }
378
379 initialize() {
380 this.enableOptionSharing = true;

Callers 1

createTooltipItemFunction · 0.45

Calls 3

isFloatBarFunction · 0.85
getParsedMethod · 0.80
getLabelForValueMethod · 0.65

Tested by

no test coverage detected