import { use } from 'echarts/core';
import { CanvasRenderer } from 'echarts/renderers';
import {
  BarChart,
  LineChart,
  PieChart,
  RadarChart,
  GaugeChart,
} from 'echarts/charts';
import {
  GridComponent,
  TooltipComponent,
  LegendComponent,
  DataZoomComponent,
  GraphicComponent,
  TitleComponent,
  GeoComponent,
  LegendScrollComponent,
  ToolboxComponent,
} from 'echarts/components';

import Chart from './chart/index.vue';
import SearchForm from './search-form/index.vue';
import MyDialog from './my-dialog/index.vue';
import SButton from './s-buttons/index.vue';
import ImageView from './image-viewer/index.vue';
import Robot from './robot/index.vue';

use([
  CanvasRenderer,
  BarChart,
  LineChart,
  PieChart,
  RadarChart,
  GaugeChart,
  GridComponent,
  TooltipComponent,
  LegendComponent,
  DataZoomComponent,
  GraphicComponent,
  TitleComponent,
  GeoComponent,
  LegendScrollComponent,
  ToolboxComponent,
]);

export default {
  install(Vue) {
    Vue.component('MyChart', Chart);
    Vue.component('SearchForm', SearchForm);
    Vue.component('MyDialog', MyDialog);
    Vue.component('SButton', SButton);
    Vue.component('ImageView', ImageView);
    Vue.component('Robot', Robot);
  },
};
