

# Building dashboards
<a name="v9-dash-building-dashboards"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

After you create a Grafana workspace and sign in, you can create dashboards and modify settings to suit your needs. 

**Topics**
+ [Creating dashboards](v9-dash-creating.md)
+ [Add or edit panels](v9-dash-edit-panels.md)
+ [Modifying dashboard settings](v9-dash-modify-settings.md)
+ [Dashboard URL variables](v9-dash-dashboard-url-variables.md)
+ [Adding a library panel to your dashboard](v9-dash-manage-library-panels.md)
+ [Managing dashboard version history](v9-dash-manage-version-history.md)
+ [Managing dashboard links](v9-dash-manage-dashboard-links.md)
+ [Dashboard JSON model](v9-dash-dashboard-json-model.md)

# Creating dashboards
<a name="v9-dash-creating"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

**Creating a dashboard **

Dashboards and panels allow you to show your data in visual form using Grafana. Each panel needs at least one query to display a visualization. Before you get started, complete the following prerequisites.
+ Ensure that you have the proper permissions. For more information about permissions, see [Users, teams, and permissions](Grafana-administration-authorization.md).
+ Identify the dashboard to which you want to add the panel.
+ Understand the query language of the target data source.
+ Ensure that data source for which you are writing a query has been added.

 To create a dashboard:

1. Sign into Grafana, hover your cursor over **Dashboard**, and click **\$1 New Dashboard**.

1. Click **Add a new panel**.

1. In the first line of the **Query** tab, click the dropdown list and select a data source.

1. Write or construct a query in the query language of your data source.

1. In the **Visualization** list, select a visualization type. Grafana displays a preview of your query results with the visualization applied. For more information, see [Visualizations options](v9-panels-viz.md).

1. Adjust panel settings in the following ways.
   + [Configure value mappings](v9-panels-configure-value-mappings.md)
   + [Visualization-specific options](v9-panels-viz.md)
   + [Override field values](v9-panels-configure-overrides.md)
   + [Configure thresholds](v9-panels-configure-thresholds.md)
   + [Configure standard options](v9-panels-configure-standard-options.md)
**Note**  
Most visualizations need some adjustment before they properly display the information you need.

1. Add a note to describe the visualization (or describe your changes) and then click **Save** in the upper-right corner of the page.
**Note**  
Notes are helpful if you need to revert the dashboard to a previous version.

**Configuring repeating rows**

You can configure Grafana to dynamically add panels or rows to a dashboard based on the value of a variable. Variables dynamically change your queries across all rows in a dashboard. For more information about repeating panels, see [Configure repeating panels]().

You can also repeat rows if you have variables set with `Multi-value` or `Include all values` selected.

Before you get started, ensure that the query includes a multi-value variable, then you should complete the following steps.

1. On the dashboard home page, click **Add panel**.

1. On the **Add a panel** dialog box, click **Add a new row**.

1. Hover over the row title and click the cog icon.

1. On the **Row Options** dialog box, add a title and select the variable for which you want to add repeating rows.
**Note**  
 To provide context to dashboard users, add the variable to the row title. 

**To move a panel**

1. Open the dashboard.

1. Click the panel title and drag the panel to the new location. You can place a panel on a dashboard in any location.

**To resize a panel**

1. Open the dashboard.

1. To adjust the size of the panel, click and drag the lower-right corner of the panel. You can size a dashboard panel to suits your needs.

# Add or edit panels
<a name="v9-dash-edit-panels"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

After you have created a dashboard, you can add, edit, or remove panels at any time.
+ **View dashboard**: To view a dashboard, from the **Home** menu, select **Dashboards**, then choose the dashboard you want to view. You might have to expand the folder that contains the dashboard.
+ **Add panel**: To add a panel to a dashboard, choose the **Add panel** icon in the menu bar near the top of the page.
+ **Edit panel**To edit an existing panel on a dashboard, choose the menu icon that appears when you hover over the panel, and then choose **Edit**.
+ **Remove panel**To remove an existing panel on a dashboard, choose the menu icon that appears when you hover over the panel, and then choose **Remove**.

# Modifying dashboard settings
<a name="v9-dash-modify-settings"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The dashboard settings page enables you to:
+ Edit general dashboard properties, including time settings.
+ Add annotation queries.
+ Add dashboard variables.
+ Add links.
+ View the dashboard JSON model

To access the dashboard setting page:

1. Open a dashboard in edit mode.

