mykola-digtiar / chartjs-plugin-piechart-outlabels

Highly customizable Chart.js plugin that displays labels outside the pie/doughnut chart.
https://piechart-outlabels.netlify.com/sample/
MIT License
52 stars 39 forks source link

Math.trunc not supported in Internet Explorer #19

Open dalownerx3 opened 3 years ago

dalownerx3 commented 3 years ago

The constructor uses Math.trunc() but that is not supported by Internet Explorer https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc.

One should add this right before the Math.trunc() function call:

            if (!Math.trunc) {
                Math.trunc = function (v) {
                    return v < 0 ? Math.ceil(v) : Math.floor(v);
                };
            }