Merge pull request #1882 from mempool/nymkappa/bugfix/pool-ranking

Fix pool ranking layout on small mobile device
This commit is contained in:
wiz 2022-06-17 08:19:48 +09:00 committed by GitHub
commit f7b60f3da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -200,6 +200,11 @@ export class PoolRankingComponent implements OnInit {
}
prepareChartOptions(miningStats) {
let pieSize = ['20%', '80%']; // Desktop
if (this.isMobile() && !this.widget) {
pieSize = ['15%', '60%'];
}
this.chartOptions = {
animation: false,
color: chartColors,
@ -215,7 +220,7 @@ export class PoolRankingComponent implements OnInit {
minShowLabelAngle: 3.6,
name: 'Mining pool',
type: 'pie',
radius: ['20%', '80%'],
radius: pieSize,
data: this.generatePoolsChartSerieData(miningStats),
labelLine: {
lineStyle: {
@ -224,6 +229,7 @@ export class PoolRankingComponent implements OnInit {
},
label: {
fontSize: 14,
formatter: (serie) => `${serie.name === 'Binance Pool' ? 'Binance\nPool' : serie.name}`,
},
itemStyle: {
borderRadius: 1,

View File

@ -57,7 +57,7 @@ export class MiningService {
// I think it's fine to hardcode this since we don't have x1000 hashrate jump everyday
// If we want to support the mining dashboard for testnet, we can hardcode it too
let selectedPower = 15;
let selectedPower = 18;
if (this.stateService.network === 'testnet') {
selectedPower = 12;
}