### **以下为接口配置方法:** ### **1、选中该折柱图组件,在操作界面右侧,点击“数据”,可设置接口。** ![](https://img.kancloud.cn/4b/f9/4bf9f20b21f7dffb192b46446911993f_427x467.png) ### **2、配置静态API** * 数据类型:选择“静态数据”; * 数据值:点击“编辑”进行修改; * 数据格式: ``` { "lengend": { "data": [ "设备一", "设备二", "设备三" ] }, "xAxis": { "type": "category", "data": [ "济南", "青岛", "烟台", "威海", "潍坊", "东营", "日照", "滨州", "莱芜", "淄博" ] }, "series": [ { "name": "设备一", "type": "bar", "data": [ 900, 800, 700, 680, 650, 640, 600, 570, 680, 650 ], "barWidth": 8, "barMinHeight": 0, "symbol": "circle", "symbolSize": 8, "lineStyle": { "width": 2 }, "itemStyle": { "color": "#4992ff", "barBorderRadius": 5 }, "label": { "show": false, "position": "top", "textStyle": { "fontSize": 14, "color": "#333", "fontWeight": 500 } } }, { "name": "设备二", "type": "bar", "data": [ 700, 680, 650, 640, 600, 570, 680, 650, 640, 600 ], "barWidth": 8, "barMinHeight": 0, "symbol": "circle", "symbolSize": 8, "lineStyle": { "width": 2 }, "itemStyle": { "color": "#58d9f9", "barBorderRadius": 5 }, "label": { "show": false, "position": "top", "textStyle": { "fontSize": 14, "color": "#333", "fontWeight": 500 } } }, { "name": "设备三", "type": "line", "yAxisIndex": 1, "data": [ 75, 65, 85, 66, 45, 55, 56, 42, 78, 69 ], "symbolSize": 8, "itemStyle": { "color": " #d5b957", "barBorderRadius": 5 }, "barWidth": 8, "barMinHeight": 0, "symbol": "circle", "lineStyle": { "width": 2 }, "label": { "show": false, "position": "top", "textStyle": { "fontSize": 14, "color": "#333", "fontWeight": 500 } } } ] } ``` ![](https://img.kancloud.cn/04/78/0478e83a6d4215b0172038d5d0203c9e_937x439.png) ### **3、配置动态API** * 数据类型:选择“静态数据”; * 数据值:点击“编辑”进行修改; * 数据格式: ``` { "data": { "lengend": { "data": [ "设备一", "设备二", "设备三" ] }, "xAxis": { "type": "category", "data": [ "济南", "青岛", "烟台", "威海", "潍坊", "东营", "日照", "滨州", "莱芜", "淄博", "德州", "聊城" ] }, "series": [ { "name": "蒸发量", "type": "bar", "data": [ 2, 4.9, 7, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20, 6.4, 3.3 ], "barWidth": 16, "barMinHeight": 0, "symbol": "circle", "smooth": false, "symbolSize": 8, "lineStyle": { "width": 2 }, "itemStyle": { "color": "#4992ff", "barBorderRadius": 0 }, "label": { "show": false, "position": "top", "textStyle": { "fontSize": 14, "color": "#333", "fontWeight": 500 } } }, { "name": "降水量", "type": "bar", "data": [ 2.6, 5.9, 9, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6, 2.3 ], "barWidth": 16, "barMinHeight": 0, "symbol": "circle", "smooth": false, "symbolSize": 8, "lineStyle": { "width": 2 }, "itemStyle": { "color": "#7cffb2", "barBorderRadius": 0 }, "label": { "show": false, "position": "top", "textStyle": { "fontSize": 14, "color": "#333", "fontWeight": 500 } } }, { "name": "平均温度", "type": "line", "yAxisIndex": 1, "data": [ 2, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23, 16.5, 12, 6.2 ], "symbolSize": 8, "itemStyle": { "color": "#d5b957", "barBorderRadius": 0 }, "barWidth": 16, "barMinHeight": 0, "symbol": "circle", "smooth": false, "lineStyle": { "width": 2 }, "label": { "show": false, "position": "top", "textStyle": { "fontSize": 14, "color": "#333", "fontWeight": 500 } } } ] } } ``` * 刷新时间:这个参数主要针对动态数据设置的,完成数据的实时更新;如果你想设置成5秒刷新一次,可以将刷新时间设置成“5000”; ![](https://img.kancloud.cn/5d/6d/5d6d3684041a4ccf4a7094676c1e7849_908x755.png)