grafana-discrete-panel icon indicating copy to clipboard operation
grafana-discrete-panel copied to clipboard

Display values outside the query window (fill left)

Open Tisonus opened this issue 7 years ago • 6 comments

My Problem The database query returns changed values in the selected time window. If the value does not often change over the specified time, Discrete displays less than a user expects.

6h query 6h 12h query 12h should be like this: gesamt InfluxDB query grafik

What I want Extend database query by one status change, fill previous and still display only the selected time period --> Fill the 6h with "Single" on the left side

Tisonus avatar Sep 18 '18 14:09 Tisonus

I have a similar issue. I have a table of measurements with only boolean values (in essence; at what time a sensor change state from on to off or vice versa):

2018-10-28 15:36:54   false
2018-10-28 16:03:17   true
2018-10-28 16:04:17   false
....

image

However, the initial value is always 'N/A' because the previous event is outside of the selected range. I tried playing with the fill values but none did what I wanted; get the actual value instead of N/A for the leftmost part of the bar.

RobThree avatar Oct 28 '18 15:10 RobThree

Another problem:

image

Let's call the top bar A and the one below B. This is the data:

Date               Sensor State
2018-10-30 23:33:42   B   OFF
2018-10-30 23:33:26   A   OFF
2018-10-30 23:33:12   B    ON
2018-10-30 23:32:56   A    ON

If you 'replay' these event's you'll see that the last color from the previous bar is used in the next bar. And that the starting color, once the date's go 'out of range' on the left, change to grey for the top bar but the second bar always starts with the previous bar's color...

Also: the above screenshot shows 'grey' correctly since there are no previous values. But as soon as the green part makes it to the left it goes 'grey' for the (what should've been) green part and then orange for the remainder. And if you don't have any changes in the current time window the bar even disappears.

It's hard to explain; I'll see if I can shoot a video / timelapse that won't bore you out of your mind waiting for all events to unfold.

RobThree avatar Oct 30 '18 22:10 RobThree

@RobThree -- I made a new issue for the problem you describe. That is clearly a bug, lets keep this issue for the feature request

ryantxu avatar Oct 31 '18 00:10 ryantxu

For the Discrete Panel you can workaround it by adding something like "-7d" after $timeFilter (in case of InfluxDB). This is not Supersmart, and a prefetch mechanism in Grafana would be nicer, but you can help yourself with that.

lephisto avatar Jan 22 '19 23:01 lephisto

@lephisto, Thanks for the workaround!

Just wanted to mention that it only works for "last XXX" time ranges and breaks "from X to Y".

Equidamoid avatar Aug 04 '19 09:08 Equidamoid

Quite same problem here, if value changes before time-range, proper value is not rendered image Complete time range image partial time range.

As you can see, on the second line, if value begins before time range, value is not rendered. Second line should be yellow from 18:20 to 22:00. It's well rendered if time range is enclosing these times, but if it's shorter as in the second graph, the second line is not rendered before 22:00 as if Grafana didn't know the value.

Vartkat avatar Feb 27 '20 23:02 Vartkat