# Bar

A bar chart compares values across categories using horizontal or vertical bars. Each bar represents a category, and bar length represents the value.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2Ft9sR52naOSA9gAUo0D90%2FScreenshot%20from%202026-01-09%2016-17-55.png?alt=media&#x26;token=9b58421e-6764-46dd-8779-fabc05c1554b" alt=""><figcaption><p>Bar chart</p></figcaption></figure>

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2F0o1T9rcLfIzs7jM23wZW%2FScreenshot%20from%202026-01-09%2016-18-43.png?alt=media&#x26;token=1c6c74b7-bc35-4a14-a3d8-052e1c79b8f6" alt=""><figcaption><p>Grouped bar chart</p></figcaption></figure>

### Configure a bar chart

Use the **Plot** panel to choose axes, grouping, and display settings.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FTJfsfDD4pt0JBgASEE6O%2FScreenshot%20from%202026-01-09%2016-24-51.png?alt=media&#x26;token=3fcbd63d-c94e-48af-891b-058fd04f2b07" alt="" width="423"><figcaption></figcaption></figure>

### Bar chart options

Use these options to control how the bar chart renders.

| Option         | What it controls                          | Typical values / notes                                                                                              |
| -------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| X-axis         | Field used for the X axis.                | Use `timestamp` for time-based bars. Use a label field for categorical bars (for example `service`, `pod`, `host`). |
| Y-axis         | Numeric field to plot.                    | Common choices: `value`, `cpu_usage`, `latency`, `error_rate`.                                                      |
| Group by       | Split into multiple bar series per group. | For example `pod` creates one series per pod. Leave empty for a single series.                                      |
| Y-axis label   | Display label for the Y axis.             | Cosmetic only. Example: “CPU Usage (%)”.                                                                            |
| Y-axis scale   | How values are scaled on the Y axis.      | **Linear** for most data. **Logarithmic** for wide ranges.                                                          |
| Reference line | A horizontal threshold line.              | Example: `80` for an SLA/limit line.                                                                                |
| Legend         | Show/hide legend.                         | Turn off for a single series or tight layouts.                                                                      |
| Calculations   | Summary overlays on the plotted data.     | Min, Max, Avg, Count, Sum, P50, P90, P95, P99.                                                                      |
| Smooth graph   | Smooths the rendered curve/series.        | Useful for long time ranges. Avoid for step-like data.                                                              |
| Custom color   | Set fixed colors for series.              | Helps keep colors consistent across dashboards.                                                                     |
| Apply          | Applies changes to the widget.            | Changes do not render until you click **Apply**.                                                                    |

### When to use a bar chart

Use a bar chart when you want to:

* Compare values across categories at a point in time
* Rank items (top N / bottom N)
* Compare groups side-by-side (grouped bars)
* Show distribution across discrete buckets

Typical use cases:

* Requests by service / endpoint
* Errors by status code
* Cost by team / namespace
* Latency by region

### When not to use a bar chart

Avoid a bar chart when:

* You need trends over time across many points (use Line/Area)
* You need part-to-whole as percentages (use Pie/Disk)
* You need detailed row-level inspection (use Table/List/Details)
