> For the complete documentation index, see [llms.txt](https://documentation.dnanexus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.dnanexus.com/user/cohort-browser/chart-types/histogram.md). Agents can also search and read this documentation through its [MCP server](https://documentation.dnanexus.com/~gitbook/mcp).

# Histogram

Learn to build and use histograms in the Cohort Browser.

{% 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 selected field. By default, values are plotted along the *x* axis on a linear scale.

The following sample histogram shows 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](https://3410363935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS1s2UHuAFgrsxnijuHMc%2Fuploads%2Fgit-blob-b536414a48da192ed73fe25a05a7e33d2f2d140c%2Fhistogram-example.png?alt=media)

### 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](https://3410363935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS1s2UHuAFgrsxnijuHMc%2Fuploads%2Fgit-blob-6e8783722fc3c42172892f52a533e06bd960b307%2Fcohort-browser-chart-histogram-chart-settings.png?alt=media)

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:

![Histogram Displaying Data for a Field Containing Non-Numeric Values](https://3410363935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS1s2UHuAFgrsxnijuHMc%2Fuploads%2Fgit-blob-5733a090a18dcb674ced103b450256dea682df12%2Fhistogram-non-numeric-values.png?alt=media)

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](https://3410363935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS1s2UHuAFgrsxnijuHMc%2Fuploads%2Fgit-blob-3077dcb6e5f67cb89950652739a9c862dc6936c1%2Fhistogram-non-numeric-values-detail.png?alt=media)

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](https://3410363935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS1s2UHuAFgrsxnijuHMc%2Fuploads%2Fgit-blob-9fd4becddfb0c33e770088f095ea0cdc8f240e95%2Fhistogram-cohort-compare-mode.png?alt=media)

See [Comparing Cohorts](https://documentation.dnanexus.com/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](https://documentation.dnanexus.com/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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.dnanexus.com/user/cohort-browser/chart-types/histogram.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
