# Histogram

### **Chart setup to build a histogram:**

{% stepper %}
{% step %}

#### Axis

Drag the dimension to plot on the axis (e.g., Age).
{% endstep %}

{% step %}

#### **Values parameter**&#x20;

Drag the measure you’d like to analyze to view its distribution in the histogram (e.g., Bill Amount).
{% endstep %}

{% step %}

#### **Chart type**

Select **Histogram Chart** from the Chart Type dropdown menu.
{% endstep %}
{% endstepper %}

> Histograms provide a graphical representation of data distribution, making it easier to identify patterns. In this example, the histogram shows the bill amount for specific age groups.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FOscWTd0psaODaRDUalbF%2Fimage.png?alt=media&#x26;token=d1446c80-ab16-404b-a7b3-adf1f2bcc654" alt=""><figcaption><p>Pivot data for Histogram</p></figcaption></figure>

### **1. Customization & formatting under Canvas settings**

#### **1.1. Show cumulative bar**

In a traditional histogram, bin values are totaled separately. In a cumulative histogram, each bin is the sum of the values in a bin and all previous bins.

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F6nOVnPIO0tCKJzvMinFd%2Fimage.png?alt=media&#x26;token=bfe5c4c5-1673-4056-990f-7498df4ef161" alt=""><figcaption><p>Cumulative histogram</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F7YThQItXVqhLKm7rg2yu%2F2024-11-19_17h12_04.png?alt=media&#x26;token=18b9735c-edd7-4716-83cf-f619ac2f4ec3" alt=""><figcaption><p>Traditional histogram</p></figcaption></figure></div>

#### **1.2. Bin**

* **Options**: You can plot the histogram by specifying the interval or defining the total number of bins. You need to specify the number of bins or the size of each bin accordingly.

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2F0mFIpWbSxEZakCdCUZXK%2Fimage.png?alt=media&#x26;token=298070c5-95d2-4965-8f1a-ed3e10f0d693" alt=""><figcaption><p>Histogram based on number of bins</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FXkSzGZXBnTpnIy8Mcxlo%2F2024-11-19_17h39_40.png?alt=media&#x26;token=a1bf665c-bcf8-4f23-be12-a959d9bfe3dc" alt=""><figcaption><p>Histogram based on size of bins</p></figcaption></figure></div>

* **Type**: Histograms plotted based on the number of bins can have closed intervals or semi-closed intervals.

<div><figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FvxDP6lXGjOG1RqmTV8ad%2Fimage.png?alt=media&#x26;token=0fc48ec4-0bd4-40c9-8bee-f9fd17ce9e1d" alt=""><figcaption><p>Semi closed interval</p></figcaption></figure> <figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FGbwwzJLpQNagr2xBUnIf%2F2024-11-19_18h00_58.png?alt=media&#x26;token=43d0cbbd-1cde-4ab7-8d06-c84c964775a3" alt=""><figcaption><p>Fully closed interval</p></figcaption></figure></div>

#### **1.3. Underflow bin**

An **underflow bin** is used to group all data points that fall below the minimum value of the range of the defined bins. This is particularly useful when dealing with datasets where some values lie outside the specified range and need to be accounted for separately.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FwgLYeTAUuNreD1en67zg%2Fimage.png?alt=media&#x26;token=0d9f0980-c054-4fca-9f8b-30202a180427" alt=""><figcaption><p>Underflow bin</p></figcaption></figure>

#### **1.4. Overflow bin**

Similar to underflow bins, you can define an upper limit with overflow bins.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FUmfb05f6KVY5lqSisPoU%2Fimage.png?alt=media&#x26;token=5bd6f243-64b8-49bb-bf27-70005e3bba64" alt=""><figcaption><p>Overflow bin</p></figcaption></figure>

#### **1.5. Gap width**

Define the space between consecutive bins.

<figure><img src="https://3132984990-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbOoZhPvC57Z0CNgep4Ib%2Fuploads%2FfgPsYKAkSHt4B9nAMT8m%2Fimage.png?alt=media&#x26;token=842618ab-0ad5-402e-b49f-85d58cc00427" alt=""><figcaption><p>Gap width for histograms</p></figcaption></figure>

## Additional formatting options

Here are the other settings that help you refine your Histogram.

<table><thead><tr><th width="143.5">Feature</th><th>Description</th><th data-type="content-ref">Link</th></tr></thead><tbody><tr><td>Number</td><td>Configure number formatting (decimals, units)</td><td><a href="../working-with-analytics+/3.-charts/3.8.-display-settings-for-charts/charts-number-settings">charts-number-settings</a></td></tr><tr><td>Legend</td><td>Show/hide and customize the legends</td><td><a href="../working-with-analytics+/3.-charts/3.8.-display-settings-for-charts/charts-legend-settings">charts-legend-settings</a></td></tr><tr><td>Data Label</td><td>Show exact values for each data point</td><td><a href="../working-with-analytics+/3.-charts/3.6.-data-label-customizations">3.6.-data-label-customizations</a></td></tr><tr><td>Trellis</td><td>Create small multiples using category split</td><td><a href="../working-with-analytics+/6.-trellis-customizations">6.-trellis-customizations</a></td></tr><tr><td>Conditional Formatting</td><td>Apply color rules to highlight values</td><td><a href="../working-with-analytics+/9.-conditional-formatting">9.-conditional-formatting</a></td></tr><tr><td>Sorting</td><td>Sort axis order</td><td><a href="../working-with-analytics+/10.-sort-and-reorder-data/sorting-data">sorting-data</a></td></tr><tr><td>Ranking</td><td>Limit to top/bottom N categories</td><td><a href="../working-with-analytics+/11.-ranking-data-topn/ranking-for-charts">ranking-for-charts</a></td></tr></tbody></table>
