Toggle navigation
双柱曲线图调整坐标轴显示位数
By
5***t
2020-08-18 06:31:12
脚本
16
21
作品使用的第三方脚本
数据管理
上传数据
支持小于 5M 任意格式(csv, xlsx, json, xml, ...)的数据文件
上传后可以通过生成的文件链接异步获取托管的数据。
历史数据
0 条
无历史数据
代码修改记录
信息提示
保存作品
对当前截图不满意?你还可以
上传本地截图
重新截图
作品名称
作品描述
标签
geo
grid
legend
markLine
markPoint
bar
effectScatter
line
lines
map
timeline
title
toolbox
tooltip
visualMap
作品默认版本
最新
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
20:11:45
图表已生成
整理代码
刷新
代码
option = { "tooltip": { "trigger": "axis", "axisPointer": { "type": "shadow", "shadowStyle": { "color": "rgba(0,27,251,0.03)" } }, "textStyle": { "color": "#fff" } }, "grid": { "x": 45, "y": 65, "x2": 50, "y2": 80, "borderWidth": 1 }, "legend": { "data": [ "总数", "已办结数", "办结率" ], "left": 50, "bottom": 14, "icon": "circle", "itemWidth": 10, "selectedMode": false, "orient": "horizontal" }, "xAxis": [{ "type": "category", "data": [ "部门1", "部门2", "部门3", "部门4", "部门5", "部门6", "部门7", "部门8", "部门9", "部门10" ], "axisLabel": { "interval": 0, "rotate": 40, "textStyle": { "color": "#666" } }, "axisTick": { "show": false, "alignWithLabel": true }, "axisLine": { "lineStyle": { "color": "#F2F4F8" } }, "splitArea": { "show": true }, }], "yAxis": [{ "name": "件", "splitLine": { "show": false }, "splitArea": { "show": false }, "axisTick": { "show": false, "alignWithLabel": true }, "axisLine": { "show": false, "lineStyle": { "color": "#bbb" } }, "axisLabel": { "interval": 0, "textStyle": { "color": "#bbb" } } }, { "name": "办结率(%)", // "max": 1, "splitLine": { "show": false }, "axisTick": { "show": false, "alignWithLabel": true }, "axisLine": { "show": false, "lineStyle": { "color": "#bbb" } }, "axisLabel": { "interval": 0, "textStyle": { "color": "#bbb" }, "formatter": function (value, index){ console.log(value,index) var numStr = value.toString(); var arr = numStr.split("."); if(arr[1]&&arr[1].length>0){ console.log(numStr) return Number(numStr).toFixed(2); }else{ return value; } } } } ], "series": [{ "name": "总数", "type": "bar", "yAxisIndex": 0, "barWidth": "14", "data": [ 200, 150, 140, 200, 180, 120, 80, 120, 240, 210 ], "label": { "show": true, "position": "top", "distance": 20, "verticalAlign": "middle", "textStyle": { "color": "black", "fontSize": 12 } }, "itemStyle": { "normal": { "color": { "x": 0, "y": 0, "x2": 0, "y2": 1, "type": "linear", "global": false, "colorStops": [{ "offset": 0, "color": "#458EF3" }, { "offset": 1, "color": "#89D8FE" } ] }, "barBorderRadius": [ 14, 14, 0, 0 ] } } }, { "name": "已办结数", "type": "bar", "yAxisIndex": 0, "symbolSize": [ 14, "100%" ], "barWidth": "14", "barGap": "60%", "data": [ 100, 90, 80, 120, 120, 50, 30, 50, 140, 110 ], "label": { "show": true, "position": "top", "distance": 20, "verticalAlign": "middle", "textStyle": { "color": "black", "fontSize": 12 } }, "itemStyle": { "normal": { "color": { "x": 0, "y": 0, "x2": 0, "y2": 1, "type": "linear", "global": false, "colorStops": [{ "offset": 0, "color": "rgba(250,180,101,0.8)" }, { "offset": 1, "color": "rgba(250,180,101,1)" } ] }, "barBorderRadius": [ 14, 14, 0, 0 ] } } }, { "name": "办结率", "type": "line", "data": [ "0.66", "0.77", "0.99", "0.11", "0.54", "0.88", "0.22", "0.44", "0.33", "0.22" ], "yAxisIndex": 1, "smooth": true, "symbolSize": 0, "lineStyle": { "color": "#2fca95", "width": 2 }, "itemStyle": { "normal": { "color": "#2fca95" } }, "markLine": { "label": { "show": true, "position": "end" }, "lineStyle": { "color": "#2fca95" }, "data": [{ "name": "平均值", "yAxis": 52.54 }] } } ] };