123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- import type {AxisPointerComponentOption, ECharts, LineSeriesOption} from 'echarts';
- import type ReactEchartsCore from 'echarts-for-react/lib/core';
- export type SeriesDataUnit = {
- name: string | number;
- value: number;
- itemStyle?: {
- color?: string;
- };
-
- onClick?: (series: Series, instance: ECharts) => void;
- };
- export type Series = {
- data: SeriesDataUnit[];
- seriesName: string;
- areaStyle?: {
- color: string;
- opacity: number;
- };
- color?: string;
- id?: string;
- lineStyle?: AxisPointerComponentOption['lineStyle'];
-
- markLine?: LineSeriesOption['markLine'];
- stack?: string;
-
- z?: number;
- };
- export type ReactEchartsRef = ReactEchartsCore;
- export type EChartEventHandler<P> = (params: P, instance: ECharts) => void;
- export type EChartChartReadyHandler = (instance: ECharts) => void;
- export type EChartHighlightHandler = EChartEventHandler<any>;
- interface EChartMouseEventParam {
-
- color: string;
-
-
- componentType: string;
-
- data: Record<string, any>;
-
- dataIndex: number;
-
-
-
-
-
-
- dataType: string;
-
- name: string;
- seriesId: string;
-
- seriesIndex: number;
-
- seriesName: string;
-
-
- seriesType: string;
-
- value: number | number[];
- }
- export type EChartMouseOutHandler = EChartEventHandler<EChartMouseEventParam>;
- export type EChartMouseOverHandler = EChartEventHandler<EChartMouseEventParam>;
- export type EChartClickHandler = EChartEventHandler<EChartMouseEventParam>;
- export type EChartDataZoomHandler = EChartEventHandler<{
-
- end: number;
-
- start: number;
- type: 'datazoom';
-
- endValue?: number;
-
- startValue?: number;
- }>;
- export type DataPoint = Pick<SeriesDataUnit, 'name' | 'value'>;
- export type EChartRestoreHandler = EChartEventHandler<{type: 'restore'}>;
- export type EChartFinishedHandler = EChartEventHandler<{}>;
- export type EChartRenderedHandler = EChartEventHandler<{}>;
|