Category: How do I do X?
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

How to Connect JSON to Chart

Issue

I'm having trouble displaying data from an internal API in a chart. The API returns JSON and I want to display one measure on the y axis over time on the x axis. I'm not sure what to put in the chart's series data field. I've tried using the JSON data source named WxAPI but it's not working. Can someone help me figure out how to display the data properly?

Resolution

The solution to displaying data from the internal API is to parse the JSON response and extract the required data.

Here's an example code snippet:

let response = '{"FireWeatherData":[{"time":1664852400000,"T_SFC":20.8000011444}, ...'

let data = JSON.parse(response)