feat: update echarts v4 to v5

This commit is contained in:
eilenexuzhe
2021-12-27 17:12:02 +08:00
parent 10b0a3dabb
commit 5ef8fff5bc
11 changed files with 137 additions and 70 deletions

View File

@@ -1,4 +1,3 @@
import { EChartOption } from 'echarts/lib/echarts';
import moment from 'moment';
import { ICurve } from 'container/common-curve/config';
import { adminMonitor } from 'store/admin-monitor';
@@ -124,7 +123,7 @@ export interface ICurveType {
type: curveType;
title: string;
curves: ICurve[];
parser: (option: ICurve, data: any[]) => EChartOption;
parser: (option: ICurve, data: any[]) => any;
}
export const byteTypeCurves: ICurveType[] = [

View File

@@ -1,5 +1,5 @@
import moment from 'moment';
import { EChartOption } from 'echarts';
import { EChartsOption } from 'echarts';
import { ICurve, ILineData, baseLineLegend, baseLineGrid, baseAxisStyle, noAxis, UNIT_HEIGHT } from 'container/common-curve/config';
import { IClusterMetrics, ISeriesOption } from 'types/base-type';
import { timeFormat } from 'constants/strategy';
@@ -48,20 +48,20 @@ export const getBaseOptions = (option: ICurve, data: ILineData[]) => {
return Number(i.value);
}),
}],
} as EChartOption;
} as EChartsOption;
};
export const parseLine = (option: ICurve, data: ILineData[]): EChartOption => {
export const parseLine = (option: ICurve, data: ILineData[]): EChartsOption => {
return Object.assign({}, getBaseOptions(option, data), {
legend: {
...baseLineLegend,
bottom: '0',
align: 'auto',
},
}) as EChartOption;
}) as EChartsOption;
};
export const parseBrokerMetricOption = (option: ICurve, data: IClusterMetrics[]): EChartOption => {
export const parseBrokerMetricOption = (option: ICurve, data: IClusterMetrics[]): EChartsOption => {
let name;
let series: ISeriesOption[];
data = data || [];