From 3a145c29bc5f3d0e2f4850eaaeffd5b7d3c1455e Mon Sep 17 00:00:00 2001 From: Sebastian Steuer Date: Tue, 10 Dec 2013 00:36:57 +0100 Subject: [PATCH] shrinking x-axis of chart in editmode working --- public/assets/js/jquery.flot.draggable.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/public/assets/js/jquery.flot.draggable.js b/public/assets/js/jquery.flot.draggable.js index 9a50734..09710d3 100644 --- a/public/assets/js/jquery.flot.draggable.js +++ b/public/assets/js/jquery.flot.draggable.js @@ -77,17 +77,22 @@ points[didx*ps+1] = newy; } - - + var is_last = series[sidx].data.length == didx+1; + // funny hack to make drag resizing usable if (newx > ax.max) { graph.plot = $.plot("#graph_container", [ graph.profile, graph.live ] , getOptions()); } - else if (newx < (ax.max*0.8)) + else if (newx < (ax.max*0.5) && newx >= ax.datamax && is_last) { - console.log('baba'); - ax.max = ax.max*0.9; + console.log(ax); + ax.options.max = newx*2; + //ax.options.max = ; + console.log(ax); + //plot.setRange(ax); + plot.setupGrid(); + //ax.max = ax.max*2; //ax2.max = ax2.max*0.9; }