> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Dashboards

> The SQL Console's dashboards feature allows you to collect and share visualizations from saved queries.

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

export const galaxyOnClick = eventName => () => {
  try {
    if (typeof window !== "undefined" && window.galaxy && eventName) {
      window.galaxy.track(eventName, {
        interaction: "click"
      });
    }
  } catch (e) {}
};

export const BetaBadge = ({link, galaxyTrack, galaxyEvent}) => {
  if (link) {
    return <a href={link} target="_blank" rel="noopener noreferrer" className="betaBadge" onClick={galaxyTrack && galaxyEvent ? galaxyOnClick(galaxyEvent) : undefined}>
                <Icon />
                <span>Beta</span>
            </a>;
  }
  return <div className="betaBadge">
            <Icon />
            <span>
                Beta feature. 
                <u>
                    <a href="/docs/beta-and-experimental-features#beta-features">
                        Learn more.
                    </a>
                </u>
            </span>
        </div>;
};

The SQL Console's dashboards feature allows you to collect and share visualizations from saved queries. Get started by saving and visualizing queries, adding query visualizations to a dashboard, and making the dashboard interactive using query parameters.

<h2 id="core-concepts">
  Core concepts
</h2>

<h3 id="query-sharing">
  Query sharing
</h3>

To share your dashboard with colleagues, be sure to share the underlying saved query. To view a visualization, you must have, at a minimum, read-only access to the underlying saved query.

<h3 id="interactivity">
  Interactivity
</h3>

