Merge pull request #10742 from dataease/pr@dev-v2@chart-scatter-tooltip-fix

fix(仪表板-散点图): 修复散点图提示显示值不正确的问题
This commit is contained in:
jianneng-fit2cloud 2024-07-03 08:27:49 +08:00 committed by GitHub
commit e9912b213f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -35,10 +35,11 @@ public class ScatterHandler extends YoyChartHandler {
boolean isDrill = filterResult.getFilterList().stream().anyMatch(ele -> ele.getFilterType() == 1);
var xAxis = formatResult.getAxisMap().get(ChartAxis.xAxis);
var yAxis = formatResult.getAxisMap().get(ChartAxis.yAxis);
var yAxisTemp = new ArrayList<>(yAxis);
var extBubble = formatResult.getAxisMap().get(ChartAxis.extBubble);
if (!extBubble.isEmpty()) {
// 剔除气泡大小移除一个
Iterator<ChartViewFieldDTO> iterator = yAxis.iterator();
Iterator<ChartViewFieldDTO> iterator = yAxisTemp.iterator();
while (iterator.hasNext()) {
ChartViewFieldDTO obj = iterator.next();
if (obj.getId().equals(extBubble.getFirst().getId())) {
@ -47,7 +48,7 @@ public class ScatterHandler extends YoyChartHandler {
}
}
}
Map<String, Object> result = ChartDataBuild.transScatterDataAntV(xAxis, yAxis, view, data, extBubble, isDrill);
Map<String, Object> result = ChartDataBuild.transScatterDataAntV(xAxis, yAxisTemp, view, data, extBubble, isDrill);
return result;
}
}

View File

@ -437,11 +437,11 @@ public class ChartDataBuild {
axisChartDataDTO.setValue(new BigDecimal(0));
}
axisChartDataDTO.setCategory(StringUtils.defaultIfBlank(yAxis.get(j).getChartShowName(), yAxis.get(j).getName()));
buildDynamicValue(view, axisChartDataDTO, row, size, extSize);
buildDynamicValue(view, axisChartDataDTO, row, size, ObjectUtils.isNotEmpty(extBubble)?extSize-1:extSize);
// pop
if (ObjectUtils.isNotEmpty(extBubble)) {
try {
axisChartDataDTO.setPopSize(StringUtils.isEmpty(row[size - extBubble.size()]) ? null : new BigDecimal(row[size - extBubble.size()]));
axisChartDataDTO.setPopSize(StringUtils.isEmpty(row[2]) ? null : new BigDecimal(row[2]));
ChartQuotaDTO bubbleQuotaDTO = new ChartQuotaDTO();
bubbleQuotaDTO.setId(extBubble.get(0).getId());
quotaList.add(bubbleQuotaDTO);