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