import Vue from "vue";
import ECharts from "vue-echarts";
import { use } from "echarts/core";

// import ECharts modules manually to reduce bundle size
// 按需模块：https://github.com/apache/echarts/blob/master/src/echarts.all.ts
// render type
import { CanvasRenderer } from "echarts/renderers";

// charts
import {
  BarChart,
  LineChart,
  PieChart,
  ScatterChart,
  RadarChart,
  BoxplotChart
} from "echarts/charts";

// component
import {
  TitleComponent,
  LegendComponent,
  DataZoomComponent,
  MarkLineComponent,
  TooltipComponent
} from "echarts/components";

use([
  CanvasRenderer,
  BarChart,
  LineChart,
  PieChart,
  ScatterChart,
  RadarChart,
  BoxplotChart,
  TitleComponent,
  LegendComponent,
  DataZoomComponent,
  MarkLineComponent,
  TooltipComponent
]);

// register component to use
Vue.component("v-chart", ECharts);
