Merge pull request #6080 from ulleo/dev

fix: [Echarts动态排序图] 空字段导致图表报错
This commit is contained in:
ulleo 2023-09-08 11:25:12 +08:00 committed by GitHub
commit 9f37d7b6cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,7 +150,7 @@ public class RaceBarService extends ViewPluginService {
data.forEach(ss -> {
xs.add(ss[encode.get("y")]);
String key = ss[(Integer) map.get("extIndex")];
String key = StringUtils.defaultString(ss[(Integer) map.get("extIndex")], StringUtils.EMPTY);
if (!keySet.contains(key)) {
keySet.add(key);
keyList.add(key);
@ -160,7 +160,7 @@ public class RaceBarService extends ViewPluginService {
Map<String, List<String[]>> groupData = data.stream().collect(Collectors.toMap(
k -> k[(Integer) map.get("extIndex")],
k -> StringUtils.defaultString(k[(Integer) map.get("extIndex")], StringUtils.EMPTY),
v -> {
List<String[]> list = new ArrayList<>();
list.add(v);
@ -179,6 +179,7 @@ public class RaceBarService extends ViewPluginService {
map.put("xs", xs);
return map;
}