Skip to content

Commit

Permalink
fix: fix pie chart bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanyxh committed Sep 28, 2024
1 parent 5ab0646 commit a1a1e31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/PieChart/PieChart.tsx
Original file line number Diff line number Diff line change
@@ -39,11 +39,11 @@ const PieChart: React.FC<Readonly<IPieChartProps>> = (props) => {

ctx.beginPath();
ctx.moveTo(radius, radius);
ctx.arc(radius, radius, radius, ratio, nextRatio);
ctx.arc(radius, radius, radius, ratio, i === data.length - 1 ? circle : nextRatio);
ctx.fillStyle = sector.color;
ctx.fill();

ratio = i === data.length - 1 ? circle : nextRatio;
ratio = nextRatio;
}
}, [radius, data]);

0 comments on commit a1a1e31

Please sign in to comment.