Update dashboard chart¶
Update the query, display and refresh configuration of the specified chart.
PATCH $CLOUDSIGMA_API_BASE/data-dashboards/{dashboard_id}/charts/{chart_id}
Before you call this API¶
Configure the regional API endpoint and authentication, and select the target workspace.
Set the operation-specific values used in the request:
$DASHBOARD_ID:dashboard_idto use, specifying the target resource via the request path.$CHART_ID:chart_idto use, specifying the target resource through the request path.
Request¶
Replace caller-specific values in the example with actual values.
curl -X PATCH "$CLOUDSIGMA_API_BASE/data-dashboards/$DASHBOARD_ID/charts/$CHART_ID" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "每日订单数",
"chart_type": "line",
"sql_text": "SELECT 1",
"chart_config": "{}",
"layout_config": "{}",
"refresh_interval": "manual",
"alert_enabled": false,
"alert_config": "{}"
}'
Request body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Required | Chart name. |
chart_type | string | Required | Chart type. |
sql_text | string | Required | Chart SQL. |
chart_config | string | Required | Chart configuration. |
layout_config | string | Required | Layout configuration. |
refresh_interval | string | Required | Refresh cycle. |
alert_enabled | boolean | Required | Whether to enable alarms. |
alert_config | string | Required | Alarm configuration. |
Successful response¶
When the update is successful, the updated chart and scheduling status are returned.
{
"code": 0,
"data": {
"ID": "0198ce79-2320-76aa-9d34-7f8e9d0c1b2a",
"DashboardID": "0198ce73-3d20-7c12-9a11-1a2b3c4d5e6f",
"Name": "每日订单数",
"ChartType": "line",
"SQLText": "SELECT 1",
"DatabaseName": "analytics",
"ChartConfig": "{}",
"LayoutConfig": "{}",
"RefreshInterval": "manual",
"SchedulerTaskID": "",
"ScheduleVersion": 2,
"ScheduleStatus": "ready",
"ScheduleError": "",
"ScheduleOperationID": "operation-002",
"AlertEnabled": false,
"AlertConfig": "{}",
"SnapshotEpochAt": "2026-08-21T07:10:00Z",
"CreatedAt": "2026-08-21T07:00:00Z",
"UpdatedAt": "2026-08-21T07:10:00Z"
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
string |
Chart ID. |
|
string |
The ID of the data dashboard. |
|
string |
Chart name. |
|
string |
Chart type. |
|
string |
Chart SQL. |
|
string |
Database name used for chart query. |
|
string |
Chart configuration. |
|
string |
Layout configuration. |
|
string |
Refresh cycle. |
|
string |
Scheduling task ID; empty when no scheduling task is created. |
|
integer |
Scheduling configuration version. |
|
string |
Scheduling status. |
|
string |
Scheduling error; empty if there is no error. |
|
string |
ID of this scheduling operation. |
|
boolean |
Whether to enable alarms. |
|
string |
Alarm configuration. |
|
string |
Result snapshot starting time. |
|
string |
Creation time. |
|
string |
Update time. |
Error response¶
{
"code": 2,
"message": "invalid argument",
"details": {
"domain": "moi-core.catalog.data_dashboard",
"reason": "DATA_DASHBOARD_INVALID_REQUEST"
}
}
| Field | Type | Description |
|---|---|---|
code | integer or string | Error code or status. |
message | string | Error message. |