admin管理员组

文章数量:1405621

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
Add a ment  | 

1 Answer 1

Reset to default 9

Use apply instead of the spread operator:

max: Math.max.apply(this, data.datasets[0].data) + 15,

This works on IE: jsfiddle

本文标签: javascriptmathmax() doesn39t work in IEStack Overflow