Dynamic data with service rest
Hello people!
I would like to support myself with the following inconvenience that I have. I am trying to load the data obtained from a rest service to the options of the chart but unfortunately does not show me the chart on screen. Thank you.
Greetings.

Is this.ventas the result of a callback, or the observable itself? Are you trying to achieve live update, or just load the data once?
@ronnyek is the result of a callback.

it won't work, only recreating component will show new data I solved it with ngIf, show the chart after data is available
@KaganRoman could you please show some sample code with ngIf?
@dgt009:
html: <chart [options]="chartOptions" *ngIf="showData"></chart> ts: refreshData() { this.service.getData().then(data => initChart(data)); this.showData = true; }
Hi @KaganRoman. In effect this problem has been solved with ngif. Thank you very much.
Regards!