Skip to content

Commit 7292440

Browse files
committed
No data check should only care about null/undefined
1 parent 357a4d9 commit 7292440

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/webapp/app/components/primitives/charts/ChartRoot.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ function ChartRootInner({
140140
}
141141

142142
/**
143-
* Hook to check if all data in the visible range is empty (zero or null).
143+
* Hook to check if all data in the visible range is empty (null or undefined).
144+
* Zero values are considered valid data and will render.
144145
* Useful for rendering "no data" states.
145146
*/
146147
export function useHasNoData(): boolean {
@@ -152,7 +153,7 @@ export function useHasNoData(): boolean {
152153
return data.every((item) => {
153154
return dataKeys.every((key) => {
154155
const value = item[key];
155-
return value === 0 || value === null || value === undefined;
156+
return value === null || value === undefined;
156157
});
157158
});
158159
}, [data, dataKeys]);

0 commit comments

Comments
 (0)