Merge branch 'master' of github.com:gcpaas/DataRoom

main
zhu.yawen 1 year ago
commit a84f7f5379

@ -99,6 +99,18 @@ const setting = [
tabName: 'custom',
groupName: 'graph'
},
{
label: '指标小数位',
// 设置组件类型
type: 'inputNumber',
// 字段
field: 'statistic_fixed',
// 对应options中的字段
optionField: 'statisticFixed',
value: 0,
tabName: 'custom',
groupName: 'graph'
},
{
label: '指标字体类型',
// 设置组件类型
@ -185,7 +197,11 @@ const data = [
}
]
// 配置处理脚本
const optionHandler ='option.range.color = [option.color1, option.color2]'
const optionHandler ='option.range.color = [option.color1, option.color2]\n' +
' let fix = option.statisticFixed\n' +
' option.statistic.title.formatter = ({ percent }) => `${(percent * 100).toFixed(fix)}%`'
// 数据处理脚本
const dataHandler = '// 取返回数据列表的第一项指标值\noption.percent = data[0][setting.filter(settingItem=>settingItem.field === \'percent\')[0].value]'
@ -226,6 +242,7 @@ const option = {
// shapeStyle: {
// fill: 'rgba(208,208,208,0)'
// },
statisticFixed: 0,
statistic: {
title: {
offsetY: 0,

@ -75,6 +75,18 @@ const setting = [
tabName: 'custom',
groupName: 'graph'
},
{
label: '指标小数位',
// 设置组件类型
type: 'inputNumber',
// 字段
field: 'statistic_fixed',
// 对应options中的字段
optionField: 'statisticFixed',
value: 0,
tabName: 'custom',
groupName: 'graph'
},
{
label: '指标字体类型',
// 设置组件类型
@ -160,7 +172,9 @@ const data = [
}
]
// 配置处理脚本
const optionHandler ='option.range.color = [option.color1, option.color2]'
const optionHandler ='option.range.color = [option.color1, option.color2]\n' +
' let fix = option.statisticFixed\n' +
' option.statistic.title.formatter = ({ percent }) => `${(percent * 100).toFixed(fix)}%`'
// 数据处理脚本
const dataHandler = '// 取返回数据列表的第一项指标值\noption.percent = data[0][setting.filter(settingItem=>settingItem.field === \'percent\')[0].value]'
@ -175,6 +189,7 @@ const option = {
range: {
color: ['l(0) 0:#6b74e4 1:#4391f4','#d0d0d0']
},
statisticFixed: 0,
startAngle: Math.PI,
endAngle: 2 * Math.PI,
indicator: null,

@ -76,6 +76,17 @@ const setting = [
],
groupName: 'graph'
},
{
label: '旋转内部标签',
type: 'switch', // 设置组件类型
field: 'labelAutoRotate', // 字段
optionField: 'label.autoRotate', // 对应options中的字段
value: true,
active: true,
inactive: false,
tabName: 'custom',
groupName: 'graph'
},
{
label: '标签颜色',
// 设置组件类型
@ -257,6 +268,7 @@ const option = {
},
color: ['#6b74e4', '#4391f4', '#38bbe5', '#69d6fd', '#36c6a0'],
label: {
autoRotate: true,
type: 'inner',
labelHeight: 50,
labelLine: {

@ -147,7 +147,9 @@ export default {
let option = null
config.setting.forEach(set => {
if (set.optionField) {
// point.style.fill
const optionField = set.optionField.split('.')
// [point,style,fill]
option = config.option
optionField.forEach((field, index) => {
if (index === optionField.length - 1) {
@ -156,6 +158,10 @@ export default {
option[field] = set.value
}
} else {
//
if (!option[field]) {
option[field] = {}
}
option = option[field]
}
})

Loading…
Cancel
Save