SMARTCHART的高级设定


Dashboard高级设定
{
     //初始参数
    "paraminit":{}, 
     //图形点击钻取联动
      "drill":{
        "1":{"paramname":"参数名","child":[2,3],"type":"seriesName"},
        "2":{"paramname":"参数名","child":[1],"type":"data[0]"}
       },
     //筛选器
    "filter":{
        "0":{"paramname":"参数名","child":[1,2,3]},
        "1":{"paramname":"参数名","child":[2,3]}
    },
    //公共数据集
    "commonds":{
        "4":"data_0",
        "5":"ds_leftjoin(data['data'],data_0)",
        "6":"ds_union(data['data'],data_0)",
        "7":"ds_union(data_0,data_1,withhead=false)"
    },
    //动态播放
    "animate":{"2":{"dataLen":5,"interval":1000,"showtip":1}},
    //分布任务
    "client":"http://xxxxx"  

    //Tableau配置,人员对应关系(可选),可以指定人员或报表对应的帐号,
    //如果不设定,系统会基于Tableau帐号的使用情况, 先进先出来分配报表对应帐号
    "tableau":{
         "工号1":"Tableau帐号",
         "工号2":"Tableau帐号",
         "default":"Tableau帐号",
         "view":"tableau报表" //必须如 8-17_19/sheet0
    }
}

详细说明: 筛选器功能说明 联动钻取功能说明 公用数据集说明

Tableau和Powerbi的设定在"BI设定"中

Tableau高级设定

{
    "工号1":"Tableau帐号",
    "工号2":"Tableau帐号",
    "default":"Tableau帐号",
    "view":"tableau报表",
    "dataset":"在dataset中找到ID",
    "option":"参数1:'xxxx',参数2:'xxxxxx'"
}
//行级别控制说明
1. "数据集设定"中新增一个数据集, 
   sql写法 select 参数1,参数2... from xxx where xx = '$username'
2. tableau设定中将这个数据集ID,写到 dataset中对应

//关于默认参数
如默认当天
"option":"当天:(function(){var day1 = new Date();return day1.format('yyyyMMdd')})(),"
默认上一天
"option":"昨天:(function(){var day1=new Date();day1.setDate(day1.getDate()-1);return day1.format('yyyyMMdd')})(),"

PowerBI设定

{
"type":"report",  //dashboard or report
"reportid":"xxxxxx-xxxx-xxx-xxx-xxxxx",

//页面编号(可选)
"pageName": "xxxxxx", 

//行级别控制(可选)
"username":"xxxx",
"roles":"'xxxxx'",
"datasets":"xxxxx-xxx-xxxx-xxx-xxxxx",

//其它参数,手机端(可选)
"other":",settings:{layoutType: models.LayoutType.MobilePortrait,background: models.BackgroundType.Transparent}"

}

嵌入任意URL:

{
  "url" : "https://www.baidu.com"
}

与第三方系统对接:

{
  "url" : "https://xxxxxx",
  "postdata":{
    "xxx": "xxxx",
    "xxx": "xxxxx"
  }
}

会使用post方法把postdata传递给对接url, 并自动加上"username": "xxx"
第三方系统需返回json格式{"status":200, "url": "xxxxx"}
返回url为拼接好的完整的链接如: https://12.10.2.1:8081/xx?token=xxxx