Use [query parameters](/reference/syntax#defining-and-using-query-parameters) to make your dashboard interactive. For instance, you can add a query parameter to a `WHERE` clause to function as a filter.

You can toggle the query parameter input via the **Global** filters side pane by selecting a “filter” type in the visualization settings. You can also toggle the query parameter input by linking to another object (like a table) on the dashboard. Please see the “[configure a filter](/products/cloud/features/sql-console-features/dashboards#configure-a-filter)” section of the quick start guide below.

<h2 id="quick-start">
  Quick start
</h2>

Let's create a dashboard to monitor our ClickHouse service using the [query\_log](/reference/system-tables/query_log) system table.

<h2 id="quick-start-1">
  Quick start
</h2>

<h3 id="create-a-saved-query">
  Create a saved query
</h3>

If you already have saved queries to visualize, you can skip this step.

Open a new query tab. Let's write a query to count query volume by day on a service using ClickHouse system tables:

<Image img="https://mintcdn.com/private-7c7dfe99-mintlify-8c05c8a2/_TDydWLKO6Z3njo9/images/cloud/dashboards/2_dashboards.png?fit=max&auto=format&n=_TDydWLKO6Z3njo9&q=85&s=b63ae74f7335ef8f3b7843496557c27d" size="md" alt="Create a saved query" border width="1600" height="1372" data-path="images/cloud/dashboards/2_dashboards.png" />

We can view the results of the query in table format or start building visualizations from the chart view. For the next step, we'll go ahead and save the query as `queries over time`:

<Image img="https://mintcdn.com/private-7c7dfe99-mintlify-8c05c8a2/_TDydWLKO6Z3njo9/images/cloud/dashboards/3_dashboards.png?fit=max&auto=format&n=_TDydWLKO6Z3njo9&q=85&s=7f08a1e1fdeb18f80d6dfdfa6c72adc9" size="md" alt="Save query" border width="1274" height="484" data-path="images/cloud/dashboards/3_dashboards.png" />

More documentation around saved queries can be found in the [Saving a Query section](/products/cloud/features/sql-console-features/sql-console#saving-a-query).

We can create and save another query, `query count by query kind`, to count the number of queries by query kind. Here's a bar chart visualization of the data in the SQL console.

<Image img="https://mintcdn.com/private-7c7dfe99-mintlify-8c05c8a2/_TDydWLKO6Z3njo9/images/cloud/dashboards/4_dashboards.png?fit=max&auto=format&n=_TDydWLKO6Z3njo9&q=85&s=53b6650cb8aa7f501fb37a5175a9bd6e" size="md" alt="A bar chart visualization of a query's results" border width="1438" height="1600" data-path="images/cloud/dashboards/4_dashboards.png" />

Now that there's two queries, let's create a dashboard to visualize and collect these queries.

<h3 id="create-a-dashboard">
  Create a dashboard
</h3>

Navigate to the Dashboards panel, and hit “New Dashboard”. After you assign a name, you'll have successfully created your first dashboard!

<Image img="https://mintcdn.com/private-7c7dfe99-mintlify-8c05c8a2/_TDydWLKO6Z3njo9/images/cloud/dashboards/5_dashboards.png?fit=max&auto=format&n=_TDydWLKO6Z3njo9&q=85&s=71af4faa433f2e03fea352f335cb8ed2" size="md" alt="Create a new dashboard" border width="1466" height="778" data-path="images/cloud/dashboards/5_dashboards.png" />

<h3 id="add-a-visualization">
  Add a visualization
</h3>

There's two saved queries, `queries over time` and `query count by query kind`. Let's visualize the first as a line chart. Give your visualization a title and subtitle, and select the query to visualize. Next, select the “Line” chart type, and assign an x and y axis.

<Image img="https://mintcdn.com/private-7c7dfe99-mintlify-8c05c8a2/_TDydWLKO6Z3njo9/images/cloud/dashboards/6_dashboards.png?fit=max&auto=format&n=_TDydWLKO6Z3njo9&q=85&s=08d908bd6c67158f06abdedd0f4ffa2a" size="md" alt="Add a visualization" border width="1600" height="1097" data-path="images/cloud/dashboards/6_dashboards.png" />

Here, additional stylistic changes can also be made - like number formatting, legend layout, and axis labels.

Next, let's visualize the second query as a table, and position it below the line chart.

<Image img="https://mintcdn.com/private-7c7dfe99-mintlify-8c05c8a2/_TDydWLKO6Z3njo9/images/cloud/dashboards/7_dashboards.png?fit=max&auto=format&n=_TDydWLKO6Z3njo9&q=85&s=19168d8daf22e7b2b3a7eb63741f4df2" size="md" alt="Visualize query results as a table" border width="1600" height="1048" data-path="images/cloud/dashboards/7_dashboards.png" />

You've created your first dashboard by visualizing two saved queries!

<h3 id="configure-a-filter">
  Configure a filter
</h3>

Let's make this dashboard interactive by adding a filter on query kind so you can display just the trends related to Insert queries. We'll accomplish this task using [query parameters](/reference/syntax#defining-and-using-query-parameters).

Click on the three dots next to the line chart, and click on the pencil button next to the query to open the in-line query editor. Here, we can edit the underlying saved query directly from the dashboard.

<Image img="https://mintcdn.com/private-7c7dfe99-mintlify-8c05c8a2/_TDydWLKO6Z3njo9/images/cloud/dashboards/8_dashboards.png?fit=max&auto=format&n=_TDydWLKO6Z3njo9&q=85&s=c2911bbc1852d0d1256512a51a28d3ac" size="md" alt="Edit the underlying query" border width="1115" height="1600" data-path="images/cloud/dashboards/8_dashboards.png" />

Now, when the yellow run query button is pressed, you'll see the same query from earlier filtered on just insert queries. Click on the save button to update the query. When you return to the chart settings, you'll be able to filter the line chart.

Now, using Global Filters on the top ribbon, you can toggle the filter by changing the input.

<Image img="https://mintcdn.com/private-7c7dfe99-mintlify-8c05c8a2/_TDydWLKO6Z3njo9/images/cloud/dashboards/9_dashboards.png?fit=max&auto=format&n=_TDydWLKO6Z3njo9&q=85&s=1b05602a802165f83907b396ee13d5fd" size="md" alt="Adjust global filters" border width="1600" height="1045" data-path="images/cloud/dashboards/9_dashboards.png" />

Suppose you want to link the line chart's filter to the table. You can do this by going back to the visualization settings, and changing the query\_kind query parameter' value source to a table, and selecting the query\_kind column as the field to link.

<Image img="https://mintcdn.com/private-7c7dfe99-mintlify-8c05c8a2/_TDydWLKO6Z3njo9/images/cloud/dashboards/10_dashboards.png?fit=max&auto=format&n=_TDydWLKO6Z3njo9&q=85&s=624a9c8c635c4f8ee15dd3cc4e6913ec" size="md" alt="Changing query parameter" border width="1600" height="1045" data-path="images/cloud/dashboards/10_dashboards.png" />

Now, you can control the filter on the line chart directly from the queries by kind table to make your dashboard interactive.

<Image img="https://mintcdn.com/private-7c7dfe99-mintlify-8c05c8a2/_TDydWLKO6Z3njo9/images/cloud/dashboards/11_dashboards.png?fit=max&auto=format&n=_TDydWLKO6Z3njo9&q=85&s=65e5d21ebdc9ba64387bf92e2388b9cb" size="md" alt="Control the filter on the line chart" border width="1600" height="1012" data-path="images/cloud/dashboards/11_dashboards.png" />
