MCPcopy Create free account
hub / github.com/chartjs/Chart.js / getMaximumSize

Method getMaximumSize

src/platform/platform.base.js:59–66  ·  view source on GitHub ↗

* Returns the maximum size in pixels of given canvas element. * @param {HTMLCanvasElement} element * @param {number} [width] - content width of parent element * @param {number} [height] - content height of parent element * @param {number} [aspectRatio] - aspect ratio to maintain

(element, width, height, aspectRatio)

Source from the content-addressed store, hash-verified

57 * @param {number} [aspectRatio] - aspect ratio to maintain
58 */
59 getMaximumSize(element, width, height, aspectRatio) {
60 width = Math.max(0, width || element.width);
61 height = height || element.height;
62 return {
63 width,
64 height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)
65 };
66 }
67
68 /**
69 * @param {HTMLCanvasElement} canvas

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected