updated to gauge.js v1.3.1
Costa Tsaousis (ktsaou) committed
Feb 5, 2017 at 05:38 UTC
2a3c9bfc374ab1cf023792780b770f4dc3efb344
3 files changed
+15
-11
web/Makefile.am
+1
-1
@@ -44,7 +44,7 @@ dist_weblib_DATA = \
44
lib/d3-3.5.17.min.js \
45
lib/dygraph-combined-dd74404.js \
46
lib/dygraph-smooth-plotter-dd74404.js \
47
- lib/gauge-d5260c3.min.js \
47
+ lib/gauge-1.3.1.min.js \
48
lib/jquery-2.2.4.min.js \
49
lib/jquery.easypiechart-97b5824.min.js \
50
lib/perfect-scrollbar-0.6.15.min.js \
web/dashboard.js
+13
-9
@@ -130,7 +130,7 @@ var NETDATA = window.NETDATA || {};
130
NETDATA.peity_js = NETDATA.serverDefault + 'lib/jquery.peity-3.2.0.min.js';
131
NETDATA.sparkline_js = NETDATA.serverDefault + 'lib/jquery.sparkline-2.1.2.min.js';
132
NETDATA.easypiechart_js = NETDATA.serverDefault + 'lib/jquery.easypiechart-97b5824.min.js';
133
- NETDATA.gauge_js = NETDATA.serverDefault + 'lib/gauge-d5260c3.min.js';
133
+ NETDATA.gauge_js = NETDATA.serverDefault + 'lib/gauge-1.3.1.min.js';
134
NETDATA.dygraph_js = NETDATA.serverDefault + 'lib/dygraph-combined-dd74404.js';
135
NETDATA.dygraph_smooth_js = NETDATA.serverDefault + 'lib/dygraph-smooth-plotter-dd74404.js';
136
NETDATA.raphael_js = NETDATA.serverDefault + 'lib/raphael-2.2.4-min.js';
@@ -5433,9 +5433,10 @@ var NETDATA = window.NETDATA || {};
5433
// is always between min and max
5434
var pcent = (value - min) * 100 / (max - min);
5435
5436
- // these should never happen
5437
- if(pcent < 0) pcent = 0;
5438
- if(pcent > 100) pcent = 100;
5436
+ // bug fix for gauge.js 1.3.1
5437
+ // if the value is the absolute min or max, the chart is broken
5438
+ if(pcent < 0.001) pcent = 0.001;
5439
+ if(pcent > 99.999) pcent = 99.999;
5440
5441
state.gauge_instance.set(pcent);
5442
// console.log('gauge set ' + pcent + ', value ' + value + ', min ' + min + ', max ' + max);
@@ -5596,19 +5597,22 @@ var NETDATA = window.NETDATA || {};
5597
5598
var options = {
5599
lines: 12, // The number of lines to draw
5599
- angle: 0.15, // The length of each line
5600
- lineWidth: 0.44, // 0.44 The line thickness
5600
+ angle: 0.15, // The span of the gauge arc
5601
+ lineWidth: 0.50, // The line thickness
5602
+ radiusScale: 0.85, // Relative radius
5603
pointer: {
5604
length: 0.8, // 0.9 The radius of the inner circle
5605
strokeWidth: 0.035, // The rotation offset
5606
color: pointerColor // Fill color
5607
},
5608
+ limitMax: true, // If false, the max value of the gauge will be updated if value surpass max
5609
+ limitMin: true, // If true, the min value of the gauge will be fixed unless you set it manually
5610
colorStart: startColor, // Colors
5611
colorStop: stopColor, // just experiment with them
5612
strokeColor: strokeColor, // to see which ones work best for you
5609
- limitMax: true,
5613
generateGradient: (generateGradient === true),
5611
- gradientType: 0
5614
+ gradientType: 0,
5615
+ highDpiSupport: true // High resolution support
5616
};
5617
5618
if (generateGradient.constructor === Array) {
@@ -6067,7 +6071,7 @@ var NETDATA = window.NETDATA || {};
6071
if(NETDATA.alarms.current !== null) {
6072
// get the current value_string
6073
var t = NETDATA.alarms.current.alarms[entry.chart + '.' + entry.name];
6070
- if(typeof t !== 'undefined' && entry.status === t.status)
6074
+ if(typeof t !== 'undefined' && entry.status === t.status && typeof t.value_string !== 'undefined')
6075
value_string = t.value_string;
6076
}
6077
web/index.html
+1
-1
@@ -3312,4 +3312,4 @@
3312
</div>
3313
</body>
3314
</html>
3315
-<script type="text/javascript" src="dashboard.js?v20170204-3"></script>
3315
+<script type="text/javascript" src="dashboard.js?v20170205-1"></script>