How to make sure your live-updating visualization works if you're using Google Sheet's IMPORTDATA
This article will hopefully explain provide a solution if you are
- using Datawrapper's external data source feature with Google Sheets to create a live-updating chart,
- pulling data from different URLs or sheets or using IMPORTDATA function, and
- having issues where your live-updating chart is not appearing or is not updating.
If you're using IMPORTDATA to load a link to another sheet or a CSV data, it takes a few seconds for the data to load while the sheet displays " loading..." and the cells remain empty:
This happens especially when you have a large dataset. When this happens frequently enough to coincide with when Datawrapper is scheduled to retrieve data from the linked spreadsheet every minute/hour, Datawrapper will update the chart's data with empty cells instead of actual values that can be plotted. This results in an empty chart or missing data in charts.
A solution to this would be to use the Google Apps Script to write a script that will only replace the values when the updated data is loaded and ready to be displayed. To read how to do this, visit the Academy articles below:
- CSV data: " How to set up automatic updates on a Google Sheet".
- JSON data: "How to create live-updating charts with JSON data"
If you still encounter issues, reach out to us at support@datawrapper.de.