From 0de40a889d6dc8bc9b648a317d9a50d616316e14 Mon Sep 17 00:00:00 2001 From: GitStart <1501599+gitstart@users.noreply.github.com> Date: Tue, 18 Jul 2023 13:07:27 +0300 Subject: [PATCH] feat: legend show be hidden for the graph with no data (#3168) Co-authored-by: gitstart Co-authored-by: Nitesh Singh Co-authored-by: RubensRafael Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com> --- frontend/src/components/Graph/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/components/Graph/index.tsx b/frontend/src/components/Graph/index.tsx index 6f0f475bac..cd988286cd 100644 --- a/frontend/src/components/Graph/index.tsx +++ b/frontend/src/components/Graph/index.tsx @@ -288,12 +288,11 @@ function Graph({ if (chartHasData) { chartPlugins.push(createIntersectionCursorPlugin()); chartPlugins.push(createDragSelectPlugin()); + chartPlugins.push(legend(name, data.datasets.length > 3)); } else { chartPlugins.push(emptyGraph); } - chartPlugins.push(legend(name, data.datasets.length > 3)); - lineChartRef.current = new Chart(chartRef.current, { type, data,