### **雷达图支持3种数据形式:** #### **1. SQL数据** 使用SQL形式,可直接连接数据库,将SQl种的数据筛选并显示在图表上。 点击报表编辑器右侧的操作栏,点击“数据”,选择"数据类型"为“SQL数据集”,按步骤操作即可,下边讲解一下各个参数的意思: * 绑定数据集:是左侧绑定过的数据集,可选择任意一个SQL类型的数据集; * 分类属性:是X轴绑定数据库的字段; * 值属性:是Y轴绑定数据库的字段; ### **数据库配置字段如下:** ![](https://img.kancloud.cn/bb/a8/bba841e5695a5dae1a017bbb20d9154e_458x430.png) ![](https://img.kancloud.cn/d7/8b/d78bc2ddfbcd473208b62421972ba2bf_807x34.png) #### **2. 静态API数据** 报表绑定的数据可以是静态API的形式。 点击报表编辑器右侧的操作栏,点击“数据”,选择"数据类型"为“Api数据集”,“Api类型”选择“静态数据”,点击“数据值”,输入静态类型即可,如: ``` [ {"name":"销售(sales)","value":4300,"type":"预算分配(Allocated Budget)"}, {"name":"管理(Administration)","value":10000,"type":"预算分配(Allocated Budget)"}, {"name":"信息技术(Information Techology)","value":28000,"type":"预算分配(Allocated Budget)"}, {"name":"客服(Customer Support)","value":35000,"type":"预算分配(Allocated Budget)"}, {"name":"研发(Development)","value":50000,"type":"预算分配(Allocated Budget)"}, {"name":"市场(Marketing)","value":19000,"type":"预算分配(Allocated Budget)"}, {"name":"销售(sales)","value":5000,"type":"实际开销(Actual Spending)"}, {"name":"管理(Administration)","value":14000,"type":"实际开销(Actual Spending)"}, {"name":"信息技术(Information Techology)","value":28000,"type":"实际开销(Actual Spending)"}, {"name":"客服(Customer Support)","value":31000,"type":"实际开销(Actual Spending)"}, {"name":"研发(Development)","value":42000,"type":"实际开销(Actual Spending)"}, {"name":"市场(Marketing)","value":21000,"type":"实际开销(Actual Spending)"} ] ``` ![](https://img.kancloud.cn/7f/e6/7fe6095600aa0e337f9046c30ddcf0d4_1226x540.png) ![](https://img.kancloud.cn/d7/8b/d78bc2ddfbcd473208b62421972ba2bf_807x34.png) #### **3. 动态API数据** 绑定的数据也可以是动态API的形式。 点击报表编辑器右侧的操作栏,点击“数据”,选择"数据类型"为“Api数据集”,“Api类型”选择“动态数据”,选择“绑定数据集”,点击“运行”,就可以将数据渲染过来,代码如: ``` { "data": [ { "name": "周一", "value": 1000, "type": "iphone" }, { "name": "周二", "value": 1300, "type": "iphone" }, { "name": "周三", "value": 1400, "type": "iphone" }, { "name": "周四", "value": 1080, "type": "iphone" }, { "name": "周五", "value": 2000, "type": "iphone" }, { "name": "周一", "value": 1300, "type": "huawei" }, { "name": "周二", "value": 1600, "type": "huawei" }, { "name": "周三", "value": 1800, "type": "huawei" }, { "name": "周四", "value": 2000, "type": "huawei" }, { "name": "周五", "value": 3000, "type": "huawei" }, { "name": "周一", "value": 1100, "type": "xiaomi" }, { "name": "周二", "value": 1200, "type": "xiaomi" }, { "name": "周三", "value": 1300, "type": "xiaomi" }, { "name": "周四", "value": 1400, "type": "xiaomi" }, { "name": "周五", "value": 1500, "type": "xiaomi" }, { "name": "周一", "value": 1000, "type": "vivo" }, { "name": "周二", "value": 1000, "type": "vivo" }, { "name": "周三", "value": 1000, "type": "vivo" }, { "name": "周四", "value": 1000, "type": "vivo" }, { "name": "周五", "value": 1000, "type": "vivo" } ] } ```