How to display legend title?

Hi, I might have an embarrassingly stupid question but I spent hours try to figure it out and failed:(

I have the following query:

SELECT
UNIX_TIMESTAMP(TIMESTAMP) as time_sec,
Cast(value as decimal(10,6)) as value, 
"SOLL-Temperatur Flur" as metric
FROM history
WHERE READING="desired-temp" AND DEVICE="EMS_Regelung" AND $__timeFilter(TIMESTAMP)
ORDER BY `TIMESTAMP` ASC

It’s a dead simple query to get temperature data and display it. But what kills me is, that Grafana shows only “value” as label for the timeseries - although it should show “SOLL-Temperatur Flur”. Grafana shows also “value” for any other query as legend (title).

What am I doing wrong? It seems funny I cannot show a correct label on the data in such an amazingly powerful tool like Grafana;))

Any help is much much appreciated!!

Did you try any of the transformations? There are many possible transformations, but the Organize Fields transformation is perhaps the easiest.

I’m new to Grafana and still a bit confused by the interface.

I tried to use the Organize Fields transformation but got

Organize fields only works with a single frame. Consider applying a join transformation first.

as message.

The thing that confuses me is why I put in and define the metric but cannot use it as label.

The main issue I see with transformation is that each label equals “value”. If the lines would be labeled “line 1” “line 2” etc, renaming would be easy. But if I would use a regex to replace “value” it simply replaces all labels… Frustrating.

I accidentally found the problem: the format was set to Table and not to Time Series… Now it is working as advertised…

2 Likes