Fix profit timeline chart bars showing zero — remove numPeople multiplier on bar datasets
This commit is contained in:
+3
-3
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user