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
beg
andend
dates. I capture those dates and trigger afilterData()
event. - The
filterData()
event runs with new dates (from slider event) and should filter originaldata
with new date parameters. This then triggersupdateChart()
event which takes updated filtereddata
and 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: