fix(视图): Echarts 视图图例为空时绘制失败

This commit is contained in:
wisonic-s 2024-01-02 15:59:14 +08:00
parent 74094579fb
commit cfa38188cb
2 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ export function baseBarOption(chart_option, chart, activeParam) {
y.type = 'bar'
y.selectedMode = true
y.select = BASE_ECHARTS_SELECT
chart_option.legend.data.push(y.name)
chart_option.legend.data.push(y.name ?? 'null')
chart_option.series.push(y)
}
}
@ -117,7 +117,7 @@ export function horizontalBarOption(chart_option, chart) {
y.type = 'bar'
y.selectedMode = true
y.select = BASE_ECHARTS_SELECT
chart_option.legend.data.push(y.name)
chart_option.legend.data.push(y.name ?? 'null')
chart_option.series.push(y)
}
}

View File

@ -56,7 +56,7 @@ export function baseLineOption(chart_option, chart) {
y.label = customAttr.label
}
y.type = 'line'
chart_option.legend.data.push(y.name)
chart_option.legend.data.push(y.name ?? 'null')
chart_option.series.push(y)
}
}