0👍
Depends on what backend you use. For example, if u obtain data through php from mysql you would use the below:
array1=[];
array2=[];
//api call on backend
this.http.get('http://localhost/angular9/chartData.php').subscribe(data => {
//create array and push the data
this.array1.push(data);
//assign this array to another arraya and map it
this.array2 = this.array1[0].map(function(item, keys) {
var mixarrayy = Object.keys(item).concat(Object.values(item));
return mixarrayy;
});
- Chartjs-ChartJS Adding Different Lines for each column
- Chartjs-Chart.js Version 3: how to set the different color for tick lines and gridlines
Source:stackexchange.com