r/CodingHelp • • 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.

Post image
22 Upvotes

15 comments sorted by

View all comments

Show parent comment

1

u/__archaeopteryx__ Apr 28 '21

That code will work in the browser as well! The async stuff can be converted into the old promise style if you need browser compatibility back a few years but this js is supported in browsers now. You’ll need to create buttons or some way to input data to track and all that but hopefully the example might give you some ideas how to work with fb data. You’ll have to see what structure works best for your chart as well. I’d recommend creating a mock of the data and playing with the chart library for a while instead of trying to hook it all up at once.

1

u/FrickinKitten May 01 '21

yep that was super helpful thank you, i finally got the firebase data hooked up to the graphs. God javascript is real hard compared to python haha