Change bar labels in pareto chart


I have a Pareto chart showing the number of times different alarms have been triggered.
I’m using the Pareto chart panel plugin.

What I’m trying to achieve is to change the bar labels from “OdigoText” to individual names like “Box full” and “Defective lid”.

Since there are no override options in this plugin, I find this difficult.

I’m using InfluxDB and flux as query language

from(bucket: "telegraf")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "mqtt_consumer")
  |> filter(fn: (r) => r["_field"] == "OdigoText")
  |> filter(fn: (r) => r["host"] == "IB")
  |> filter(fn: (r) => r["topic"] == "odigo/alarm/BoxFull" or r["topic"] == "odigo/alarm/DefectLid" or r["topic"] == "odigo/alarm/LidsstoreageEmpty")
  |> filter(fn: (r) => r._value == true)
  |> count()
  |> group(columns: ["_topic"])

Picture of my dashboard:

Roughly what I’m trying to accomplish:

After experimenting with various types of queries for several hours, I managed to partially resolve the issue.
Even though the problem is solved, I can’t explain how the query works.
Besides changing the query, I also had to rename the topics.