From b6daaff368da1c60816ff0d81f8d42db98e64df7 Mon Sep 17 00:00:00 2001 From: effe Date: Sat, 14 Sep 2024 15:35:09 -0400 Subject: [PATCH] feat: stacked columns graph --- .../munera/views/dashboard/DashboardView.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/application/munera/views/dashboard/DashboardView.java b/src/main/java/com/application/munera/views/dashboard/DashboardView.java index 3ea4834..d6d1045 100644 --- a/src/main/java/com/application/munera/views/dashboard/DashboardView.java +++ b/src/main/java/com/application/munera/views/dashboard/DashboardView.java @@ -181,13 +181,22 @@ public class DashboardView extends Div { "title: { text: 'Total Expense' }, " + "stackLabels: { " + "enabled: true, " + - "style: { fontWeight: 'bold', color: 'gray' } " + + "style: { fontWeight: 'bold', color: 'gray' }, " + + "formatter: function() { " + + " if (this.total > 0) { return this.total; } else { return ''; }" + // Only show total if greater than 0 + "}" + "} " + "}, " + "plotOptions: { " + "column: { " + "stacking: 'normal', " + - "dataLabels: { enabled: true } " + + "dataLabels: { " + + "enabled: true, " + + "formatter: function() { " + + " if (this.y > 0) { return this.y; } else { return ''; }" + // Only show data label if value > 0 + "}," + + "color: 'black'" + // Set label color + "} " + "} " + "}, " + "series: " + seriesData.toString() + " " +