Variable associated with names

What Grafana version and what operating system are you using?

  • Oracle Linux Server 8.8
  • Grafana 10.1.1

I have a dashboard with the following variable:
$month = 1M, 2M, 3M

In the “timeShift” function, I use it to select up to 3 previous months from an Zabbix SLA monitoring.
time_shift_var

There’s a text box above the SLA visualization that displays a simple text.

image


Is there a way to display the selected month in a textual form instead of the actual variable value?

For example:

If $month = 1M
Then the text box displays “August”

If $month = 2M
Then the text box displays “July”

If $month = 3M
Then the text box displays “June”

You can use value mapping in your variable so you can display the month name and you can also follow our detailed documentation on it.

Hi @infofcc3, thanks for the reply.

Value mappings are not available for text visualizations.

Also, your suggested mapping is fixed, and I was looking for some sort of dynamic mapping.

Thanks for your clarification! In the Text Panel, there is limited functionality for adding dynamic mappings. If you’re looking for more advanced dynamic mapping capabilities, you can use the Dynamic Text Plugin.