11import 'react' ;
22import { Liquid , LiquidOptions as Options } from '@antv/g2plot/lib/plots/liquid' ;
33import createPlot , { BasePlotOptions } from '../createPlot' ;
4- import { polyfillOptions } from './core/polyfill' ;
4+ import { polyfillOptions , polyfillVisible } from './core/polyfill' ;
55import { get , isNil , deepMix , isFunction } from '@antv/util' ;
66
77type Opt = Omit < Options , 'percent' > ;
@@ -25,7 +25,7 @@ export default createPlot<LiquidOptions>(Liquid, 'LiquidChart', (opt) => {
2525 // 旧版数据使用方式
2626 options . percent = value / ( max - min ) ;
2727 const formatter = get ( options , 'statistic.content.formatter' ) ;
28- if ( options . statistic ) {
28+ if ( options . statistic !== null && options . statistic !== false ) {
2929 deepMix ( options , {
3030 statistic : {
3131 content : {
@@ -41,6 +41,10 @@ export default createPlot<LiquidOptions>(Liquid, 'LiquidChart', (opt) => {
4141 }
4242 }
4343
44+ polyfillVisible ( options , 'statistic' ) ;
45+ polyfillVisible ( options , 'statistic.title' ) ;
46+ polyfillVisible ( options , 'statistic.content' ) ;
47+
4448 // value 转为data,用于placeholder统一判断
4549 const data = options . percent ;
4650 return { data, ...options } ;
0 commit comments