# 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="https://2494440469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fggsr9Xlsze5cwVr4WMof%2Fuploads%2FXtCnrvB83I4fuUIp6JCX%2Fchart-1.png?alt=media&#x26;token=b19f6f58-210a-4ae9-8d86-9458c5418a82" alt="" width="328"><figcaption></figcaption></figure>

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

<figure><img src="https://2494440469-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fggsr9Xlsze5cwVr4WMof%2Fuploads%2Fum5wCnSd1ruFUkSlqbRb%2Fchart-2.png?alt=media&#x26;token=c8561989-457a-4192-ba37-7a630fe5a1bd" alt=""><figcaption></figcaption></figure>
