prevent easipiecharts and gauge charts from updating their units while the chart is not rendered again
Costa Tsaousis (ktsaou) committed
Oct 20, 2017 at 01:57 UTC
da87208e2d40a639d3717231c57f9358ccc20aef
1 file changed
+18
-16
web/dashboard.js
+18
-16
@@ -6356,12 +6356,6 @@ var NETDATA = window.NETDATA || {};
6356
barColor = tmp;
6357
}
6358
6359
- state.legendSetUnitsString = function(units) {
6360
- if(typeof state.tmp.easyPieChartUnits !== 'undefined')
6361
- state.tmp.easyPieChartUnits.innerText = units;
6362
- };
6363
- state.legendShowUndefined = function() {};
6364
-
6359
var pcent = NETDATA.easypiechartPercentFromValueMinMax(state, value, min, max);
6360
chart.data('data-percent', pcent);
6361
@@ -6389,6 +6383,13 @@ var NETDATA = window.NETDATA || {};
6383
if(animate === false) state.tmp.easyPieChart_instance.disableAnimation();
6384
state.tmp.easyPieChart_instance.update(pcent);
6385
if(animate === false) state.tmp.easyPieChart_instance.enableAnimation();
6386
+
6387
+ state.legendSetUnitsString = function(units) {
6388
+ if(typeof state.tmp.easyPieChartUnits !== 'undefined')
6389
+ state.tmp.easyPieChartUnits.innerText = units;
6390
+ };
6391
+ state.legendShowUndefined = function() {};
6392
+
6393
return true;
6394
};
6395
@@ -6730,16 +6731,6 @@ var NETDATA = window.NETDATA || {};
6731
if(typeof state.tmp.gauge_instance !== 'undefined')
6732
animate = false;
6733
6733
- state.legendSetUnitsString = function(units) {
6734
- if(typeof state.tmp.gaugeChartUnits !== 'undefined')
6735
- state.tmp.gaugeChartUnits.innerText = units;
6736
-
6737
- state.tmp.___gaugeOld__.valueLabel = null;
6738
- state.tmp.___gaugeOld__.minLabel = null;
6739
- state.tmp.___gaugeOld__.maxLabel = null;
6740
- };
6741
- state.legendShowUndefined = function() {};
6742
-
6734
state.tmp.gauge_instance = new Gauge(state.tmp.gauge_canvas).setOptions(options); // create sexy gauge!
6735
6736
state.tmp.___gaugeOld__ = {
@@ -6759,6 +6750,17 @@ var NETDATA = window.NETDATA || {};
6750
NETDATA.gaugeSet(state, value, min, max);
6751
NETDATA.gaugeSetLabels(state, value, min, max);
6752
NETDATA.gaugeAnimation(state, true);
6753
+
6754
+ state.legendSetUnitsString = function(units) {
6755
+ if(typeof state.tmp.gaugeChartUnits !== 'undefined') {
6756
+ state.tmp.gaugeChartUnits.innerText = units;
6757
+ state.tmp.___gaugeOld__.valueLabel = null;
6758
+ state.tmp.___gaugeOld__.minLabel = null;
6759
+ state.tmp.___gaugeOld__.maxLabel = null;
6760
+ }
6761
+ };
6762
+ state.legendShowUndefined = function() {};
6763
+
6764
return true;
6765
};
6766