0
Good afternoon everyone, I am studying Ionic and would like to represent some data that is in a comic in my chart. I made the list via php api and the values are all coming right(I even used ngfor to list them), but I don’t know how to turn the bd data into an array. Follow 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 label representation part:
{
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,
}
]
}
To where "(???)" would be the name of the array variable.
Just to be clear, the select of the api is this: select current potentialfrom current consumo_current.
– Lucas Vilela