2

I get the above error for the below code(trying to connect google pie chart with mysql data through php):

Could someone please advise?

export class ChartsComponent   {
  cartkey = [];
  myType:any;
  myData:any;
  myOptions:any;

constructor(
private apiService: PatientsService,
private http: HttpClient)
    { 
this.http.get('http://localhost/angular8phpcrud/chartData.php').subscribe(data => {
this.cartkey = data.map(function(item, keys) {
var mixarrayy = Object.keys(item).concat(Object.values(item));
return mixarrayy;
  });
  console.log(this.cartkey);

this.myType = 'PieChart';
this.myData = this.cartkey;
this.myOptions = {
  colors: ['#e0440e', '#e6693e', '#ec8f6e', '#f3b49f', '#f6c7b6']
  };
});
}

}
KeenLearnerA
  • 159
  • 3
  • 14

1 Answers1

0

Hi #KeenLearnerA Please check below link and I am shure this will helpful to you:

Increase this line into your component.ts file:

import { map } from "rxjs/operators";

Angular Google chart with php data

Thanks

Therichpost
  • 1,759
  • 2
  • 14
  • 19