i have an API that gives me timeseries data for weather sensors, the data looks like this :
{date:Date, sensorName:string, value:number, unit:string…}
let’s take a use case, i make two calls for two sensors and i get the following responses :
{date:2024-07-10T10:00:00,sensorName:’sensorA’,value:10,unit: ‘°C’…}
{date:2024-07-10T10:01:00,sensorName:’sensorA’,value:11,unit: ‘°C’…}
{date:2024-07-10T10:00:00,sensorName:’sensorB’,value:15,unit: ‘°C’…}
{date:2024-07-10T10:06:00,sensorName:’sensorB’,value:16,unit: ‘°C’…}
i would like to have the following ag-grid :
/timestamp /SensorA /SensorB
/2024-07-10T10:00:00 10 15
/2024-07-10T10:01:00 11 —
/2024-07-10T10:06:00 — 16
and each time i select another sensor, i add dynamically a new column with the sensorName as header, the new timestamp missing lines, and the values of the sensor.
could you please give me a hint on how to do that ?
i know how to get a distinct list of sensor names, but how to tell the grid, fill only the cell corresponding to the sensor ?