Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed translated content for 'zh'
Sv translation
languageen

Stack Bar chart

JSON used as input for Stack bar chart rendering consists of multiple elements.

Table of Contents
minLevel3

Basic structure

Code Block
{
  "x_axis": {
    "labels": {
      "labels": [ ... ]
    }
  }
  "y_axis": {
    "labels": {
      "labels": [ ... ]
    }
  }
  "elements": [
    {
      "type": "bar_stack",
      "keys": [ ... ],
      "values": [ ... ]
    }
  ]
}

Common elements

NameDescriptionExample
chartId
Chart view identifier. Refer to REST API.
chart_4-b3T3T8tVlP_JDdEDsaCIu
bg_color
Defines the color of the background for the entire chart
#e5e5e5
is_decimal_separator_comma
Determines whether to use comma as decimal separator. [0, 1]1
is_thousand_separator_disabled
Determines whether to use the thousands separator or not. [0, 1]1
tooltip

Defines the basic tooltip settings for the entire chart.

NameDescriptionExample
mouse
Mouse sensitivity2
shadow
[true, false]true
stroke
[0, 1]1
colour
Default font color for tooltips
#202020
background
Default background for tooltips.
"#ffffff"
 

Example

Code Block
{
	"chartId": "chart_4-b3T3T8tVlP_JDdEDsaCIu",
	"bg_colour": "#e5e5e5",
	"is_decimal_separator_comma": 1,
	"is_thousand_separator_disabled": 1,
	"tooltip": {
	    "mouse": "2",
    	"shadow": true,
	    "stroke": 1,
	    "colour": "#202020",
	    "background": "#ffffff"
	},
	"options": {}
} 

"x_axis" content

NameDescriptionExample
colour
Color of the axis label
#c7c7c7
grid-colour
Color of the x-axis grid (horizontal)
#c7c7c7
labels

Nested object defining the axis labels

NameDescriptionExample
colour
Color of the labels
#4e4e4e
labels
Array of labels to display.
[ "Austria", "Canada" ]
 

Example:

Code Block
 "x_axis": {
    "colour": "#c7c7c7",
    "grid-colour": "#c7c7c7",
    "labels": {
       "colour": "#4e4e4e",
       "labels": [ "Austria", "Canada" ]
    }
 },

"y_axis" content

Y axis is defined by min and max value, size of one step (steps) and labels. Each label consists of value on Y axis (y) and displayed text. You can specify also colour and grid-colour for Y axis.

NameDescriptionExample
colour
Color of the axis label
#e9e9e9
grid-colour
Color of the y-axis grid (vertical)
#e9e9e9
steps
Size of the steps of the axis50000
min
Minimal value displayed on the axis0
max
Maximal value displayed on the axis400000
labels

Nested object defining the axis labels

NameDescriptionExample
colour
Color of the labels
#4e4e4e
labels
Array of label and values
[ { "text": "0 USD", "y": 0 }, { "text": "50.000 USD", "y": 50000 } ]
 

 

Example:

Code Block
"y_axis": {
    "colour": "#e9e9e9",
    "grid-colour": "#e9e9e9",
    "steps": 50000,
    "min": 0,
    "max": 400000,
    "labels": {
      "colour": "#4e4e4e",
      "labels": [
        { "text": "0 USD", "y": 0 },
        { "text": "50.000 USD", "y": 50000 },
        { "text": "100.000 USD", "y": 100000 },
        { "text": "150.000 USD", "y": 150000 },
        { "text": "200.000 USD", "y": 200000 },
        { "text": "250.000 USD", "y": 250000 },
        { "text": "300.000 USD", "y": 300000 },
        { "text": "350.000 USD", "y": 350000 },
        { "text": "400.000 USD", "y": 400000 }
      ]
    }
  }

"elements" content

Each object in array elements describe one chart element. In example below we have only one element with title Revenue, that has type stack bar and contains array with 2 values (in example below Austria and Canada). Each value is an array that contains value objects. In example below first value array is for Austria and consists of top, bottom, value, tool tip, label, top label, colour and context. Legend keys can be specified and displayed at the top of the chart. 

