Fix profit timeline chart bars showing zero — remove numPeople multiplier on bar datasets

This commit is contained in:
Marty Bostick
2026-07-29 22:32:35 +00:00
parent d537d166e2
commit f694910785
+3 -3
View File
@@ -1822,10 +1822,10 @@ ${numPeople > 0 ? `
});
const monthly = buildMonthlyTimeline(phases, commPct);
const actualPeople = Math.max(numPeople, 1);
let tRows = '';
let runningCum = 0;
for (const m of monthly) {
const actualPeople = Math.max(numPeople, 1);
runningCum += m.comm * actualPeople;
tRows += `<tr>
<td>Month ${m.m}</td>
@@ -1845,7 +1845,7 @@ ${numPeople > 0 ? `
datasets: [
{
label: 'Their Profit',
data: monthly.map(m => m.prof * numPeople),
data: monthly.map(m => m.prof),
backgroundColor: 'rgba(0,214,143,0.4)',
borderColor: '#00d68f',
borderWidth: 1,
@@ -1853,7 +1853,7 @@ ${numPeople > 0 ? `
},
{
label: 'Your Commission',
data: monthly.map(m => m.comm * numPeople),
data: monthly.map(m => m.comm * actualPeople),
backgroundColor: 'rgba(108,92,231,0.5)',
borderColor: '#6c5ce7',
borderWidth: 1,