diff --git a/src/Charts/NegativeStatusChart.jsx b/src/Charts/NegativeStatusChart.jsx index 0ee7531..d078f0c 100755 --- a/src/Charts/NegativeStatusChart.jsx +++ b/src/Charts/NegativeStatusChart.jsx @@ -2,13 +2,12 @@ import React from 'react'; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts'; const SystemStatusChart = ({ data }) => { - // Обрезаем массив, оставляя только последние 20 точек const trimmedData = data.slice(-20); return ( { - + ); diff --git a/src/Charts/SystemStatusChart.jsx b/src/Charts/SystemStatusChart.jsx index 0ee7531..5d82137 100755 --- a/src/Charts/SystemStatusChart.jsx +++ b/src/Charts/SystemStatusChart.jsx @@ -5,6 +5,22 @@ const SystemStatusChart = ({ data }) => { // Обрезаем массив, оставляя только последние 20 точек const trimmedData = data.slice(-20); + const CustomTooltip = ({ active, payload, label }) => { + if (active && payload && payload.length) { + return ( +
+

{`Время: ${label}`}

+

{`Значение: ${payload[0].value}`}

+
+ ); + } + return null; + }; + return ( { - - + } />