# Create Chart Widget

After creating the dashboard page and its corresponding menu, the next step is to define a **chart widget** that will be rendered on the dashboard.

In the Widget Dashboard approach, chart widgets are created by **manually inserting configuration data** into the database table **`WIDGET_PREF`**.\
This table stores widget‑level preferences that are used by the runtime engine to identify and render the chart widget.

***

#### Widget Configuration via Database

To create a chart widget, insert a new record into the **`WIDGET_PREF`** table using the following values.

These values associate a widget instance with a specific widget definition used by the dashboard.

***

#### WIDGET\_PREF Table Values

| Column   | Value   |
| -------- | ------- |
| ID       | `90101` |
| WIDGETID | `10`    |

***

#### Field Description Overview

* **ID**\
  Unique identifier for the widget preference entry.\
  This value distinguishes the widget instance within the dashboard configuration.
* **WIDGETID**\
  Identifier that maps the preference entry to a specific widget definition.\
  This value determines which chart or widget type will be rendered.

***

#### Result

Once the record is inserted into the **`WIDGET_PREF`** table:

* The chart widget becomes available for use on the dashboard
* The runtime engine recognizes the widget configuration
* The widget can be rendered based on the associated dashboard page and menu setup


---

# 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/create-chart-widget.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.
