import ECharts from 'vue-echarts'
import {use} from "echarts/core"
import {
    CanvasRenderer
} from 'echarts/renderers'
import {Map3DChart, Scatter3DChart} from 'echarts-gl/charts';
import {Geo3DComponent} from 'echarts-gl/components';
import {
    BarChart, PieChart, MapChart, EffectScatterChart, LineChart, PictorialBarChart, GraphChart, GaugeChart, ScatterChart
} from 'echarts/charts'
import {
    GridComponent,
    TitleComponent,
    TooltipComponent,
    LegendComponent,
    DatasetComponent,
    VisualMapComponent,
    GeoComponent,
    MarkPointComponent,
    GraphicComponent,
} from 'echarts/components'

use([
    CanvasRenderer,
    BarChart, PieChart, MapChart, EffectScatterChart, LineChart, PictorialBarChart, GraphChart, GaugeChart, ScatterChart,
    GridComponent,
    LegendComponent,
    TooltipComponent,
    TitleComponent,
    DatasetComponent,
    VisualMapComponent,
    GeoComponent,
    MarkPointComponent,
    GraphicComponent,
    Map3DChart,
    Scatter3DChart,
    Geo3DComponent
])

export const registerEcharts = (app: any) => {
    app.component('v-chart', ECharts)
}