Skip to content

Commit

Permalink
Orden inverso en el heatmap
Browse files Browse the repository at this point in the history
  • Loading branch information
yjx0003 committed Sep 17, 2019
1 parent 50fd779 commit 819683b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/controllers/datasets/heatmap/HeatmapDataSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ public String createSeries(List<EnrolledUser> enrolledUsers, List<EnrolledUser>
dateStart, dateEnd);
List<String> rangeDates = groupBy.getRangeString(dateStart, dateEnd);

for (EnrolledUser selectedUser : selectedUsers) {
if (selectedUser == null) continue;
for (int i = selectedUsers.size() - 1; i >= 0; i--) {
EnrolledUser selectedUser = selectedUsers.get(i);
if (selectedUser == null)
continue;
stringBuilder.append("{name:'" + DataSetsUtil.escapeJavaScriptText(selectedUser.toString()) + "',");

Map<T, List<Long>> types = userCounts.get(selectedUser);
List<Long> results = new ArrayList<>();
for (int i = 0; i < rangeDates.size(); i++) {
for (int j = 0; j < rangeDates.size(); j++) {
long result = 0;
for (T type : selecteds) {
List<Long> times = types.get(type);
result += times.get(i);
result += times.get(j);
}
results.add(result);
}
Expand All @@ -45,7 +47,7 @@ public String createSeries(List<EnrolledUser> enrolledUsers, List<EnrolledUser>
}

public static String createCategory(GroupByAbstract<?> groupBy, LocalDate dateStart, LocalDate dateEnd) {
return "["+DataSetsUtil.joinWithQuotes(groupBy.getRangeString(dateStart, dateEnd))+"]";
return "[" + DataSetsUtil.joinWithQuotes(groupBy.getRangeString(dateStart, dateEnd)) + "]";
}

}

0 comments on commit 819683b

Please sign in to comment.