forked from github/dataease
refactor(图表): 面积图无数据不渲染
This commit is contained in:
parent
d3a79af605
commit
f955cb3e0b
@ -86,7 +86,9 @@ export class Area extends G2PlotChartView<AreaOptions, G2Area> {
|
|||||||
|
|
||||||
drawChart(drawOptions: G2PlotDrawOptions<G2Area>): G2Area {
|
drawChart(drawOptions: G2PlotDrawOptions<G2Area>): G2Area {
|
||||||
const { chart, container, action } = drawOptions
|
const { chart, container, action } = drawOptions
|
||||||
if (chart?.data) {
|
if (!chart.data.data?.length) {
|
||||||
|
return
|
||||||
|
}
|
||||||
// data
|
// data
|
||||||
const data = cloneDeep(chart.data.data)
|
const data = cloneDeep(chart.data.data)
|
||||||
|
|
||||||
@ -104,7 +106,6 @@ export class Area extends G2PlotChartView<AreaOptions, G2Area> {
|
|||||||
|
|
||||||
return newChart
|
return newChart
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected configLabel(chart: Chart, options: AreaOptions): AreaOptions {
|
protected configLabel(chart: Chart, options: AreaOptions): AreaOptions {
|
||||||
const tmpOptions = super.configLabel(chart, options)
|
const tmpOptions = super.configLabel(chart, options)
|
||||||
|
Loading…
Reference in New Issue
Block a user