<< Click to Display Table of Contents >> Get data for tables, pivot, charts, Freestyle table components in a dashboard |
![]() ![]() ![]() |
Request address |
http://ip:port/bi/api?action=getElemData&token=xxxx |
|
Request message |
Request parameter |
required parameter:xmlData (required) <?xml version="1.0" encoding="UTF-8"?> <info> <user></user> <page> <pageSize>1</pageSize> <pageNow>1</pageNow> </page> <getdata> <dbpath>典型功能演示/表格1</dbpath> <ename>Table1</ename> </getdata> <params> <param name="param" type="dateTime">2017-05-19 19:16:14</param> </params> </info> If the paging is not used, the full amount of data is used, that is, <?xml version="1.0" encoding="UTF-8"?> <info> <getdata> <dbpath>典型功能演示/表格1</dbpath> <ename>Table1</ename> </getdata> </info> or <?xml version="1.0" encoding="UTF-8"?> <info> <getdata> <dbpath>典型功能演示/图表</dbpath> <ename>Chart10</ename> </getdata> </info> or <?xml version="1.0" encoding="UTF-8"?> <info> <getdata> <getMarkNames>true</getMarkNames> <dbpath>典型功能演示/图表</dbpath> <ename>Chart10</ename> </getdata> </info> or <?xml version="1.0" encoding="UTF-8"?> <info> <getdata> <markame>Bar[Mark[Sum_SALES]]</markame> <dbpath>典型功能演示/图表</dbpath> <ename>Chart10</ename> </getdata> </info> |
parametric description |
Parameter is node information : 1) user(optional):The target user name you want to view 2) dbpath(required):dashboard path 3) ename(required):Dashboard component name 4) page(optional):The values of pageSize and pageNow in page should be greater than or equal to 1. PageSize is how many pageNow is displayed per page as a result of returning the page. 5) params(optional): Some parameters can be passed inside to control the query.Type is the type of the parameter,There are mainly the following: string、boolean、float、double、char、byte、short、int、long 、time、dateTime。If the parameter has multiple values, separate it with a comma, ",". 6) getMarkNames (optional), some chart components (such as histograms) can be bound to multiple measurement data, different measurement data can be classified according to different labels, when this parameter is true, you can get the binding measurement column on the chart component list of. 7) markame (optional), when the chart component is bound to multiple measurement columns, specify to obtain the data of the measurement column, if it is empty, then obtain the data of the first measurement column. The name of the measurement column can be obtained using "getMarkNames". 8) The parameter format for the date type is as follows: ➢The format of date is"yyyy-MM-dd" ➢The format of datetime is "yyyy-MM-dd HH:mm:ss" ➢The format of time is "HH:mm:ss" |
|
Sample |
function getData() { var xml = getXml(); $.post("http://" + ip + ":" + port + "/" + project + "/api?action=getElemData&token=xxxx", {xmlData : xml}, function(result) { writeXml(result); }); } |
|
Response message |
Response result
|
Successful operation <?xml version="1.0" encoding="utf-8"?> <info> <page> <rowCount>4248</rowCount> <-- The size of the data --> <pageCount>4248</pageCount> <-- Total pages --> <pageSize>1</pageSize> <-- Size of data per page --> <pageNow>1</pageNow> <-- current page --> </page> <grid> <row> <header type="dateTime">DATE</header> <header type="string">PRODUCT_TYPE</header> <header type="string">PRODUCT</header> <header type="int">SALES</header> </row> <row> <col>2009-01-01 00:00:00.0</col> <col>Coffee</col> <col>Amaretto</col> <col>219</col> </row> </grid> </info> |
Result description |
1)The type label is the type of chart, and the types included are shown in the appendix. You cannot use automatic type and organization charts, otherwise type has no value. If a chart contains multiple types, you get a comma-spliced string of multiple types. 2)The grid label returns the data table structure. In which row is the line, the header is the column name, the col is the column. The tag corresponds to the corresponding value respectively. The non administrator account can not check the other account data. |