Skip to content

The open alternative to Salesforce, designed for AI.

[DASHBOARDS] Fix pie chart gap when there is only one slice (#17388)

Raphaël Bosic76ddfd6d1e4
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetPieChart/components/GraphWidgetPieChart.tsx b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetPieChart/components/GraphWidgetPieChart.tsx
index ae1034e8159..2d66fafe3a1 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetPieChart/components/GraphWidgetPieChart.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetPieChart/components/GraphWidgetPieChart.tsx
@@ -140,7 +140,7 @@ export const GraphWidgetPieChart = ({
const chartColors = hasNoData
? [theme.background.tertiary]
: enrichedData.map((item) => item.colorScheme.solid);
- const pieChartPadAngle = hasNoData ? 0 : 0.4;
+ const pieChartPadAngle = hasNoData || enrichedData.length <= 1 ? 0 : 0.4;
const ArcsLayer = useCallback(
(props: PieCustomLayerProps<PieChartDataItemWithColor>) => (