import React from 'react'
import ReactApexChart from 'react-apexcharts'
import './styles.css'
const ApexChart = () => {
const [state, setState] = React.useState({
series: [
{
name: 'Visitors',
data: [400, 430, 448, 470, 540, 580, 690, 1100, 1200, 1380],
},
],
options: {
chart: {
type: 'bar',
height: 350,
},
plotOptions: {
bar: {
borderRadius: 4,
borderRadiusApplication: 'end',
horizontal: true,
},
},
dataLabels: {
enabled: false,
},
title: {
text: 'Monthly Visitors by Country',
align: 'left',
},
xaxis: {
categories: [
'South Korea',
'Canada',
'United Kingdom',
'Netherlands',
'Italy',
'France',
'Japan',
'United States',
'China',
'Germany',
],
labels: {
formatter: function (val) {
return val + 'k'
},
},
},
},
})
return (
<div>
<div id="chart">
<ReactApexChart
options={state.options}
series={state.series}
type="bar"
height={350}
/>
</div>
</div>
)
}
export default ApexChart