fix:图表生成时序调整

This commit is contained in:
zhongzm
2024-11-15 14:31:58 +08:00
parent e0990a40df
commit bf94591035

View File

@@ -261,15 +261,6 @@ const updateChart = () => {
},
tooltip: {
trigger: 'axis',
formatter: function (params: any[]) {
const time = params[0].axisValue;
let result = `${time}<br/>`;
params.forEach(param => {
const value = param.value === 0 ? '0' : param.value;
result += `${param.marker}${param.seriesName}: ${value}<br/>`;
});
return result;
}
},
legend: {
data: selectedKPIs.value.map(kpiId =>
@@ -365,8 +356,8 @@ onMounted(async () => {
chart = echarts.init(container);
if (kpiColumns.value.length > 0) {
updateChart();
await fetchChartData();
updateChart();
} else {
console.warn('No KPI columns available after fetching');
}