I'm using chart.js to make a chart in my project. It is working fine except for the fact that Internet explorer isnt showing the chart. I found out that this is caused by the following code:
max: Math.max(...data.datasets[0].data) + 15,
Does anybody know if there is a similar solution or any other way?
For the entire code and how it works see this fiddle: /
Thanks in advance
I'm using chart.js to make a chart in my project. It is working fine except for the fact that Internet explorer isnt showing the chart. I found out that this is caused by the following code:
max: Math.max(...data.datasets[0].data) + 15,
Does anybody know if there is a similar solution or any other way?
For the entire code and how it works see this fiddle: https://jsfiddle/4otw7vzu/1/
Thanks in advance
Share Improve this question asked Oct 3, 2017 at 7:07 bergJbergJ 4771 gold badge4 silver badges11 bronze badges 2-
3
Math.max()
works fine in IE. The spread operator you're using doesn't work in IE. You will have to create the array in some other fashion. – Thijs Commented Oct 3, 2017 at 7:13 - Ah alright, thanks for the explanation :) – bergJ Commented Oct 3, 2017 at 10:11
1 Answer
Reset to default 9Use apply
instead of the spread operator:
max: Math.max.apply(this, data.datasets[0].data) + 15,
This works on IE: jsfiddle
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744910054a4600493.html
评论列表(0条)