Skip to content

Commit 7e2c16d

Browse files
committed
feat: show labels
1 parent 699720f commit 7e2c16d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/shaggy-masks-film.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@saas-ui/charts': patch
3+
---
4+
5+
Added showLabel prop to render labels on pie chart

packages/saas-ui-charts/src/pie-chart.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface PieChartProps {
1717
height?: number
1818
valueFormatter?: (value: number) => string
1919
showTooltip?: boolean
20+
showLabel?: boolean
2021
/**
2122
* Render custom tooltip content.
2223
*/
@@ -32,6 +33,7 @@ export function PieChart(props: PieChartProps) {
3233
data,
3334
valueFormatter,
3435
showTooltip,
36+
showLabel,
3537
tooltipContent,
3638
} = props
3739

@@ -67,6 +69,7 @@ export function PieChart(props: PieChartProps) {
6769
cy="50%"
6870
innerRadius={innerRadius}
6971
outerRadius={outerRadius}
72+
label={showLabel}
7073
stroke="none"
7174
paddingAngle={2}
7275
isAnimationActive={false}

0 commit comments

Comments
 (0)