NameDescriptionExample
type
Type of the chart. For stack bar chart, the value is "bar_stack"bar_stack
text
Name of the chart 
font-size
Font size used for displaying text 
colour
Color used for displayed text 
keys

Array of text labels displayed at the top of the chart

NameDescriptionExample
colour
Color used for displayed text
#b5cb04
text
Text of the keyYear 2013
font-size
Font size used for displaying text12
 
values

Array of value arrays

NameDescriptionExample
top
Numerical value specifying the top position of a bar
222172
bottom
Numerical value specifying the bottom position of a bar
48637
valNumerical value specifying the value of a bar
173535
tip
Tooltip text to display on mouse hover
"Austria\n2013 (Revenue)\n173535 / 222172"
label
Value label displayed inside a bar (optional)
"Austria\n2013 (Revenue)\n(173535)"
topLabel
Value label displayed at the top of a bar (optional)
"222172 USD"
colour
Color used for a bar#b5cb04
context
If defined, context will be send to the client as event parameter 
 
Code Block
 "elements": [
    {
      "type": "bar_stack",
      "text": "Revenue",
      "font-size": 10,
      "colour": "#4379bd",
      "keys": [
        {
          "colour": "#4379bd",
          "text": "Year 2012",
          "font-size": 12
        },
        {
          "colour": "#b5cb04",
          "text": "Year 2013",
          "font-size": 12
        }
      ],
      "values": [
        [
          {
            "val": 48637,
            "top": 48637,
            "bottom": 0,
            "colour": "#4379bd",
            "label": "Austria\n2012 (Revenue)\n(48637)",
            "tip": "Austria\n2012 (Revenue)\n48637 / 222172",
            "context": "{\"dataLink\":\"36_1097194719\",\"identifierQuery\":\"[L_COUNTRY={Austria}]\",\"dateInterval\":{\"from\":\"2012-01-01\",\"to\":\"2012-12-31\"}}"
          },
          {
            "val": 173535,
            "top": 222172,
            "bottom": 48637,
            "colour": "#b5cb04",
            "label": "Austria\n2013 (Revenue)\n(173535)",
            "topLabel": "222172 USD",
            "tip": "Austria\n2013 (Revenue)\n173535 / 222172",
            "context": "{\"dataLink\":\"36_-792896568\",\"identifierQuery\":\"[L_COUNTRY={Austria}]\",\"dateInterval\":{\"from\":\"2013-01-01\",\"to\":\"2013-12-31\"}}"
          }
        ],
        [
          {
            "val": 42788,
            "top": 42788,
            "bottom": 0,
            "colour": "#4379bd",
            "label": "Canada\n2012 (Revenue)\n(42788)",
            "tip": "Canada\n2012 (Revenue)\n42788 / 384257",
            "context": "{\"dataLink\":\"36_1288031050\",\"identifierQuery\":\"[L_COUNTRY={Canada}]\",\"dateInterval\":{\"from\":\"2012-01-01\",\"to\":\"2012-12-31\"}}"
          },
          {
            "val": 341469,
            "top": 384257,
            "bottom": 42788,
            "colour": "#b5cb04",
            "label": "Canada\n2013 (Revenue)\n(341469)",
            "topLabel": "384257 USD",
            "tip": "Canada\n2013 (Revenue)\n341469 / 384257",
            "context": "{\"dataLink\":\"36_-602060237\",\"identifierQuery\":\"[L_COUNTRY={Canada}]\",\"dateInterval\":{\"from\":\"2013-01-01\",\"to\":\"2013-12-31\"}}"
          }
        ]
      ]
    }
  ]

Examples

Attachments
uploadfalse
oldfalse
sortByname

 

Sv translation
languageja

積み上げ棒チャート

積み上げ棒チャートレンダリングの入力として使用されるJSONは、複数の要素で構成されています。

Table of Contents
minLevel3

