Answers for "pie charts react"

0

pie charts react

import React from "react";
import Chart from "react-apexcharts";

export default class PieChart extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      options: {
        series: [40, 30, 15, 15],
        labels: ["Apple", "Mango", "Lemon", "Banana"]
      }
    };
  }
  render() {
    return (
      <div id="pieChart">
        <Chart
          options={this.state.options}
          series={this.state.options.series}
          type="pie"
          width="100%"
        />
      </div>
    );
  }
}
Posted by: Guest on May-03-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language