diff --git a/apps/web-antd/src/views/aiot/alarm/summary/chart-options.ts b/apps/web-antd/src/views/aiot/alarm/summary/chart-options.ts index 5f6c80f8b..138e14839 100644 --- a/apps/web-antd/src/views/aiot/alarm/summary/chart-options.ts +++ b/apps/web-antd/src/views/aiot/alarm/summary/chart-options.ts @@ -28,7 +28,7 @@ const LEVEL_COLORS: Record = { 3: '#8c8c8c', }; -/** 告警趋势面积图 */ +/** 告警趋势折线图(每种类型独立一条线,都从0开始) */ export function getTrendChartOptions(data: AiotAlarmApi.TrendItem[]): any { const dates = data.map((d) => d.date.slice(5)); // MM-DD const types = Object.keys(TYPE_NAMES); @@ -36,7 +36,7 @@ export function getTrendChartOptions(data: AiotAlarmApi.TrendItem[]): any { return { tooltip: { trigger: 'axis', - axisPointer: { type: 'cross', label: { backgroundColor: '#6a7985' } }, + axisPointer: { type: 'line' }, }, legend: { data: types.map((t) => TYPE_NAMES[t]), @@ -53,10 +53,11 @@ export function getTrendChartOptions(data: AiotAlarmApi.TrendItem[]): any { name: TYPE_NAMES[type], type: 'line', smooth: true, - stack: 'total', - areaStyle: { opacity: 0.25 }, + symbol: 'circle', + symbolSize: 6, emphasis: { focus: 'series' }, itemStyle: { color: TYPE_COLORS[type] }, + lineStyle: { width: 2 }, data: data.map((d) => (d[type] as number) || 0), })), };