Chart.js-RangeSlider icon indicating copy to clipboard operation
Chart.js-RangeSlider copied to clipboard

Cannot read property 'splice' of undefined

Open ffixitt opened this issue 7 years ago • 3 comments

Something is wrong ....

ffixitt avatar Jun 27 '18 13:06 ffixitt

I got the same error with the minimal version. Switching to the RangerSlider-all.min.js seems to fix the problem.

I believe it has to do with jQuery version. The one I'm using when I get the error is v3.3.1 as opposed to the "All" version that includes jQuery v2.1.3

Hope this helps.

spmsh avatar Sep 11 '18 16:09 spmsh

I have the same error in the console. No matter which version (3.31 or 2.1.3) of jQuery is included. Any help, please?

Edit: problem solved by copying this specific js files from the header section of the fiddle example:

jacekpietrzyk1 avatar Jul 10 '19 22:07 jacekpietrzyk1

Just downloaded the package as is and had to modify 2 things in RangeSlider-all.min.js on line 18617 to get the test-1.html chart to open:

nD.pointBackgroundColor=nD.pointBackgroundColor.splice(min,max-min||1) to nD.pointBackgroundColor=nD.pointBackgroundColor and nD.pointBorderColor=nD.pointBorderColor.splice(min,max-min||1) to nD.pointBorderColor=nD.pointBorderColor

Error in the console(Chrome 81) is : Uncaught TypeError: Cannot read property 'splice' of undefined at Object._getData (RangeSlider-all.min.js:18617) at Object._create (RangeSlider-all.min.js:18617) at new RangeSliderChart (RangeSlider-all.min.js:18617) at test-1.html:133

Chart loads find after making the 2 changes, just possibly missing colour as I likely just removed the 2 properties being passed correctly

biiim avatar Apr 23 '20 12:04 biiim