uploadFirebase

Usage: Uploads data from Firebase to be used as chart data. The function will asynchronously fetch the data and return a promise if data is successfully fetched. This must be called before make, using, and in when creating a chart because you want the data to be fetched before building the chart.

If using this function, you would need to chain a then and use the data returned to create your chart. For catching any errors, we recommend chaining a catch at the end. See example below.

See liveUpdateFirebaseData for instructions on how to enable chart with live data updates from Firebase!

uploadFirbase(firbaseUrl)
Params Type Units
firebaseUrl String N/A

Example:


tld3.uploadFirebase('https://tld3.firebaseio.com/') // upload data from from Firebase
    .then((data) => { // if the promise returns successfully, create the chart
      tld3.make('BarChart')
          .using(data)
          .in('#barchart');
    })
    .catch((err) => { // else handle error
      console.error(err);
    });