fix: inverted colors of graph

This commit is contained in:
filippo-ferrari 2024-09-12 19:26:23 +02:00
parent 9eb914c612
commit cda5ee05d8

View file

@ -206,7 +206,7 @@ public class DashboardView extends Div {
StringBuilder data = new StringBuilder("[");
for (Map.Entry<String, Double> entry : personData.entrySet()) {
double value = entry.getValue();
String color = value >= 0 ? "#90EE90" : "#FF9999"; // Green for positive, red for negative
String color = value >= 0 ? "#FF9999" : "#90EE90"; // Green for positive, red for negative
data.append("{ y: ").append(value).append(", color: '").append(color).append("' },");
}
data.setCharAt(data.length() - 1, ']'); // Replace last comma with closing bracket