# Histogram Chart

### What is a Histogram Chart?

A **Histogram Chart** is a type of bar chart that displays the distribution of numerical data. It divides the data range into intervals (called *bins*) and shows how many values fall into each bin. Unlike a bar chart, which is used for categorical data, histograms are ideal for continuous numerical data.

### 💡 Example: Age Distribution in a Population

Imagine you're working with a dataset containing the ages of individuals in a city survey. You want to understand which age groups are most common.

A histogram chart is ideal here, as it can group ages into intervals (e.g., 20–25, 25–30) and show how many people fall into each range.

#### 🔢 Sample Data

| Age Range | Frequency |
| --------- | --------- |
| 20–25     | 15        |
| 25–30     | 42        |
| 30–35     | 28        |
| 35–40     | 18        |
| 40–45     | 10        |
| 45–50     | 7         |

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

#### 📌 When to Use a Histogram

Use a histogram when you want to:

* Understand **distribution** of numerical data
* Detect **patterns**, **clusters**, or **gaps**
* Spot **outliers** or **skewness**
* Visualize **frequency** or **spread** of values like sales, profit, scores, etc.

***

### 🔁 Common Variants of Histograms

* **Stacked Histogram** – Multiple categories stacked in each bin
* **Normalized Histogram** – Uses percentage values instead of raw counts
* **Cumulative Histogram** – Displays running total across bins

***

### 🔧 Basic Configuration Options

* **Bins**: Define the number or size of intervals
* **Aggregations**: Use `average`, `count`, `sum`, etc.
* **Sorting**: Order by value or category
* **Axis Titles**: Add X and Y axis labels
* **Bar Colors**: Customize chart appearance

***

### 🛠 Step-by-Step Guide

#### 1. Enter Prompt & Proceed

<figure><img src="/files/6Tu6Z2YnZbNYcHLHLKFQ" alt=""><figcaption></figcaption></figure>

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

* On the dashboard, in the “Describe what you are trying to analyze” field, enter a natural language query like:

  ```
  Avg Sales by Region. Show in Histogram
  ```
* Click **Next** to continue.

Infinity interprets your prompt and pre-selects the appropriate chart type and data fields.

***

#### 2. Select Data Source

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

* Choose from **previously connected data sources** listed in the dropdown
* Or upload a file in `.csv` or `.xls` format by dragging and dropping it or using the “browse” option
* Example selected dataset: `global_superstore_orders`
* Click **Next** once the dataset is selected

***

#### 3. Configure Histogram Settings

* **Dimension (X-axis):** `Region`
* **Metric (Y-axis):** `Avg(Sales)`
* **Order By:** `Avg(Sales)` (optional sorting)

<figure><img src="/files/2H7XtvGXcsTrXG72aOx2" alt=""><figcaption></figcaption></figure>

Click **Save** once configuration is complete.

***

#### 4. Apply Styling (Optional)

Click **Advanced Editor** for styling and customization.

**Available Styling Options (Summary):**

* **Chart Background** – Set colors or transparency
* **Padding & Zoom** – Adjust space and interactive zoom
* **Series** – Customize bar styles, widths, and colors
* **Legend** – Control placement, visibility, and font
* **Axes** – Label formatting, tick spacing, and scaling
* **Gridlines** – Enable/disable lines and set styles
* **Other** – Tooltips, refresh behavior, and interactivity

These allow fine-tuning your chart for clarity, branding, and presentation-readiness.

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

<figure><img src="/files/701MM2mRIr89reU3TFgh" alt=""><figcaption></figcaption></figure>

***

### ✅ Summary

You’ve now created a Histogram Chart that reveals the average sales distribution across regions using simple steps and natural language prompts. With advanced customization available, you can tailor the chart to meet different analytical and visual requirements.

Use Infinity's intuitive interface and styling tools to:

* Spot trends instantly
* Support decision-making
* Deliver visually impactful insights


---

# 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.getinfinity.app/user-guide/comprehensive-user-guide/2.-charts/featured-chart-examples/histogram-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.
