diff --git a/ui/web/static/js/charts.js b/ui/web/static/js/charts.js index a2af4595..8ef2d98a 100644 --- a/ui/web/static/js/charts.js +++ b/ui/web/static/js/charts.js @@ -1132,11 +1132,13 @@ class MultiGaugeChart extends Echart { const channels = JSON.stringify(this.chartData.channels); const things = JSON.stringify(this.chartData.things); const gaugeLabel = this.chartData.labels; + const colours = this.chartData.colours; return ` var multiGaugeChart = echarts.init(document.getElementById("${this.ID}")); - gaugeLabel = ${JSON.stringify(gaugeLabel)}; + var gaugeLabel = ${JSON.stringify(gaugeLabel)}; + var colours = ${JSON.stringify(colours)}; var gaugeData = gaugeLabel.map((label, index) => { // Dynamic positioning can be improved based on the number of gauges @@ -1214,7 +1216,8 @@ class MultiGaugeChart extends Echart { channels: ${channels}, publishers: ${things}, gaugeLabel: gaugeLabel, - name: '${this.chartData.valueName}' + name: '${this.chartData.valueName}', + colours: colours, } getData(multiGaugeChart, chartData); @@ -1248,6 +1251,9 @@ class MultiGaugeChart extends Echart { detail: { valueAnimation: true, offsetCenter: ['0%', (index - (gaugeLabel.length - 1) / 2) * 40 + 12 + '%'] + }, + itemStyle: { + color: chartData.colours[i], } }; }); diff --git a/ui/web/templates/charts/multigaugemodal.html b/ui/web/templates/charts/multigaugemodal.html index 625a1e63..d3162593 100644 --- a/ui/web/templates/charts/multigaugemodal.html +++ b/ui/web/templates/charts/multigaugemodal.html @@ -72,6 +72,7 @@