grafanagrafana-variable

How to set Display name in Grafana for a time series line using dashboard variables?


I currently have a dashboard variable dimensionValue defined in my variables, in my dashboard. This query for this variable equates to 2 possible values : ORDS or APEX. I would like to label the lines on a time series graph based on these variables. I tried using $dimensionValue in the Display name (Change the field or series name) field, however this ends up showing both the values in the graph legend. The green represents the first value 'APEX', and the yellow represents the second value 'ORDS'. I just want them to have their respective names instead of the whole tuple. Dashboard Screenshot


Solution

  • I was able to do this : Use transforms to find and replace by regex. This works in Grafana 8.5.27.

    Transform display name by regex in Grafana