I am currently utilizing ngx-charts version 10.0.1 to create Treemap charts. My Angular version is 7.2.1. The chart functions as expected in Chrome, but the labels do not appear in IE11. Upon page load, I encounter the following errors in the IE console:
TypeError: Object doesn't support property or method 'forEach' (Note: I am using a forEach loop to process data from the backend, I have also attempted converting it into a regular for loop without success.)
TypeError: Unable to set property 'pointer-events' of undefined or null reference.
Additionally, the hover and click animations are significantly slower in IE compared to Chrome. The tooltip displays the label and value correctly.
Techniques I have attempted so far:
1) After researching forums, I installed classlist.js and included the following links in Index.html
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/classlist.js/classList.min.js"></script>
<script src="node_modules/zone.js/dist/zone.min.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
2) I added animations.js and ensured it was properly installed. 3) Attempted a rollback to ngx-charts version 8.1.0.
However, none of the above methods resolved the issue.
Here is the code snippet from my Polyfills.ts file:
import 'core-js/es6/symbol';
import 'core-js/es6/object';
...
...
(window as any).global = window;
if (!Object.entries) {
Object.entries = function (obj) {
var ownProps = Object.keys(obj),
i = ownProps.length,
resArray = new Array(i); // preallocate the Array
while (i--)
resArray[i] = [ownProps[i], obj[ownProps[i]]];
return resArray;
};
}