extends AntVDrawOptions
{
areaId?: string
@@ -50,6 +51,28 @@ export abstract class L7PlotChartView<
defaultsDeep(options.legend, legend)
return options
}
+ protected configEmptyDataStrategy(chart: Chart, options: ChoroplethOptions): ChoroplethOptions {
+ const { functionCfg } = parseJson(chart.senior)
+ const emptyDataStrategy = functionCfg.emptyDataStrategy
+ if (!emptyDataStrategy || emptyDataStrategy === 'breakLine') {
+ return options
+ }
+ const data = cloneDeep(options.source.data)
+ if (emptyDataStrategy === 'setZero') {
+ data.forEach(item => {
+ item.value === null && (item.value = 0)
+ })
+ }
+ if (emptyDataStrategy === 'ignoreData') {
+ for (let i = data.length - 1; i >= 0; i--) {
+ if (data[i].value === null) {
+ data.splice(i, 1)
+ }
+ }
+ }
+ options.source.data = data
+ return options
+ }
protected constructor(name: string, defaultData?: any[]) {
super(ChartLibraryType.L7_PLOT, name)
this.defaultData = defaultData
diff --git a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue
index 559135cd53..ac84688c29 100644
--- a/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue
+++ b/core/core-frontend/src/views/chart/components/views/components/ChartComponentG2Plot.vue
@@ -59,7 +59,6 @@ const state = reactive({
},
linkageActiveParam: null,
pointParam: null,
- loading: false,
data: { fields: [] } // 图表数据
})
let chartData = shallowRef