prevent charts refresh when global pan and zoom is active
Costa Tsaousis (ktsaou) committed
Dec 10, 2015 at 13:08 UTC
373c6ce5bda064390cdb7c2adb03e7602f7f872f
1 file changed
+14
-10
web/dashboard.js
+14
-10
@@ -623,7 +623,7 @@
623
if(this.debug) this.log('updateChartPanOrZoom(): caller did not set proper mode');
624
this.setMode('pan');
625
}
626
-
626
+
627
if(!this.current.force_after_ms || !this.current.force_before_ms) {
628
if(this.debug) this.log('updateChartPanOrZoom(' + (after / 1000).toString() + ' - ' + (before / 1000).toString() + '): INIT');
629
move = true;
@@ -669,6 +669,10 @@
669
needed = true;
670
break;
671
}
672
+ else if(!this.follows_global) {
673
+ // FIXME update to latest value
674
+ ;
675
+ }
676
}
677
}
678
@@ -685,7 +689,7 @@
689
690
this.element_legend_childs.title_date.className += "netdata-legend-title-date";
691
this.element_legend.appendChild(this.element_legend_childs.title_date);
688
-
692
+
693
this.element_legend.appendChild(document.createElement('br'));
694
695
this.element_legend_childs.title_time.className += "netdata-legend-title-time";
@@ -711,6 +715,7 @@
715
};
716
me.element_legend_childs.series[d].name.className += 'netdata-legend-name';
717
me.element_legend_childs.series[d].value.className += 'netdata-legend-value';
718
+ me.element_legend_childs.series[d].value.title = d;
719
720
var c = i % NETDATA.colors.length;
721
me.element_legend_childs.series[d].name.style.color = NETDATA.colors[c];
@@ -732,6 +737,7 @@
737
};
738
me.element_legend_childs.series[d.name].name.className += 'netdata-legend-name';
739
me.element_legend_childs.series[d.name].value.className += 'netdata-legend-value';
740
+ me.element_legend_childs.series[d.name].value.title = d;
741
742
var c = i;
743
while(c >= NETDATA.colors.length) c -= NETDATA.colors.length;
@@ -745,7 +751,7 @@
751
el.appendChild(me.element_legend_childs.series[d.name].value);
752
});
753
}
748
-
754
+
755
// create a hidden div to be used for hidding
756
// the original legend of the chart library
757
el = document.createElement('div');
@@ -794,7 +800,7 @@
800
801
hasLegend: function() {
802
if(this.element_legend) return true;
797
-
803
+
804
if(this.library && this.library.legend == 'right-side') {
805
var legend = $(this.element).data('legend') || 'yes';
806
if(legend == 'no') return false;
@@ -834,16 +840,14 @@
840
},
841
842
needsResize: function() {
837
- return (this.last_resized < NETDATA.options.last_resized);
843
+ return (this.library && !this.library.autoresize && this.last_resized < NETDATA.options.last_resized);
844
},
845
846
resizeChart: function() {
847
if(this.needsResize()) {
842
- if(this.library && !this.library.autoresize) {
843
- if(this.debug) this.log('forcing re-generation due to window resize.');
844
- this.created_ms = 0;
845
- this.last_resized = new Date().getTime();
846
- }
848
+ if(this.debug) this.log('forcing re-generation due to window resize.');
849
+ this.created_ms = 0;
850
+ this.last_resized = new Date().getTime();
851
}
852
},
853