1. Click **Dashboard settings** (gear icon) located at the top of the page.

**Modifying dashboard time settings**

Adjust dashboard time settings when you want to change the dashboard timezone, the local browser time, and specify auto-refresh time intervals.

**To modify dashboard time settings**

1. On the **Dashboard** settings page, select **General**.

1. Navigate to the **Time Options** section.

1. Specify time settings according to the following descriptions.

1. Timezone specifies the local time zone of the service or system that you are monitoring. This can be helpful when monitoring a system or service that operates across several time zones.
   + Grafana uses the *default* selected time zone for the user profile, team, or organization. If no time zone is specified for the user profile, a team the user is a member of, or the organization, then Grafana uses the local browser time.
   + The time zone configured for the viewing user browser, the *local browser time*, is used. This is usually the same time zone as set on the computer.
   + Use standard [ISO 8601 time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), including UTC.
+ **Auto-refresh** customizes the options displayed for relative time and the auto-refresh options Entries are comma separated and accept any valid time unit.
+ **Now delay** overrides the `now` time by entering a time delay. Use this option to accommodate known delays in data aggregation to avoid null values.
+ **Hide time picker** removes the Grafana time picker display.

**Note**  
To have time controls, your data must include a time column. See the documentation for your specific [data source](AMG-data-sources.md) for more information about including a time column.

**Adding an annotation query**

An annotation query is a query that queries for events. These events can be visualized in graphs across the dashboard as vertical lines along with a small icon you can hover over to see the event information.

**To add n annotation query**

1. On the **Dashboard settings** page, select **Annotations**.

1. Select **Add annotation query**. 

1. Enter a name and select a data source.

1. Complete the rest of the form to build a query and annotation.

The query editor UI changes based on the data source that you select. see the [Data source](AMG-data-sources.md) documentation for details on how to construct a query.

**Adding a variable**

Variables enable you to create more interactive and dynamic dashboards. Instead of hard-coding things like server, application, and sensor names in your metric queries, you can use variables in their place. Variables are displayed as dropdown lists at the top of the dashboard. These dropdowns make it easy to change the data being displayed in your dashboard.

For more information about variables, see [Variables](v9-dash-variables.md).

1. On the **Dashboard settings** page, click **Variable** in the left side section menu and then the **Add variable** button.

1. In the **General** section, the the name of the variable. This is the name that you will later use in queries.

1. Select a variable **Type**.
**Note**  
The variable type that you select impacts which fields that you populate on the page.

1. Define the variable and click **Update**.

**Adding a link **

Dashboard links enable you to place links to other dashboards and websites directly below the dashboard header. Links provide for easy navigation to other, related dashboards and content. 

1.  On the **Dashboard settings** page, click **Links** in the left side section menu and then the **Add link** button. 

1.  Enter title and and in the **Type** field, select **Dashboard** or **Link**. 

1.  To add a dashboard link, add an optional tag, select any of the dashboard link Options, and click **Apply**. 
**Note**  
Tags are useful creating a dynamic dropdown of dashboards that all have a specific tag. 

1.  To add a link, add a URL and tooltip text that appears when the user hovers over the link, select an icon that appears next to the link, and select any of the dashboard link options. 

**View dashboard JSON model ** 

A dashboard in Grafana is represented by a JSON object, which stores metadata of its dashboard. Dashboard metadata includes dashboard properties, metadata from panels, template variables, panel queries, and so on. 

To view a dashboard JSON model, on the **Dashboard settings** page, click **JSON**.

For more information about the JSON fields, see [JSON fields](v9-dash-dashboard-json-model.md).

# Dashboard URL variables
<a name="v9-dash-dashboard-url-variables"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Grafana can apply variable values passed as query parameters in dashboard URLs. For more information, see [Manage dashboard links](v9-dash-manage-dashboard-links.md) and [Templates and variables](v9-dash-variables.md).

**Passing variables as query parameters**

Grafana interprets query string parameters prefixed with `var-` as variables in the given dashboard.

For example, in this URL: 

```
https://${your-domain}/path/to/your/dashboard?var-example=value
```

The query parameter `var-example=value` represents the dashboard variable example with a value of `value`.

**Passing multiple values for a variable**

To pass multiple values, repeat the variable parameter once for each value.

```
https://${your-domain}/path/to/your/dashboard?var-example=value1&var-example=value2
```

