From 00acb2525e1f6e55925805beb41e64fdfa6e3e9f Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Tue, 24 Oct 2023 16:34:23 +0200 Subject: [PATCH] prevent cls --- assets/src/css/admin.css | 4 +++- assets/src/js/components/chart.js | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/assets/src/css/admin.css b/assets/src/css/admin.css index d39b66b3..d5acfe9e 100644 --- a/assets/src/css/admin.css +++ b/assets/src/css/admin.css @@ -62,6 +62,7 @@ h1.ka-logo, .ka-chart { position: relative; overflow: visible; + min-height: 240px; } .ka-chart--tooltip { position: absolute; @@ -122,9 +123,10 @@ h1.ka-logo, grid-template-columns: repeat(6, 1fr); } -/** TopX components */ +/** Topx components */ .ka-topx { grid-column: span 6; + min-height: 689px; } @media (min-width: 840px) { .ka-topx { diff --git a/assets/src/js/components/chart.js b/assets/src/js/components/chart.js index 45bf05bf..04709d13 100644 --- a/assets/src/js/components/chart.js +++ b/assets/src/js/components/chart.js @@ -46,8 +46,8 @@ function hideTooltip() { export default function(root, height) { height = height ?? Math.max(240, Math.min(window.innerHeight / 3, window.innerWidth / 2, 360)); - let groupByMonth = false; - let dateFormatOptions = groupByMonth ? {month: 'short', year: 'numeric'} : undefined + root.parentElement.style.minHeight = `${height}px`; + let dateFormatOptions = {month: 'short', year: 'numeric'}; let width = root.clientWidth; const innerWidth = width - padding.left - padding.right; const innerHeight = height - padding.bottom - padding.top; @@ -92,7 +92,7 @@ export default function(root, height) { * @param {Date} endDate */ function update(startDate, endDate) { - groupByMonth = startDate.getDate() === 1 && isLastDayOfMonth(endDate) && (endDate.getMonth() - startDate.getMonth()) >= 2 + const groupByMonth = startDate.getDate() === 1 && isLastDayOfMonth(endDate) && (endDate.getMonth() - startDate.getMonth()) >= 2 dateFormatOptions = groupByMonth ? {month: 'short', year: 'numeric'} : undefined request('/stats', {