From 77e9b04bae941c273a5cdb86368eed0099e39d3d Mon Sep 17 00:00:00 2001 From: Mustafa Saifee Date: Fri, 27 Dec 2024 11:20:48 +0200 Subject: [PATCH] Fix slope and strip chart --- src/Components/Graphs/SlopeChart/Graph.tsx | 4 ++-- .../Graphs/StripChart/HorizontalStripChart/Graph.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Components/Graphs/SlopeChart/Graph.tsx b/src/Components/Graphs/SlopeChart/Graph.tsx index 845bd47..126dae2 100644 --- a/src/Components/Graphs/SlopeChart/Graph.tsx +++ b/src/Components/Graphs/SlopeChart/Graph.tsx @@ -218,10 +218,10 @@ export function Graph(props: Props) { resetSelectionOnDoubleClick ) { setMouseClickData(undefined); - onSeriesMouseClick(undefined); + if (onSeriesMouseClick) onSeriesMouseClick(undefined); } else { setMouseClickData(d); - onSeriesMouseClick(d); + if (onSeriesMouseClick) onSeriesMouseClick(d); } } }} diff --git a/src/Components/Graphs/StripChart/HorizontalStripChart/Graph.tsx b/src/Components/Graphs/StripChart/HorizontalStripChart/Graph.tsx index 3d73d76..cd50d5a 100644 --- a/src/Components/Graphs/StripChart/HorizontalStripChart/Graph.tsx +++ b/src/Components/Graphs/StripChart/HorizontalStripChart/Graph.tsx @@ -157,10 +157,10 @@ export function Graph(props: Props) { resetSelectionOnDoubleClick ) { setMouseClickData(undefined); - onSeriesMouseClick(undefined); + if (onSeriesMouseClick) onSeriesMouseClick(undefined); } else { setMouseClickData(d); - onSeriesMouseClick(d); + if (onSeriesMouseClick) onSeriesMouseClick(d); } } }}