* @return {number} * @private
()
| 980 | * @private |
| 981 | */ |
| 982 | _tickSize() { |
| 983 | const optionTicks = this.options.ticks; |
| 984 | |
| 985 | // Calculate space needed by label in axis direction. |
| 986 | const rot = toRadians(this.labelRotation); |
| 987 | const cos = Math.abs(Math.cos(rot)); |
| 988 | const sin = Math.abs(Math.sin(rot)); |
| 989 | |
| 990 | const labelSizes = this._getLabelSizes(); |
| 991 | const padding = optionTicks.autoSkipPadding || 0; |
| 992 | const w = labelSizes ? labelSizes.widest.width + padding : 0; |
| 993 | const h = labelSizes ? labelSizes.highest.height + padding : 0; |
| 994 | |
| 995 | // Calculate space needed for 1 tick in axis direction. |
| 996 | return this.isHorizontal() |
| 997 | ? h * cos > w * sin ? w / cos : h / sin |
| 998 | : h * sin < w * cos ? h / cos : w / sin; |
| 999 | } |
| 1000 | |
| 1001 | /** |
| 1002 | * @return {boolean} |
no test coverage detected