# Creating Charts and Dashboards

{% 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 %}

Create interactive visualizations and manage dashboard layouts in the Cohort Browser.

{% hint style="success" %}
If you'd like to filter your dataset to specific samples, see [Defining and Managing Cohorts](https://documentation.dnanexus.com/user/cohort-browser/defining-cohorts).
{% endhint %}

## Managing Dashboards

Dashboards contain your charts and define their layout. Each such configuration is called a dashboard view. Dashboard views can be specific to a [saved cohort](https://documentation.dnanexus.com/user/defining-cohorts#saving-cohorts) or standalone (custom dashboard view). You can create multiple dashboard views, allowing you to switch between different visualizations and analyses.

By using **Dashboard Actions**, you can save or load your own dashboard views. This lets you quickly switch between different visualizations without having to set them up each time.

* **Save Dashboard View** - Saves the current dashboard configuration as a [record](https://documentation.dnanexus.com/developer/api/introduction-to-data-object-classes/records#records) of the `DashboardView` type, including all tiles and their settings.
* **Load Dashboard View** - Loads a custom dashboard view, restoring the tiles and their configurations.

![Using Dashboard Actions](https://1612471957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_EsL_ie8XyZlLe_yf9%2Fuploads%2Fgit-blob-1dec052f9a94c4b9edd5c340340f093ee5af2379%2Fcohort-browser-dashboard-actions-menu.png?alt=media)

After loading a dashboard view once, you can access it again from **Dashboard Actions** > **Custom Dashboard Views**.

{% hint style="success" %}
**Moving dashboards between datasets?** If you want to use your dashboard views with a different Apollo Dataset, you can use the [Rebase Cohorts And Dashboards](https://documentation.dnanexus.com/developer/dataset-management/rebase-cohorts-and-dashboards) app to transfer your custom dashboard configurations to a new target dataset.
{% endhint %}

## Visualizing Data

Add charts to your dashboards to visualize the clinical and phenotypical data in your dataset. For example, you can add charts to display patient demographics or clinical measurements.

{% hint style="info" %}
**Working with Multi-Assay Visualizations**

For omics datasets, such as those for germline variants, somatic variants, or gene expression, you have additional predefined visualization options available:

* Germline and somatic variants are visualized using lollipop plots and variant frequency matrices. For details, see [Analyzing Germline Variants](https://documentation.dnanexus.com/user/cohort-browser/analyzing-germline-variants) and [Analyzing Somatic Variants](https://documentation.dnanexus.com/user/cohort-browser/analyzing-somatic-variants).
* Gene expression data is visualized using expression level and feature correlation charts. For details, see [Analyzing Gene Expression Data](https://documentation.dnanexus.com/user/cohort-browser/analyzing-gene-expression).
  {% endhint %}

### Adding Tiles to Visualize Data

Each chart is represented as a tile on the dashboard. You can add multiple tiles to visualize different aspects of your data.

1. In the **Overview** tab, click **+ Add Tile** on the top-right.
2. In the hierarchical list of the dataset fields, select the field you want to visualize.
3. In **Data Field Details**, choose your preferred chart type.
   * The available [chart types](https://documentation.dnanexus.com/user/cohort-browser/chart-types) depend on the field's value type.
4. Click **Add Tile**.

The tile appears on the dashboard with the current cohort data. You can add up to 15 tiles.

### Creating Multi-Variable Charts

When selecting data fields to visualize, you can add a secondary data field to create a multi-variable chart. This allows you to visualize relationships between two data fields in the same chart.

To visualize the relationship between two data fields in the same chart, first select your primary data field from the hierarchical list. This opens a **Data Field Details** panel, showing the field's information and a preview of a basic chart.

To add a secondary field, keep the primary field selected and search for the desired field. When you find it, click the **Add as Secondary Field** icon (**+**) next to its name rather than selecting it directly. This adds the new field to the visualization. The **Data Field Details** panel updates to show the combined information for both fields.

{% hint style="info" %}
You can click the **+** icon only when at least one chart type is supported for the specified combination.
{% endhint %}

For certain chart types, such as [Stacked Row Chart](https://documentation.dnanexus.com/user/cohort-browser/chart-types/stacked-row-chart) and [Scatter Plot](https://documentation.dnanexus.com/user/cohort-browser/chart-types/scatter-plot), you can re-order the primary and secondary data fields by dragging the data field in **Data Field Details**.

![Adding grouped box plot by combining two data fields](https://1612471957-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-L_EsL_ie8XyZlLe_yf9%2Fuploads%2Fgit-blob-363b87978cfd1227dc48dfd4ff97f99acf6b13ef%2F2D%20chart%20flow.gif?alt=media)

{% hint style="success" %}
For more details on multi-variable charts, including how to build **a survival curve**, see [Multi-Variable Charts](https://documentation.dnanexus.com/user/chart-types#multi-variable-charts).
{% endhint %}

### Chart Optimization

When working with large datasets, keep these tips in mind:

* Limit dashboard tiles: To ensure fast loading times and a clear overview, it's best to limit the number of charts on a single dashboard. Typically, 8-10 tiles is a good number for human comprehension and optimal performance.
* Filter data first: Reduce the volume of data by applying [filters](https://documentation.dnanexus.com/user/cohort-browser/defining-cohorts) before you create complex visualizations. This improves chart loading speed.
