Browse Source

fix: Pie chart disappears when percent is 0

wonderjar 7 years ago
parent
commit
5b2daa657b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/components/Charts/Pie/index.js

+ 2 - 2
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}
               />
             </Chart>