Trying to assign dynamic values coming from angular service in angular component does not update HighChart. If I call drawChart from outside of service response subscribe method, it works but with hardcoded data because response data is not available outside subscribe method.
Following are HighChart options.
chart:{ type: "bar"}, title: {text:null}, xAxis:{categories:null}, yAxis: { title:{ text:"time (seconds)" } }, tooltip: { valueSuffix:"seconds" }, series: [] };```HighChart on my HTML.
[Highcharts] = "SomeChart" [options] = "ChartOptions" style = "width: 100%; height: 100%; display: block;"> </highcharts-chart>```This high chart is being populated by following code in angular component.
let resp = this.RptService.getWorkflowAvgTime(); resp.subscribe(reportData=> {this.DataSource.data = reportData as sommeObject[]; this.drawChart(reportData);}) }```following is drawChart function
{ let s: Array<any> = [] data.forEach(function (obj) { s.push({name: obj.yIdentifier, data:[obj.value]}) }) this.ChartOptions.series= s; console.log(this.ChartOptions.series); // Console prints proper values assigned to chartOptions }```