Grafana interprets `var-example=value1&var-example=value2` as the dashboard variable example with two values: `value1` and `value2`.

**Adding variables to dashboard links**

Grafana can add variables to dashboard links when you generate them from a dashboard’s settings. For more information and steps to add variables, see [Manage dashboard links](v9-dash-manage-dashboard-links.md).

**Passing ad hoc filters**

Ad hoc filters apply key or value filters to all metric queries that use a specified data source. For more information, see [Ad hoc filters]().

To pass an ad hoc filter as a query parameter, use the variable syntax to pass the ad hoc filter variable, and also provide the key, the operator as the value, and the value as a pipe-separated list.

For example, in this URL:

`https://${your-domain}/path/to/your/dashboard?var-adhoc=example_key|=|example_value` 

The query parameter `var-adhoc=key|=|value` applies the ad hoc filter configured as the adhoc dashboard variable using the `example_key` key, the `=` operator, and the `example_value` value.

**Note**  
When sharing URLs with ad hoc filters, remember to encode the URL. In the above example, replace the pipes `(|)` with `%7C` and the equality operator `(=)` with` %3D`.

**Controlling time range using the URL**

To set a dashboard’s time range, use the `from`, `to`, `time`, and `time.window` query parameters. Because these are not variables, they do not require the `var-` prefix.

# Adding a library panel to your dashboard
<a name="v9-dash-manage-library-panels"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

A library panel is a reusable panel that you can use in any dashboard. When you change a library panel, the change propagates to all instances of where the panel is used. Library panels streamline reuse of panels across multiple dashboards.

You can save a library panel in a folder alongside saved dashboards.

**Creating a library panel**

When you create a library panel, the panel on the source dashboard is converted to a library panel as well. You need to save the original dashboard after a panel is converted.

1. Open a panel in edit mode.

1. In the panel display options, click the down arrow option to bring changes to the visualization.

1. To open the **Create** dialog box, click the **Library panels** option, and then click **Create library panel**.

1. In **Library panel name**, enter the name.

1. In **Save in folder**, select the folder to save the library panel.

1. To save your changes, click **Create library panel**.

1. To save the dashboard, click **Save**.

After a library panel is created, you can modify the panel using any dashboard on which it appears. After you save the changes, all instances of the library panel reflect these modifications.

**Adding a library panel to a dashboard**

Add a Grafana library panel to a dashboard when you want to provide visualizations to other dashboard users.

1. Hover over the **Dashboards** option on the left menu, then select **New dashboard** from the dropdown options. The **Add panel **dialog box will open.

1. Click the **Add a panel** from the panel library option. You will see a list of your library panels.

1. Filter the list or search to find the panel you want to add.

1. Click a panel to add it to the dashboard.

**Unlinking a library panel**

Unlink a library panel when you want to make a change to the panel and not affect other instances of the library panel.

1. Hover over **Dashboard** on the left menu, and then click **Library panels**.

1. Select a library panel that is being used in different dashboards.

1. Select the panel that you want to unlink.

1. Click the title of the panel and then click **Edit**. The panel will open in edit mode.

1. Click the **Unlink** option on the top right corner of the page.

**Viewing a list of library panels**

Unlink a library panel when you want to make a change to the panel and not affect other instances of the library panel.

1. Hover over the **Dashboard** option on the left menu, then click **Library panels**. You can see a list of previously defined library panels.

1. Search for a specific library panel if you know its name. You can also filter the panels by folder or type.

**Deleting a library panel**

Delete a library panel when you no longer need it.

1. Hover over **Dashboard** on the left menu, and select **Library panels**.

1. Select the panel that you want to delete.

1. Click the delete icon next to the library name.

# Managing dashboard version history
<a name="v9-dash-manage-version-history"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Whenever you save a version of your dashboard, a copy of that version is saved so that previous versions of your dashboard are never lost. A list of these versions is available by entering the dashboard settings and then selecting **Versions** in the left side menu.

The dashboard version history feature lets you compare and restore to previously saved dashboard versions.

**Comparing two dashboard versions**

To compare two dashboard versions, select the two versions from the list that you wish to compare. Click **Compare versions** to view the diff between the two versions.

Upon clicking the button, you’ll be brought to the diff view. By default, you’ll see a textual summary of the changes.

If you want to view the diff of the raw JSON that represents your dashboard, you can do that as well by clicking the **View JSON Diff** button at the bottom.

