npm install apexcharts react-apexcharts
import React from 'react';
import Chart from 'react-apexcharts';
class MyChart extends React.Component {
constructor(props) {
super(props);
this.state = {
options: {
chart: {
type: 'line'
},
xaxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May
', 'Jun', 'Jul']
}
},
series: [{
name: 'Sales',
data: [10, 20, 15, 30, 25, 40, 35]
}]
}
}
render() {
return (
<div>
<Chart options={this.state.options} series={this.state.series} type="line" />
</div>
);
}
}
export default MyChart;