Fix scenario comparison chart showing zeros — use actualPeople for compare chart data
This commit is contained in:
+2
-2
@@ -1931,13 +1931,13 @@ ${numPeople > 0 ? `
|
|||||||
|
|
||||||
const ctx3 = document.getElementById('compareChart').getContext('2d');
|
const ctx3 = document.getElementById('compareChart').getContext('2d');
|
||||||
const compareLabels = SCENARIOS.map(s => s.label.replace('$', '').replace('(', '').replace(')', ''));
|
const compareLabels = SCENARIOS.map(s => s.label.replace('$', '').replace('(', '').replace(')', ''));
|
||||||
const compareData = SCENARIOS.map(s => Math.round(s.yr1 * mult * numPeople));
|
const compareData = SCENARIOS.map(s => Math.round(s.yr1 * mult * actualPeople));
|
||||||
chart3 = new Chart(ctx3, {
|
chart3 = new Chart(ctx3, {
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
data: {
|
data: {
|
||||||
labels: compareLabels,
|
labels: compareLabels,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: `Year 1 Earnings (${numPeople} people)`,
|
label: `Year 1 Earnings (${actualPeople} person${actualPeople > 1 ? 's' : ''})`,
|
||||||
data: compareData,
|
data: compareData,
|
||||||
backgroundColor: compareData.map((v, i) => {
|
backgroundColor: compareData.map((v, i) => {
|
||||||
const ids = [`gift${giftLevel}`, `self${selfLevel}`];
|
const ids = [`gift${giftLevel}`, `self${selfLevel}`];
|
||||||
|
|||||||
Reference in New Issue
Block a user