Toggle navigation
有描述的柱状图
By
天***道
2020-02-24 08:45:23
脚本
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 = { title: { text: '初次举报反映的问题类别分布图', left: 'center', bottom: 0 }, graphic: [{ type: 'group', top: 20, left: '23%', children: [{ type: 'rect', z: 100, left: 'center', top: 'middle', shape: { width: 100, height: 30 }, style: { fill: '#b1d2a2', stroke: '#f79646', lineWidth: 2, } }, { type: 'text', z: 100, left: 'center', top: 'middle', style: { fill: '#333', text: [ '违反党纪问题', ].join('\n'), font: '14px Microsoft YaHei' } } ] }, { type: 'group', top: 20, left: '62%', children: [{ type: 'rect', z: 100, left: 'center', top: 'middle', shape: { width: 155, height: 30 }, style: { fill: '#b1d2a2', stroke: '#f79646', lineWidth: 2, } }, { type: 'text', z: 100, left: 'center', top: 'middle', style: { fill: '#333', text: [ '职务违法职务犯罪问题', ].join('\n'), font: '14px Microsoft YaHei' } } ] }, { type: 'group', top: 20, right: '5%', children: [{ type: 'rect', z: 100, left: 'center', top: 'middle', shape: { width: 70, height: 30 }, style: { fill: '#b1d2a2', stroke: '#f79646', lineWidth: 2, } }, { type: 'text', z: 100, left: 'center', top: 'middle', style: { fill: '#333', text: [ '其他问题', ].join('\n'), font: '14px Microsoft YaHei' } } ] } ], grid: { left: 50, right: 50, bottom: 120 }, tooltip: { trigger: 'axis', axisPointer: { // 坐标轴指示器,坐标轴触发有效 type: '' // 默认为直线,可选为:'line' | 'shadow' }, formatter: function(params, ticket, callback) { if (params[0].data) { return params[0].name + '
' + params[0].marker + params[0].data; } else { return ''; } } }, xAxis: { type: 'category', data: ['政治纪律', '组织纪律', '廉洁纪律', '群众纪律', '工作纪律', '生活纪律', '', '贪污贿赂', '滥用职权', '其他职务违法犯罪', '', '其他违法犯罪' ], axisLabel: { rotate: 45 }, axisTick: { show: false } }, yAxis: { type: 'value' }, series: [{ data: [120, 200, 150, 80, 70, 110, , 130, 200, 150, , 400], type: 'bar', barWidth: 20, //柱图宽度 itemStyle: { normal: { // 定制显示(按顺序) color: function(params) { // var colorList = ['#C33531','#EFE42A','#64BD3D','#EE9201','#29AAE3', '#B74AE5','#0AAF9F','#E89589','#16A085','#4A235A','#C39BD3 ','#F9E79F','#BA4A00','#ECF0F1','#616A6B','#EAF2F8','#4A235A','#3498DB' ]; var colorList = ['#C33531', '#EFE42A', '#64BD3D', '#EE9201', '#29AAE3']; var colrIndex = (params.dataIndex / (colorList.length - 1) > 1) ? (params.dataIndex % colorList.length) : params.dataIndex; return colorList[colrIndex] } }, }, }] }