import { ApexOptions } from 'apexcharts'; import React, { useState } from 'react'; import ReactApexChart from 'react-apexcharts'; interface ChartThreeState { series: number[]; } const options: ApexOptions = { chart: { fontFamily: 'Satoshi, sans-serif', type: 'donut', }, colors: ['#3C50E0', '#6577F3', '#8FD0EF', '#0FADCF'], labels: ['Desktop', 'Tablet', 'Mobile', 'Unknown'], legend: { show: false, position: 'bottom', }, plotOptions: { pie: { donut: { size: '65%', background: 'transparent', }, }, }, dataLabels: { enabled: false, }, responsive: [ { breakpoint: 2600, options: { chart: { width: 380, }, }, }, { breakpoint: 640, options: { chart: { width: 200, }, }, }, ], }; const PieChart: React.FC = () => { const [state, setState] = useState({ series: [65, 34, 12, 56], }); const handleReset = () => { setState((prevState) => ({ ...prevState, series: [65, 34, 12, 56], })); }; handleReset; return (
Visitors Analytics

Desktop 65%

Tablet 34%

Mobile 45%

Unknown 12%

); }; export default PieChart;