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']
};
});
}
}