Skip to main content

Dynamic Text Panel 3.1.0

· Updated on September 15, 2023
Mikhail Volkov

We're excited to announce the release of the Dynamic Text Panel 3.1.0. This feature release includes the following updates:

  • Added Time Zone and Range parameters for JavaScript Code.
  • Added Replace variables and Location service parameters for Javascript Code.
  • Updated the replaceVariable function with a scoped function. Variables in repeated panels are supported.
  • Updated to the latest Grafana 9.4.3 toolkit.
Grafana Catalog

The plugin was updated in Grafana Catalog on March 13, 2023.

Time Range and Zone

Added the Time Zone and Time Range parameters enabling the display of the selected time zone and time ranges with custom handlers.

Here is an example of how to display the selected dashboard, user's time zone, and time range in Grafana.

Content

<h2>Dashboard {{tz}}</h1>
<h2>Browser {{browser}}</h1>

```json
{{{json (range)}}}
```

JavaScript Code

handlebars.registerHelper('tz', () => timeZone);
handlebars.registerHelper('range', () => timeRange);
handlebars.registerHelper('browser', () => Intl.DateTimeFormat().resolvedOptions().timeZone);
Dynamic Text allows displaying updated time zone and range in Grafana.
Dynamic Text allows displaying updated time zone and range in Grafana.

Replace Variables

Updated the replaceVariable function with a scoped function and added support for repeated panels.

Dynamic Text Panel provides the {{variable}} helper to work with dashboard and global variables. Alternatively, you can create a custom Handlebars helper to introduce additional logic and formats.

Content

- Native helper **{{variable "test"}}**
- Custom helper **{{myVariable "test"}}**

JavaScript Code

handlebars.registerHelper("myVariable", (name) => replaceVariables(`$${name}`));

Magic (JavaScript) Trio

One of the three plugins that complete Grafana is Dynamic Text Panel. With Dynamic Text, Data Manipulation, and Business Charts Panel you can create fully functional web applications meeting your needs and expectations.

Dynamic Text, Data Manipulation, and Business Charts Panel plugins.

Getting Started

You can install Dynamic Text Panel from the Grafana Plugins catalog or using the Grafana command line tool.

For the latter, please use the following command:

grafana-cli plugins install marcusolsson-dynamictext-panel

YouTube Tutorial

Dynamic Text Panel is a Grafana visualization plugin that converts plain text and table data into visually appealing, easy-to-read information cards. You can use variables, Markdown, and Handlebars to customize the look of the outputted cards.

The Dynamic Text Panel plugin allows you to construct a text visualization template from the values of a dataset returned by a data source query.

Markdown, HTML, and Handlebars for transforming data visualizations.
JavaScript code in Dynamic Text Panel.

Release Notes

Features / Enhancements

  • Added support for the Time Zone and Time Range parameters in JavaScript code (#155).
  • Added compatibility with Grafana 9.4.3 (#156).
  • Added the Magic (JavaScript) Trio tutorial in the README file (#157).
  • Updated the replaceVariables function with a scoped function (#160).
  • Added the Replace variables and Location service parameters for JavaScript code (#160).

Feedback

We're looking forward to hearing from you. You can use different ways to get in touch with us.

  • Ask a question, request a new feature, or report an issue at GitHub issues.
  • Subscribe to our YouTube Channel and leave your comments.
  • Sponsor our open-source plugins for Grafana at GitHub Sponsor.
  • Support our project by starring the repository.