From 34c83e7c170ec7f2f694b05e9102f74cfa3789ce Mon Sep 17 00:00:00 2001 From: Henry Dollman Date: Fri, 27 Sep 2024 13:08:11 -0400 Subject: [PATCH] hide temp sensors chart legend if more than 11 sensors --- beszel/site/src/components/charts/temperature-chart.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/beszel/site/src/components/charts/temperature-chart.tsx b/beszel/site/src/components/charts/temperature-chart.tsx index 3a3a387..79580a3 100644 --- a/beszel/site/src/components/charts/temperature-chart.tsx +++ b/beszel/site/src/components/charts/temperature-chart.tsx @@ -54,6 +54,8 @@ export default function TemperatureChart({ return chartData }, [systemData]) + const colors = Object.keys(newChartData.colors) + return (
{/* {!yAxisSet && } */} @@ -108,7 +110,7 @@ export default function TemperatureChart({ /> } /> - {Object.keys(newChartData.colors).map((key) => ( + {colors.map((key) => ( ))} - } /> + {colors.length < 12 && } />}