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.
There’s a text box above the SLA visualization that displays a simple text.
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.
Steps to create associated variable
Create grafana dashboard and add visualization
[image]
Select the values which you want to select eg(the traditional values which are available in your datasource like: 1M,2M,3M)
[image]
Now go to add override and add override by name and select the field name
[image]
Now add override property of value mapping and click on add value mapping
[image]
Now add custome value mapping and click on update.
[image]
Final Outcome: Your values are st…
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 .