# Change the Chart to Column Stacked Chart

After configuring multiple data series on a chart, you can further enhance the visualization by switching the chart type to a **Column Stacked Chart**.\
This allows you to compare aggregated values while also visualizing how each category contributes to the total.

The Column Stacked Chart is configured by updating both **chart‑level** and **series‑level** settings in the database.

***

#### Add an Additional Series for Column Chart

First, insert an additional record into the **`DASH_WIDGET_CHART_PROP`** table to define a new series that will participate in the stacked column chart.

Use the following values:

| Column            | Value         |
| ----------------- | ------------- |
| ID                | `9010102`     |
| DASH\_ID          | `90101`       |
| CHART\_TYPE       | `column`      |
| TABLE\_NAME       | `MOCKUP_DATA` |
| FIELD\_NAME       | `COL2_VALUE`  |
| FIELD\_DESC       | `COL1_DESC`   |
| COND1\_FIELD      | `DASH_CODE`   |
| COND1\_VALUE      | `SA004-1`     |
| SEQ               | `3`           |
| NAME              | `KONKHEAN`    |
| STACK\_GROUP      | `UP_COUNTRY`  |
| COND2\_FIELD      | `COL2_DESC`   |
| COND2\_VALUE      | `KONKHEAN`    |
| FIELD\_DESC\_SORT | *(empty)*     |
| FIELD\_PREFIX     | *(empty)*     |
| FIELD\_SUFFIX     | *(empty)*     |
| SYMBOL            | *(empty)*     |
| LEGEND            | *(empty)*     |
| FIELD\_COLOR      | *(empty)*     |
| DATA\_LABEL       | *(empty)*     |
| Y\_AXIS           | *(empty)*     |

***

#### Update Existing Series to Column Type

To ensure consistency across all series:

* Update the **`CHART_TYPE`** column in the **`DASH_WIDGET_CHART_PROP`** table for the **previous two series**\
  and set the value to:

```
CHART_TYPE = 'column'
```

This converts all existing series from Line to Column format.

***

#### Configure Stacked Groups

Next, configure the stacked grouping to control how the columns are stacked:

* To create a stacked group for **Bangkok**, update the **`STACK_GROUP`** column of the Bangkok series to:

```
STACK_GROUP = 'BANGKOK'
```

* To assign **Chiang Mai** to the **UP\_COUNTRY** stacked group, update the **`STACK_GROUP`** column of the Chiang Mai series to:

```
STACK_GROUP = 'UP_COUNTRY'
```

This groups provinces into logical stacks within the column chart.

***

#### Update Chart Type to Stacked Column

Finally, update the **chart‑level** configuration to enable stacked column rendering.

Update the **`DASHTYPE`** column in the **`DASH_WIDGET_PROP`** table for the widget to:

```
DASHTYPE = 'stacked_group_column'
```

This instructs the dashboard runtime to render the chart as a **stacked column chart**.

***

#### Verify the Updated Chart

After completing all configuration changes:

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

***

#### Expected Result

The dashboard now displays a **Column Stacked Chart**, representing **Income comparison between Bangkok and up‑country regions 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%2FjU7B3WuijqseJtjDqyvH%2Fimage.png?alt=media&#x26;token=4cd89ab8-25f5-44ff-adab-17f55743244f" alt=""><figcaption></figcaption></figure>

***

#### Summary

By switching to a Column Stacked Chart:

* Multiple series can be grouped and compared visually
* Aggregate totals and individual contributions are displayed together
* Complex comparisons become easier to interpret

This demonstrates the flexibility of the Widget Dashboard’s **configuration‑driven chart rendering model**.


---

# 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-column-stacked-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.
