Grafana templating is a very useful feature. I like it because I can put multiple data series in one graph, and use the templating variable to switch on and off one series.
To create a templating variable, on the dashboard, click on gear icon and click “templating”:
In the above example, “heap” measurement has a “type” tag, which has 4 values.
To support selecting one data series, the query of the graph needs to be configured as follows: