/api/reports/views/:id/chartReturns chart metadata for rendering. Tip |
---|
Charts can be rendered using BellaDati Charts SDK. |
Request ParametersParameters | Detail | Example |
---|
id
| ID of the view. You can find the ID in the response to /api/reports/:id . | 123 | filter
| (Optional) Filter used in the chart with following structure: | |
---|
drilldown | Drilldown defined with attribute code and following structure: | |
---|
op | Filter operation type - please see list of supported values. | value/values | (Optional) Depends on selected "op". Contains value or values for filter. | countOp | (Optional) Used with COUNT operation. Specifies the second operation used together with count. Supported values: EQ, NEQ, GT, GTE, LT, LTE |
|
| Code Block |
---|
{
"drilldown": {
"L_COUNTRY_OR_AREA": {
"op": "EQ",
"value": "Slovakia"
},
"L_TYPE": {
"op": "IN",
"values": [ "Type 1", "Type 2", "Type 3" ]
},
"L_DATE": {
"op": "NOT_NULL"
},
"L_PRODUCT":{
"op":"COUNT",
"countOp":"LTE",
"value":"816"
}
}
} |
| dateTimeDefinition
| (Optional) Date and time definition used in the chart with following structure: Name | Description |
---|
dateInterval | (Optional) Date interval to filter values. Has following structure: | |
---|
aggregationType | Date interval period - please see list of supported values. | interval | Interval definition with following structure: |
| timeInterval | (Optional) Time interval to filter values. Has following structure: | |
---|
aggregationType | Time interval period - please see list of supported values. | interval | Interval definition with following structure: |
|
| Code Block |
---|
{
"dateInterval": {
"interval": {
"from": "actualYear-1y",
"to": "actualYear-1d",
"type": "custom"
},
"aggregationType": "DAY"
},
"timeInterval": {
"interval": {
"from": {"hour":"14","minute":"15","second":"16"},
"to": {"hour":"20","minute":"0","second":"0"},
"type": "absolute"
},
"aggregationType": "SECOND"
}
} |
|
Response StructureJSON response has following definition: Name | Description |
---|
content | JSON charts data - please see Charts SDK for more details. | cleverTitle | View title with description of applied filter and datetime definition. |
Sample Request / ResponseUsing curl : Code Block |
---|
curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\"" https://service.belladati.com/api/reports/views/88738/chart
|
The JSON format response: Code Block |
---|
| {
"content": {
"chartId": "chart_88738",
"bg_colour": "#e5e5e5",
"is_decimal_separator_comma": 1,
"elements": [
],
"is_thousand_separator_disabled": 1,
"options": {
},
"tooltip": {
"colour": "#202020",
"stroke": 1,
"mouse": "2",
"shadow": true,
"background": "#ffffff"
}
},
"cleverTitle": "<div class=\"cleverTitle\"><\/div>"
}
|
Sample request with filter, using curl: Code Block |
---|
curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\"" https://service.belladati.com/api/reports/views/88738/chart?filter={"drilldown":{"L_STATE":{"op": "IN","values":["Arizona"]}}} |
|