Skip to main content

Variables

Use the replaceVariables() function to replace Dashboard and Global variables.

const email = replaceVariables("${__user.email}");

To learn about three types of variables take a look at Variables.

Replace Variables

In the following example, we replaced the series's name with a value from the variable.

Replace Dashboard Variables.
Replace Dashboard Variables.

Example

docs/volkovlabs-echarts-panel/replace.js
loading...

Update Variables

Dashboard variables can be updated in the Event Handlers, where

  • name is the name of the variables. Add var- to update the variable value in the URL.
  • value is the updated value.
echartsInstance.on("click", (params) => {
locationService.partial({ "var-name": value }, true);
});