Merge pull request #5401 from mempool/mononaut/acc-pie-colors
adjust pie colors to handle more pools
This commit is contained in:
		
						commit
						f782693b26
					
				| @ -67,12 +67,13 @@ export class ActiveAccelerationBox implements OnChanges { | |||||||
| 
 | 
 | ||||||
|     const acceleratingPools = (poolList || []).filter(id => pools[id]).sort((a,b) => pools[a].lastEstimatedHashrate - pools[b].lastEstimatedHashrate); |     const acceleratingPools = (poolList || []).filter(id => pools[id]).sort((a,b) => pools[a].lastEstimatedHashrate - pools[b].lastEstimatedHashrate); | ||||||
|     const totalAcceleratedHashrate = acceleratingPools.reduce((total, pool) => total + pools[pool].lastEstimatedHashrate, 0); |     const totalAcceleratedHashrate = acceleratingPools.reduce((total, pool) => total + pools[pool].lastEstimatedHashrate, 0); | ||||||
|  |     const lightenStep = acceleratingPools.length ? (0.48 / acceleratingPools.length) : 0; | ||||||
|     acceleratingPools.forEach((poolId, index) => { |     acceleratingPools.forEach((poolId, index) => { | ||||||
|       const pool = pools[poolId]; |       const pool = pools[poolId]; | ||||||
|       const poolShare = ((pool.lastEstimatedHashrate / this.miningStats.lastEstimatedHashrate) * 100).toFixed(1); |       const poolShare = ((pool.lastEstimatedHashrate / this.miningStats.lastEstimatedHashrate) * 100).toFixed(1); | ||||||
|       data.push(getDataItem( |       data.push(getDataItem( | ||||||
|         pool.lastEstimatedHashrate, |         pool.lastEstimatedHashrate, | ||||||
|         toRGB(lighten({ r: 147, g: 57, b: 244 }, index * .08)), |         toRGB(lighten({ r: 147, g: 57, b: 244 }, index * lightenStep)), | ||||||
|         `<b style="color: white">${pool.name} (${poolShare}%)</b>`, |         `<b style="color: white">${pool.name} (${poolShare}%)</b>`, | ||||||
|         true, |         true, | ||||||
|       ) as PieSeriesOption); |       ) as PieSeriesOption); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user