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 monthly = buildMonthlyTimeline(phases, commPct);
|
||||||
|
const actualPeople = Math.max(numPeople, 1);
|
||||||
let tRows = '';
|
let tRows = '';
|
||||||
let runningCum = 0;
|
let runningCum = 0;
|
||||||
for (const m of monthly) {
|
for (const m of monthly) {
|
||||||
const actualPeople = Math.max(numPeople, 1);
|
|
||||||
runningCum += m.comm * actualPeople;
|
runningCum += m.comm * actualPeople;
|
||||||
tRows += `<tr>
|
tRows += `<tr>
|
||||||
<td>Month ${m.m}</td>
|
<td>Month ${m.m}</td>
|
||||||
@@ -1845,7 +1845,7 @@ ${numPeople > 0 ? `
|
|||||||
datasets: [
|
datasets: [
|
||||||
{
|
{
|
||||||
label: 'Their Profit',
|
label: 'Their Profit',
|
||||||
data: monthly.map(m => m.prof * numPeople),
|
data: monthly.map(m => m.prof),
|
||||||
backgroundColor: 'rgba(0,214,143,0.4)',
|
backgroundColor: 'rgba(0,214,143,0.4)',
|
||||||
borderColor: '#00d68f',
|
borderColor: '#00d68f',
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
@@ -1853,7 +1853,7 @@ ${numPeople > 0 ? `
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Your Commission',
|
label: 'Your Commission',
|
||||||
data: monthly.map(m => m.comm * numPeople),
|
data: monthly.map(m => m.comm * actualPeople),
|
||||||
backgroundColor: 'rgba(108,92,231,0.5)',
|
backgroundColor: 'rgba(108,92,231,0.5)',
|
||||||
borderColor: '#6c5ce7',
|
borderColor: '#6c5ce7',
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user