import React from 'react'
import ReactApexChart from 'react-apexcharts'
import './styles.css'
const ApexChart = () => {
const [state, setState] = React.useState({
series: [54, 41, 38, 16, 12],
options: {
chart: {
width: 480,
type: 'donut',
},
labels: [
'North America',
'Europe',
'Asia Pacific',
'Latin America',
'Middle East',
],
title: {
text: 'Revenue by Region ($M)',
align: 'center',
},
legend: {
show: false,
},
plotOptions: {
pie: {
dataLabels: {
external: {
show: true,
},
},
},
},
responsive: [
{
breakpoint: 480,
options: {
chart: {
width: 320,
},
},
},
],
},
})
return (
<div>
<div id="chart">
<ReactApexChart
options={state.options}
series={state.series}
type="donut"
width={480}
/>
</div>
</div>
)
}
export default ApexChart