From 0dd9e5dda6ed053550c41fc0d9203140ee213e96 Mon Sep 17 00:00:00 2001 From: aj Date: Thu, 23 May 2019 09:54:17 +0100 Subject: [PATCH] cumulative scrobble graph and dark theme --- .../fx/controller/ScrobblesViewPaneController.java | 7 +++++-- .../sarsoo/fmframework/fx/styles/mainPane.css | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/sarsoo/fmframework/fx/controller/ScrobblesViewPaneController.java b/src/main/java/sarsoo/fmframework/fx/controller/ScrobblesViewPaneController.java index 62d985e..83ef43a 100644 --- a/src/main/java/sarsoo/fmframework/fx/controller/ScrobblesViewPaneController.java +++ b/src/main/java/sarsoo/fmframework/fx/controller/ScrobblesViewPaneController.java @@ -34,7 +34,7 @@ public class ScrobblesViewPaneController { @FXML public void initialize() { - + } public void populate(FMObj obj) { @@ -82,8 +82,11 @@ public class ScrobblesViewPaneController { calendar.addCount(scrobbleDate.getMonth(), scrobbleDate.getYear()); } + int cumulative = 0; + for(MonthScrobbles month: calendar.getMonthScrobbles()) { - series.getData().add(new Data(month.toString(), month.getCount())); + cumulative += month.getCount(); + series.getData().add(new Data(month.toString(), cumulative)); } areaChart.getData().add(series); diff --git a/src/main/resources/sarsoo/fmframework/fx/styles/mainPane.css b/src/main/resources/sarsoo/fmframework/fx/styles/mainPane.css index 4c2d59f..5724c9f 100644 --- a/src/main/resources/sarsoo/fmframework/fx/styles/mainPane.css +++ b/src/main/resources/sarsoo/fmframework/fx/styles/mainPane.css @@ -17,10 +17,22 @@ -fx-start-angle: 90; } +.chart-vertical-grid-lines { + -fx-stroke: #404040; +} + +.chart-horizontal-grid-lines { + -fx-stroke: #404040; +} + .chart-bar { -fx-background-color: #202124; } +.chart-plot-background { + -fx-background-color: transparent; +} + .chart-pie-label { -fx-fill: white; }