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

Method determineDataLimits

src/scales/scale.logarithmic.js:112–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110 }
111
112 determineDataLimits() {
113 const {min, max} = this.getMinMax(true);
114
115 this.min = isFinite(min) ? Math.max(0, min) : null;
116 this.max = isFinite(max) ? Math.max(0, max) : null;
117
118 if (this.options.beginAtZero) {
119 this._zero = true;
120 }
121
122 // if data has `0` in it or `beginAtZero` is true, min (non zero) value is at bottom
123 // of scale, and it does not equal suggestedMin, lower the min bound by one exp.
124 if (this._zero && this.min !== this._suggestedMin && !isFinite(this._userMin)) {
125 this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);
126 }
127
128 this.handleTickRangeOptions();
129 }
130
131 handleTickRangeOptions() {
132 const {minDefined, maxDefined} = this.getUserBounds();

Callers

nothing calls this directly

Calls 3

changeExponentFunction · 0.85
getMinMaxMethod · 0.65

Tested by

no test coverage detected