Skip to content

Commit

Permalink
Fix Cannot read property 'chart' of undefined error
Browse files Browse the repository at this point in the history
Fixes #75
  • Loading branch information
mattlewis92 authored Oct 11, 2017
1 parent 63e1624 commit 7b50cd1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ng2-highcharts-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ export abstract class Ng2HighchartsBase implements OnDestroy, DoCheck {
var duration = parseFloat(getComputedStyle(this.hostElement.nativeElement).transitionDuration);
var interval = setInterval(() => {
if (duration < 0) { clearInterval(interval); }
this.pChart.reflow();
duration -= 50;
try {
this.pChart.reflow();
} catch (e) {}
}, duration);
}

Expand Down Expand Up @@ -55,4 +57,4 @@ export abstract class Ng2HighchartsBase implements OnDestroy, DoCheck {
}

abstract draw(opt: any /*HighchartsOptions*/): void;
}
}

0 comments on commit 7b50cd1

Please sign in to comment.