# Bar chart

Bar charts facilitate the viewing of data broken down by segmentation.

<figure><img src="/files/SParHc5hwMUPjM0PmIyE" alt="Bar chart example"><figcaption></figcaption></figure>

The NQL query requires a segmentation label and an aggregation.

## Data shape <a href="#barchart-datashape" id="barchart-datashape"></a>

`<segmentation 1>, (<segmentation 2>, <segmentation 3>,...), <kpi 1>, (<kpi 2>, <kpi 3>, ...)`

Bar charts NQL query structure depends on the following cases:

* [NQL for bar charts with default breakdown disabled](#nql-for-bar-charts-without-a-breakdown-dropdown)
* [NQL for bar charts with default breakdowns enabled](#nql-for-bar-charts-with-a-breakdown-dropdown)

## NQL structure for bar charts with disabled default breakdowns <a href="#barcharts-without-breakdowns" id="barcharts-without-breakdowns"></a>

When [configuring visualization fields](#linechart-linechartspecificsettings) specific to the bar chart, if you do not **Enable default breakdowns** you must follow the NQL structure below.

```
...
summarize <kpi1>, <kpi2>, ... by <segmentation1>, <segmentation2>, ...
```

In this case, you should always specify `by <segmentation1>,...` in the query.

{% hint style="info" %}
Refer to the [Live Dashboards NQL examples](/platform/user-guide/live-dashboards/live-dashboards-nql-examples.md#livedashboardsnqlexamples-barchart) documentation for query examples.
{% endhint %}

## NQL structure for bar charts with enabled default breakdowns <a href="#barcharts-with-breakdowns" id="barcharts-with-breakdowns"></a>

When [configuring visualization fields](#linechart-linechartspecificsettings) specific to the bar chart, if you **Enable default breakdowns** you must follow the NQL structure below.

<pre><code><strong>...
</strong><strong>summarize &#x3C;kpi1>, &#x3C;kpi2>, ... 
</strong></code></pre>

In this case, you can omit `by <segmentation1>,...` from the query since the system defaults to the options in the breakdown dropdown. See the **Preview** section in the image below.

{% hint style="info" %}
Refer to the [Live Dashboards NQL examples](/platform/user-guide/live-dashboards/live-dashboards-nql-examples.md#livedashboardsnqlexamples-barchart) documentation for query examples.
{% endhint %}

<figure><img src="/files/VP5k51VYQmkHh4FvzKbM" alt=""><figcaption></figcaption></figure>

## Bar chart column names—regardless of default breakdowns <a href="#barchart-columnnames" id="barchart-columnnames"></a>

The variable names in the NQL query are used as labels for the columns.

<figure><img src="/files/WfuKpQTn9vJMMunxkb3m" alt="Column names"><figcaption></figcaption></figure>

The variable names are formatted with the following heuristic:

* Underscores are replaced with spaces.
* The first character of the variable is changed to uppercase.

{% hint style="info" %}
In bar-chart widgets on live dashboards, you can sort the results by clicking on the chart column headers.
{% endhint %}

<figure><img src="/files/pwjx5jlg3MR0eI8ybLqj" alt="Sorting bar chart results by column data."><figcaption></figcaption></figure>

***

## Configuring visualization fields specific to Bar charts <a href="#linechart-linechartspecificsettings" id="linechart-linechartspecificsettings"></a>

{% hint style="info" %}
Refer to the [Managing Live Dashboards](/platform/user-guide/live-dashboards/managing-live-dashboards.md#filling-in-widget-visualization-fields) documentation to learn how to fill in the remaining configuration fields that are not specific to this widget.
{% endhint %}

After selecting the **Bar chart** option from the **Chart type** drop-down in the [Add widget](/platform/user-guide/live-dashboards/managing-live-dashboards.md#adding-widgets)/[Edit a widget](/platform/user-guide/live-dashboards/managing-live-dashboards.md#managing-widgets) pop-up:

1. Give the widget a **Title (optional)**.
2. Enter a **Widget description (optional)** to explain, for example, how the metric should be interpreted, calculated, or any subtleties to the metric.
   * The widget description appears when hovering over the info icon next to the bar chart widget in the dashboard.
3. Determine if the bar-chart results update according to the selected **Global timepicker** (timeframe) and/or **Global filters** applied to the dashboar&#x64;**.**
   * In bar-chart widgets on live dashboards, the action menu lets you either **Show all** results or **Show filtered** data—based on global dashboard filters.
4. Define the **Maximum number of rows to be displayed** in the container.
   * The dashboard displays a **Load more** button if the chart results exceed the defined limit.

***

RELATED TOPIC

* [KPI](/platform/user-guide/live-dashboards/widget-types/kpi.md)
* [Line chart](/platform/user-guide/live-dashboards/widget-types/line-chart.md)
* [Single-metric gauge chart](/platform/user-guide/live-dashboards/widget-types/single-metric-gauge-chart.md)
* [Multi-metric gauge chart](/platform/user-guide/live-dashboards/widget-types/multi-metric-gauge-chart.md)
* [Table](/platform/user-guide/live-dashboards/widget-types/table.md)
* [Heading](/platform/user-guide/live-dashboards/widget-types/heading.md)
* [Filter widget](/platform/user-guide/live-dashboards/widget-types/filter-widget.md)
* [Timeframe picker](/platform/user-guide/live-dashboards/widget-types/timeframe-picker.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nexthink.com/platform/user-guide/live-dashboards/widget-types/bar-chart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
