From fb0a100a7f9a0c9d316117ffda36480b02571567 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 1 Mar 2023 06:40:58 +0100 Subject: [PATCH] Fix broken chart --- resources/views/accounts/show.twig | 6 ++++++ resources/views/index.twig | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/views/accounts/show.twig b/resources/views/accounts/show.twig index 9c729d03aa..986507e235 100644 --- a/resources/views/accounts/show.twig +++ b/resources/views/accounts/show.twig @@ -191,6 +191,12 @@ var expenseCategoryUrl = '{{ route('chart.account.expense-category', [account.id, start.format('Ymd'), end.format('Ymd')]) }}'; var expenseBudgetUrl = '{{ route('chart.account.expense-budget', [account.id, start.format('Ymd'), end.format('Ymd')]) }}'; var drawVerticalLine = ''; + var lineColor = 'red'; + var lineTextColor = '#000'; + if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { + lineColor = '#a00'; + lineTextColor = '#bec5cb'; + } {# render vertical line with text "today" #} {% if start.lte(today) and end.gte(today) %} drawVerticalLine = '{{ today.isoFormat(monthAndDayFormat) }}'; diff --git a/resources/views/index.twig b/resources/views/index.twig index fc8dbe05b2..f8f6dc9dbe 100644 --- a/resources/views/index.twig +++ b/resources/views/index.twig @@ -172,8 +172,8 @@ var lineColor = 'red'; var lineTextColor = '#000'; if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { - var lineColor = '#a00'; - var lineTextColor = '#bec5cb'; + lineColor = '#a00'; + lineTextColor = '#bec5cb'; } var billCount = {{ billCount }}; var accountFrontpageUrl = '{{ route('chart.account.frontpage') }}';