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

Method drawLabels

src/core/core.scale.js:1557–1583  ·  view source on GitHub ↗

* @protected

(chartArea)

Source from the content-addressed store, hash-verified

1555 * @protected
1556 */
1557 drawLabels(chartArea) {
1558 const optionTicks = this.options.ticks;
1559
1560 if (!optionTicks.display) {
1561 return;
1562 }
1563
1564 const ctx = this.ctx;
1565
1566 const area = this._computeLabelArea();
1567 if (area) {
1568 clipArea(ctx, area);
1569 }
1570
1571 const items = this.getLabelItems(chartArea);
1572 for (const item of items) {
1573 const renderTextOptions = item.options;
1574 const tickFont = item.font;
1575 const label = item.label;
1576 const y = item.textOffset;
1577 renderText(ctx, label, 0, y, tickFont, renderTextOptions);
1578 }
1579
1580 if (area) {
1581 unclipArea(ctx);
1582 }
1583 }
1584
1585 /**
1586 * @protected

Callers 2

drawMethod · 0.95
_layersMethod · 0.95

Calls 5

_computeLabelAreaMethod · 0.95
getLabelItemsMethod · 0.95
clipAreaFunction · 0.85
renderTextFunction · 0.85
unclipAreaFunction · 0.85

Tested by

no test coverage detected