From 5b2daa657bf030aa11e7b583825ffe002a7619b7 Mon Sep 17 00:00:00 2001 From: wonderjar Date: Wed, 12 Sep 2018 20:53:12 +0800 Subject: [PATCH] fix: Pie chart disappears when percent is 0 --- src/components/Charts/Pie/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Charts/Pie/index.js b/src/components/Charts/Pie/index.js index 124fb748..76134ed7 100644 --- a/src/components/Charts/Pie/index.js +++ b/src/components/Charts/Pie/index.js @@ -167,7 +167,7 @@ class Pie extends Component { }, }; - if (percent) { + if (percent || percent === 0) { selected = false; tooltip = false; formatColor = value => { @@ -227,7 +227,7 @@ class Pie extends Component { tooltip={tooltip && tooltipFormat} type="intervalStack" position="percent" - color={['x', percent ? formatColor : defaultColors]} + color={['x', percent || percent === 0 ? formatColor : defaultColors]} selected={selected} /> -- GitLab