fix(图表): 修复堆叠柱状图下钻字段排序不生效

This commit is contained in:
wisonic 2024-11-06 18:40:20 +08:00
parent 5c720eaeb7
commit bb3199c71d
2 changed files with 8 additions and 3 deletions

View File

@ -52,10 +52,10 @@ public class StackBarHandler extends BarHandler {
if (ObjectUtils.isNotEmpty(extStack) &&
Objects.equals(drillFields.get(0).getId(), extStack.get(0).getId())) {
fieldsToFilter.addAll(view.getXAxis());
groupStackDrill(noDrillFieldAxis, noDrillFilterList, fieldsToFilter, drillFields, drillRequestList);
formatResult.getAxisMap().put(ChartAxis.xAxis, noDrillFieldAxis);
result.setFilterList(noDrillFilterList);
}
groupStackDrill(noDrillFieldAxis, noDrillFilterList, fieldsToFilter, drillFields, drillRequestList);
formatResult.getAxisMap().put(ChartAxis.xAxis, noDrillFieldAxis);
result.setFilterList(noDrillFilterList);
}
return (T) result;
}

View File

@ -316,6 +316,11 @@ public class ChartDataManage {
dillAxis.add(nextDrillField);
fields.add(nextDrillField.getId());
} else {
Optional<ChartViewFieldDTO> axis = xAxis.stream().filter(x -> Objects.equals(x.getId(), nextDrillField.getId())).findFirst();
axis.ifPresent(field -> {
field.setSort(nextDrillField.getSort());
field.setCustomSort(nextDrillField.getCustomSort());
});
dillAxis.add(nextDrillField);
}
}