Skip to content

Commit

Permalink
Merge pull request #82 from mattlewis92/patch-2
Browse files Browse the repository at this point in the history
Fix Cannot read property 'chart' of undefined error
  • Loading branch information
Bigous authored Nov 3, 2017
2 parents 829ad69 + 7b50cd1 commit 85fb91e
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 85fb91e

Please sign in to comment.