cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Line Chart

divyanshArya03
7 - Data Storage
7 - Data Storage
We are using sisense widget inside our ReactApp.
There is a use case where we are subscribing to "beforequery" event and calling a function(say TestFunc) and that whenever TestFunc changes, a new instance of TestFunc gets subscribed to the event while previous one is still subscribed.

 

```
useEffect(()=>{
widget.on('beforequery', TestFunc)
},[TestFunc])
```

 

To tackle this issue of multiple functions being subscribed to the event on the widget, we are manually clearing out the handlers array in widget(array which keeps the list of functions subscribed to an event) and adding the new instance of TestFunc in that array.

 

```
widgetObject.$$model.$$events.beforequery.handlers = []
```

 

Now even though we have only one function in the handlers array, still the previous instance of the function is getting called whenever "beforequery" is getting triggered, which is resulting in visible fluctuation on the chart being displayed while it is rendered by the sisense widget.
 
Refer Code Snippet : https://pastebin.com/DNVQ847K
Sisense Version : L2023.2.0.152
React Version : 17.0.0
1 REPLY 1

Shivangi
7 - Data Storage
7 - Data Storage

Hi Team,

Could you please provide us any update on the above reported issue?

Thanks in advance