Toggle navigation
报警总数
By
绿***绿
2020-04-07 03:40:21
脚本
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
图表已生成
整理代码
刷新
代码
let dataPie = [ { value: 410, name: '企业' }, { value: 380, name: '政府' }, { value: 501, name: '个人' }, ]; let colorPie = ['#173852', '#0b2036', '#002e49']; let colorWrap = ['#3087d6', '#afe1ff', '#4be1ff']; let baseDataPie = [], baseDataWrap = []; for (var i = 0; i < dataPie.length; i++) { baseDataPie.push({ value: dataPie[i].value, name: dataPie[i].name, itemStyle: { normal: { borderWidth: 50, borderColor: colorPie[i], } } }); baseDataWrap.push({ value: dataPie[i].value, name: dataPie[i].name, itemStyle: { normal: { color: colorWrap[i], borderWidth: 10, borderColor: colorWrap[i], shadowBlur: 50, shadowColor: 'rgba(48, 135, 214, 0.3)', } } }, { value: 10, name: '', itemStyle: { normal: { color: 'transparent', borderWidth: 10, borderColor: 'transparent', } } }); } option = { backgroundColor: '#021228', title: { text: '报警总数', subtext: '10,225', textStyle: { color: '#00b5f3', fontSize: 12, }, subtextStyle: { align: 'center', fontSize: 18, color: ['#85c7e3'], fontWeight:800 }, x: '38%', y: 'center', }, tooltip: { show: true, trigger: 'item', formatter: "{a}:{b}
占比:{d}%" }, legend: { data: ['企业', '政府', '个人'], icon: 'vertical', right: '1%', top: 'center', orient: 'vertical', itemGap: 20, itemWidth: 15, itemHeight: 8, formatter: function(name) { let target; for (let i = 0; i < dataPie.length; i++) { if (dataPie[i].name === name) { target = dataPie[i].value } } let arr = [name, target]; return arr.join("\n") }, textStyle: { lineHeight: 20, color: '#9ed2f5', }, }, grid: { left: '1%', // 与容器左侧的距离 right: '1%', // 与容器右侧的距离 top: '1%', // 与容器顶部的距离 bottom: '1%', // 与容器底部的距离 }, series: [ { name: '', type: 'pie', clockWise: false, //顺时加载 hoverAnimation: false, //鼠标移入变大 center: ['40%', '50%'], radius: ['80%', '81%'], tooltip: { show: false }, label: { normal: { show: false } }, data: baseDataWrap }, { name: '报警', type: 'pie', color: colorPie, selectedMode: 'single', radius: ['55%', '58%'], center: ['40%', '50%'], hoverAnimation: false, label: { normal: { show: false, } }, data: baseDataPie }, ] };