import React, { useState } from "react"; import Chart from "react-apexcharts"; const Piechart = () => { const [series, setSeries] = useState([35.1, 23.5, 2.4, 5.4]); const chartOptions = { series: series, labels: ["Fertilizers", "Pestisides", "Manner", "Urea"], colors: ["#1C64F2", "#16BDCA", "#FDBA8C", "#E74694"], chart: { type: "donut", height: 320, }, plotOptions: { pie: { donut: { labels: { show: true, total: { show: true, label: "Total", formatter: function (w) { return w.globals.seriesTotals.reduce((a, b) => a + b, 0) + "k"; }, }, }, }, }, }, legend: { position: "bottom", }, }; return (
Farm Info
); }; export default Piechart;