If you want to restore to the version you are diffing against, you can do so by clicking the **Restore to version <x>** button in the top right.

**Restoring to a previously saved dashboard version**

If you need to restore to a previously saved dashboard version, you can either click the **Restore** button on the right of a row in the dashboard version list, or click the **Restore to version <x>** button appearing in the diff view. Clicking the button will bring up the following pop-up prompting you to confirm the restoration.

After restoring to a previous version, a new version will be created containing the same exact data as the previous version, only with a different version number. This is indicated in the **Notes column** for the row in the new dashboard version. This is done simply to ensure your previous dashboard versions are not affected by the change.

# Managing dashboard links
<a name="v9-dash-manage-dashboard-links"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

You can use links to navigate between commonly used dashboards or to connect others to your visualizations. Links let you create shortcuts to other dashboards, panels, and even external websites.

Grafana supports dashboard links, panel links, and data links. Dashboard links are displayed at the top of the dashboard. Panel links are accessible by clicking an icon on the top left corner of the panel.

**Choosing which link to use**

Start by figuring out how you’re currently navigating between dashboards. If you’re often jumping between a set of dashboards and struggling to find the same context in each, links can help optimize your workflow.

The next step is to figure out which link type is right for your workflow. Even though all the link types in Grafana are used to create shortcuts to other dashboards or external websites, they work in different contexts.
+ If the link relates to most if not all of the panels in the dashboard, use dashboard links.
+ If you want to drill down into specific panels, use panel links.
+ If you want to link to an external site, you can use either a dashboard link or a panel link.
+ If you want to drill down into a specific series, or even a single measurement, use data links.

**Controlling time range using the URL**

To control the time range of a panel or dashboard, you can provide query parameters in the dashboard URL:
+ `from` defines lower limit of the time range, specified in ms epoch.
+ `to` defines upper limit of the time range, specified in ms epoch.
+ `time` and `time.window` defines a time range from `time-time.window/2` to `time+time.window/2`. Both params should be specified in ms. For example `?time=1500000000000&time.window=10000` will result in 10s time range from 1499999995000 to 1500000005000.

**Dashboard links**

When you create a dashboard link, you can include the time range and current template variables to directly jump to the same context in another dashboard. This way, you don’t have to worry whether the person you send the link to is looking at the right data. For other types of links, see [Data link variables]().

