# Histogram

{% hint style="info" %}
An Apollo license is required to use Cohort Browser on the DNAnexus Platform. Org approval may also be required. [Contact DNAnexus Sales](mailto:sales@dnanexus.com) for more information.
{% endhint %}

## When to Use Histograms

Histograms can be used to visualize numerical, date, and datetime data.

| Supported Data Types |
| -------------------- |
| Numerical (Integer)  |
| Numerical (Float)    |
| Date                 |
| Datetime             |

## Using Histograms in the Cohort Browser

In a histogram in the Cohort Browser, each vertical bar represents the count of records in a particular "bin." Each bin groups records that share the same value or similar values, in a particular field.

The Cohort Browser automatically groups records into bins, based on the distribution of values in the dataset, for the field. Values are distributed in a linear fashion, on the *x* axis.

Below is a sample histogram showing the distribution of values in a field *Critical care total days*. The label under the chart title indicates the number of records (203) for which values are shown, and the name of the entity ("RNAseq Notes") to which the data relates.

![Histogram in the Cohort Browser](/files/LNjZiUzFEaXW3Rxzu9JY)

### Customizing Chart Display

You can customize how histogram data is displayed by clicking ⛭ **Chart Settings** in the chart toolbar.

![Histogram chart settings showing Display Statistics, Transform Data, and Chart Type options](/files/cwH4lCVkzU3Npy7vQ6s0)

For data with wide value ranges or skewed distributions, you can apply logarithmic scaling to either or both axes:

* **log₂** - Values transformed using $$f(x) = \text{sign}(x) \cdot \log\_2(|x|+1)$$
* **log₁₀** - Values transformed using $$f(x) = \text{sign}(x) \cdot \log\_{10}(|x|+1)$$

When you apply logarithmic transformation, the axis label updates to show the transformation type (log₂ or log₁₀).

### Non-Numeric Data in Histograms

A field containing numeric data may also contain some non-numeric values. These values cannot be represented in a histogram. In such cases, you see the following informational message below the chart:

![Histogram Displaying Data for a Field Containing Non-Numeric Values](/files/ur9hijCg16LBkd5ueWmx)

Clicking the "non-numeric values" link displays detail on those values, and the number of records in which each appears:

![Detail on Non-Numeric Values Omitted from a Histogram](/files/L4qKznRrbylESBr5BgqY)

In Cohort Compare mode, histograms can be used to compare the distribution of values in a field that's common to both cohorts. In this scenario, the distributions are overlaid one atop another. Clicking the "ˇ" icon, in the lower right corner of the tile containing the chart, opens a tooltip showing the cohort names and the colors used to represent data in each.

![Histogram in Cohort Compare Mode](/files/-MMJocVOp6fQDtWImdg7)

See [Comparing Cohorts](/user/cohort-browser/defining-cohorts.md#comparing-cohorts) for more on using Cohort Compare mode.

## Preparing Data for Visualization in Histograms

When [ingesting data using Data Model Loader](/developer/ingesting-data/data-model-loader/ingestion-data-types.md), the following data types can be visualized in histograms:

* Integer
* Integer Sparse
* Float
* Float Sparse
* Date
* Date Sparse
* Datetime
* Datetime Sparse


---

# 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://documentation.dnanexus.com/user/cohort-browser/chart-types/histogram.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.
