0

angular-hicharts deprecated their ref and uses a ref$ observable instead.

I have updated to Highcharts 7 and the latest version of angular-highcharts that supports Highcharts 7.

I used the code below to drillUp() but I assume that I should change to use the new ref$ but I am unsure how to.

this.pieChart = new Chart(this.getConfig());
...
...
this.pieChart.ref.drillUp();

How do I use the ref$ observable to drillUp()?

Do I need to subscribe to ref$ and assign the reference to the variable? Something like this?

 pieChart.ref$.subscribe(chartReference => {        
    this.chartReference = chartReference;        
 });

The above gives an error for missing properties when typed as Chart.

Xander
  • 402
  • 1
  • 6
  • 19
  • You are not using the official wrapper, see https://github.com/highcharts/highcharts-angular. In that wrapper, you might use the chart callback function to create a reference to the chart. Demo: https://stackblitz.com/edit/highcharts-angular-basic-line-ctjx9a – Karol Kołodziej Jan 15 '21 at 07:12
  • @KarolKołodziej The office wrapper doesn't support Highcharts 7 though, but thanks for your comment. – Xander Jan 16 '21 at 10:14
  • As you might check in the `package.json` in the official wrapper the minimal version of Highcharts is 6.0.0. https://github.com/highcharts/highcharts-angular/blob/master/highcharts-angular/package.json – Karol Kołodziej Jan 18 '21 at 08:48
  • Also, the demo works just fine with the 7.0.0 version: https://stackblitz.com/edit/highcharts-angular-basic-line-tyhsxr – Karol Kołodziej Jan 18 '21 at 08:49
  • @KarolKołodziej Thanks for the info. I was look at the project's package.json https://github.com/highcharts/highcharts-angular/blob/master/package.json which states 8.2.2. Which is correct? It might work with 7 but is it intended to work with 7? – Xander Jan 19 '21 at 14:31
  • The project with a few charts in it which is attached to the wrapper works on the latest Highcharts version (which for now is 8.2.2). We are always trying to test the new release with the wrapper that is why we always update the version there. But the wrap is tested and works fine with versions above the 6.0.0. – Karol Kołodziej Jan 22 '21 at 07:39

0 Answers0