Bigous / ng2-highcharts

Angular2 library to use Highcharts out of the box
59 stars 23 forks source link

update chart data | easy way to access object reference #91

Open pkoretic opened 6 years ago

pkoretic commented 6 years ago

Hi.

I have taken a look at #10 #42 #19. However, just using this code

<div [ng2-highcharts]="chartData"></div>

and replacing the whole charData object properties triggers complete rerender as expected.

Accessing the reference is not available by default so there is no easy way to actually just update the data. The setInterval example you mentioned also replaces the whole object. Could an init event be added (similar as for example angular-highcharts) and #10 workaround, so that this would be as easy as:

<div [ng2-highcharts]="chartData" (init)="onInit($event)"></div>

without manually having to write custom code to trigger this init?

Thanks