1

In my InfluxDB have a binary event stream that indicates whether an cleaning is ongoing (1) or not (0).

> SELECT * FROM cleaning LIMIT 10;
name: cleaning
time                value
----                -----
1561622810000000000 1
1561623025000000000 0
1561709577000000000 0
1561795643000000000 1
1561795864000000000 0
1561882011000000000 1
1561882227000000000 0
1561968461000000000 1
1561968714000000000 0
1562054978000000000 1

I also have some sensor data that measures values in the interval [0, 14].

> SELECT * FROM primary LIMIT 10;
name: primary
time                value
----                -----
1561606794000000000 5.89
1561606976000000000 5.88
1561607114000000000 5.87
1561607195000000000 5.86
1561607268000000000 5.85
1561607341000000000 5.84
1561607440000000000 5.83
1561607548000000000 5.82
1561607641000000000 5.81
1561607724000000000 5.8

I want to display both time series in Grafana on the same panel like this: Image showing binary event as unit jump signal on same panel as sensor signal

Using the raw time series by queuing SELECT value FROM cleaning; in Grafana leads to a sawtooth signal. Thats not what I want. I've tried queries using GROUP BY operations but I was not able to create the wanted pattern.

How do I create the pattern displayed in the image? Is it even possible? If yes, is it also possible for the binary signal to span over the whole height of the panel?

fischor
  • 91
  • 2
  • 7

1 Answers1

1

When editing a panel, activate Visualization > Mode Options > Staircase option to get the desired staircase/stepplot visualization. You can use the alias or regex option to apply it to a single series.

fischor
  • 91
  • 2
  • 7