forked from github/dataease
Merge pull request #11300 from dataease/pr@dev-v2@fix_group_bar_drill
fix(图表): 修复分组柱状图下钻分组信息丢失 #10875
This commit is contained in:
commit
61a6eeab68
@ -6,10 +6,7 @@ import lombok.Getter;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@ -69,7 +66,8 @@ public class GroupBarHandler extends BarHandler {
|
||||
var xAxis = formatResult.getAxisMap().get(ChartAxis.xAxis);
|
||||
var xAxisExt = formatResult.getAxisMap().get(ChartAxis.xAxisExt);
|
||||
var yAxis = formatResult.getAxisMap().get(ChartAxis.yAxis);
|
||||
var xAxisBase = xAxis.subList(0, xAxis.size() - xAxisExt.size());
|
||||
var drillAxis = xAxis.stream().filter(axis -> FieldSource.DRILL == axis.getSource()).toList();
|
||||
var xAxisBase = xAxis.subList(0, xAxis.size() - xAxisExt.size() - drillAxis.size());
|
||||
return ChartDataBuild.transBaseGroupDataAntV(xAxisBase, xAxis, xAxisExt, yAxis, view, data, isDrill);
|
||||
}
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ public class ChartDataManage {
|
||||
if (i == drillRequestList.size() - 1) {
|
||||
ChartViewFieldDTO nextDrillField = drill.get(i + 1);
|
||||
if (!fields.contains(nextDrillField.getId())) {
|
||||
viewField.setSource(FieldSource.DRILL);
|
||||
nextDrillField.setSource(FieldSource.DRILL);
|
||||
nextDrillField.setSort(getDrillSort(xAxis, drill.get(0)));
|
||||
xAxis.add(nextDrillField);
|
||||
dillAxis.add(nextDrillField);
|
||||
|
Loading…
Reference in New Issue
Block a user