Просмотр исходного кода

fix: Pie chart disappears when percent is 0

wonderjar 7 лет назад
Родитель
Сommit
5b2daa657b
1 измененных файлов с 2 добавлено и 2 удалено
  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>