# Grafana question about line for all input in DB

**URL:** <https://discourse.nodered.org/t/grafana-question-about-line-for-all-input-in-db/46370>\
**Category:** General\
**Created:** [27 May 2021 20:39 UTC](https://discourse.nodered.org/t/grafana-question-about-line-for-all-input-in-db/46370 "2021-05-27T20:39:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [27 May 2021 20:39 UTC](https://discourse.nodered.org/t/grafana-question-about-line-for-all-input-in-db/46370/1 "2021-05-27T20:39:03Z")

</div>

Hello  
i do send daily aproximatly 10 time information to a influxDB.  
With Grafana i just would like the hourly input as bar and cumulative line of each input into the database.  
i just can't find out how to use it - best would be to count how many time a timestamp have been crated.  
thanks for a feedback  
have a nice day  
vinc

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 May 2021 20:56 UTC](https://discourse.nodered.org/t/grafana-question-about-line-for-all-input-in-db/46370/2 "2021-05-27T20:56:36Z")

</div>

It isn't clear exactly what you want. Could you show us an example of what is in the db and what you want to see.  
Note that this isn't related to node-red at all, it should really be addressed to the Grafana forum, but unfortunately their forum is often useless.

---

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [27 May 2021 21:25 UTC](https://discourse.nodered.org/t/grafana-question-about-line-for-all-input-in-db/46370/3 "2021-05-27T21:25:36Z")

</div>

@Colin  
you are right the grafan forum is useless.

just imagine  
time | temp | humidity  
1622121314650076482 | 25 | 45  
1622121194555993546 | 20 | 35  
1622121075258313152 | 30 | 35  
1622115555326630910 | 22 | 35  
1622082315267830865 | 20 | 35  
1622076794912493915 | 27 | 55

the numbers are not important

i would like to have x line the time any 1 would be to count how many data you have so would be 6 and it would be a curve going up without stop

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 May 2021 09:03 UTC](https://discourse.nodered.org/t/grafana-question-about-line-for-all-input-in-db/46370/4 "2021-05-28T09:03:44Z")

</div>

Something like this I think  
`SELECT CUMULATIVE_SUM(COUNT("temp")) FROM "the_measurement" WHERE $timeFilter GROUP BY time($__interval)`

The COUNT select counts the number of non-null values of the field temp over each pixel interval and the CUMULATIVE\_SUM accumulates them across the chart.  
That is assuming you are using influx 1.8.

---

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [28 May 2021 17:26 UTC](https://discourse.nodered.org/t/grafana-question-about-line-for-all-input-in-db/46370/5 "2021-05-28T17:26:00Z")

</div>

It works. Merci @Colin - yes my influx 1.8.6  
How is a horizontal line called ?

But i found out something "strange"  
if the datas are lets say daily 3 datas and over 5 day and if the view is over 7days i got a sum of 15 which is correct. if i change the zoom level to 3 day i will get a sum of 9 datalines

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 May 2021 17:45 UTC](https://discourse.nodered.org/t/grafana-question-about-line-for-all-input-in-db/46370/6 "2021-05-28T17:45:00Z")

</div>

Do you mean the chart goes from 0 to 9? If so you can zoom in on each of the steps and see when they were. Enable staircase node in the chart to make it easier to see when they were.

---

<div class="post-metadata">

**Author:** ![vikozo](https://avatars.discourse-cdn.com/v4/letter/v/858c86/32.png) [@vikozo](https://discourse.nodered.org/u/vikozo)\
**Post date:** [28 May 2021 17:50 UTC](https://discourse.nodered.org/t/grafana-question-about-line-for-all-input-in-db/46370/7 "2021-05-28T17:50:24Z")

</div>

yes if I zoom in 3 days it show 0-9 not important how much data are befor.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 May 2021 18:50 UTC](https://discourse.nodered.org/t/grafana-question-about-line-for-all-input-in-db/46370/8 "2021-05-28T18:50:10Z")

</div>

Sorry I don't understand what you mean. Do you mean that you want to show the total including what comes before the bit on the chart?

If so then can you explain why you want that?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 July 2021 18:50 UTC](https://discourse.nodered.org/t/grafana-question-about-line-for-all-input-in-db/46370/9 "2021-07-27T18:50:17Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
