mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-18 03:06:16 +01:00
improve y axis annoyances on charts
This commit is contained in:
@@ -192,7 +192,7 @@ export function useYaxisWidth(chartRef: React.RefObject<HTMLDivElement>) {
|
||||
if (yAxisElement) {
|
||||
// console.log('yAxisElement', yAxisElement)
|
||||
clearInterval(interval)
|
||||
setYAxisWidth(yAxisElement.getBoundingClientRect().width + 24)
|
||||
setYAxisWidth(yAxisElement.getBoundingClientRect().width + 22)
|
||||
}
|
||||
}, 16)
|
||||
return () => clearInterval(interval)
|
||||
@@ -221,3 +221,7 @@ export function useClampedIsInViewport(options: HookOptions): [boolean | null, C
|
||||
export function toFixedWithoutTrailingZeros(num: number, digits: number) {
|
||||
return parseFloat(num.toFixed(digits)).toString()
|
||||
}
|
||||
|
||||
export function toFixedFloat(num: number, digits: number) {
|
||||
return parseFloat(num.toFixed(digits))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user