Handled sum=0 case for Pie and Donut charts

This commit is contained in:
Abhinandan Kushwaha 2021-10-20 00:23:55 +05:30
parent fdd1b085cb
commit 706bc008ef
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "react-native-gifted-charts",
"version": "0.1.12",
"version": "0.1.13",
"description": "The most complete library for Bar, Line, Area, Pie and Donut charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.",
"main": "src/index.tsx",
"files": [

View File

@ -278,7 +278,7 @@ export const PieChart = (props: propTypes) => {
});
};
return (
return total === 0 ? null : (
<View style={{transform: [{scaleY: tilt}]}}>
<Canvas ref={handleCanvas} />
{(props.centerLabelComponent || (donut && !isDataShifted)) && (