diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue index e7df267002..f9cb7d2c9b 100644 --- a/frontend/src/views/chart/group/Group.vue +++ b/frontend/src/views/chart/group/Group.vue @@ -196,9 +196,9 @@ :options="chartGroupTreeAvailable" :normalizer="normalizer" :placeholder="$t('chart.select_group')" - :noChildrenText="$t('commons.treeselect.no_children_text')" - :noOptionsText="$t('commons.treeselect.no_options_text')" - :noResultsText="$t('commons.treeselect.no_results_text')" + :no-children-text="$t('commons.treeselect.no_children_text')" + :no-options-text="$t('commons.treeselect.no_options_text')" + :no-results-text="$t('commons.treeselect.no_results_text')" /> @@ -773,6 +773,7 @@ export default { view.customFilter = JSON.stringify([]) view.drillFields = JSON.stringify([]) view.extBubble = JSON.stringify([]) + this.setChartDefaultOptions(view) const _this = this post('/chart/view/save', view).then(response => { this.closeCreateChart() @@ -788,6 +789,33 @@ export default { }) }, + setChartDefaultOptions(view) { + const type = view.type + const attr = JSON.parse(view.customAttr) + if (type.includes('pie')) { + if (view.render === 'echarts') { + attr.label.position = 'inside' + } else { + attr.label.position = 'inner' + } + } else if (type.includes('line')) { + attr.label.position = 'top' + } else if (type.includes('treemap')) { + if (view.render === 'echarts') { + attr.label.position = 'inside' + } else { + attr.label.position = 'middle' + } + } else { + if (view.render === 'echarts') { + attr.label.position = 'inside' + } else { + attr.label.position = 'middle' + } + } + view.customAttr = JSON.stringify(attr) + }, + getTable(table) { this.table = JSON.parse(JSON.stringify(table)) },