Get a widget's chart data
A widget is one chart on a dashboard. Get the data it displays, computed from the current work items in the dashboard's projects. The dashboard's filter and the widget's own filter both apply. The response shape depends on the chart type; see Chart types.
No query parameter is required. A chart type reads only the parameters listed for it below and ignores the rest. Any other parameter, including filters, pql_filters or x_axis_property, is ignored too: the chart always uses the widget's saved settings. To change them, update the widget.
| Chart type | page | column_page | row_ids | Page size |
|---|---|---|---|---|
BAR_CHART, LINE_CHART, AREA_CHART | yes | config.max_rows (default 20) buckets | ||
TABLE_CHART | yes | yes | yes | config.max_rows (10) rows, config.max_columns (20) columns |
WORK_ITEMS_TABLE, ASSIGNED_WORK_ITEMS_TABLE | yes | config.max_rows (10) work items | ||
WORK_ITEMS_STATISTICS | yes | config.max_rows (10) groups | ||
WORK_ITEM_TYPE_PROGRESS | yes | config.max_rows (6) parent work items | ||
WORK_ITEMS_SMART_COUNTER, WORK_ITEMS_SMART_GAUGE | yes | config.rows_to_show (6) groups | ||
PIE_CHART, DONUT_CHART, NUMBER | Not paginated | |||
CYCLE_PROGRESS_BAR, ACTIVE_CYCLE_PROGRESS_BAR, INTAKE_* | Not paginated |
To load more columns of a TABLE_CHART for the rows already on screen:
GET …/chart/returns row page 1 and column page 1.GET …/chart/?page=2returns the next rows, with column page 1.GET …/chart/?page=2&column_page=2&row_ids=["backlog","started"]returns column page 2 for those rows. URL-encoderow_ids:row_ids=%5B%22backlog%22%2C%22started%22%5D.
Path parameters
slug:requiredstringThe workspace slug. It appears in your Plane URLs. In https://app.plane.so/my-team/projects/, the slug is my-team.
dashboard_id:requiredstring (uuid)The dashboard the widget is on.
pk:requiredstring (uuid)The widget ID. A widget on a different dashboard returns 404.
Query parameters
page:optionalintegerWhich page of rows, buckets, groups or counters to return. Default 1. The page size is the chart's own config setting, not a query parameter. A page past the last one returns the last page, so read page and total_pages in the response. Below 1, or not an integer, returns 400 on a chart type that reads it.
column_page:optionalintegerTABLE_CHART only. Which page of columns to return. Default 1; the page size is config.max_columns. A page past the last returns the last column page.
row_ids:optionalstring (JSON array)TABLE_CHART only. The data[].group_by_id values of the rows already on screen, for example ["backlog","started"]. Include null for the "no value" row. The response then has exactly these rows, in this order, for the requested column_page, without ranking the rows again. Row pagination fields are approximate in that case (next_page is null and total_count is the number of IDs sent), so keep the ones from the earlier response.
Valid JSON that isn't an array returns 400. A value that isn't valid JSON is ignored.
Scopes
workspaces.dashboards.widgets:read, or the broad read scope.
Errors
| Status | Code | Cause |
|---|---|---|
400 | invalid_request | A page, column_page or row_ids value is invalid, or the widget's saved settings don't fit its chart type (for example a widget saved half-configured in the app). errors[] names the field. |
401 | unauthorized | Missing or invalid credentials. |
402 | payment_required | Dashboards, or this chart type, aren't included in the workspace's plan, or you aren't a member of the workspace. |
403 | forbidden | Guests can't use dashboards, or your token lacks the scope. |
404 | not_found | The dashboard or widget doesn't exist, or you can't see the dashboard. |
406 | not_acceptable | The Accept header asks for a representation the API can't produce. |
429 | rate_limited | Throttled. Wait for the Retry-After header's seconds before retrying. |
curl -X GET \
"https://api.plane.so/api/v2/workspaces/my-team/dashboards/05186e3b-94a3-49b0-8403-9307d292daea/widgets/0bda418f-3e9a-47bd-8e70-faa04e1f9540/chart/" \
-H "X-Api-Key: $PLANE_API_KEY"import requests
response = requests.get(
"https://api.plane.so/api/v2/workspaces/my-team/dashboards/05186e3b-94a3-49b0-8403-9307d292daea/widgets/0bda418f-3e9a-47bd-8e70-faa04e1f9540/chart/",
headers={"X-Api-Key": "your-api-key"},
)
print(response.json())const response = await fetch(
"https://api.plane.so/api/v2/workspaces/my-team/dashboards/05186e3b-94a3-49b0-8403-9307d292daea/widgets/0bda418f-3e9a-47bd-8e70-faa04e1f9540/chart/",
{
method: "GET",
headers: {
"X-Api-Key": "your-api-key",
},
},
);
const data = await response.json();{
"schema": {
"state_group": {
"started": {
"id": "started",
"name": "Started"
},
"backlog": {
"id": "backlog",
"name": "Backlog"
},
"completed": {
"id": "completed",
"name": "Completed"
},
"unstarted": {
"id": "unstarted",
"name": "Unstarted"
},
"cancelled": {
"id": "cancelled",
"name": "Cancelled"
}
},
"priority": {
"none": {
"id": "none",
"name": "None"
},
"high": {
"id": "high",
"name": "High"
},
"medium": {
"id": "medium",
"name": "Medium"
},
"urgent": {
"id": "urgent",
"name": "Urgent"
}
}
},
"total_count": 4,
"total_pages": 1,
"page": 1,
"per_page": 20,
"next_page": null,
"prev_page": null,
"data": [
{
"key": "none",
"count": 16,
"groups": {
"backlog": 5,
"started": 9,
"unstarted": 2
},
"projects": {}
},
{
"key": "high",
"count": 2,
"groups": {
"completed": 2
},
"projects": {}
},
{
"key": "medium",
"count": 2,
"groups": {
"cancelled": 1,
"started": 1
},
"projects": {}
},
{
"key": "urgent",
"count": 2,
"groups": {
"started": 2
},
"projects": {}
}
],
"x_axis_schema_key": "priority",
"group_by_schema_key": "state_group",
"group_keys": ["started", "backlog", "completed", "unstarted", "cancelled"]
}{
"schema": {},
"value": 22,
"y_axis_metric": "WORK_ITEM_COUNT"
}{
"type": "invalid_request",
"code": "invalid_request",
"detail": "One or more fields failed validation.",
"errors": [
{
"field": "page",
"code": "invalid",
"message": "Input should be greater than or equal to 1"
}
]
}
