# How to plot data with missing data

**URL:** <https://community.grafana.com/t/how-to-plot-data-with-missing-data/122511>\
**Category:** Grafana\
**Tags:** api, alerting\
**Created:** [May 25, 2024, 4:45pm UTC](https://community.grafana.com/t/how-to-plot-data-with-missing-data/122511 "2024-05-25T16:45:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahana](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@mahana](https://community.grafana.com/u/mahana)\
**Post date:** [May 25, 2024, 4:45pm UTC](https://community.grafana.com/t/how-to-plot-data-with-missing-data/122511/1 "2024-05-25T16:45:33Z")

</div>

I have 32 sensors. Whenever the value of a sensor changes, the new value it put into an InfluxDB2 table. What I would like to do is plot those 32 sensors in one graph with the x-axis being the time and the y-axis being the value of the sensor. The issue is,

a) the timestamps are not at a fixed interval because data is only written into the DB when a value changes.  
b) For a particular timestamp, I only have data for one sensor. So for the other 31 sensors there should just be some interpolation (linear is fine) between the last reading and next reading.

Can this be achieved with Grafana? If not, I have to write a new program that just reads all 32 values at constant intervals and store all 32 values to the DB, even if the values didn’t change.

---

<div class="post-metadata">

**Author:** ![jangaraj](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/jangaraj/32/39197_2.png) [@jangaraj](https://community.grafana.com/u/jangaraj)\
**Post date:** [May 28, 2024, 7:40pm UTC](https://community.grafana.com/t/how-to-plot-data-with-missing-data/122511/2 "2024-05-28T19:40:37Z")

</div>

> [@mahana](#):
>
> Can this be achieved with Grafana?

No way. That’s task for InfluxDB. InfluxDB v1 has fill option (fill previous is the best option for your case, not linear):

> **[GROUP BY clause | InfluxDB Cloud (TSM) Documentation](https://docs.influxdata.com/influxdb/cloud/query-data/influxql/explore-data/group-by/#group-by-time-intervals-and-fill)**
>
> Use the GROUP BY clause to group query results by one or more specified tags and/or a specified time interval.

Find the same functionality in your InfluxDB v2 and try to use it.
