# Liquid Chart

## Display a chart from an API

An API that provides data to a chart needs to return a single number between 0.0 and 1.00.&#x20;

This example returns a random percentage.&#x20;

```
(1..100 | Get-Random) / 100
```

Select an API from the list of available APIs.&#x20;

![](https://3638551245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-Mj1JRGrw0AkC_VOwaID%2F-Mj1JwxhoynI_Gd8Ra28%2Fimage.png?alt=media\&token=8abe54d2-616f-46da-9478-ad917f6f9b9e)

The liquid chart will display the value.&#x20;

![](https://3638551245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-Mj1JRGrw0AkC_VOwaID%2F-Mj1JlDyJaT45ACHZ7Nd%2Fimage.png?alt=media\&token=1e12eba4-6040-4c28-bc03-bb8d99d43064)

## Display a chart from a Script

You can display a liquid chart with data from a script. You should return a single value between 0.0 and 1.00.&#x20;

This script we are executing in this example returns a random percentage.&#x20;

```
(1..100 | Get-Random) / 100
```

Select the script as the data source.&#x20;

![](https://3638551245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-Mj1JRGrw0AkC_VOwaID%2F-Mj1KvLL6LUTcBECJA4U%2Fimage.png?alt=media\&token=e772fd5b-edc6-4556-af2f-438aab599957)

The chart will display based on the data returned.&#x20;

![](https://3638551245-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M6jY7sXTmhiAIMGYw_m%2F-Mj1JRGrw0AkC_VOwaID%2F-Mj1JlDyJaT45ACHZ7Nd%2Fimage.png?alt=media\&token=1e12eba4-6040-4c28-bc03-bb8d99d43064)

## Properties

| Properties       | Description                                                   | Available Since |
| ---------------- | ------------------------------------------------------------- | --------------- |
| Id               | The ID of this component                                      | 2.2.0           |
| Data Source Type | The data source type for this chart. Accepts scripts or APIs. | 2.2.0           |
| Data Source      | The data source for this chart.                               | 2.2.0           |
| Color            | The color of the chart.                                       | 2.2.0           |


---

# 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.powershelluniversal.com/master-1/userinterfaces/pages/liquid-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.
