Codepen
Codepen to demonstrate the problem
Click the "manually toggle" button and watch the console output
Explanation
-
What is the behavior you expect?
The selectedDataPoints array should contain an up to date list of the currently selected data points when toggled using the toggleDataPointSelection method.
-
What is happening instead?
The selectedDataPoints is being filled with NaN on every click.