/*
 * @FilePath: \wang-vue-worke:\demo\daping\src\utils\echarts.ts
 * @Author: 王路平
 * @文件版本: V1.0.0
 * @Date: 2023-01-30 10:39:55
 * @Description: 
 * 
 * 版权信息         : 2023 by ${再登软件}, All Rights Reserved.
 */

import * as echarts from 'echarts/core';
import {
  BarChart,
  // 系列类型的定义后缀都为 SeriesOption
  BarSeriesOption,
  LineChart,
  LineSeriesOption,
  GaugeChart,
  GaugeSeriesOption,
  CustomChart,
  CustomSeriesOption,
  MapChart,
  PieChart,
  PieSeriesOption,
} from 'echarts/charts';
// import {LiquidfillChart,
//   LiquidfillSeriesOption,} from 'echarts-liquidfill'
import {
  TitleComponent,
  // 组件类型的定义后缀都为 ComponentOption
  TitleComponentOption,
  TooltipComponent,
  TooltipComponentOption,
  GeoComponent,
  GridComponent,
  GridComponentOption,
  VisualMapComponent ,
  TimelineComponent ,
  CalendarComponent ,
  //基准线
  MarkLineComponent,
  
  // 数据集组件
  DatasetComponent,
  DatasetComponentOption,
  // 内置数据转换器组件 (filter, sort)
  TransformComponent,
  LegendComponent,
  ToolboxComponent
} from 'echarts/components';
import { LabelLayout, UniversalTransition } from 'echarts/features';
import { CanvasRenderer } from 'echarts/renderers';

// 通过 ComposeOption 来组合出一个只有必须组件和图表的 Option 类型
type ECOption = echarts.ComposeOption<
  | BarSeriesOption
  | LineSeriesOption
  | GaugeSeriesOption
  | TitleComponentOption
  | TooltipComponentOption
  | CustomSeriesOption
  | GridComponentOption
  | DatasetComponentOption
  | PieSeriesOption
>;

// 注册必须的组件
echarts.use([
  TitleComponent,
  TooltipComponent,
  GeoComponent,
  GridComponent,
  DatasetComponent,
  TransformComponent,
  LegendComponent,
  MarkLineComponent,
  VisualMapComponent,
  TimelineComponent ,
  CalendarComponent ,
  BarChart,
  LineChart,
  GaugeChart,
  PieChart,
  MapChart,
  CustomChart,
  // LiquidfillChart,
  LabelLayout,
  UniversalTransition,
  CanvasRenderer,
  ToolboxComponent
]);

// 导出
export default echarts;