Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

/api/reports/views/:id/chart

Returns chart metadata for rendering.

Tip

Charts can be rendered using BellaDati Charts SDK.

Resource Information

Request Parameters

Parameters

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:

Name
Description
drilldown

Drilldown defined with attribute code and following structure:

Name
Description
opFilter 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:

NameDescription
dateInterval

(Optional) Date interval to filter values. Has following structure:

Name
Description
aggregationTypeDate interval period - please see list of supported values.
interval

Interval definition with following structure:

Name
Description
typeInterval type - please see list of supported values.
fromInterval start value - please see Setting Date Interval
toInterval end value - please see Setting Date Interval
timeInterval

(Optional) Time interval to filter values. Has following structure:

Name
Description
aggregationTypeTime interval period - please see list of supported values.
interval

Interval definition with following structure:

Name
Description
typeInterval type - please see list of supported values.
fromInterval start value - please see Setting Date Interval
toInterval end value - please see Setting Date Interval
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 Structure

JSON response has following definition:

NameDescription
contentJSON charts data - please see Charts SDK for more details.
cleverTitleView title with description of applied filter and datetime definition.

Sample Request / Response

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

The JSON format response:

Code Block
javascript
javascript
{
  "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"]}}}
Sv translation
languageja

/api/reports/views/:id/chart

レンダリングのためのチャートのメタデータを返します。

アイコン

Tip

チャートはBellaDati  SDKチャートを使用することでレンダリング可能です。

リソース情報

要求パラメータ

パラメータ

詳細

id

閲覧ID。あなたは/api/reports/:idへレスポンスにIDを見つけることができます。

123

filter

(オプション)フィルタが次のような構造を持つKPIで使用されます。

説明
drilldown

ドリルダウンが次のような属性コードと構造で定義されます:

説明
opフィルタ操作タイプ - サポートされる値のリストを参照してください。
value/values(オプション)選択した"op"に依存します。フィルタ用の値または値を格納します。




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"
      }
   }
}


dateTimeDefinition

(オプション)日付と時刻の定義が次のような構造を持つKPIで使用します:

説明
dateInterval

(オプション)日付間隔間隔が値をフィルタリングします。

構造は次の通りです:

説明
aggregationType日付間隔期間 - サポートされる値のリストを参照してください。
interval

間隔の定義が次のような構造を持ちます:

説明
type

間隔タイプ - サポートされている値のリストを参照してください。

from間隔開始値
to間隔終了値



timeInterval

(オプション)時刻間隔が値をフィルタリングします。構造は次の通りです:

説明
aggregationType時刻間隔期間-サポートされる値のリストを参照してください。
interval

間隔の定義が次のような構造を持ちます:

Name
Description
type間隔タイプ - サポートされている値のリストを参照してください。
from間隔開始値
to間隔終了値





Code Block
{
   "dateInterval": {
      "interval": {
          "from":{"year":"2014","month":"1","day":"22"},
          "to":{"year":"2014","month":"1","day":"25"},
          "type": "absolute"
      },
      "aggregationType": "DAY"
   },
   "timeInterval": {
      "interval": {
          "from":{"hour":"14","minute":"15","second":"16"},
          "to":{"hour":"20","minute":"0","second":"0"},
          "type": "absolute"
      },
      "aggregationType": "SECOND"
   }
}


レスポンスの構造

JSONレスポンスは、次の定義が含まれます。

説明
contentJSONチャートデータ - 詳細については、SDKチャートを参照してください。
cleverTitle適用されたフィルタの日付時刻の定義の説明とタイトルを見られます。

サンプルリクエスト/レスポンス

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

JSON形式のレスポンス:

Code Block
javascript
javascript
{
  "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>"
}