diff --git a/OpenBudgeteer.Blazor/Pages/Report.razor b/OpenBudgeteer.Blazor/Pages/Report.razor index 1a940e3..a359ca3 100644 --- a/OpenBudgeteer.Blazor/Pages/Report.razor +++ b/OpenBudgeteer.Blazor/Pages/Report.razor @@ -2,12 +2,14 @@ @using ApexCharts @using OpenBudgeteer.Blazor.Common -

Month Balances

- +

Bank Balances

- +

Income & Expenses per Month

- +

Income & Expenses per Year

- + Bucket Monthly Expenses @foreach (var chart in _monthBucketExpensesConfigsLeft) { - + Bucket Monthly Expenses @foreach (var chart in _monthBucketExpensesConfigsRight) { - + InjectMonthBucketExpensesChart { set => MonthBucketExpensesCharts.Add(value); } - - private ApexChartOptions MonthIncomeExpensesChartOptions = new() - { - Legend = new() { Show = false } - }; - private ApexChartOptions YearIncomeExpensesChartOptions = new() + private Theme BaseTheme => new() { - Legend = new() { Show = false } + Mode = AppSettings.Mode == AppSettings.ThemeMode.Dark ? Mode.Dark : Mode.Light, + Palette = PaletteType.Palette1 }; private ApexReportViewModel _apexContext = null!; @@ -53,10 +50,10 @@ protected override async Task OnInitializedAsync() StateHasChanged(); var tasks = new List() { - MonthBalanceChart.UpdateSeriesAsync(true), - BankBalanceChart.UpdateSeriesAsync(true), - MonthIncomeExpensesChart.UpdateSeriesAsync(true), - YearIncomeExpensesChart.UpdateSeriesAsync(true) + MonthBalanceChart.UpdateSeriesAsync(), + BankBalanceChart.UpdateSeriesAsync(), + MonthIncomeExpensesChart.UpdateSeriesAsync(), + YearIncomeExpensesChart.UpdateSeriesAsync() }; tasks.AddRange(MonthBucketExpensesCharts .Select(monthBucketExpensesChart => monthBucketExpensesChart.UpdateSeriesAsync())); diff --git a/OpenBudgeteer.Core/Common/AppSettings.cs b/OpenBudgeteer.Core/Common/AppSettings.cs index 786a769..555ddc1 100644 --- a/OpenBudgeteer.Core/Common/AppSettings.cs +++ b/OpenBudgeteer.Core/Common/AppSettings.cs @@ -1,6 +1,21 @@ -namespace OpenBudgeteer.Core.Common; +using OpenBudgeteer.Core.Common.Extensions; + +namespace OpenBudgeteer.Core.Common; public static class AppSettings { + public enum ThemeMode { Light, Dark } + public static string Theme { get; set; } = "default"; + + public static ThemeMode Mode => Theme switch + { + "cyborg" or + "darkly" or + "slate" or + "solar" or + "superhero" or + "vapor" => ThemeMode.Dark, + _ => ThemeMode.Light + }; }