From c04ac115217bd8df59d095cbf767dc096457a3a3 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 27 Sep 2024 15:57:42 +0300 Subject: [PATCH] fix: bug with focus in stacking column chart (#222) --- demo/examples/legend.html | 32 +++++++++++++++++++++++++++ src/YagrCore/plugins/legend/legend.ts | 7 +++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/demo/examples/legend.html b/demo/examples/legend.html index 6544e1f..235ab63 100644 --- a/demo/examples/legend.html +++ b/demo/examples/legend.html @@ -35,6 +35,10 @@

Legend

+
+
+
+ diff --git a/src/YagrCore/plugins/legend/legend.ts b/src/YagrCore/plugins/legend/legend.ts index c06b83f..a1e508d 100644 --- a/src/YagrCore/plugins/legend/legend.ts +++ b/src/YagrCore/plugins/legend/legend.ts @@ -253,14 +253,19 @@ export default class LegendPlugin { } const targetSerie = this.yagr.uplot.series.find(({id}) => id === serieId); - if (targetSerie) { yagr.setFocus(targetSerie.id, true); + + // fix bug with focus in stacking column chart + yagr.redraw(true, false); } }; const onSerieMouseLeave = () => { yagr.setFocus(null, true); + + // fix bug with focus in stacking column chart + yagr.redraw(true, false); }; series.forEach((serieNode) => {