Merge pull request #10114 from dataease/pr@dev-v2@refactor_area_null_data

refactor(图表): 面积图无数据不渲染
This commit is contained in:
wisonic-s 2024-06-05 16:46:40 +08:00 committed by GitHub
commit b42c06c4df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,7 +86,9 @@ export class Area extends G2PlotChartView<AreaOptions, G2Area> {
drawChart(drawOptions: G2PlotDrawOptions<G2Area>): G2Area {
const { chart, container, action } = drawOptions
if (chart?.data) {
if (!chart.data.data?.length) {
return
}
// data
const data = cloneDeep(chart.data.data)
@ -104,7 +106,6 @@ export class Area extends G2PlotChartView<AreaOptions, G2Area> {
return newChart
}
}
protected configLabel(chart: Chart, options: AreaOptions): AreaOptions {
const tmpOptions = super.configLabel(chart, options)