Good afternoon everyone, I'm studying the ionic and would like to represent some data that is in a DB in my chart. I made the list via api of php and the values are arriving all right (I even used ngfor to list them), but I do not know how to make the data from bd into an array. Here are the codes: (List in .html)
<ion-item-sliding *ngFor="let produto of mesa">
<ion-item >
<ion-row>
<ion-col col-8>
{{produto.potencia_atual}}
</ion-col>
</ion-row>
</ion-item>
</ion-item-sliding>
page.ts
grafico(){
this.consumoProvider.grafico()
.then(data => {
this.mesa = data;
});
}
page.ts in the part of the label representation:
{
label: 'Meu terceiro Dataset',
fill: false,
lineTension: 0.1,
backgroundColor: 'rgb(255, 0, 0)',
borderColor: 'rgb(255, 00, 00)',
borderCapStyle: 'butt',
borderJoinStyle: 'miter',
pointRadius: 1,
pointHitRadius: 10,
data: (????),
scanGaps: false,
}
]
}
Where "(????)" would be the name of the array variable.