|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
import fontList from 'data-room-ui/js/utils/fontList'
|
|
|
|
|
// 配置版本号
|
|
|
|
|
const version = '2023101401'
|
|
|
|
|
const version = '2023101402'
|
|
|
|
|
// 分类
|
|
|
|
|
const category = 'Gauge'
|
|
|
|
|
// 标题
|
|
|
|
@ -138,6 +138,32 @@ const setting = [
|
|
|
|
|
tabName: 'custom',
|
|
|
|
|
groupName: 'graph'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '标签间距大小',
|
|
|
|
|
// 设置组件类型
|
|
|
|
|
type: 'inputNumber',
|
|
|
|
|
// 字段
|
|
|
|
|
field: 'statistic_content_offsetY',
|
|
|
|
|
// 对应options中的字段
|
|
|
|
|
optionField: 'statistic.content.offsetY',
|
|
|
|
|
value: -30,
|
|
|
|
|
min:-100,
|
|
|
|
|
tabName: 'custom',
|
|
|
|
|
groupName: 'graph'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '指标间距大小',
|
|
|
|
|
// 设置组件类型
|
|
|
|
|
type: 'inputNumber',
|
|
|
|
|
// 字段
|
|
|
|
|
field: 'statistic_title_offsetY',
|
|
|
|
|
// 对应options中的字段
|
|
|
|
|
optionField: 'statistic.title.offsetY',
|
|
|
|
|
value: 0,
|
|
|
|
|
min:-100,
|
|
|
|
|
tabName: 'custom',
|
|
|
|
|
groupName: 'graph'
|
|
|
|
|
}
|
|
|
|
|
// 图例 legend
|
|
|
|
|
// 边距 padding
|
|
|
|
|
]
|
|
|
|
@ -146,6 +172,9 @@ const data = [
|
|
|
|
|
percent: 0.75
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
// 配置处理脚本
|
|
|
|
|
const optionHandler =''
|
|
|
|
|
|
|
|
|
|
// 数据处理脚本
|
|
|
|
|
const dataHandler = '// 取返回数据列表的第一项指标值\noption.percent = data[0][setting.filter(settingItem=>settingItem.field === \'percent\')[0].value]'
|
|
|
|
|
|
|
|
|
@ -185,7 +214,7 @@ const option = {
|
|
|
|
|
// },
|
|
|
|
|
statistic: {
|
|
|
|
|
title: {
|
|
|
|
|
offsetY: -20,
|
|
|
|
|
offsetY: 0,
|
|
|
|
|
style: {
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
lineHeight: 2,
|
|
|
|
@ -195,6 +224,7 @@ const option = {
|
|
|
|
|
formatter: ({ percent }) => `${(percent * 100).toFixed(0)}%`
|
|
|
|
|
},
|
|
|
|
|
content: {
|
|
|
|
|
offsetY: -30,
|
|
|
|
|
content: '占比',
|
|
|
|
|
style: {
|
|
|
|
|
fontSize: 20,
|
|
|
|
@ -212,5 +242,6 @@ export default {
|
|
|
|
|
name,
|
|
|
|
|
option,
|
|
|
|
|
setting,
|
|
|
|
|
dataHandler
|
|
|
|
|
dataHandler,
|
|
|
|
|
optionHandler
|
|
|
|
|
}
|
|
|
|
|