mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 19:42:56 +08:00
perf(图表): 水波图和仪表盘无数据不渲染
This commit is contained in:
parent
406167735a
commit
d3330e35a4
@ -50,7 +50,9 @@ export class Liquid extends G2PlotChartView<LiquidOptions, G2Liquid> {
|
||||
|
||||
drawChart(drawOptions: G2PlotDrawOptions<G2Liquid>): G2Liquid {
|
||||
const { chart, container } = drawOptions
|
||||
if (chart?.data) {
|
||||
if (!chart.data?.series) {
|
||||
return
|
||||
}
|
||||
const initOptions: LiquidOptions = {
|
||||
percent: 0
|
||||
}
|
||||
@ -58,7 +60,6 @@ export class Liquid extends G2PlotChartView<LiquidOptions, G2Liquid> {
|
||||
// 开始渲染
|
||||
return new G2Liquid(container, options)
|
||||
}
|
||||
}
|
||||
|
||||
protected configTheme(chart: Chart, options: LiquidOptions): LiquidOptions {
|
||||
const customAttr = parseJson(chart.customAttr)
|
||||
|
@ -65,7 +65,9 @@ export class Gauge extends G2PlotChartView<GaugeOptions, G2Gauge> {
|
||||
|
||||
drawChart(drawOptions: G2PlotDrawOptions<G2Gauge>): G2Gauge {
|
||||
const { chart, container, scale } = drawOptions
|
||||
if (chart?.data) {
|
||||
if (!chart.data?.series) {
|
||||
return
|
||||
}
|
||||
// options
|
||||
const initOptions: GaugeOptions = {
|
||||
percent: 0,
|
||||
@ -99,7 +101,6 @@ export class Gauge extends G2PlotChartView<GaugeOptions, G2Gauge> {
|
||||
const options = this.setupOptions(chart, initOptions, scale)
|
||||
return new G2Gauge(container, options)
|
||||
}
|
||||
}
|
||||
|
||||
protected configMisc(chart: Chart, options: GaugeOptions): GaugeOptions {
|
||||
const customAttr = parseJson(chart.customAttr)
|
||||
|
Loading…
Reference in New Issue
Block a user