基本的な構造

Code Block
{
  "x_axis": {
    "labels": {
      "labels": [ ... ]
    }
  }
  "y_axis": {
    "labels": {
      "labels": [ ... ]
    }
  }
  "elements": [
    {
      "type": "bar_stack",
      "keys": [ ... ],
      "values": [ ... ]
    }
  ]
}

共通の要素 

説明
chartId
チャートビュー識別子。 RESTAPIをご参照してください。
chart_4-b3T3T8tVlP_JDdEDsaCIu
bg_color
チャートの全体に背景の色を定義します
#e5e5e5
is_decimal_separator_comma
小数点記号としてカンマを使用/非使用を決定します。 [0, 1]1
is_thousand_separator_disabled
桁区切りを使用/非使用を決定します。 [0, 1]1
tooltip

チャートの全体に基本的なツールチップの設定を定義します。

説明
mouse
マウス感度2
shadow
[true, false]true
stroke
[0, 1]1
colour
ツールチップのの色フォントデフォルト
#202020
background
ツールチップの背景デフォルト
"#ffffff"
 

Code Block
{
	"chartId": "chart_4-b3T3T8tVlP_JDdEDsaCIu",
	"bg_colour": "#e5e5e5",
	"is_decimal_separator_comma": 1,
	"is_thousand_separator_disabled": 1,
	"tooltip": {
	    "mouse": "2",
    	"shadow": true,
	    "stroke": 1,
	    "colour": "#202020",
	    "background": "#ffffff"
	},
	"options": {}
} 

「x_axis」コンテンツ

説明
colour
軸ラベルの色
#c7c7c7
grid-colour
x軸グリッドの色(水平方向)
#c7c7c7
labels

ネストされたオブジェクト軸ラベルを定義します

説明
colour
ラベルの色
#4e4e4e
labels
表示にラベルの配列
[ "Austria", "Canada" ]
 

Code Block
 "x_axis": {
    "colour": "#c7c7c7",
    "grid-colour": "#c7c7c7",
    "labels": {
       "colour": "#4e4e4e",
       "labels": [ "Austria", "Canada" ]
    }
 },

「y_axis」コンテンツ

Y軸は、最小値と最大値、一つステップのサイズ(ステップ)とラベルによって定義されます。各ラベルは、Y軸(y)上に含まれて、テキストが表示されます。また、Y軸の色グリッドを指定できます。

説明
colour
軸ラベルの色
#e9e9e9
grid-colour
y軸グリッドの色(垂直)
#e9e9e9
steps
軸ステップサイズ50000
min
軸上に表示した最小値0
max
軸上に表示した最大値400000
labels

ネストされたオブジェクト軸ラベルを定義します。

説明
colour
ラベルの色
#4e4e4e
labels
ラベルと値の配列
[ { "text": "0 USD", "y": 0 }, { "text": "50.000 USD", "y": 50000 } ]
 

 

Code Block
"y_axis": {
    "colour": "#e9e9e9",
    "grid-colour": "#e9e9e9",
    "steps": 50000,
    "min": 0,
    "max": 400000,
    "labels": {
      "colour": "#4e4e4e",
      "labels": [
        { "text": "0 USD", "y": 0 },
        { "text": "50.000 USD", "y": 50000 },
        { "text": "100.000 USD", "y": 100000 },
        { "text": "150.000 USD", "y": 150000 },
        { "text": "200.000 USD", "y": 200000 },
        { "text": "250.000 USD", "y": 250000 },
        { "text": "300.000 USD", "y": 300000 },
        { "text": "350.000 USD", "y": 350000 },
        { "text": "400.000 USD", "y": 400000 }
      ]
    }
  }

「要素」コンテンツ

配列要素内の各オブジェクトは、1つのチャート要素を記述します。以下の例では、積み上げ棒タイプを持つRevenueタイトルを持つ要素が1つしかなく、2つの値を持つ配列を含まれています(以下の例ではオーストリアカナダ)。各値は、値オブジェクトを含む配列です。下の例では、最初の値の配列はオーストリア向けで、トップボトムツールチップラベルトップラベルおよびコンテキストで構成されています。解訳キーは、チャートの上部に指定して表示できます。

