# Pie Chart Widget

**General Setting**

User can change following things in Pie Chart widget:

* Name for widget which will be used data reference. For Example, if widget name is 'Pie Chart', then data of widget is referenced as Pie Chart.data
* Show title - User can show/hide widget title
* Title Color
* Background Color

![Configure Pie Chart Widget](/files/vnavDtPhGv5hzRAe6g7y)

**Widget Setting**

In Widget Setting option, user can change following parameters:

* Inner Radius - Integer value for radius of inner circle of pie chart
* Show Legend - Enable to show legends

![Configure Pie Chart Widget](/files/hNKxYyWwl9XUokweWlCI)

#### Source <a href="#source" id="source"></a>

User can select a source mode as MQTT or Action.

**Using MQTT**

Here, to update data on Pie Chart user can publish JSON object on given **data** MQTT topic. No need to provide \<account\_id> while providing the MQTT topic. The JSON obejct will be as below.

```
// Example 

{ "Andrew": 100 ,"John":160 ,"Sam":120}
```

![Configure Pie Chart Widget](/files/eocaX1EidhGF9LbCT0H5)

**Using Action**

Here, to update the Pie Chart widget, output of the action should contain JSON Object as given in above example. User can also update the widget either onLoad or periodically by providing refresh interval.

![Configure Pie Chart Widget](/files/F2s6WXOIgVnjUnUo4ahh)

#### Event Handling

Pie Chart widget does not support any event.

#### Example

Here, data in below format published on configured topic, will appear as shown in image.

```
// Example

{ "Andrew": 100 ,"John":160 ,"Sam":120}
```

![MQTT Data for Pie Chart](/files/Yomn3IYtoJcUN3Cn6IgI)

![Pie Chart Example](/files/AM6Btcv0NmWLXzo1laRT)


---

# 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.thingsup.io/widgets/pie-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.
