|
|
|
@ -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,
|
|
|
|
|