Creating a template variable
Now that we have an idea of what our panel might look like, we observe that if we were to create additional panels, one for each category of 311 call, we might need to create many panels, with each being a virtually identical panel, except for the value of the category in question. This seems tedious at best, and a potential maintenance nightmare at worst. What would happen if, say, you wanted to tailor the color scheme for the breakdowns or change the stacking options? You might end up clicking through dozens of panels, just to make a single change.
What if we could put a placeholder string in our query, and then set the value of that placeholder from a menu selection? You would then be creating a kind of template panel, with a placeholder standing in for the actual query value. In the panel query, you would fill a template panel variable. A template variable is a special string that represents a placeholder that Grafana will substitute from a selection...