Change axis title from description to a calculate day

Hi all,

switching form influxql to flux I have a problem with the bar-gauge axis. I’m using the InfluxDB v2.6.1 and Grafana 9.3.6.

I want to display the daily total gas consumption. My Viessmann heater provides in the api values for the last 8 days I want to consume. I called the data points V-Gas-total.day01…V-Gas-total.day08 in addition there is also a datapoint for the last timestamp V-Gas-total.readDate.
Using the following flux code, the data I get is fine, but it shows the _measurement V-Gas-total.day0X and I want to user the data point V-Gas-total.readDate or the date of today to calculate and show the day name (Mon, Tues, etc).

import "timezone"
option location = timezone.location(name: "Europe/Berlin")

from(bucket: "iobroker")
  |> range(start: -7d)
  |> filter(fn: (r) => r["_measurement"] =~ /
  |> filter(fn: (r) => r["_field"] == "value")
  |> last()

The result currently looks like this:

Any idea how I could resolve this?

Thanks, Leif

If the axis labels will always be V-Gas-total.day01…V-Gas-total.day08, then wouldn’t it be easiest to create 8 value mappings in the Grafana options?

Hi Grant,
thanks for your answer. Yes the label is always the same. But as I wrote, I’m looking for an option replace V-Gas-total.day01 with now() and than format it as …ddd, and V-Gas-total.day02 with now()-1d etc. or using just V-Gas-total.readDate instead of now.