Add label to y axis and adjust step size if percentage

This commit is contained in:
Sean Kelly 2024-04-28 21:22:09 -07:00
parent 8c610bea49
commit 9079224cb3

View File

@ -123,9 +123,10 @@ export function ThresholdBarGraph({
yaxis: {
show: true,
labels: {
formatter: (val: number) => Math.ceil(val).toString(),
formatter: (val: number) => `${Math.ceil(val)}${unit}`,
},
min: 0,
stepSize: unit === "%" ? 5 : undefined,
},
} as ApexCharts.ApexOptions;
}, [graphId, threshold, unit, systemTheme, theme, formatTime]);
@ -365,9 +366,10 @@ export function CameraLineGraph({
yaxis: {
show: true,
labels: {
formatter: (val: number) => Math.ceil(val).toString(),
formatter: (val: number) => `${Math.ceil(val)}${unit}`,
},
min: 0,
stepSize: unit === "%" ? 5 : undefined,
},
} as ApexCharts.ApexOptions;
}, [graphId, systemTheme, theme, formatTime]);