diff --git a/package.json b/package.json index 96aca534..b72b47f8 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ }, "dependencies": { "lodash": "^4.17.11", - "paths-js": "^0.4.7", + "paths-js": "^0.4.10", "point-in-polygon": "^1.0.1" }, "xo": { diff --git a/src/pie-chart.js b/src/pie-chart.js index 89016eda..dad83a5d 100644 --- a/src/pie-chart.js +++ b/src/pie-chart.js @@ -26,7 +26,11 @@ class PieChart extends AbstractChart { if (absolute) { value = c.item[this.props.accessor] } else { - value = Math.round((100 / total) * c.item[this.props.accessor]) + '%' + if (total === 0){ + value = 0 + '%'; + }else{ + value = Math.round((100 / total) * c.item[this.props.accessor]) + '%'; + } } return (