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
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
本文标签: javascriptmathmax() doesn39t work in IEStack Overflow
版权声明:本文标题:javascript - math.max() doesn't work in IE - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744910053a2631859.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论