Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: decrease the pad angle and remove the empty legend entries (#6507)

Vikrant Gupta96b5e0920f3c
diff --git a/frontend/src/container/PanelWrapper/PiePanelWrapper.tsx b/frontend/src/container/PanelWrapper/PiePanelWrapper.tsx
index dce84ad78d..61998c7886 100644
--- a/frontend/src/container/PanelWrapper/PiePanelWrapper.tsx
+++ b/frontend/src/container/PanelWrapper/PiePanelWrapper.tsx
@@ -8,6 +8,7 @@ import { getYAxisFormattedValue } from 'components/Graph/yAxisConfig';
import { themeColors } from 'constants/theme';
import { useIsDarkMode } from 'hooks/useDarkMode';
import { generateColor } from 'lib/uPlotLib/utils/generateColor';
+import { isNaN } from 'lodash-es';
import { useRef, useState } from 'react';
import { Query } from 'types/api/queryBuilder/queryBuilderData';
@@ -44,7 +45,7 @@ function PiePanelWrapper({
const isDarkMode = useIsDarkMode();
- const pieChartData: {
+ let pieChartData: {
label: string;
value: string;
color: string;
@@ -67,6 +68,10 @@ function PiePanelWrapper({
)
.filter((d) => d !== undefined) as never[]),
);
+ pieChartData = pieChartData.filter(
+ (arc) =>
+ arc.value && !isNaN(parseFloat(arc.value)) && parseFloat(arc.value) > 0,
+ );
let size = 0;
let width = 0;
@@ -108,7 +113,7 @@ function PiePanelWrapper({
if (!active) return half - 3;
return data.label === active.label ? half : half - 3;
}}
- padAngle={0.02}
+ padAngle={0.01}
cornerRadius={3}
width={size}
height={size}