javascript - math.max() doesn't work in IE - Stack Overflow

I'm using chart.js to make a chart in my project. It is working fine except for the fact that Inte

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744910054a4600493.html

相关推荐

  • javascript - math.max() doesn't work in IE - Stack Overflow

    I'm using chart.js to make a chart in my project. It is working fine except for the fact that Inte

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信