Commit 7c1b38bea78660c597f537d70c01e0b8ce529335

Authored by hitier
1 parent ff5fd5bf

Draw charts to fit window width

not dynamical resizable yet, you have to reload page after resizing
window to have chart fit it.
app/main/static/js/charges.js
  1 +const main_elt = document.getElementById("main")
  2 +
1 3 const margin = {top: 60, right: 350, bottom: 100, left: 90},
2   - width = 1300 - margin.left - margin.right,
  4 + width = main_elt.offsetWidth * 0.95 - margin.left - margin.right,
3 5 height = 500 - margin.top - margin.bottom;
4 6  
  7 +
5 8 const height_ratio = 1.2
6 9  
7 10 const tooltip_offset = {dx: 0, dy: 100}
... ...
app/templates/base_page.html
... ... @@ -121,7 +121,7 @@
121 121 </footer>
122 122 </nav>
123 123  
124   - <main class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4" role="main">
  124 + <main id="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4" role="main">
125 125 <h2 class="sub-header">{{subtitle}}</h2>
126 126 {% include 'flash-messages.html' %}
127 127 {% block content %}
... ...