import React, { CSSProperties } from 'react'; import * as echarts from 'echarts/core'; import ReactEcharts from 'echarts-for-react'; import { // 系列类型的定义后缀都为 SeriesOption PieSeriesOption } from 'echarts/charts'; import { GridComponentOption, TooltipComponentOption } from 'echarts/components'; type ECOption = echarts.ComposeOption; export type DataType = { value: string | number; name: string; percent?: number; itemStyle?: any; }; export interface BasePieProps { data: DataType[]; unit?: string; onlyPercentage?: boolean; style?: CSSProperties; autoLoop?: boolean; duration?: number; config?: ECOption; pieColors?: [string, string][]; legendPosition?: 'right' | 'bottom'; /** 图表交互事件 */ onEvents?: Record void>; /** 图表渲染器 */ renderer?: 'canvas' | 'svg'; } declare const BasePie: React.ForwardRefExoticComponent>; export default BasePie;