> For the complete documentation index, see [llms.txt](https://docs.onelens.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onelens.cloud/observe-visibility-and-insights/cost-reporting/dashboards/building-widgets.md).

# Building Widgets

Widgets are the building blocks of every dashboard. Each widget displays a specific metric, chart, or report, allowing you to monitor cloud costs, AI usage, infrastructure, savings opportunities, and operational insights from a single dashboard.

To add a widget:

1. Open a dashboard.
2. Click **Add Widget**.
3. Select a widget creation method.
4. Configure the widget.
5. Add it to your dashboard.

***

### Choose a Widget Creation Method

When you click **Add Widget**, OneLens provides two ways to create widgets.

* **Simple Widget Creator** – Quickly add widgets using pre-configured reports and templates.
* **Query Builder** – Build fully customized widgets by selecting your own data source, metrics, filters, and visualization.

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

*Choose between the Simple Widget Creator for a guided experience or the Query Builder for complete customization.*

***

## Build a Widget using Query Builder

The Query Builder guides you through a series of steps to create a widget.

***

### Step 1 : Select a Data Source

Begin by selecting the data source that contains the information you want to visualize.

Available modules may include:

* Cost360
* AI Cost & Usage
* Kubernetes
* Tickets & Insights
* Policies
* Anomalies
* Budgets
* Commitments

The available modules depend on your OneLens deployment.

<figure><img src="/files/36KuY0c9t8uUGIxrbh5G" alt=""><figcaption></figcaption></figure>

***

### Step 2 : Configure the Widget

Choose the data you want to display.

Configure the following:

* **Metric** – Select the value to measure (for example, Cost, Savings, Token Usage, or Requests).
* **Aggregation** – Choose how the data should be calculated, such as Sum, Average, Maximum, or Count.
* **Group By** – Organize results by one or more dimensions such as Service, Account, Region, or Environment.
* **Top N** *(optional)* – Limit the results to the highest-ranking records.

The available metrics and aggregations depend on the selected data source.

<figure><img src="/files/4YfqWkxoFbCbdjhBiBSr" alt=""><figcaption></figcaption></figure>

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

***

### Step 3 : Apply Filters

Filters help narrow the data displayed in the widget.

You can filter by dimensions supported by the selected data source, including:

* Date Range
* Account
* Service
* Region
* Environment
* Cost Center
* Cloud Provider

You can also configure the reporting granularity, such as Daily, Weekly, or Monthly, where supported.

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

***

### Step 4 : Select a Visualization

Choose how the results should be displayed.

Dashboard V2 supports multiple visualization types, including:

* KPI Card
* Column Chart
* Line Chart
* Area Chart
* Pie Chart
* Table
* Leaderboard
* Treemap
* Heatmap

Only visualization types compatible with the selected data are available.

Provide a widget name, review the preview, and click **Add Widget** to place it on the dashboard.

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

***

### Supported Visualizations

Dashboard V2 automatically recommends and enables visualization types based on the selected data.

| Visualization | Best Used For               |
| ------------- | --------------------------- |
| KPI Card      | Single metrics              |
| Column Chart  | Category comparisons        |
| Line Chart    | Trends over time            |
| Area Chart    | Continuous trends           |
| Pie Chart     | Distribution analysis       |
| Leaderboard   | Rankings                    |
| Table         | Detailed analysis           |
| Treemap       | Hierarchical breakdowns     |
| Heatmap       | Two-dimensional comparisons |

***

### After Adding a Widget

Once added, widgets can be:

* Moved using drag-and-drop
* Resized
* Edited
* Deleted

Changes are not saved automatically. Click **Save Changes** to persist your dashboard layout.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.onelens.cloud/observe-visibility-and-insights/cost-reporting/dashboards/building-widgets.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
