ngx-charts doesn't work with IE 11

Created on 22 Feb 2017  路  7Comments  路  Source: swimlane/ngx-charts

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here

Current behavior
Crashes when trying to load the library.

iexplore_2017-02-22_12-50-17

Expected behavior
Does not crash.

Reproduction of the problem
Visit your demo site with IE 11: https://swimlane.github.io/ngx-charts/

Please tell us about your environment:
OS: Windows 10 Pro x64
IDE: Atom
Node: 7.5.0

  • ngx-charts version: 4.1.2

  • Angular version: 2.4.8

  • Browser: IE 11

  • Language: TypeScript 2.0.10

Most helpful comment

this polyfill.ts works for me

``import 'core-js/es6';
import 'core-js/es7/array';
import 'core-js/es7/reflect';
import 'core-js/client/shim';
import 'classlist.js';
import 'intl';
require('zone.js/dist/zone');

// IE11 fix
if (typeof SVGElement.prototype.contains == 'undefined') {
SVGElement.prototype.contains = HTMLDivElement.prototype.contains;
}``

require yarn add classlist.js intl

All 7 comments

Include the classList polyfill referenced here:
https://angular.io/docs/ts/latest/guide/browser-support.html#!#classlist

Oh thanks, I will do that on my site.

The bug I showed there happened on your demo site though. So I was assuming that it wasn't working.

@HitomiTenshi did that work for you?

@marjan-georgiev Including es6 shims and after that the classList polyfill worked! At least the the line chart.

sorry but i have a similar issue wit IE11, my chart displays well on Chrome and Mozilla some advises please

import { BrowserAnimationsModule } from '/animations';
import { NgxChartsModule } from '@swimlane/ngx-charts';

ERROR Error: Uncaught (in promise): TypeError: Object doesn't support property or method 'contains'
TypeError: Object doesn't support property or method 'contains'

[legend]="showLegend" [autoScale]="autoScale" [timeline]="timeline" [roundDomains]="roundDomains" (select)="onSelect($event)">

this polyfill.ts works for me

``import 'core-js/es6';
import 'core-js/es7/array';
import 'core-js/es7/reflect';
import 'core-js/client/shim';
import 'classlist.js';
import 'intl';
require('zone.js/dist/zone');

// IE11 fix
if (typeof SVGElement.prototype.contains == 'undefined') {
SVGElement.prototype.contains = HTMLDivElement.prototype.contains;
}``

require yarn add classlist.js intl

Was this page helpful?
0 / 5 - 0 ratings

Related issues

emeric0101 picture emeric0101  路  3Comments

faisalnet5 picture faisalnet5  路  3Comments

kakalos12 picture kakalos12  路  4Comments

ianfdk picture ianfdk  路  3Comments

amcdnl picture amcdnl  路  4Comments