mpx200 / ng-dygraphs

Angular 2+ library for support of dygraphs(http://dygraphs.com) charts
MIT License
3 stars 9 forks source link

Fix issue with missing 'chart' element in DOM. #6

Closed JimiC closed 7 years ago

JimiC commented 7 years ago

Unfortunately my last PR introduced an unseen issue.

The use case is that when there are no data available and the noDataLabel gets displayed, #chart element is not present in the DOM, in order for Dygraph to plot the data when they are available again. The error message is TypeError: Cannot read property 'nativeElement' of undefined which relates to this.chart @ https://github.com/mpx200/ng-dygraphs/blob/master/src/ng-dygraphs.component.ts#L71

#chart needs to always be present in the DOM, therefore we need to show/hide it and not add/remove it.

Sorry for any inconvenience caused.