* @param {string} label * @return {{w:number, h:number}} * @private
(label)
| 589 | * @private |
| 590 | */ |
| 591 | _getLabelSize(label) { |
| 592 | const ticksOpts = this.options.ticks; |
| 593 | const tickLabelWidth = this.ctx.measureText(label).width; |
| 594 | const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation); |
| 595 | const cosRotation = Math.cos(angle); |
| 596 | const sinRotation = Math.sin(angle); |
| 597 | const tickFontSize = this._resolveTickFontOptions(0).size; |
| 598 | |
| 599 | return { |
| 600 | w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation), |
| 601 | h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation) |
| 602 | }; |
| 603 | } |
| 604 | |
| 605 | /** |
| 606 | * @param {number} exampleTime |
no test coverage detected