Graph with 100% in the middle and positive and negative zero at the ends

  • What Grafana version and what operating system are you using?
    We are using Grafana 9.4.3

  • What are you trying to achieve?
    I am trying to graph the power factor measured by a power meter.

  • How are you trying to achieve it?
    I set up a Time Series panel using the following query:

from(bucket: "SCADA")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "${Substation}")
  |> filter(fn: (r) => r["point_id"] =~ /Power/ or r["point_id"] =~ /kW/)
  |> filter(fn: (r) => r["_field"] == "CV")
  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
  |> yield(name: "last")

I put the kW and kVAR measurements on the left axis and the power factor on the right axis, formatted as a percentage with a soft min of -100% and a soft max of 100%.

  • What happened?


    The power factor in the green trace is varying between +99.9% and -99.9%. See below for why this is a problem.

  • What did you expect to happen?
    Power factor actually runs from -0% to 100% to +0%, with +/- 100% being in the middle and =/- 0% being at the ends, rather than having zero in the middle. Is there a way to achieve this with Grafana’s time series panel?

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

  • Did you follow any online instructions? If so, what is the URL?
    I didn’t find any instructions, but I did find a unanswered related post in the plugin development section of the community: Power factor measurement Gauge

Any help or guidance here would be much appreciated.