|
@@ -1,48 +1,20 @@
|
|
|
-import type {
|
|
|
|
|
- // 系列类型的定义后缀都为 SeriesOption
|
|
|
|
|
- BarSeriesOption,
|
|
|
|
|
- LineSeriesOption,
|
|
|
|
|
-} from 'echarts/charts';
|
|
|
|
|
-import type {
|
|
|
|
|
- DatasetComponentOption,
|
|
|
|
|
- GridComponentOption,
|
|
|
|
|
- // 组件类型的定义后缀都为 ComponentOption
|
|
|
|
|
- TitleComponentOption,
|
|
|
|
|
- TooltipComponentOption,
|
|
|
|
|
-} from 'echarts/components';
|
|
|
|
|
-import type { ComposeOption } from 'echarts/core';
|
|
|
|
|
|
|
+export type { ECOption } from './types';
|
|
|
|
|
|
|
|
-import { BarChart, LineChart, PieChart, RadarChart } from 'echarts/charts';
|
|
|
|
|
|
|
+import { BarChart, LineChart, PieChart, RadarChart } from "echarts/charts";
|
|
|
import {
|
|
import {
|
|
|
- // 数据集组件
|
|
|
|
|
DatasetComponent,
|
|
DatasetComponent,
|
|
|
GridComponent,
|
|
GridComponent,
|
|
|
LegendComponent,
|
|
LegendComponent,
|
|
|
TitleComponent,
|
|
TitleComponent,
|
|
|
ToolboxComponent,
|
|
ToolboxComponent,
|
|
|
TooltipComponent,
|
|
TooltipComponent,
|
|
|
- // 内置数据转换器组件 (filter, sort)
|
|
|
|
|
- TransformComponent,
|
|
|
|
|
-} from 'echarts/components';
|
|
|
|
|
-import * as echarts from 'echarts/core';
|
|
|
|
|
-import {
|
|
|
|
|
- LabelLayout,
|
|
|
|
|
- LegacyGridContainLabel,
|
|
|
|
|
- UniversalTransition,
|
|
|
|
|
-} from 'echarts/features';
|
|
|
|
|
-import { CanvasRenderer } from 'echarts/renderers';
|
|
|
|
|
|
|
+ TransformComponent
|
|
|
|
|
+} from "echarts/components";
|
|
|
|
|
+import * as echarts from "echarts/core";
|
|
|
|
|
+import { LabelLayout, LegacyGridContainLabel, UniversalTransition } from "echarts/features";
|
|
|
|
|
+import { CanvasRenderer } from "echarts/renderers";
|
|
|
|
|
|
|
|
-// 通过 ComposeOption 来组合出一个只有必须组件和图表的 Option 类型
|
|
|
|
|
-export type ECOption = ComposeOption<
|
|
|
|
|
- | BarSeriesOption
|
|
|
|
|
- | DatasetComponentOption
|
|
|
|
|
- | GridComponentOption
|
|
|
|
|
- | LineSeriesOption
|
|
|
|
|
- | TitleComponentOption
|
|
|
|
|
- | TooltipComponentOption
|
|
|
|
|
->;
|
|
|
|
|
|
|
|
|
|
-// 注册必须的组件
|
|
|
|
|
echarts.use([
|
|
echarts.use([
|
|
|
TitleComponent,
|
|
TitleComponent,
|
|
|
PieChart,
|
|
PieChart,
|