Toggle navigation
By
衰***命
2020-11-12 03:06:11
脚本
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
图表已生成
整理代码
刷新
代码
var img = { a: "/asset/get/s/data-1605149982832-J2TYULtfd.png", }; var value = 1; // >0 var getname = ['实验室', '多媒体', '普通教室', '计算机房', '运动场', '语音室', '体育馆', '形体训练室', '微格教室', '其他', '数码钢琴房', '音乐厅', '琴房', '翻译同传室', '泰语实训室', '画室']; var getvalue = [190, 165, 49, 22, 22, 17, 8, 4, 2, 2, 2, 1, 1, 1, 1, 1]; var ydata2 = []; for (var i = 0; i < getname.length; i++) { ydata2.push({ value: getvalue[i], symbol: 'image://' + img.a }); } var maxnum = Math.max.apply(null, getvalue); var maxlen = Math.pow(10, String(Math.ceil(maxnum)).length - 2); if (maxnum >= 5) { var max = Math.ceil(maxnum / (9.5 * maxlen)) * maxlen * 10; } else { var max = 5; } if(getname.length>7){ var isshow=true }else{ var isshow=false } option = { backgroundColor: "#000", grid: { left: "20", top: "10", bottom: "30", right: "10", containLabel: true }, tooltip: { trigger: 'axis', formatter: function(params) { return '
' + params[0].name + '房间数:' + params[0].value + '间
'; }, axisPointer: { type: 'none' } }, yAxis: { min: 0, max: max, // 计算最大值 interval: max / 5, // 平均分为5份 splitNumber: 5, splitLine: { show: false }, axisLine: { show: false }, axisLabel: { show: false }, axisTick: { show: false } }, xAxis: [{ type: "category", data: getname, axisLine: { show: false }, axisTick: { show: false }, splitLine: { show: false, lineStyle: { type: "dashed", color: "#3e86dd" } }, axisLabel: { margin: 8, textStyle: { color: "#FFF", fontSize: 12, } } } ], dataZoom: [{ show: isshow, zoomLock: true, //禁止拉伸 height: 8, xAxisIndex: [0], bottom: 10, startValue: 0, endValue: 6, handleIcon: "M-292,322.2c-3.2,0-6.4-0.6-9.3-1.9c-2.9-1.2-5.4-2.9-7.6-5.1s-3.9-4.8-5.1-7.6c-1.3-3-1.9-6.1-1.9-9.3c0-3.2,0.6-6.4,1.9-9.3c1.2-2.9,2.9-5.4,5.1-7.6s4.8-3.9,7.6-5.1c3-1.3,6.1-1.9,9.3-1.9c3.2,0,6.4,0.6,9.3,1.9c2.9,1.2,5.4,2.9,7.6,5.1s3.9,4.8,5.1,7.6c1.3,3,1.9,6.1,1.9,9.3c0,3.2-0.6,6.4-1.9,9.3c-1.2,2.9-2.9,5.4-5.1,7.6s-4.8,3.9-7.6,5.1C-285.6,321.5-288.8,322.2-292,322.2z", handleSize: "100%", handleStyle: { color: "#ADADAD", //shadowColor: "#B1B5B9", //shadowBlur: 5, }, backgroundColor: "transparent", fillerColor: "#ADADAD", textStyle: { color: "transparent", }, dataBackground: { lineStyle: { color: "transparent", }, areaStyle: { color: "transparent", }, }, borderColor: "transparent", }], series: [ { type: "pictorialBar", symbolSize: ['25', '6'], animation: true, symbolRepeat: "true", symbolPosition: "start", symbolMargin: 2, symbolOffset: [0, 0], data: ydata2, label: { normal: { show: true, textStyle: { color: '#FFF', fontSize: 12, }, formatter: "{c}间", position: "top", offset: [0, 0] } }, }, { type: "bar" }, ] };