增加折线
This commit is contained in:
parent
55ff382434
commit
a42c3f5824
|
|
@ -288,6 +288,9 @@
|
||||||
const loadChartData = async (deployId, summaryMode, startTime) => {
|
const loadChartData = async (deployId, summaryMode, startTime) => {
|
||||||
if (!deployId) return;
|
if (!deployId) return;
|
||||||
|
|
||||||
|
// ✅ 先清空数据,让 tag 显示 0 项
|
||||||
|
chartDataList.value = [];
|
||||||
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
// 格式化日期
|
// 格式化日期
|
||||||
|
|
@ -531,6 +534,51 @@
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// ✅ 新增:折线图
|
||||||
|
{
|
||||||
|
name: item.title || '趋势',
|
||||||
|
type: 'line',
|
||||||
|
data: item.data || [],
|
||||||
|
smooth: true,
|
||||||
|
symbol: 'circle',
|
||||||
|
symbolSize: 6,
|
||||||
|
lineStyle: {
|
||||||
|
color: '#ff6b6b',
|
||||||
|
width: 2,
|
||||||
|
},
|
||||||
|
itemStyle: {
|
||||||
|
color: '#ff6b6b',
|
||||||
|
},
|
||||||
|
areaStyle: {
|
||||||
|
color: {
|
||||||
|
type: 'linear',
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
x2: 0,
|
||||||
|
y2: 1,
|
||||||
|
colorStops: [
|
||||||
|
{ offset: 0, color: 'rgba(255, 107, 107, 0.3)' },
|
||||||
|
{ offset: 1, color: 'rgba(255, 107, 107, 0.05)' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
focus: 'series',
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
position: 'top',
|
||||||
|
fontSize: 10,
|
||||||
|
color: '#ff6b6b',
|
||||||
|
fontWeight: 500,
|
||||||
|
formatter: (params) => {
|
||||||
|
return params.value;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// 将折线图与柱状图关联,共享 x 轴
|
||||||
|
xAxisIndex: 0,
|
||||||
|
yAxisIndex: 0,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
legend: {
|
legend: {
|
||||||
show: true,
|
show: true,
|
||||||
|
|
@ -544,6 +592,13 @@
|
||||||
name: item.title || '数据',
|
name: item.title || '数据',
|
||||||
icon: 'roundRect',
|
icon: 'roundRect',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: item.title || '趋势',
|
||||||
|
icon: 'line',
|
||||||
|
itemStyle: {
|
||||||
|
color: '#ff6b6b',
|
||||||
|
},
|
||||||
|
},
|
||||||
...(item.markLines || []).map((line) => ({
|
...(item.markLines || []).map((line) => ({
|
||||||
name: line.name,
|
name: line.name,
|
||||||
icon: 'line',
|
icon: 'line',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue