How to create graphs dynamically?

I’m calling the APIs and getting the JSON array as an API response. Inside the JSON array, each object has some numerical values, now I want to create graphs for each object’s numerical value in different rows, and each row has an object ID as a row title.

for example; suppose I am getting this response:

{
  "data": [
    {
      "state": "state 1",
      "co2": 12,
      "o2": 10
    },
    {
      "state": "state 2",
      "co2": 12,
      "o2": 10
    }
  ]
}

(this is the sample response).

Here I want to create state-wise rows with state names as row titles, inside each row graph for co2 and o2. I want to create rows and graphs dynamically because the number of states may vary inside the JSON array.

@mattabrams can you help me in this?