Dashboard links can also be used as shortcuts to external systems, such as submitting [a GitHub issue with the current dashboard name](https://github.com/grafana/grafana/issues/new?title=Dashboard%3A%20HTTP%20Requests).

After adding a dashboard link, it will show up in the upper-right corner of your dashboard.

**Adding links to dashboards**

Add links to other dashboards at the top of your current dashboard.

1. While viewing the dashboard you want to link, click the gear at the top of the screen to open **Dashboard settings**.

1. Click **Links** and then click **Add Dashboard Link** or **New**.

1. In **Type**, select **dashboards**.

1. Select link options from the following.
   + **With tags**: Enter tags to limit the linked dashboards to only the ones with the tags you enter. Otherwise, Grafana includes links to all other dashboards.
   + **As dropdown**: If you are linking to lots of dashboards, then you probably want to select this option and add an optional title to the dropdown. Otherwise, Grafana displays the dashboard links side by side across the top of your dashboard.
   + **Time range**: Select this option to include the dashboard time range in the link. When the user clicks the link, the linked dashboard will open with the indicated time range already set.
   + **Variable values**: Select this option to include template variables currently used as query parameters in the link. When the user clicks the link, any matching templates in the linked dashboard are set to the values from the link. For more information, see [Dashboard URL variables](v9-dash-dashboard-url-variables.md).
   + **Open in new tab**: Select this option if you want the dashboard link to open in a new tab or window.

1. Click **Add**.

**Adding a URL link to a dashboard**

Add a link to a URL at the top of your current dashboard. You can link to any available URL, including dashboards, panels, or external sites. You can even control the time range to ensure the user is zoomed in on the right data in Grafana.

1. While viewing the dashboard you want to link, click the gear at the top of the screen to open **Dashboard settings**.

1. Click **Links** and then click **Add Dashboard Link** or **New**.

1. In Type, select **Link**.

1. Select link options from the following.
   + **URL**: Enter the URL you want to link to. Depending on the target, you might want to include field values. For more information, see this [Github example](https://github.com/grafana/grafana/issues/new?title=Dashboard%3A%20HTTP%20Requests).
   + **Title**: Enter the title you want the link to display.
   + **Tooltip**: Enter the tooltip you want the link to display.
   + **Icon**: Choose the icon that you want displayed with the link.
   + **Time range**: Select this option to include the dashboard time range in the link. When the user clicks the link, the linked dashboard will open with the indicated time range set.
     + `from` defines lower limit of the time range, specified in ms epoch.
     + `to` defines upper limit of the time range, specified in ms epoch.
     + `time` and `time.window` defines a time range from `time-time.window/2` to `time+time.window/2`. Both params should be specified in ms. For example `?time=1500000000000&time.window=10000` will result in 10s time range from 1499999995000 to 1500000005000.
   + **Variable values**: Select this option to include template variables currently used as query parameters in the link. When the user clicks the link, any matching templates in the linked dashboard are set to the values from the link. 

     The variable format is as follows: 

     `https://${you-domain}/path/to/your/dashboard?var-${template-varable1}=value1&var-{template-variable2}=value2`
   + **Open in a new tab**: Select this option if you want the dashboard link to open in a new tab or window

1. Click **Add**.

**Updating a dashboard link**

To change or update an existing dashboard link, follow this procedure.

1. In **Dashboard settings,** on the **Links** tab, click the existing link that you want to edit.

1. Change the settings and then click **Update**.

**Duplicating a dashboard link**

To duplicate an existing dashboard link, click the duplicate icon next to the existing link that you want to duplicate.

**Deleting a dashboard link**

To delete an existing dashboard link, click the trash icon next to the duplicate icon that you want to delete.

**Panel links**

Each panel can have its own set of links that are shown in the upper left corner of the panel. You can link to any available URL, including dashboards, panels, or external sites. You can even control the time range to ensure the user is zoomed in on the right data in Grafana.

To see available panel links, click the icon on the top left corner of a panel.
+ **Adding a panel link**: Each panel can have its own set of links that are shown in the upper left corner of the panel. You can link to any available URL, including dashboards, panels, or external sites. You can even control the time range to ensure the user is zoomed in on the right data in Grafana. Click the icon on the top left corner of a panel to see available panel links.

  1. Hover your cursor over the panel that you want to add a link to and then press `e`. Or click the dropdown arrow next to the panel title and then click **Edit**.

  1. On the **Panel** tab, scroll down to the **Links** section. 

  1. Expand **Links** and then click **Add link**.

  1. Enter a **Title**. **Title** is a human-readable label for the link that will be displayed in the UI.

  1. Enter the **URL** you want to link to. You can even add one of the template variables defined in the dashboard. Press `Ctrl+Space` or `Cmd+Space` and click in the URL field to see the available variables. By adding template variables to your panel link, the link sends the user to the right context, with the relevant variables already set.

     You can also use time variables.
     + `from` defines the lower limit of the time range, specified in ms epoch.
     + `to` defines the upper limit of the time range, specified in ms epoch.
     + `time` and `time.window` defines a time range from `time-time.window/2` to `time+time.window/2`. Both parameters should be specified in ms. For example `?time=1500000000000&time.window=10000` results in 10s time range from 1499999995000 to 1500000005000.
+ **Updating a panel link**

  1. On the **Panel** tab, find the link you want to make changes to.

  1. Click the **Edit** (pencil) icon to open the Edit link window.

  1. Make any necessary changes.

  1. Click **Save** to save changes and close the window.

  1. Click **Save** in the upper right to save your changes to the dashboard.
+ **Deleting a panel link**

  1. On the **Panel** tab, find the link that you want to make changes to.

  1. Click the **X** icon next to the link you want to delete.

  1. Click **Save** in the upper right to save your changes to the dashboard.

# Dashboard JSON model
<a name="v9-dash-dashboard-json-model"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 9.x**.  
For Grafana workspaces that support Grafana version 12.x, see [Working in Grafana version 12](using-grafana-v12.md).  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

A dashboard in Grafana is represented by a JSON object, which stores metadata of its dashboard. Dashboard metadata includes dashboard properties, metadata from panels, template variables, and panel queries.

To view the JSON of a dashboard.

1. Navigate to a dashboard.

1. In the top navigation menu, click the **Dashboard settings** (gear) icon.

1. Click **JSON Model**.

**JSON fields**

When a user creates a new dashboard, a new dashboard JSON object is initialized with the following fields.

**Note**  
In the following JSON, id is shown as null, which is the default value assigned to it until a dashboard is saved. After a dashboard is saved, an integer value is assigned to the `id` field.

```
{
  "id": null,
  "uid": "cLV5GDCkz",
  "title": "New dashboard",
  "tags": [],
  "style": "dark",
  "timezone": "browser",
  "editable": true,
  "graphTooltip": 1,
  "panels": [],
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "time_options": [],
    "refresh_intervals": []
  },
  "templating": {
    "list": []
  },
  "annotations": {
    "list": []
  },
  "refresh": "5s",
  "schemaVersion": 17,
  "version": 0,
  "links": []
}
```

The following describes each field in the dashboard JSON.


| Name | Usage | 
| --- | --- | 
| **id** | unique numeric identifier for the dashboard (generated by the db) | 
| **uid** | unique dashboard identifier that can be generated by anyone. string (8-40) | 
| **title** | current title of dashboard | 
| **tags** | tags associated with dashboard, an array of strings | 
| **style** | theme of dashboard, such as *dark* or *light* | 
| **timezone** | timezone of dashboard, such as *utc* or *browser* | 
| **editable** | if a dashboard is editable or not | 
| **graphTooltip** | 0 for no shared crosshair or tooltip (default), 1 for shared crosshair, 2 for shared crosshair and shared tooltip | 
| **time** | time range for dashboard, such as *last 6 hours* or *last 7 days* | 
| **timepicker** | timepicker metadata, see [timepicker section](#v9-dash-dashboard-json-model) for details | 
| **templating** | templating metadata, see [templating section](#v9-dash-dashboard-json-model) for details | 
| **annotations** | annotations metadata, see [annotations](v9-panels-annotate-visualizations.md) for how to add them | 
| **refresh** | auto-refresh interval | 
| **schemaVersion** | version of the JSON schema (integer), incremented each time a Grafana update brings changes to said schema | 
| **version** | version of the dashboard (integer), incremented each time the dashboard is updated | 
| **panels** | panels array (see below for detail) | 

**Panels**

Panels are the building blocks of a dashboard. It consists of data source queries, type of graphs, aliases, and more. Panel JSON consists of an array of JSON objects, each representing a different panel. Most of the fields are common for all panels but some fields depend on the panel type. The following is an example of panel JSON of a text panel.

```
"panels": [
  {
    "type": "text",
    "title": "Panel Title",
    "gridPos": {
      "x": 0,
      "y": 0,
      "w": 12,
      "h": 9
    },
    "id": 4,
    "mode": "markdown",
    "content": "# title"
  }
```

**Panel size and position**

The gridPos property describes the panel size and position in grid coordinates.
+ `w`: 1–24 (the width of the dashboard is divided into 24 columns)
+ `h`: In grid height units, each represents 30 pixels.
+ `x`: The x position, in same unit as `w`.
+ `y`: The y position, in same unit as `h`.

The grid has a negative gravity that moves up panels if there is empty space above a panel.

**Timepicker**

```
"timepicker": {
    "collapse": false,
    "enable": true,
    "notice": false,
    "now": true,
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "status": "Stable",
    "type": "timepicker"
  }
```

**Templating **

The `templating` field contains an array of template variables with their saved values along with some other metadata.

```
"templating": {
    "enable": true,
    "list": [
       {
        "allFormat": "wildcard",
        "current":  {
          "tags": [],
          "text": "prod",
          "value": "prod"
        },
        "datasource": null,
        "includeAll": true,
        "name": "env",
        "options": [
           {
            "selected": false,
            "text": "All",
            "value": "*"
          },
           {
            "selected": false,
            "text": "stage",
            "value": "stage"
          },
           {
            "selected": false,
            "text": "test",
            "value": "test"
          }
        ],
        "query": "tag_values(cpu.utilization.average,env)",
        "refresh": false,
        "type": "query"
      },
       {
        "allFormat": "wildcard",
        "current":  {
          "text": "apache",
          "value": "apache"
        },
        "datasource": null,
        "includeAll": false,
        "multi": false,
        "multiFormat": "glob",
        "name": "app",
        "options": [
           {
            "selected": true,
            "text": "tomcat",
            "value": "tomcat"
          },
           {
            "selected": false,
            "text": "cassandra",
            "value": "cassandra"
          }
        ],
        "query": "tag_values(cpu.utilization.average,app)",
        "refresh": false,
        "regex": "",
        "type": "query"
      }
    ]
  }
```