import type { BarSeriesOption, RadarSeriesOption }                                    from 'echarts/charts';
import { BarChart, RadarChart }                                                       from 'echarts/charts';
import type {
  DatasetComponentOption,
  GridComponentOption,
  LegendComponentOption,
  VisualMapComponentOption,
} from 'echarts/components';
import { DatasetComponent, GridComponent, LegendComponent, VisualMapComponent } from 'echarts/components';
import type { ComposeOption }                                                         from 'echarts/core';
import { use }                                                                        from 'echarts/core';
import { CanvasRenderer }                                                             from 'echarts/renderers';

import VChart, { THEME_KEY } from 'vue-echarts';


use([
  CanvasRenderer,
  DatasetComponent, VisualMapComponent,
  GridComponent, LegendComponent,
  BarChart,
  RadarChart,
]);

export type EChartsOption = ComposeOption<
  | DatasetComponentOption
  | GridComponentOption
  | VisualMapComponentOption
  | LegendComponentOption
  | BarSeriesOption
  | RadarSeriesOption
>;


export default VChart;
export const theme = [ THEME_KEY, 'dark' ] as const;
