diff --git a/core/backend/src/main/java/io/dataease/service/chart/ChartViewService.java b/core/backend/src/main/java/io/dataease/service/chart/ChartViewService.java index 5ea24400db..8547e357e1 100644 --- a/core/backend/src/main/java/io/dataease/service/chart/ChartViewService.java +++ b/core/backend/src/main/java/io/dataease/service/chart/ChartViewService.java @@ -357,6 +357,11 @@ public class ChartViewService { } List extStack = gson.fromJson(view.getExtStack(), new TypeToken>() { }.getType()); + if (CollectionUtils.isNotEmpty(xAxis) && StringUtils.equals(xAxis.get(0).getGroupType(), "q") && StringUtils.equalsIgnoreCase(view.getRender(), "antv")) { + List xAxisExt = gson.fromJson(view.getXAxisExt(), new TypeToken>() { + }.getType()); + extStack.addAll(xAxisExt); + } List extBubble = gson.fromJson(view.getExtBubble(), new TypeToken>() { }.getType()); List fieldCustomFilter = new ArrayList(); @@ -640,6 +645,9 @@ public class ChartViewService { yAxis.addAll(sizeField); } List extStack = gson.fromJson(view.getExtStack(), tokenType); + if (CollectionUtils.isNotEmpty(xAxis) && StringUtils.equals(xAxis.get(0).getGroupType(), "q") && StringUtils.equalsIgnoreCase(view.getRender(), "antv")) { + extStack.addAll(xAxisExt); + } List extBubble = gson.fromJson(view.getExtBubble(), tokenType); List fieldCustomFilter = gson.fromJson(view.getCustomFilter(), filterTokenType); List drill = gson.fromJson(view.getDrillFields(), tokenType); @@ -939,6 +947,8 @@ public class ChartViewService { if (!checkDrillExist(xAxis, extStack, nextDrillField.getId(), view)) { // get drill list first element's sort,then assign to nextDrillField nextDrillField.setSort(getDrillSort(xAxis, drill.get(0))); + nextDrillField.setDrill(true); + if (isAntVScatterNumberXAxis) { extStack.add(nextDrillField); } else { diff --git a/core/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java b/core/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java index db8fdd5e27..786ef57552 100644 --- a/core/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java +++ b/core/backend/src/main/java/io/dataease/service/chart/util/ChartDataBuild.java @@ -303,8 +303,10 @@ public class ChartDataBuild { } } List extGroupList = new ArrayList<>(); + List extBaseGroupList = new ArrayList<>(); if (xIsNumber) { extGroupList.addAll(extGroup); + extBaseGroupList.addAll(extGroup.stream().filter(d -> !d.isDrill()).collect(Collectors.toList())); } @@ -374,11 +376,20 @@ public class ChartDataBuild { } if (CollectionUtils.isNotEmpty(extGroup) && xIsNumber) { //有分组时其实就是第一个 + String catalog = null; if (isDrill) { - axisChartDataDTO.setCategory(row[extGroupList.size() - 1]); + catalog = row[extGroupList.size() - 1]; } else { - axisChartDataDTO.setCategory(row[0]); + catalog = row[0]; } + axisChartDataDTO.setCategory(StringUtils.defaultIfBlank(catalog, "null")); + + if (!extBaseGroupList.isEmpty()) { + axisChartDataDTO.setField(row[extBaseGroupList.size() - 1]); + } else { + axisChartDataDTO.setField(yAxis.get(j).getName()); + } + } else { axisChartDataDTO.setCategory(yAxis.get(j).getName()); } diff --git a/core/frontend/src/components/suspensionSelector/index.vue b/core/frontend/src/components/suspensionSelector/index.vue index 7182735689..db59daae6f 100644 --- a/core/frontend/src/components/suspensionSelector/index.vue +++ b/core/frontend/src/components/suspensionSelector/index.vue @@ -107,6 +107,13 @@ export default { .form-item ::v-deep .el-form-item__label{ font-size: 12px; } + + .form-item ::v-deep .el-checkbox__label { + font-size: 12px; + } + .form-item ::v-deep .el-radio__label { + font-size: 12px; + } .el-select-dropdown__item{ padding: 0 20px; } diff --git a/core/frontend/src/icons/svg/icon-setting.svg b/core/frontend/src/icons/svg/icon-setting.svg new file mode 100644 index 0000000000..f81b9f1de8 --- /dev/null +++ b/core/frontend/src/icons/svg/icon-setting.svg @@ -0,0 +1,3 @@ + + + diff --git a/core/frontend/src/icons/svg/icon_switch_outlined.svg b/core/frontend/src/icons/svg/icon_switch_outlined.svg new file mode 100644 index 0000000000..d2e7d5fb17 --- /dev/null +++ b/core/frontend/src/icons/svg/icon_switch_outlined.svg @@ -0,0 +1,3 @@ + + + diff --git a/core/frontend/src/views/chart/chart/common/common_antv.js b/core/frontend/src/views/chart/chart/common/common_antv.js index ac85a2ff71..111bf2bf7c 100644 --- a/core/frontend/src/views/chart/chart/common/common_antv.js +++ b/core/frontend/src/views/chart/chart/common/common_antv.js @@ -246,6 +246,9 @@ export function getLabel(chart) { contentItems.push(valueFormatter(param.value, formatterCfg)) } res = contentItems.join('\n') + } else if (chart.type === 'scatter' && xAxis && xAxis.length > 0 && xAxis[0].groupType === 'q') { + // 针对散点图 + res = param.field } else { for (let i = 0; i < yAxis.length; i++) { const f = yAxis[i] @@ -313,13 +316,18 @@ export function getTooltip(chart) { const t = JSON.parse(JSON.stringify(customAttr.tooltip)) if (t.show) { tooltip = {} - let xAxis, yAxis, extStack + let xAxis, yAxis, extStack, xAxisExt try { xAxis = JSON.parse(chart.xaxis) } catch (e) { xAxis = JSON.parse(JSON.stringify(chart.xaxis)) } + try { + xAxisExt = JSON.parse(chart.xaxisExt) + } catch (e) { + xAxisExt = JSON.parse(JSON.stringify(chart.xaxisExt)) + } try { yAxis = JSON.parse(chart.yaxis) } catch (e) { @@ -467,14 +475,18 @@ export function getTooltip(chart) { } // if (chart.type === 'scatter' && xAxis && xAxis.length > 0 && xAxis[0].groupType === 'q') { - tooltip.fields = ['x', 'category', 'value', 'group'] + tooltip.fields = ['x', 'category', 'value', 'group', 'field'] tooltip.customContent = (title, data) => { const key1 = xAxis[0]?.name - let key2, v1, v2 + let key2, v1, v2, subGroup + + let hasSubGroup = false if (data && data.length > 0) { title = data[0].data.category key2 = data[0].data.group + subGroup = data[0].data.field + hasSubGroup = xAxisExt.length > 0 const fx = xAxis[0] if (fx.formatterCfg) { @@ -499,6 +511,12 @@ export function getTooltip(chart) { return `
${title}
+ ` + + (hasSubGroup + ? `
+ ${xAxisExt[0].name}:${subGroup} +
` : ``) + + `
${key1}:${v1}
diff --git a/core/frontend/src/views/chart/chart/util.js b/core/frontend/src/views/chart/chart/util.js index cbde5bcffd..92a9757112 100644 --- a/core/frontend/src/views/chart/chart/util.js +++ b/core/frontend/src/views/chart/chart/util.js @@ -3452,7 +3452,43 @@ export function getColors(chart, colors, reset) { isCustom: false }) } - } else if (includesAny(chart.type, 'bar', 'scatter', 'radar', 'area') && !chart.type.includes('group')) { + } else if (chart.type === 'scatter') { + const xAxis = JSON.parse(chart.xaxis) + if (chart.data && chart.render === 'antv' && xAxis && xAxis.length > 0 && xAxis[0].groupType === 'q') { + const data = chart.data.data + const groups = [] + for (let i = 0; i < data.length; i++) { + const d = data[i] + if (!groups.includes(d.category)) { + groups.push(d.category) + } + } + for (let i = 0; i < groups.length; i++) { + const s = groups[i] + seriesColors.push({ + name: s, + color: colors[i % colors.length], + isCustom: false + }) + } + } else { + if (Object.prototype.toString.call(chart.yaxis) === '[object Array]') { + series = JSON.parse(JSON.stringify(chart.yaxis)) + } else { + series = JSON.parse(chart.yaxis) + } + if (series) { + for (let i = 0; i < series.length; i++) { + const s = series[i] + seriesColors.push({ + name: s.name, + color: colors[i % colors.length], + isCustom: false + }) + } + } + } + } else if ((includesAny(chart.type, 'bar', 'radar', 'area')) && !chart.type.includes('group')) { if (Object.prototype.toString.call(chart.yaxis) === '[object Array]') { series = JSON.parse(JSON.stringify(chart.yaxis)) } else { @@ -3499,7 +3535,6 @@ export function getColors(chart, colors, reset) { // if (customSortData && customSortData.length > 0) { // data = customSort(customSortData, data) // } - for (let i = 0; i < data.length; i++) { const s = data[i] seriesColors.push({ diff --git a/core/frontend/src/views/chart/components/componentStyle/BackgroundColorSelector.vue b/core/frontend/src/views/chart/components/componentStyle/BackgroundColorSelector.vue index e60ce961ee..b1569cd787 100644 --- a/core/frontend/src/views/chart/components/componentStyle/BackgroundColorSelector.vue +++ b/core/frontend/src/views/chart/components/componentStyle/BackgroundColorSelector.vue @@ -117,6 +117,14 @@ export default { .form-item ::v-deep .el-form-item__label{ font-size: 12px; } + +.form-item ::v-deep .el-checkbox__label { + font-size: 12px; +} +.form-item ::v-deep .el-radio__label { + font-size: 12px; +} + .el-select-dropdown__item{ padding: 0 20px; } diff --git a/core/frontend/src/views/chart/components/componentStyle/LegendSelector.vue b/core/frontend/src/views/chart/components/componentStyle/LegendSelector.vue index 2b2e2f2884..77803e4877 100644 --- a/core/frontend/src/views/chart/components/componentStyle/LegendSelector.vue +++ b/core/frontend/src/views/chart/components/componentStyle/LegendSelector.vue @@ -221,6 +221,14 @@ export default { .form-item ::v-deep .el-form-item__label{ font-size: 12px; } + +.form-item ::v-deep .el-checkbox__label { + font-size: 12px; +} +.form-item ::v-deep .el-radio__label { + font-size: 12px; +} + .el-select-dropdown__item{ padding: 0 20px; } diff --git a/core/frontend/src/views/chart/components/componentStyle/LegendSelectorAntV.vue b/core/frontend/src/views/chart/components/componentStyle/LegendSelectorAntV.vue index 60283bf7b1..15e96cd67d 100644 --- a/core/frontend/src/views/chart/components/componentStyle/LegendSelectorAntV.vue +++ b/core/frontend/src/views/chart/components/componentStyle/LegendSelectorAntV.vue @@ -225,6 +225,14 @@ export default { .form-item ::v-deep .el-form-item__label{ font-size: 12px; } + +.form-item ::v-deep .el-checkbox__label { + font-size: 12px; +} +.form-item ::v-deep .el-radio__label { + font-size: 12px; +} + .el-select-dropdown__item{ padding: 0 20px; } diff --git a/core/frontend/src/views/chart/components/componentStyle/MarginSelector.vue b/core/frontend/src/views/chart/components/componentStyle/MarginSelector.vue index 1d0b4fa5aa..4ee8cfb10d 100644 --- a/core/frontend/src/views/chart/components/componentStyle/MarginSelector.vue +++ b/core/frontend/src/views/chart/components/componentStyle/MarginSelector.vue @@ -251,6 +251,14 @@ export default { .form-item ::v-deep .el-form-item__label{ font-size: 12px; } + +.form-item ::v-deep .el-checkbox__label { + font-size: 12px; +} +.form-item ::v-deep .el-radio__label { + font-size: 12px; +} + .el-select-dropdown__item{ padding: 0 20px; } diff --git a/core/frontend/src/views/chart/components/componentStyle/SplitSelector.vue b/core/frontend/src/views/chart/components/componentStyle/SplitSelector.vue index e2a9081e12..e2a41cd7fd 100644 --- a/core/frontend/src/views/chart/components/componentStyle/SplitSelector.vue +++ b/core/frontend/src/views/chart/components/componentStyle/SplitSelector.vue @@ -247,6 +247,14 @@ export default { .form-item ::v-deep .el-form-item__label{ font-size: 12px; } + +.form-item ::v-deep .el-checkbox__label { + font-size: 12px; +} +.form-item ::v-deep .el-radio__label { + font-size: 12px; +} + .el-select-dropdown__item{ padding: 0 20px; } diff --git a/core/frontend/src/views/chart/components/componentStyle/SplitSelectorAntV.vue b/core/frontend/src/views/chart/components/componentStyle/SplitSelectorAntV.vue index fc74ea5e81..7d71c56edd 100644 --- a/core/frontend/src/views/chart/components/componentStyle/SplitSelectorAntV.vue +++ b/core/frontend/src/views/chart/components/componentStyle/SplitSelectorAntV.vue @@ -147,9 +147,9 @@ export default { diff --git a/core/frontend/src/views/chart/components/componentStyle/XAxisSelector.vue b/core/frontend/src/views/chart/components/componentStyle/XAxisSelector.vue index 808b5946cf..e97120bb57 100644 --- a/core/frontend/src/views/chart/components/componentStyle/XAxisSelector.vue +++ b/core/frontend/src/views/chart/components/componentStyle/XAxisSelector.vue @@ -478,6 +478,14 @@ export default { .form-item ::v-deep .el-form-item__label{ font-size: 12px; } + +.form-item ::v-deep .el-checkbox__label { + font-size: 12px; +} +.form-item ::v-deep .el-radio__label { + font-size: 12px; +} + .el-select-dropdown__item{ padding: 0 20px; } diff --git a/core/frontend/src/views/chart/components/componentStyle/XAxisSelectorAntV.vue b/core/frontend/src/views/chart/components/componentStyle/XAxisSelectorAntV.vue index 7bd74c37d5..fd847622fc 100644 --- a/core/frontend/src/views/chart/components/componentStyle/XAxisSelectorAntV.vue +++ b/core/frontend/src/views/chart/components/componentStyle/XAxisSelectorAntV.vue @@ -465,6 +465,14 @@ export default { .form-item ::v-deep .el-form-item__label{ font-size: 12px; } + +.form-item ::v-deep .el-checkbox__label { + font-size: 12px; +} +.form-item ::v-deep .el-radio__label { + font-size: 12px; +} + .el-select-dropdown__item{ padding: 0 20px; } diff --git a/core/frontend/src/views/chart/components/componentStyle/YAxisExtSelector.vue b/core/frontend/src/views/chart/components/componentStyle/YAxisExtSelector.vue index d3ae81851e..3a1b25543f 100644 --- a/core/frontend/src/views/chart/components/componentStyle/YAxisExtSelector.vue +++ b/core/frontend/src/views/chart/components/componentStyle/YAxisExtSelector.vue @@ -465,6 +465,14 @@ export default { font-size: 12px; line-height: 38px; } + +.form-item ::v-deep .el-checkbox__label { + font-size: 12px; +} +.form-item ::v-deep .el-radio__label { + font-size: 12px; +} + .form-item ::v-deep .el-form-item__label{ font-size: 12px; } diff --git a/core/frontend/src/views/chart/components/componentStyle/YAxisExtSelectorAntV.vue b/core/frontend/src/views/chart/components/componentStyle/YAxisExtSelectorAntV.vue index df6eb7f1c8..517edd1340 100644 --- a/core/frontend/src/views/chart/components/componentStyle/YAxisExtSelectorAntV.vue +++ b/core/frontend/src/views/chart/components/componentStyle/YAxisExtSelectorAntV.vue @@ -454,6 +454,14 @@ export default { justify-content: space-between; align-items: center; } + +.form-item ::v-deep .el-checkbox__label { + font-size: 12px; +} +.form-item ::v-deep .el-radio__label { + font-size: 12px; +} + .form-item-slider ::v-deep .el-form-item__label{ font-size: 12px; line-height: 38px; diff --git a/core/frontend/src/views/chart/components/componentStyle/YAxisSelector.vue b/core/frontend/src/views/chart/components/componentStyle/YAxisSelector.vue index e7b29e2b54..16ed4d09e2 100644 --- a/core/frontend/src/views/chart/components/componentStyle/YAxisSelector.vue +++ b/core/frontend/src/views/chart/components/componentStyle/YAxisSelector.vue @@ -471,6 +471,14 @@ export default { .form-item ::v-deep .el-form-item__label{ font-size: 12px; } + +.form-item ::v-deep .el-checkbox__label { + font-size: 12px; +} +.form-item ::v-deep .el-radio__label { + font-size: 12px; +} + .el-select-dropdown__item{ padding: 0 20px; } diff --git a/core/frontend/src/views/chart/components/componentStyle/YAxisSelectorAntV.vue b/core/frontend/src/views/chart/components/componentStyle/YAxisSelectorAntV.vue index fd35a3ab1e..ac7dee48ac 100644 --- a/core/frontend/src/views/chart/components/componentStyle/YAxisSelectorAntV.vue +++ b/core/frontend/src/views/chart/components/componentStyle/YAxisSelectorAntV.vue @@ -461,6 +461,14 @@ export default { .form-item ::v-deep .el-form-item__label{ font-size: 12px; } + +.form-item ::v-deep .el-checkbox__label { + font-size: 12px; +} +.form-item ::v-deep .el-radio__label { + font-size: 12px; +} + .el-select-dropdown__item{ padding: 0 20px; } diff --git a/core/frontend/src/views/chart/components/senior/Threshold.vue b/core/frontend/src/views/chart/components/senior/Threshold.vue index 10d31c03c5..74239f9377 100644 --- a/core/frontend/src/views/chart/components/senior/Threshold.vue +++ b/core/frontend/src/views/chart/components/senior/Threshold.vue @@ -7,6 +7,7 @@ :model="thresholdForm" label-width="80px" size="mini" + @submit.native.prevent > + aaa