0
To popular a precise monthly/annual data chart that the Array is grouped by date.
Data from the Firestore:
this.chartsSrv.chartGeral().subscribe((snapshot) => {
snapshot.docs.forEach(doc => {
let item = doc.data();
this.dataArray.push({
"id": item.id,
"dataPost": moment(item.dataPost.toDate()).format('DD/MM/YYYY')
});
})
})
console.log(this.dataArray);
The chart requires 3 information according to the following formats.
Pico: It switches as the maximum value of the length property of the array you would need to create.
Months: [Jan, Feb, Mar ... ] according to the values that come from each array group in the dataPost item
Total per Month: then enters the question that I need to group by date and take the length property of each group.
Okay, what have you tried?
– veroneseComS
@veroneseComS tried this answer but unsuccessfully https://answall.com/questions/342198/l%C3%b3gica-para-agrupar-dados-em-array-javascript? Rq=1
– Ezequiel Tavares