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

Method computeTickLimit

src/scales/scale.linear.js:34–41  ·  view source on GitHub ↗

* Returns the maximum number of ticks based on the scale dimension * @protected

()

Source from the content-addressed store, hash-verified

32 * @protected
33 */
34 computeTickLimit() {
35 const horizontal = this.isHorizontal();
36 const length = horizontal ? this.width : this.height;
37 const minRotation = toRadians(this.options.ticks.minRotation);
38 const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;
39 const tickFont = this._resolveTickFontOptions(0);
40 return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));
41 }
42
43 // Utils
44 getPixelForValue(value) {

Callers

nothing calls this directly

Calls 3

toRadiansFunction · 0.85
isHorizontalMethod · 0.65

Tested by

no test coverage detected