- 字符串支持用 \n 换行
字符串模板 模板变量有:
{a}:系列名。
{b}:数据名。
{c}:数据值。
+ 字符串支持用 \n 换行
字符串模板 模板变量有:
{a}:系列名。
{b}:数据名。
{c}:数据值。
{d}:百分比(用于饼图等)。
@@ -97,7 +96,16 @@ export default {
return {
labelForm: JSON.parse(JSON.stringify(DEFAULT_LABEL)),
fontSize: [],
- isSetting: false
+ isSetting: false,
+ labelPosition: [
+ { name: this.$t('chart.inside'), value: 'inside' },
+ { name: this.$t('chart.outside'), value: 'outside' },
+ { name: this.$t('chart.center'), value: 'center' },
+ { name: this.$t('chart.text_pos_top'), value: 'top' },
+ { name: this.$t('chart.text_pos_bottom'), value: 'bottom' },
+ { name: this.$t('chart.text_pos_left'), value: 'left' },
+ { name: this.$t('chart.text_pos_right'), value: 'right' }
+ ]
}
},
watch: {
@@ -113,6 +121,9 @@ export default {
}
if (customAttr.label) {
this.labelForm = customAttr.label
+ if (!this.labelForm.labelLine) {
+ this.labelForm.labelLine = JSON.parse(JSON.stringify(DEFAULT_LABEL.labelLine))
+ }
}
}
}