fix(视图): 瀑布图移除轴值数值格式化功能,防止与指标数值格式化冲突

This commit is contained in:
junjun 2022-08-01 17:32:48 +08:00
parent 62517b7fdb
commit 73cb6b3f46
3 changed files with 14 additions and 10 deletions

View File

@ -430,14 +430,18 @@ export function getYAxis(chart) {
fontSize: parseInt(a.axisLabel.fontSize)
},
formatter: function(value) {
if (!chart.type.includes('horizontal')) {
if (!a.axisLabelFormatter) {
return valueFormatter(value, formatterItem)
} else {
return valueFormatter(value, a.axisLabelFormatter)
}
} else {
if (chart.type === 'waterfall') {
return value
} else {
if (!chart.type.includes('horizontal')) {
if (!a.axisLabelFormatter) {
return valueFormatter(value, formatterItem)
} else {
return valueFormatter(value, a.axisLabelFormatter)
}
} else {
return value
}
}
}
} : null

View File

@ -93,7 +93,7 @@
</el-select>
</el-form-item>
<span v-show="chart.type && !chart.type.includes('horizontal')">
<span v-show="chart.type && !chart.type.includes('horizontal') && chart.type !== 'waterfall'">
<el-form-item :label="$t('chart.value_formatter_type')" class="form-item">
<el-select v-model="axisForm.axisLabelFormatter.type" @change="changeYAxisStyle('axisLabelFormatter')">
<el-option v-for="type in typeList" :key="type.value" :label="$t('chart.' + type.name)" :value="type.value" />

View File

@ -64,7 +64,7 @@
</el-form-item>
</span>
</span>
<el-divider v-if="showProperty('splitLine')" />
<el-divider v-if="showProperty('splitLine')" />
<el-form-item v-show="showProperty('splitLine')" :label="$t('chart.axis_show')" class="form-item">
<el-checkbox v-model="axisForm.splitLine.show" @change="changeYAxisStyle('splitLine')">{{ $t('chart.axis_show') }}</el-checkbox>
</el-form-item>
@ -93,7 +93,7 @@
</el-select>
</el-form-item>
<span v-show="chart.type && !chart.type.includes('horizontal')">
<span v-show="chart.type && !chart.type.includes('horizontal') && chart.type !== 'waterfall'">
<el-form-item :label="$t('chart.value_formatter_type')" class="form-item">
<el-select v-model="axisForm.axisLabelFormatter.type" @change="changeYAxisStyle('axisLabelFormatter')">
<el-option v-for="type in typeList" :key="type.value" :label="$t('chart.' + type.name)" :value="type.value" />