From 7c1b38bea78660c597f537d70c01e0b8ce529335 Mon Sep 17 00:00:00 2001 From: Richard Hitier Date: Fri, 9 Apr 2021 16:25:29 +0200 Subject: [PATCH] Draw charts to fit window width --- app/main/static/js/charges.js | 5 ++++- app/templates/base_page.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/main/static/js/charges.js b/app/main/static/js/charges.js index 7e1fee3..4056698 100644 --- a/app/main/static/js/charges.js +++ b/app/main/static/js/charges.js @@ -1,7 +1,10 @@ +const main_elt = document.getElementById("main") + const margin = {top: 60, right: 350, bottom: 100, left: 90}, - width = 1300 - margin.left - margin.right, + width = main_elt.offsetWidth * 0.95 - margin.left - margin.right, height = 500 - margin.top - margin.bottom; + const height_ratio = 1.2 const tooltip_offset = {dx: 0, dy: 100} diff --git a/app/templates/base_page.html b/app/templates/base_page.html index 91a9f30..878e184 100644 --- a/app/templates/base_page.html +++ b/app/templates/base_page.html @@ -121,7 +121,7 @@ -
+

{{subtitle}}

{% include 'flash-messages.html' %} {% block content %} -- libgit2 0.21.2