Time Series Bars are out of proportion


i have Grafana 9.3.6 installt and a Time Series Panel for killowatthour per Month.
The Bars are not proportional (see Picture)

Heres my code:

from(bucket: "solarkraftwerk")
  |> range(start: -12mo, stop: now())
  |> filter(fn: (r) => r["_measurement"] == "solarkraftwerk")
  |> filter(fn: (r) => r["_field"] == "todaykwh")
  |> aggregateWindow(every: 24h, fn: last, createEmpty: false)
  |> truncateTimeColumn(unit: 1m)
  |> aggregateWindow(every: 1mo, fn: sum, createEmpty: false)
  |> timeShift(duration: -1d)

  • What Grafana version and what operating system are you using?
    Raspberry Pi 4B Raspian OS 64bit Bullseye 11 Kernel 5.15
    Grafana 9.3.6

  • What are you trying to achieve?
    Bars proportional

  • How are you trying to achieve it?

  • What happened?

  • What did you expect to happen?

  • Can you copy/paste the configuration(s) that you are having problems with?

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

  • Did you follow any online instructions? If so, what is the URL?

What does the graph look like when you remove the above?

Also, does using Step Before or Step After help?

EDIT: I misunderstood the original question. I thought it was about the alignment of the bars with the months, but it was about the proportional height of the parts. The solution by @ldrascic should work fine.

Hi @starfoxfs,
Bars are not proportional because y-axis starts from 8.6 kWh instead of 0 kWh. You can change that y axis starts from 0 by setting Min = 0 (under Standard options).

Another option is to define Soft min = 0 (under Overrides) which will do the same. Key difference is that soft boundaries can be exceeded while true boundaries (Min/Max) can’t. So, if you use boundary Min = 0 and have negative values of power (just an example) those won’t be shown on graph while if you use Soft Min = 0 then you would see those values on graph as well. In your case you can use either one because you can only get power from Solar panels :sun_with_face: ( well, untill short circuit :zap: :smiley: ) .

Grafana override soft min

Here is explanation between Max and Soft Max:

Best regards,

1 Like


thanks for the fast answers :smile:

|> timeShift(duration: -1d)

If i delete this only the bars move 1day to future, but the Proportion is the same.

What helped is @ldrascic answer, setting an override with Soft min = 0 :+1:

Now it´s fine