# Chart cell

Next to code cells, text cells and SQL cells, DataLab also allows you to insert dedicated chart cells into your notebook. Chart cells are a way to create charts from data frames without writing *any* code. They are great for quick exploration, but also for building publication-grade visuals to include in your reports.

### Creating a chart cell (Python)

Follow these steps to create a chart cell in your workbook:

* Ensure you have at least one pandas DataFrame in your Python session that is assigned to a variable. You can do this by importing a CSV, running a [SQL cell](/work/sql-cell.md) or writing pandas code.
* Click on "Add Content" at the bottom of the notebook or in between two cells. Then, select "Chart".
* Select the DataFrame you want to visualize in the dropdown menu at the top left of the newly created cell.&#x20;
  * Don't see your DataFrame here? You might not have an active session, or the DataFrame may not exist anymore. Try re-running your previous cells to make sure the DataFrame exists in your session!
* Select the category and series that you want to display on your chart. [Learn more](/work/chart-cell/configuring-your-chart.md) about categories, series, and customizing your chart.

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

### Creating a chart cell (R)

To create a chart cell in an R session, follow the same steps as above. Instead of a pandas DataFrame, the source data for your chart must be an R data frame or the result of a [SQL cell](/work/sql-cell.md).


---

# 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://datalab-docs.datacamp.com/work/chart-cell.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.
