1import React from "react";
2import Chart from "react-apexcharts";
3
4export default class PieChart extends React.Component {
5 constructor(props) {
6 super(props);
7 this.state = {
8 options: {
9 series: [40, 30, 15, 15],
10 labels: ["Apple", "Mango", "Lemon", "Banana"]
11 }
12 };
13 }
14 render() {
15 return (
16 <div id="pieChart">
17 <Chart
18 options={this.state.options}
19 series={this.state.options.series}
20 type="pie"
21 width="100%"
22 />
23 </div>
24 );
25 }
26}