import ReactEcharts from 'echarts-for-react';
import { CSSProperties, useMemo } from 'react';
const PieChart = ({ style = {}, data }: { style?: CSSProperties, data: any }) => {
  const option = useMemo(() => {
    const showXAis = false; 
    return {
      tooltip: {
        trigger: 'item',
      },
      legend: {
        show: false,
      },

      series: [
        {
          type: 'pie',
          radius: ['70%', '90%'],
          avoidLabelOverlap: false,
          padAngle: 5,
          itemStyle: {},
          label: {
            show: false,
            position: 'center',
          },

          labelLine: {
            show: false,
          },
          data: data,
        },
      ],
    };
  }, []);

  return (
    <ReactEcharts
      option={option} // option：图表配置项
      style={{ width: '118px', height: '118px', ...style }}
    />
  );
};

export default PieChart;
