# Change the Chart to Pie Chart

After configuring and testing the chart widget and its series, you can change the **chart visualization type** from a **Line chart** to a **Pie chart**.\
This is done by updating specific configuration values in the database tables that control chart rendering.

***

#### Update Chart Type Configuration

To change the chart type from **Line** to **Pie**, update the **`DASHTYPE`** column in the **`DASH_WIDGET_PROP`** table for the corresponding chart record.

Set the value as shown below:

```
DASHTYPE = 'pie'
```

This change defines the overall chart visualization type used by the widget.

***

#### Update Chart Series Type

In addition to updating the chart configuration, the chart **series type** must also be updated.

Update the **`CHART_TYPE`** column in the **`DASH_WIDGET_CHART_PROP`** table for the relevant series record and set the value as:

```
CHART_TYPE = 'pie'
```

This ensures that the data series is rendered correctly using the Pie chart format.

***

#### Verify the Updated Chart

After applying both configuration changes:

1. Open the dashboard page again.
2. Click the **Training** page (or the dashboard menu configured earlier).

***

#### Expected Result

The dashboard now displays the chart in **Pie Chart** format.\
The updated chart represents the **Income comparison between Bangkok and Upcountry**, grouped by quarter, as shown below.

<figure><img src="https://2015371994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMpDjHWFRUtZ5nJcSfVXd%2Fuploads%2F9kMdLCFEQxgAydrhd5Z7%2Fimage.png?alt=media&#x26;token=5c9d8f3f-1a89-4ebb-adac-500bbf800e0b" alt=""><figcaption></figcaption></figure>

***

#### Summary

By updating:

* `DASH_WIDGET_PROP.DASHTYPE`, and
* `DASH_WIDGET_CHART_PROP.CHART_TYPE`

you can dynamically switch the same dataset between different chart visualizations without recreating the widget.

This flexibility allows the Widget Dashboard to support multiple analytical views using the same underlying data configuration.


---

# 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.onewebstack.com/oneweb-platform-th/building-apps/ui-page-designer/ux-ui-components/dashboard/widget-dashboard/steps-to-create-a-widget-dashboard/change-the-chart-to-pie-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.
