Skip to main content

GetChartDataByConditions

Get chart data by specifying conditions

Description

Obtains chart data by specifying conditions.

Method

POST

Request URL Format

/api/v0/applications/:app-id/charts/:chart-id/filter

Payload

conditions -  Specify search conditions
Specify the display_id of the DataReport field, or "rpf_id" (the report field ID returned by the /conditions API), to narrow down.
"search_value": Specify search conditions as an array (see sample) *Similar to the specification of an item list, the specification contents differ for each field type.

Request URL Sample

When using the display ID as a search condition

id: Specify the display ID of the data report field in

POST https://api.xxx.com/api/v0/applications/APP_ID/charts/CHART_ID/conditions
{
"conditions":[
{
"id":"CATEGORY",
"search_value":["B"]
}
]
}

When using report field ID

rpf_id: Specify the report field ID in

POST https://api.xxx.com/api/v0/applications/APP_ID/charts/CHART_ID/conditions
{
"conditions":[
{
"rpf_id": "9ac0d794-fc4a-473f-be36-647d22c7cfa2",
"search_value":["7"]
}
]
}

Response Sample

{
"chart": {
"type": "barStacked"
},
"color": "DEFAULT",
"datasets": [
{
"data": [
60,
120
],
"label": "7月"
}
],
"labels": [
"事業部A",
"事業部B"
],
"title": {
"text": "1"
},
"zero": true
}