> For the complete documentation index, see [llms.txt](https://docs.rierino.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rierino.com/sdk-dv-ui/values/line-percent.md). Agents can also search and read this documentation through its [MCP server](https://docs.rierino.com/~gitbook/mcp).

# Line Percent

Shows rows as labelled progress bars with their percentages.

{% tabs %}
{% tab title="Definition" %}

```json
{
  "sources": [{ "key": "channels", "url": "SourceVisData?queryId=channels", "params": {} }],
  "layout": {
    "type": "RCard",
    "props": { "title": "Revenue by channel", "classes": { "rootExtra": "relative h-44" } },
    "items": [
      {
        "type": "RLinePercent",
        "bind": { "query": "SELECT channel, share FROM channels ORDER BY share DESC" },
        "props": { "labelField": "channel", "valueField": "share" }
      }
    ]
  }
}
```

{% endtab %}

{% tab title="Sample data" %}
The rows the dashboard's sources return.

`channels` (3 rows)

```json
[
  { "channel": "Web store", "share": 0.54 },
  { "channel": "Mobile app", "share": 0.31 },
  { "channel": "Marketplace", "share": 0.15 }
]
```

{% endtab %}
{% endtabs %}

## Usage

```json
{
  "type": "RLinePercent",
  "bind": { "query": "SELECT channel, share FROM channels ORDER BY share DESC" },
  "props": { "labelField": "channel", "valueField": "share" }
}
```

Each row of the data is a bar: its label, its value as a percentage, and a bar filled to that value. Values are fractions: `0.54` fills 54% of the bar.

## Props

| Prop         | Type       | Default                               | Description                                      |
| ------------ | ---------- | ------------------------------------- | ------------------------------------------------ |
| `labelField` | `string`   | `"label"`                             | Field each bar's label is read from.             |
| `valueField` | `string`   | `"value"`                             | Field each bar's fraction is read from.          |
| `sample`     | `object[]` | `[{ label: "Label", value: 0.5 }, …]` | Rows shown when there is no data, for designing. |
| `classes`    | `object`   |                                       | Class names for the parts, see Classes below.    |

In the Rierino designer: **Label Field**, **Value Field** and **Classes**.

## Classes

The parts are repeated for every bar.

| Part           | Built-in classes                        | Styles                   |
| -------------- | --------------------------------------- | ------------------------ |
| `root`         | `relative py-2`                         | One bar with its texts   |
| `text`         | `flex text-bright-gray text-regular-12` | The label and percentage |
| `label`        | `flex-1`                                | The label                |
| `value`        | `text-purple-heart`                     | The percentage           |
| `bar`          | `h-[3px]`                               | The bar                  |
| `segment`      | `h-[3px]`                               | Both parts of the bar    |
| `valueSegment` | `fill-portage`                          | The filled part          |
| `clearSegment` | `fill-hawkes-blue`                      | The rest of the bar      |

Set `classes.<part>` to replace the built-in classes, or `classes.<part>Extra` to add to them.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rierino.com/sdk-dv-ui/values/line-percent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
