diff --git a/src/PieChart.tsx b/src/PieChart.tsx index 3e498ddc..918ca7e5 100644 --- a/src/PieChart.tsx +++ b/src/PieChart.tsx @@ -56,14 +56,10 @@ class PieChart extends AbstractChart { if (total === 0) { value = 0 + "%"; } else { - const percentage = Math.round( - (100 / total) * c.item[this.props.accessor] - ); + const percentage = (100 / total) * c.item[this.props.accessor]; value = Math.round((100 / total) * c.item[this.props.accessor]) + "%"; - if (avoidFalseZero && percentage === 0) { + if (avoidFalseZero && percentage > 0 && percentage < 0.5) { value = "<1%"; - } else { - value = percentage + "%"; } } }