Quiero ver mi campo Firestore al cargar, pero pasó como 1 valor con 2 parámetros.
no se como solucionar esto por favor ayuda :)
[fuego]: https://i.stack.imgur.com/Vhww8.png
[gráfico + algo de console.log]: https://i.stack.imgur.com/yY1o6.png
var dataArray = []; const pH = {}; async function GetDocument() { var ref = doc(db,"pHvalue", "pH"); const docSnap = await getDoc(ref); if(docSnap.exists()){ pH.value = docSnap.data().pH; dataArray.value = dataArray.push(pH.value); console.log(pH); console.log(pH.value); console.log(dataArray); }; Chart.defaults.font.size = 20; Chart.defaults.font.color = '#000'; const ctx = document.getElementById('myChartpH').getContext('2d'); const myChart = new Chart(ctx, { type: 'line', data: { labels: ['pH'], datasets: [{ label: 'pH value', data: dataArray, fill: true, backgroundColor: 'rgb(120, 16, 126)', borderWidth: 1, pointStyle: 'circle', pointRadius: 5, pointBackgroundColor: "yellow", pointBorderColor: 'rgb(0, 0, 0)' }] }, options: { scales: { y: { beginAtZero: true, } } }, }); } window.onload = GetDocument;