]> ToastFreeware Gitweb - chrisu/seepark.git/blobdiff - web/static/seepark_web.js
js: resize charts on window resize
[chrisu/seepark.git] / web / static / seepark_web.js
index 75c362b32b83e6137b98e28a95be8186e6c58e6f..e4bd8d640646581708e418b28469bd256e81010c 100644 (file)
@@ -60,6 +60,12 @@ function dayschart(element, title, days, xtickformat) {
                size: {
                        width: document.getElementById(element).parentElement.clientWidth * 80 / 100
                },
+               onresized: function () {
+                       chart.resize({
+                               width: document.getElementById(element).parentElement.clientWidth * 80 / 100
+                       });
+                       // chart.flush();
+               },
                transition: {
                        duration: null
                },
@@ -94,6 +100,7 @@ function dayschart(element, title, days, xtickformat) {
                },
                zoom: {
                        enabled: true,
+                       /*
                        onzoomend: function (domain) {
                                // UNIX epoch
                                var start = domain[0].getTime()/1000;
@@ -106,6 +113,7 @@ function dayschart(element, title, days, xtickformat) {
                                        loaddays(this, element, days); // this = chart
                                }
                        }
+                       */
                },
                tooltip: {
                        format: {