From fa5f75887588aa9fa08d78f02453e1204bc2ae9f Mon Sep 17 00:00:00 2001 From: Mononaut Date: Fri, 2 Aug 2024 16:44:36 +0000 Subject: [PATCH] adjust pie colors to handle more pools --- .../active-acceleration-box.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/components/acceleration/active-acceleration-box/active-acceleration-box.component.ts b/frontend/src/app/components/acceleration/active-acceleration-box/active-acceleration-box.component.ts index 46ba12816..7506fb6fc 100644 --- a/frontend/src/app/components/acceleration/active-acceleration-box/active-acceleration-box.component.ts +++ b/frontend/src/app/components/acceleration/active-acceleration-box/active-acceleration-box.component.ts @@ -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 totalAcceleratedHashrate = acceleratingPools.reduce((total, pool) => total + pools[pool].lastEstimatedHashrate, 0); + const lightenStep = acceleratingPools.length ? (0.48 / acceleratingPools.length) : 0; acceleratingPools.forEach((poolId, index) => { const pool = pools[poolId]; const poolShare = ((pool.lastEstimatedHashrate / this.miningStats.lastEstimatedHashrate) * 100).toFixed(1); data.push(getDataItem( pool.lastEstimatedHashrate, - toRGB(lighten({ r: 147, g: 57, b: 244 }, index * .08)), + toRGB(lighten({ r: 147, g: 57, b: 244 }, index * lightenStep)), `${pool.name} (${poolShare}%)`, true, ) as PieSeriesOption);