mirror of
https://github.com/fankes/beszel.git
synced 2025-10-20 10:19:27 +08:00
hide temp sensors chart legend if more than 11 sensors
This commit is contained in:
@@ -54,6 +54,8 @@ export default function TemperatureChart({
|
|||||||
return chartData
|
return chartData
|
||||||
}, [systemData])
|
}, [systemData])
|
||||||
|
|
||||||
|
const colors = Object.keys(newChartData.colors)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{/* {!yAxisSet && <Spinner />} */}
|
{/* {!yAxisSet && <Spinner />} */}
|
||||||
@@ -108,7 +110,7 @@ export default function TemperatureChart({
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{Object.keys(newChartData.colors).map((key) => (
|
{colors.map((key) => (
|
||||||
<Line
|
<Line
|
||||||
key={key}
|
key={key}
|
||||||
dataKey={key}
|
dataKey={key}
|
||||||
@@ -120,7 +122,7 @@ export default function TemperatureChart({
|
|||||||
isAnimationActive={false}
|
isAnimationActive={false}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
<ChartLegend content={<ChartLegendContent />} />
|
{colors.length < 12 && <ChartLegend content={<ChartLegendContent />} />}
|
||||||
</LineChart>
|
</LineChart>
|
||||||
</ChartContainer>
|
</ChartContainer>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user