提交 944b1bbf authored 作者: junjie's avatar junjie

feat(视图):图表->label类型fix

上级 e27baac6
......@@ -717,7 +717,9 @@ export default {
quota_font_size: '指标字体大小',
space_split: '维度/指标间隔',
only_one_quota: '仅支持1个指标',
only_one_result: '仅显示第1个计算结果'
only_one_result: '仅显示第1个计算结果',
dimension_show: '维度显示',
quota_show: '指标显示'
},
dataset: {
datalist: '数据集',
......
......@@ -33,7 +33,9 @@ export const DEFAULT_SIZE = {
gaugeEndAngle: -45,
dimensionFontSize: 18,
quotaFontSize: 18,
spaceSplit: 10
spaceSplit: 10,
dimensionShow: true,
quotaShow: true
}
export const DEFAULT_LABEL = {
show: false,
......
......@@ -6,10 +6,10 @@
id="label-content"
:style="content_class"
>
<p :style="label_class">
<p v-if="dimensionShow" :style="label_class">
{{ chart.data.x[0] }}
</p>
<span :style="label_space">
<span v-if="quotaShow" :style="label_space">
<p v-for="item in chart.data.series" :key="item.name" :style="label_content_class">
{{ item.data[0] }}
</p>
......@@ -40,6 +40,8 @@ export default {
return {
height: 'auto',
splitHeight: '10px',
dimensionShow: true,
quotaShow: true,
title_class: {
margin: '0 0',
width: '100%',
......@@ -109,9 +111,15 @@ export default {
this.label_content_class.color = customAttr.color.quotaColor
}
if (customAttr.size) {
this.dimensionShow = customAttr.size.dimensionShow
this.quotaShow = customAttr.size.quotaShow
this.label_class.fontSize = customAttr.size.dimensionFontSize + 'px'
this.label_content_class.fontSize = customAttr.size.quotaFontSize + 'px'
this.label_space.marginTop = customAttr.size.spaceSplit + 'px'
if (!this.dimensionShow) {
this.label_space.marginTop = '0px'
} else {
this.label_space.marginTop = customAttr.size.spaceSplit + 'px'
}
}
}
if (this.chart.customStyle) {
......
......@@ -115,11 +115,17 @@
</el-form>
<el-form v-show="chart.type && chart.type.includes('text')" ref="sizeFormPie" :model="sizeForm" label-width="100px" size="mini">
<el-form-item :label="$t('chart.dimension_show')" class="form-item">
<el-checkbox v-model="sizeForm.dimensionShow" @change="changeBarSizeCase">{{ $t('chart.show') }}</el-checkbox>
</el-form-item>
<el-form-item :label="$t('chart.dimension_font_size')" class="form-item">
<el-select v-model="sizeForm.dimensionFontSize" :placeholder="$t('chart.dimension_font_size')" @change="changeBarSizeCase">
<el-option v-for="option in fontSize" :key="option.value" :label="option.name" :value="option.value" />
</el-select>
</el-form-item>
<el-form-item :label="$t('chart.quota_show')" class="form-item">
<el-checkbox v-model="sizeForm.quotaShow" @change="changeBarSizeCase">{{ $t('chart.show') }}</el-checkbox>
</el-form-item>
<el-form-item :label="$t('chart.quota_font_size')" class="form-item">
<el-select v-model="sizeForm.quotaFontSize" :placeholder="$t('chart.quota_font_size')" @change="changeBarSizeCase">
<el-option v-for="option in fontSize" :key="option.value" :label="option.name" :value="option.value" />
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论