Skip to content

Commit

Permalink
fix: Handle empty data object in tooltip (#2641)
Browse files Browse the repository at this point in the history
* Handle empty data object

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
MichaelUnkey and autofix-ci[bot] authored Dec 2, 2024
1 parent bcecd79 commit ae32930
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/dashboard/lib/charts/useTooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export function useTooltip<T extends Datum>({
snapToX = true,
}: TooltipOptions<T>): ChartTooltipContext {
const { series, data, xScale, yScale, margin } = chartContext;

if (data.length === 0) {
return {} as ChartTooltipContext;
}
const visxTooltipInPortal = useTooltipInPortal({
scroll: true,
detectBounds: true,
Expand Down

0 comments on commit ae32930

Please sign in to comment.