{"_id":"57fcc4870312b20e00ac6510","parentDoc":null,"version":{"_id":"57fcc4860312b20e00ac64c0","project":"5435687035740020002a1c04","__v":1,"createdAt":"2016-10-11T10:52:54.637Z","releaseDate":"2016-10-11T10:52:54.637Z","categories":["57fcc4860312b20e00ac64c1","57fcc4860312b20e00ac64c2","57fcc4860312b20e00ac64c3","57fcc4860312b20e00ac64c4","57fcc4860312b20e00ac64c5","57fcc4860312b20e00ac64c6","57fcc4860312b20e00ac64c7","57fcc4860312b20e00ac64c8","57fcc4860312b20e00ac64c9","57fcc4860312b20e00ac64ca","57fcc4860312b20e00ac64cb"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"[APP-1265], [APP-1035]","version_clean":"5.2.0","version":"5.2"},"__v":0,"category":{"_id":"57fcc4860312b20e00ac64ca","version":"57fcc4860312b20e00ac64c0","__v":0,"project":"5435687035740020002a1c04","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-30T22:39:02.374Z","from_sync":false,"order":9,"slug":"flow-data-structures","title":"Flow Data Structures"},"project":"5435687035740020002a1c04","user":"54497cce27b7fc140078d9a5","updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-31T23:00:41.497Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"Agent Lua","language":"lua","code":"output.sort = true\noutput.bars = array({\n  {value = 12, label = \"test1\"},\n  {value = 52, label = \"test2\"},\n  {value = 22, label = \"test3\"}\n})"}]},"method":"post","results":{"codes":[{"status":200,"language":"json","code":"{\n    \"errors\": [\n    ],\n    \"skipped\": [\n    ],\n    \"updated\": [\n    \t\"your_flow_tag\"\n    ]\n}","name":""},{"code":"{\n    \"errors\": [\n        \"error description\"\n    ],\n    \"skipped\": [\n    \t\"your_flow_tag\"\n    ],\n    \"updated\": [\n    ]\n}","name":"","status":400,"language":"json"}]},"settings":"","auth":"required","params":[{"_id":"567afea9666e1c0d005aabd9","ref":"","in":"path","required":true,"desc":"The tag for the barchart flow","default":"","type":"string","name":"barchart_flow_tag"},{"_id":"567afe753241c20d00b73037","ref":"","in":"body","required":true,"desc":"The bars (see below)","default":"","type":"array_object","name":"bars"},{"_id":"567afe753241c20d00b73036","ref":"","in":"body","required":false,"desc":"","default":"","type":"int","name":"max"},{"_id":"567b06bdb56bac0d0019d89c","ref":"","in":"body","required":false,"desc":"","default":"","type":"int","name":"min"},{"_id":"567b08ee4cde0321001e1125","ref":"","in":"body","required":false,"desc":"","default":"","type":"boolean","name":"sort"}],"url":"/flows/:barchart_flow_tag/metrics"},"isReference":false,"order":1,"body":"[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Bar Parameter\",\n    \"h-1\": \"Notes\",\n    \"h-2\": \"Type\",\n    \"h-3\": \"Description\",\n    \"1-0\": \"label\",\n    \"2-0\": \"value\",\n    \"1-2\": \"string\",\n    \"2-2\": \"number\",\n    \"2-3\": \"A number representing the value of the barchart. This will determine the length of the bar.\",\n    \"1-3\": \"The text to overlay on top of the bar.\",\n    \"1-1\": \"Required\",\n    \"2-1\": \"Required\",\n    \"0-0\": \"color\",\n    \"0-1\": \"Required\",\n    \"0-2\": \"CSS color\",\n    \"0-3\": \"The color of the bar.\",\n    \"3-0\": \"rounding\",\n    \"3-2\": \"integer\",\n    \"3-3\": \"The number of digits to round to.  0 to round to the nearest integer.\"\n  },\n  \"cols\": 4,\n  \"rows\": 4\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/WRuCEqElRikleZM3I2MA_barchart_half2.png\",\n        \"barchart_half2.png\",\n        \"800\",\n        \"215\",\n        \"#3aa1dd\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]","excerpt":"A bar chart is a stack of horizontal bars, each with a label, value, and color. The value determines the length of the bar. The bars will be sorted from top to bottom in terms of length by default. You can choose to turn off sorting. Send data with a hash of bars containing an array with each bar as a hash. Bar charts​ can display a maximum of 20 bars. There may be less than 20 shown if your widget box is too small. Resize your widget box if all your data is not being displayed.","slug":"barchart","type":"endpoint","title":"Bar Chart"}

postBar Chart

A bar chart is a stack of horizontal bars, each with a label, value, and color. The value determines the length of the bar. The bars will be sorted from top to bottom in terms of length by default. You can choose to turn off sorting. Send data with a hash of bars containing an array with each bar as a hash. Bar charts​ can display a maximum of 20 bars. There may be less than 20 shown if your widget box is too small. Resize your widget box if all your data is not being displayed.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

barchart_flow_tag:
required
string
The tag for the barchart flow

Body Params

bars:
required
array of objects
The bars (see below)
max:
integer
min:
integer
sort:
boolean

Examples


Result Format


Documentation

[block:parameters] { "data": { "h-0": "Bar Parameter", "h-1": "Notes", "h-2": "Type", "h-3": "Description", "1-0": "label", "2-0": "value", "1-2": "string", "2-2": "number", "2-3": "A number representing the value of the barchart. This will determine the length of the bar.", "1-3": "The text to overlay on top of the bar.", "1-1": "Required", "2-1": "Required", "0-0": "color", "0-1": "Required", "0-2": "CSS color", "0-3": "The color of the bar.", "3-0": "rounding", "3-2": "integer", "3-3": "The number of digits to round to. 0 to round to the nearest integer." }, "cols": 4, "rows": 4 } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/WRuCEqElRikleZM3I2MA_barchart_half2.png", "barchart_half2.png", "800", "215", "#3aa1dd", "" ] } ] } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}