diff --git a/static/predictions.html b/static/predictions.html index c3c9c73d0..6a2dcc92e 100644 --- a/static/predictions.html +++ b/static/predictions.html @@ -581,16 +581,45 @@ function renderPublicTrend() { {chair: 'C', amount: c, pct: c/total*100}, ].sort((x, y) => y.amount - x.amount); - el.innerHTML = renderTrendBars(ranked.slice(0, 2)); + // Count unique bettors per chair + const bettorCount = {A: 0, B: 0, C: 0}; + for (const rb of Object.values(roundBettors)) { + for (const ch of CHAIRS) if ((rb.chairs[ch] || 0) > 0) bettorCount[ch]++; + } + const totalBettors = Object.keys(roundBettors).length; + const bettorRanked = CHAIRS.map(c => ({chair: c, count: bettorCount[c], pct: totalBettors > 0 ? bettorCount[c] / totalBettors * 100 : 0})) + .sort((x, y) => y.count - x.count); + + let bettorHtml = ''; + if (totalBettors > 0) { + bettorHtml = `