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

Function relativeLabelSize

src/scales/scale.linearbase.js:147–152  ·  view source on GitHub ↗
(value, minSpacing, {horizontal, minRotation})

Source from the content-addressed store, hash-verified

145}
146
147function relativeLabelSize(value, minSpacing, {horizontal, minRotation}) {
148 const rad = toRadians(minRotation);
149 const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;
150 const length = 0.75 * minSpacing * ('' + value).length;
151 return Math.min(minSpacing / ratio, length);
152}
153
154export default class LinearScaleBase extends Scale {
155

Callers 1

generateTicksFunction · 0.85

Calls 1

toRadiansFunction · 0.85

Tested by

no test coverage detected