mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-18 03:06:16 +01:00
improve chart scaling + add space below docker net chart for tooltip
This commit is contained in:
@@ -191,10 +191,10 @@ export function useYaxisWidth(chartRef: React.RefObject<HTMLDivElement>) {
|
||||
const yAxisElement = chartRef?.current?.querySelector('.yAxis')
|
||||
if (yAxisElement) {
|
||||
// console.log('yAxisElement', yAxisElement)
|
||||
setYAxisWidth(yAxisElement.getBoundingClientRect().width + 22)
|
||||
clearInterval(interval)
|
||||
setYAxisWidth(yAxisElement.getBoundingClientRect().width + 22)
|
||||
}
|
||||
}, 0)
|
||||
}, 16)
|
||||
return () => clearInterval(interval)
|
||||
}, [])
|
||||
return yAxisWidth
|
||||
@@ -217,3 +217,7 @@ export function useClampedIsInViewport(options: HookOptions): [boolean | null, C
|
||||
|
||||
return [wasInViewportAtleastOnce, wrappedTargetRef]
|
||||
}
|
||||
|
||||
export function toFixedWithoutTrailingZeros(num: number, digits: number) {
|
||||
return parseFloat(num.toFixed(digits)).toString()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user