Skip to content

Commit 5d685bc

Browse files
committed
fix: 水波图statistic 不能隐藏的bug
1 parent e830f67 commit 5d685bc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/plots/LiquidChart.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'react';
22
import { Liquid, LiquidOptions as Options } from '@antv/g2plot/lib/plots/liquid';
33
import createPlot, { BasePlotOptions } from '../createPlot';
4-
import { polyfillOptions } from './core/polyfill';
4+
import { polyfillOptions, polyfillVisible } from './core/polyfill';
55
import { get, isNil, deepMix, isFunction } from '@antv/util';
66

77
type 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

Comments
 (0)