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

Method setDimensions

src/core/core.scale.js:514–534  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

512 call(this.options.beforeSetDimensions, [this]);
513 }
514 setDimensions() {
515 // Set the unconstrained dimension before label rotation
516 if (this.isHorizontal()) {
517 // Reset position before calculating rotation
518 this.width = this.maxWidth;
519 this.left = 0;
520 this.right = this.width;
521 } else {
522 this.height = this.maxHeight;
523
524 // Reset position before calculating rotation
525 this.top = 0;
526 this.bottom = this.height;
527 }
528
529 // Reset padding
530 this.paddingLeft = 0;
531 this.paddingTop = 0;
532 this.paddingRight = 0;
533 this.paddingBottom = 0;
534 }
535 afterSetDimensions() {
536 call(this.options.afterSetDimensions, [this]);
537 }

Callers 1

updateMethod · 0.95

Calls 1

isHorizontalMethod · 0.95

Tested by

no test coverage detected