mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-03 19:38:20 +08:00
34 lines
698 B
TypeScript
34 lines
698 B
TypeScript
import { getBasicChartConfig } from '@src/constants/chartConfig';
|
|
|
|
export const getChartConfig = (title: string) => {
|
|
return {
|
|
option: getBasicChartConfig({
|
|
title: { text: title },
|
|
tooltip: { enterable: true },
|
|
}),
|
|
seriesCallback: (lines: { name: string; data: [][] }[]) => {
|
|
// series 配置
|
|
return lines.map((line) => ({
|
|
...line,
|
|
lineStyle: {
|
|
width: 1,
|
|
},
|
|
smooth: 0.25,
|
|
symbol: 'emptyCircle',
|
|
symbolSize: 4,
|
|
emphasis: {
|
|
disabled: true,
|
|
},
|
|
}));
|
|
},
|
|
};
|
|
};
|
|
|
|
export const HealthStateMap: any = {
|
|
'-1': 'Unknown',
|
|
0: '好',
|
|
1: '中',
|
|
2: '差',
|
|
3: 'Down',
|
|
};
|