説明
type
チャートタイプ。積み上げ棒チャートの場合、値は「bar_stack」としますbar_stack
text
チャート名 
font-size
テキストを表示するために使用されるフォントサイズ 
colour
表示されたテキストに使用されるカラー 
keys

テキストラベルの配列はチャートの上部に表示しました

説明
colour
表示されたテキストに使用されるカラー
#b5cb04
text
キーのテキストYear 2013
font-size
テキストを表示するために使用されるフォントサイズ12
 
values

配列値の配列

説明
top
棒の上部の位置を指定する数値
222172
bottom
棒の下部に位置を指定する数値
48637
val棒の値を指定する数値
173535
tip
マウスホバーで表示するツールチップのテキスト
"Austria\n2013 (Revenue)\n173535 / 222172"
label
棒の内側に表示された値ラベル(オプション)
"Austria\n2013 (Revenue)\n(173535)"
topLabel
棒の上部に表示された値ラベル(オプション)
"222172 USD"
colour
棒に使用したラー#b5cb04
context
定義されている場合、コンテキストがイベントパラメータとしてクライアントに送信されます 
 
Code Block
 "elements": [
    {
      "type": "bar_stack",
      "text": "Revenue",
      "font-size": 10,
      "colour": "#4379bd",
      "keys": [
        {
          "colour": "#4379bd",
          "text": "Year 2012",
          "font-size": 12
        },
        {
          "colour": "#b5cb04",
          "text": "Year 2013",
          "font-size": 12
        }
      ],
      "values": [
        [
          {
            "val": 48637,
            "top": 48637,
            "bottom": 0,
            "colour": "#4379bd",
            "label": "Austria\n2012 (Revenue)\n(48637)",
            "tip": "Austria\n2012 (Revenue)\n48637 / 222172",
            "context": "{\"dataLink\":\"36_1097194719\",\"identifierQuery\":\"[L_COUNTRY={Austria}]\",\"dateInterval\":{\"from\":\"2012-01-01\",\"to\":\"2012-12-31\"}}"
          },
          {
            "val": 173535,
            "top": 222172,
            "bottom": 48637,
            "colour": "#b5cb04",
            "label": "Austria\n2013 (Revenue)\n(173535)",
            "topLabel": "222172 USD",
            "tip": "Austria\n2013 (Revenue)\n173535 / 222172",
            "context": "{\"dataLink\":\"36_-792896568\",\"identifierQuery\":\"[L_COUNTRY={Austria}]\",\"dateInterval\":{\"from\":\"2013-01-01\",\"to\":\"2013-12-31\"}}"
          }
        ],
        [
          {
            "val": 42788,
            "top": 42788,
            "bottom": 0,
            "colour": "#4379bd",
            "label": "Canada\n2012 (Revenue)\n(42788)",
            "tip": "Canada\n2012 (Revenue)\n42788 / 384257",
            "context": "{\"dataLink\":\"36_1288031050\",\"identifierQuery\":\"[L_COUNTRY={Canada}]\",\"dateInterval\":{\"from\":\"2012-01-01\",\"to\":\"2012-12-31\"}}"
          },
          {
            "val": 341469,
            "top": 384257,
            "bottom": 42788,
            "colour": "#b5cb04",
            "label": "Canada\n2013 (Revenue)\n(341469)",
            "topLabel": "384257 USD",
            "tip": "Canada\n2013 (Revenue)\n341469 / 384257",
            "context": "{\"dataLink\":\"36_-602060237\",\"identifierQuery\":\"[L_COUNTRY={Canada}]\",\"dateInterval\":{\"from\":\"2013-01-01\",\"to\":\"2013-12-31\"}}"
          }
        ]
      ]
    }
  ]

Attachments
uploadfalse
oldfalse
sortByname