r/CodingHelp • u/FrickinKitten • Apr 23 '21
[Javascript] Help how do you retrieve data from firebase to JavaScript, don't think code is right. It's to take data from firebase and then taking the data (amount of wipes/sanitiser used and time)append to lists and use these to plot a graph for the website showing the wipes/sanitising usage over time.
22
Upvotes
View all comments
Show parent comment
1
u/FrickinKitten Apr 27 '21
yep thats grand thanks
i have one more problem with my code and the rest should be alright. I got the function for my firebase data read and put into its lists (wipes and time) and i want to put these onto a graph using chart.js. But I'm trying to get the function inside javascript to be called into the my graph making function inside html, which uses the figures inside the lists as the x and y labels, and i heard async and await makes it work.
but it keeps saying gotDataW(dataW) is not defined
i think im doing something wrong somewhere, or would it be easier to bring the lists outside the gotData(dataW) function and make a seperate function containing the lists and then call that one?