I want to reset the data everytime my slider event runs but I seem to be going in a loop. This is the sequence of events I am TRYING to create:
- Data and chart loads up with all
data, initially. - Slider runs and changes the
begandenddates. I capture those dates and trigger afilterData()event. - The
filterData()event runs with new dates (from slider event) and should filter originaldatawith new date parameters. This then triggersupdateChart()event which takes updated filtereddataand displays new chart.
I tried a bunch of things. Right now, the problem is that it does not recognize the variable data even though I made it global (which I’m not even confident is the right thing to do).
How and where can I filter data to reset it everytime slider runs?
My code: