From 654c8cd75e26046996824d7d79294c8e625c0bf6 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Sun, 9 Oct 2016 11:42:41 +0300 Subject: [PATCH] allow functions to be given for easypiechart barColor; fixes #1089; fixes #958 --- web/dashboard.html | 2 +- web/dashboard.js | 12 +++++++++++- web/demo.html | 2 +- web/demo2.html | 2 +- web/demosites.html | 2 +- web/goto-host-from-alarm.html | 2 +- web/index.html | 2 +- web/registry.html | 2 +- web/tv.html | 2 +- 9 files changed, 19 insertions(+), 9 deletions(-) diff --git a/web/dashboard.html b/web/dashboard.html index 214304aa..c645acf0 100644 --- a/web/dashboard.html +++ b/web/dashboard.html @@ -652,4 +652,4 @@ So, to avoid flashing the charts, we destroy and re-create the charts on each up - + diff --git a/web/dashboard.js b/web/dashboard.js index d2122ce8..4fa431d5 100644 --- a/web/dashboard.js +++ b/web/dashboard.js @@ -4997,8 +4997,18 @@ state.easyPieChartUnits.style.top = unittop.toString() + 'px'; state.element_chart.appendChild(state.easyPieChartUnits); + var barColor = self.data('easypiechart-barcolor'); + if(typeof barColor === 'undefined' || barColor === null) + barColor = state.chartColors()[0]; + else { + //
+ var tmp = eval(barColor); + if(typeof tmp === 'function') + barColor = tmp; + } + chart.easyPieChart({ - barColor: self.data('easypiechart-barcolor') || state.chartColors()[0], //'#ef1e25', + barColor: barColor, trackColor: self.data('easypiechart-trackcolor') || NETDATA.themes.current.easypiechart_track, scaleColor: self.data('easypiechart-scalecolor') || NETDATA.themes.current.easypiechart_scale, scaleLength: self.data('easypiechart-scalelength') || 5, diff --git a/web/demo.html b/web/demo.html index f5e40c00..aa037765 100644 --- a/web/demo.html +++ b/web/demo.html @@ -20,7 +20,7 @@ - +
diff --git a/web/demo2.html b/web/demo2.html index e0af3890..c55827cc 100644 --- a/web/demo2.html +++ b/web/demo2.html @@ -21,7 +21,7 @@ - +
diff --git a/web/demosites.html b/web/demosites.html index 019ca926..367aeda6 100644 --- a/web/demosites.html +++ b/web/demosites.html @@ -52,7 +52,7 @@ and that you have chown it to be owned by netdata:netdata --> - + - + + diff --git a/web/registry.html b/web/registry.html index 767d97ae..09986764 100644 --- a/web/registry.html +++ b/web/registry.html @@ -169,7 +169,7 @@ var netdataRegistryCallback = function(machines_array) { and that you have chown it to be owned by netdata:netdata --> - + +