Toggle navigation
仪表盘
By
前***珊
2018-12-11 07:14:33
脚本
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 axisLine = { show: false, lineStyle: { width: 10, shadowBlur: 0, color: [ [0.2, '#6ff2c2'], [0.4, '#c2fb83'], [0.6, '#eadc57'], [0.8, '#fab272'], [1, '#ff776b'] ] } } let textStyle = { fontWeight: 'normal', fontSize: 16, color: "#fff" } let axisLineZhou = { // 坐标轴线 lineStyle: { color: [ [0.66, '#dddddd'], [1, '#dddddd'] ], // 属性lineStyle控制线条样式 width: 2 } } //仪表盘刻度 let axisTicks = { show: true, lineStyle: { color: '#1b8586', width: 1 }, length: -5, splitNumber: 8 } let splitLines = { show: true, length: -10, lineStyle: { color: '#1b8586', } } let zuoBiaoAxisLabel = { distance: -15, textStyle: { color: "#03B7C9", fontSize: "8" } } let details = { //表盘的数据,字体颜色也在这里进行修改 show: true, offsetCenter: [0, '90%'], textStyle: { fontSize: 18, color: "#ff7705", padding:[20,0,0,0] } } let Heightdetails = { //表盘的数据,字体颜色也在这里进行修改,高危部分的修改 show: true, offsetCenter: [0, '90%'], textStyle: { fontSize: 18, color: "#ff7705", } } var myRate1 = 1000; option = { title: [{ x: "21%", bottom:'28%', text: '中危攻击', textStyle: textStyle, }, { x: "47%", bottom: '28%', text: '高危攻击', textStyle: textStyle, }, { x: "70%", bottom: '28%', text: '低危攻击', textStyle: textStyle, }], backgroundColor:"#013954", series: [{ //高危攻击 type: 'gauge', center: ['50%', '50%'], // 默认全局居中 radius: '38%', splitNumber: 8, //刻度数量 min: 0, max: 1000, startAngle: 200, endAngle: -20, clockwise: true, axisLine: { show: true, lineStyle: { width: 2, shadowBlur: 0, color: [ [1, '#1b8586'] ] } }, axisTick: axisTicks, splitLine: splitLines, axisLabel: zuoBiaoAxisLabel, pointer: { //仪表盘指针 show: 0 }, detail: { show: false }, data: [{ name: "", value: myRate1 }] }, { //高危攻击 startAngle: 200, endAngle: -20, type: 'gauge', center: ['50%', '50%'], // 默认全局居中 radius: '31%', min: 0, max: 1000, splitNumber: 0, axisLine: axisLineZhou, // 坐标轴线 , axisLabel: { // 坐标轴小标记 show: false, }, splitLine: { // 分隔线 length: 10, // 属性length控制线长 lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 width: 0, color: '#444' } }, pointer: { // 分隔线 指针 color: '#666666', width: 0, length: 230 }, detail: { show: false }, }, { //高危攻击 type: 'gauge', startAngle: 200, endAngle: -20, radius: '25%', center: ['50%', '50%'], // 默认全局居中 min: 0, max: 1000, axisLine: axisLine, axisTick: { show: false }, splitLine: { show: false, length: 20, }, axisLabel: { show: false }, pointer: { show: true, }, detail: Heightdetails, itemStyle: { normal: { color: "#09c2c0", } }, data: [{ value: 9999 }] }, { type: 'gauge', center: ['25%', '50%'], // 默认全局居中 radius: '35%', splitNumber: 8, //刻度数量 min: 0, max: 1000, endAngle: 45, clockwise: true, axisLine: { show: true, lineStyle: { width: 2, shadowBlur: 0, color: [ [1, '#1b8586'] ] } }, axisTick: axisTicks, splitLine: splitLines, axisLabel: zuoBiaoAxisLabel, pointer: { //仪表盘指针 show: 0 }, detail: { show: false, textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE color: '#f00', fontSize: 14 }, }, data: [{ name: "", value: myRate1 }] }, { type: 'gauge', center: ['25%', '50%'], // 默认全局居中 radius: '30%', min: 0, max: 1000, endAngle: 45, splitNumber: 0, axisLine: axisLineZhou, // 坐标轴线 , axisLabel: { // 坐标轴小标记 show: false }, splitLine: { // 分隔线 length: 10, // 属性length控制线长 lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 width: 0, color: '#444' } }, pointer: { // 分隔线 指针 color: '#666666', width: 0, length: 230 }, detail: { show: false }, }, { name: '中危攻击', type: 'gauge', endAngle: 45, radius: '25%', center: ['25%', '50%'], // 默认全局居中 min: 0, max: 7000, axisLine: axisLine, axisTick: { show: false, }, splitLine: { show: false, length: 20, }, axisLabel: { show: false }, pointer: { show: true, width:5 }, detail: details, itemStyle: { normal: { color: "#09c2c0", } }, data: [{ value: 6162 }] }, { type: 'gauge', center: ['73%', '50%'], // 默认全局居中 radius: '35%', splitNumber: 8, //刻度数量 min: 0, max: 1000, startAngle: 140, endAngle: -45, clockwise: true, axisLine: { show: true, lineStyle: { width: 2, shadowBlur: 0, color: [ [1, '#1b8586'] ] } }, axisTick: axisTicks, splitLine: splitLines, axisLabel: zuoBiaoAxisLabel, pointer: { //仪表盘指针 show: 0 }, detail: { show: false }, data: [{ name: "", value: myRate1 }] }, { type: 'gauge', center: ['73%', '50%'], // 默认全局居中 radius: '30%', min: 0, max: 1000, startAngle: 140, endAngle: -45, splitNumber: 0, axisLine: axisLineZhou, // 坐标轴线 , axisLabel: { // 坐标轴小标记 show: false, }, splitLine: { // 分隔线 show: false, }, pointer: { // 分隔线 指针 color: '#666666', width: 0, length: 230 }, detail: { show: false }, }, { name: '低危攻击', type: 'gauge', startAngle: 140, endAngle: -45, radius: '25%', center: ['73%', '50%'], // 默认全局居中 min: 0, max: 1000, axisLine: axisLine, axisTick: { show: false }, splitLine: { show: false, length: 20, }, axisLabel: { show: false }, pointer: { show: true, width:5 }, detail: details, itemStyle: { normal: { color: "#09c2c0", } }, data: [{ value: 607 }] }] };