diff --git a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.html b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.html index 509e15574..745fe491f 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.html +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.html @@ -25,13 +25,14 @@ -
+
-
- +
+
diff --git a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.scss b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.scss index 62eac44f5..316f0fc47 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.scss +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.scss @@ -26,6 +26,11 @@ padding-bottom: 20px; padding-right: 20px; } +.chart-widget { + width: 100%; + height: 100%; + max-height: 275px; +} .formRadioGroup { margin-top: 6px; 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 e478c5c17..fde49b9b4 100644 --- a/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts +++ b/frontend/src/app/components/hashrate-chart/hashrate-chart.component.ts @@ -69,7 +69,7 @@ export class HashrateChartComponent implements OnInit { timestamp: data.hashrates[hashIndex].timestamp, difficulty: data.difficulty[data.difficulty.length - 1].difficulty }); - ++hashIndex; + ++hashIndex; } break; } @@ -121,7 +121,7 @@ export class HashrateChartComponent implements OnInit { prepareChartOptions(data) { this.chartOptions = { color: [ - new graphic.LinearGradient(0, 0, 0, 0.65, [ + new graphic.LinearGradient(0, 0, 0, 0.65, [ { offset: 0, color: '#F4511E' }, { offset: 0.25, color: '#FB8C00' }, { offset: 0.5, color: '#FFB300' }, @@ -133,6 +133,7 @@ export class HashrateChartComponent implements OnInit { grid: { right: this.right, left: this.left, + bottom: 30, }, tooltip: { trigger: 'axis', @@ -146,6 +147,25 @@ export class HashrateChartComponent implements OnInit { color: '#b1b1b1', }, borderColor: '#000', + formatter: function (data) { + let hashratePowerOfTen: any = selectPowerOfTen(1); + let hashrate = data[0].data[1]; + let difficultyPowerOfTen = hashratePowerOfTen; + let difficulty = data[1].data[1]; + + if (this.isMobile()) { + hashratePowerOfTen = selectPowerOfTen(data[0].data[1]); + hashrate = Math.round(data[0].data[1] / hashratePowerOfTen.divider); + difficultyPowerOfTen = selectPowerOfTen(data[1].data[1]); + difficulty = Math.round(data[1].data[1] / difficultyPowerOfTen.divider); + } + + return ` + ${data[0].axisValueLabel}
+ ${data[0].marker} ${data[0].seriesName}: ${formatNumber(hashrate, this.locale, '1.0-0')} ${hashratePowerOfTen.unit}H/s
+ ${data[1].marker} ${data[1].seriesName}: ${formatNumber(difficulty, this.locale, '1.0-0')} ${difficultyPowerOfTen.unit} + `; + }.bind(this) }, xAxis: { type: 'time', @@ -179,13 +199,16 @@ export class HashrateChartComponent implements OnInit { }, yAxis: [ { + min: function (value) { + return value.min * 0.9; + }, type: 'value', name: 'Hashrate', axisLabel: { color: 'rgb(110, 112, 121)', formatter: (val) => { const selectedPowerOfTen: any = selectPowerOfTen(val); - const newVal = val / selectedPowerOfTen.divider; + const newVal = Math.round(val / selectedPowerOfTen.divider); return `${newVal} ${selectedPowerOfTen.unit}H/s` } }, @@ -194,6 +217,9 @@ export class HashrateChartComponent implements OnInit { } }, { + min: function (value) { + return value.min * 0.9; + }, type: 'value', name: 'Difficulty', position: 'right', @@ -201,7 +227,7 @@ export class HashrateChartComponent implements OnInit { color: 'rgb(110, 112, 121)', formatter: (val) => { const selectedPowerOfTen: any = selectPowerOfTen(val); - const newVal = val / selectedPowerOfTen.divider; + const newVal = Math.round(val / selectedPowerOfTen.divider); return `${newVal} ${selectedPowerOfTen.unit}` } }, diff --git a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html index 78c8760bf..aa7affc1e 100644 --- a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html +++ b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.html @@ -5,11 +5,13 @@
-
-
Mining Pools Share (1w)
+
@@ -18,10 +20,12 @@
-
Hashrate (1y)
+
+ + Hashrate (1y) + +
-
diff --git a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.scss b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.scss index c2fb37e8c..e575a405b 100644 --- a/frontend/src/app/components/mining-dashboard/mining-dashboard.component.scss +++ b/frontend/src/app/components/mining-dashboard/mining-dashboard.component.scss @@ -16,22 +16,17 @@ } .card-title { - color: #4a68b9; font-size: 1rem; } +.card-title > a { + color: #4a68b9; +} -.card-wrapper { - .card { - height: auto !important; - } - .card-body { - display: flex; - flex: inherit; - text-align: center; - flex-direction: column; - justify-content: space-around; - padding: 22px 20px; - } +.card-body { + padding: 1.25rem 1rem 0.75rem 1rem; +} +.card-body.pool-ranking { + padding: 1.25rem 0.25rem 0.75rem 0.25rem; } #blockchain-container { diff --git a/frontend/src/app/components/pool-ranking/pool-ranking.component.html b/frontend/src/app/components/pool-ranking/pool-ranking.component.html index a687e41c7..5e6068866 100644 --- a/frontend/src/app/components/pool-ranking/pool-ranking.component.html +++ b/frontend/src/app/components/pool-ranking/pool-ranking.component.html @@ -1,11 +1,12 @@
-
+
-
+
Block