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

Method aspectRatio

src/core/core.controller.js:197–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

195 }
196
197 get aspectRatio() {
198 const {options: {aspectRatio, maintainAspectRatio}, width, height, _aspectRatio} = this;
199 if (!isNullOrUndef(aspectRatio)) {
200 // If aspectRatio is defined in options, use that.
201 return aspectRatio;
202 }
203
204 if (maintainAspectRatio && _aspectRatio) {
205 // If maintainAspectRatio is truthly and we had previously determined _aspectRatio, use that
206 return _aspectRatio;
207 }
208
209 // Calculate
210 return height ? width / height : null;
211 }
212
213 get data() {
214 return this.config.data;

Callers

nothing calls this directly

Calls 1

isNullOrUndefFunction · 0.85

Tested by

no test coverage detected