# Chart card

> Canonical HTML: https://screenrig.ai/docs/cards/chart/

A signage-grade chart: columns, bars, lines, areas or a donut, with big direct labels and few gridlines.

Category: Operations. Tags: Charts and gauges, Numbers and metrics, Offices and workplaces.

## Previews

![Chart](/cards/chart/v1/screenshots/canvas-bloom.webp?sha=c5c5d849fdaecd56d206101e25f1ae4004ca87b64e284e0b41db68affa6b7a01)

Canvas

![Chart](/cards/chart/v1/screenshots/corner-bloom.webp?sha=146aef9dd966dcd1b0f1a053a61f03248541da7e96a81a4bac0c66d54ebf9e92)

Corner

![Chart](/cards/chart/v1/screenshots/chip-bloom.webp?sha=e2fc7d8a44160a542994b5505d1d221abd706ac9a375c483b884e353902b2e3c)

Chip

## Views and forms

Views: canvas, corner, chip. Canvas forms: landscape, portrait.

[Card views, themes and publishing](/docs/cards/). [Browse the gallery](/apps/#cards).

## Data and privacy

This card uses its configured properties and live card data.

## Properties

For theme, background, accent and position, see [Common properties](/docs/cards/#common-properties).

Set static properties in `params`. Bind `data` to a project card data key for live values; that document holds only dynamic properties. Without a data key, put the complete configuration in `params`. Nested rows describe the contents of their parent property.

### Static properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `title` | string | `""` | maxLength: `60` |  |
| `subtitle` | string | `""` | maxLength: `80` |  |
| `kind` | string | `"column"` | `"column"`, `"bar"`, `"line"`, `"area"`, `"donut"` | column: vertical bars; bar: horizontal bars; donut uses the first series. |
| `prefix` | string | `""` | maxLength: `3` | Before every value, for example $. |
| `unit` | string | `""` | maxLength: `6` | After every value, for example % or k. |
| `decimals` | integer | `0` | minimum: `0`; maximum: `4` |  |
| `stacked` | boolean | `false` |  | Stack the series (column and bar). |
| `showValues` | boolean | `true` |  |  |
| `targetLabel` | string | `"Target"` | maxLength: `24` |  |

### Dynamic properties

| Name | Type | Default | Values and limits | Description |
| --- | --- | --- | --- | --- |
| `series` | array |  | minItems: `1`; maxItems: `4`; Required |  |
| `series[].name` | string | `""` | maxLength: `32` |  |
| `series[].values` | array |  | minItems: `1`; maxItems: `31`; Required |  |
| `labels` | array | `[]` | maxItems: `31` | Category labels, one per value. |
| `target` | number, null | `null` |  | A horizontal target line. |

## Canvas example

Add this item to a playlist page’s `primitives`. [Publish the playlist and assign a screen](/docs/cards/#publish-a-card-canvas).

```json
{
  "id": "chart",
  "primitive": "card",
  "card": "chart",
  "major": 1,
  "params": {
    "theme": "neomustard"
  },
  "rect": {
    "x": 0,
    "y": 0,
    "width": 1920,
    "height": 1080
  },
  "layer": 0,
  "content_fit": "fill",
  "data": "chart-main"
}
```

## Write live data

Create this document before showing the card, then replace it to update the screen without republishing. Use the same project as the playlist. Supply your API authorization through the environment; see [API authentication](/docs/authentication/).

```console
curl --request PUT "https://api.screenrig.ai/api/card-data/chart-main" \
  --header "Authorization: Bearer $SCREENRIG_TOKEN" \
  --header "ScreenRig-Project: $SCREENRIG_PROJECT" \
  --header "Content-Type: application/json" \
  --data '{"document":{"series":[{"values":[1]}],"labels":[],"target":null}}'
```
