import React from 'react'; import { Chart as ChartJS, CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend, } from 'chart.js'; import { Line } from 'react-chartjs-2'; ChartJS.register( CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend ); const options = { responsive: true, plugins: { legend: { display: false, }, title: { display: false, }, }, }; export default function CpuChart({chart_dataset}) { const labels = Object.keys(chart_dataset); const data = { labels, datasets: [ { label: 'Загрузка CPU', data: Object.values(chart_dataset), borderColor: '#ff9f43', backgroundColor: 'rgba(255, 99, 132, 0.5)', } ], }; return ; }