# Chart

The **chart** widget allows you to view data from one or more data fields on a  **line** or **bar** chart.

In the **Widget options** modal, configure the following settings:

In the **Name** text box, enter a **name** as the **label** for your widget.

In the **Data fields** drop-down list, select the **data field** that you want to add as the data source. Click on the **+** button to add more data fields. You can assign different colors for each data field using the **color picker** associated with each drop-down list.

Click on the **Last from** text box and select a predefined timeframe from the list. If the desired timeframe is not available, you can manually type a timeframe, such as '3 days', '7 weeks', etc. Note that '3 days' refers to the last three days, including today, for example. Here is a list of predefined timeframe presets: `1 hour`, `1 day`, `1 week`, `1 month`, and `1 year`.

In the **Chart type** drop-down list, select either a **line chart** or a **bar chart**.

To add a **color** to the **background** of the widget, click on the **Background color** box and choose a color from the **color picker**.

Click on the **Save** button.

<figure><img src="/files/fXR2wp8Q5MPtgy9Z3DQf" alt="" width="328"><figcaption></figcaption></figure>

The resulting **Chart** widget looks something like this:

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


---

# 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://docs.widgelix.com/get-started/widgets/chart.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.
