Get column name instead of value in data link variable from bar chart

What I wanted to achieve was possible on our latest version of Grafana before updating to v10.0.3.

I have the following bar chart panel:

And I want to create a data link that references the ‘pumpkin_pie’ and ‘blueberry_pie’ (the bar names) instead of the values. Before upgrading to Grafana v10.0.3, this datalink implementation worked well and, when hovering, provided me two options, one for the value and one for the name of the bar.

grafana/path_to_dash?var-Pies=${__value.raw}

The ${__value.raw} variable provided the value as well as the name of the bar. Now, in the new version, it only provides the value of the bar. Has the name of the bar been moved to a new variable? Or should I open a feature request for this to be fixed/implemented again?

Hi there,

You can get the name of the bar with ${__data.fields[0]} instead of ${__value.raw}. This change is since Grafana 10.0.0, but I can see we haven’t done a proper job of announcing it in the documentation. Truly sorry about that!

Thank you for the input, we will see into adding it to the documentation!

UPDATE: Even though ${__data.fields[0]} will get you what you need, it turns out that the fact that using ${__value.raw} in a data link resulted in more than 1 links was a bug. Instead, you can get that as an option - by setting Tooltip mode to “All” instead of “Single”.

Unable to replicate this, I spun up Grafana 9.5 and ${__value.raw} is the same as in 10, the raw unformatted value

I checked 9.1. Maybe the change is further back from Grafana 10 indeed. Somewhere between 9.1 and 9.5