How to show field name in Legend?

If you were accessing the raw field ( without mean, last, etc ) and no groupBy - $col would contain the field name.

Without “Alias” (within grafana ux) or “AS” (in raw query editor) - Influx will return the function name that created the column, not the original field name; in the returned data.

As mentioned; you may need to manually set an ‘alias’ for each field you need in the legend.

3 Likes