From 47da8c023b2a6346592501042b53d8e6e35d2e85 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Wed, 9 Mar 2022 12:15:10 +0100 Subject: [PATCH] Add message if on mining charts if there is no data to display --- .../hashrate-chart/hashrate-chart.component.ts | 14 ++++++++++++++ .../hashrate-chart-pools.component.ts | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts index 948ffed41..582dee263 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts @@ -125,7 +125,21 @@ export class HashrateChartComponent implements OnInit { } prepareChartOptions(data) { + let title = undefined; + if (data.hashrates.length === 0) { + title = { + textStyle: { + color: "grey", + fontSize: 15 + }, + text: "Indexing in progress...", + left: "center", + top: "center" + }; + } + this.chartOptions = { + title: title, color: [ new graphic.LinearGradient(0, 0, 0, 0.65, [ { offset: 0, color: '#F4511E' }, diff --git a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts index 7e3f081a6..016f7a319 100644 --- a/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts +++ b/frontend/src/app/components/hashrates-chart-pools/hashrate-chart-pools.component.ts @@ -124,7 +124,21 @@ export class HashrateChartPoolsComponent implements OnInit { } prepareChartOptions(data) { + let title = undefined; + if (data.series.length === 0) { + title = { + textStyle: { + color: "grey", + fontSize: 15 + }, + text: "Indexing in progress...", + left: "center", + top: this.widget ? 115 : this.isMobile() ? 'center' : 225, + }; + } + this.chartOptions = { + title: title, grid: { right: this.right, left: this.left,