remove loan from some charts
This commit is contained in:
parent
410aa7e112
commit
469f7af7a4
1 changed files with 19 additions and 21 deletions
|
|
@ -32,7 +32,7 @@ class ChartManager {
|
|||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
legend: { position: 'top' },
|
||||
title: { display: true, text: 'ROI Progression Over Time' }
|
||||
title: { display: true, text: 'ROI Progression Over Time - Direct Investment Only' }
|
||||
},
|
||||
scales: {
|
||||
y: {
|
||||
|
|
@ -65,7 +65,7 @@ class ChartManager {
|
|||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
legend: { position: 'top' },
|
||||
title: { display: true, text: 'Net Financial Position (Break-Even Analysis)' }
|
||||
title: { display: true, text: 'Net Financial Position - Direct Investment Only' }
|
||||
},
|
||||
scales: {
|
||||
y: {
|
||||
|
|
@ -252,21 +252,20 @@ class ChartManager {
|
|||
const maxMonths = Math.max(...scenarios.map(s => this.calculator.monthlyData[s].length));
|
||||
const monthLabels = Array.from({ length: maxMonths }, (_, i) => `M${i + 1}`);
|
||||
|
||||
// Update ROI Progression Chart with both models
|
||||
// Update ROI Progression Chart - Direct Investment Only
|
||||
this.charts.roiProgression.data.labels = monthLabels;
|
||||
this.charts.roiProgression.data.datasets = scenarios.filter(s => this.calculator.results[s]).map(scenario => {
|
||||
const scenarioBase = scenario.replace('_direct', '').replace('_loan', '');
|
||||
const model = scenario.includes('_loan') ? 'loan' : 'direct';
|
||||
const isDirect = model === 'direct';
|
||||
this.charts.roiProgression.data.datasets = scenarios.filter(s =>
|
||||
this.calculator.results[s] && s.includes('_direct')
|
||||
).map(scenario => {
|
||||
const scenarioBase = scenario.replace('_direct', '');
|
||||
const scenarioName = this.calculator.scenarios[scenarioBase]?.name || scenarioBase;
|
||||
|
||||
return {
|
||||
label: `${scenarioName} (${model.charAt(0).toUpperCase() + model.slice(1)})`,
|
||||
label: `${scenarioName}`,
|
||||
data: this.calculator.monthlyData[scenario].map(d => d.roiPercent),
|
||||
borderColor: colors[scenarioBase],
|
||||
backgroundColor: colors[scenarioBase] + (isDirect ? '30' : '15'),
|
||||
borderDash: isDirect ? [] : [5, 5],
|
||||
borderWidth: isDirect ? 3 : 2,
|
||||
backgroundColor: colors[scenarioBase] + '30',
|
||||
borderWidth: 3,
|
||||
tension: 0.4,
|
||||
pointBackgroundColor: this.calculator.monthlyData[scenario].map(d =>
|
||||
d.roiPercent >= 0 ? colors[scenarioBase] : '#dc3545'
|
||||
|
|
@ -275,25 +274,24 @@ class ChartManager {
|
|||
});
|
||||
this.charts.roiProgression.update();
|
||||
|
||||
// Update Net Position Chart (Break-Even Analysis) with both models
|
||||
// Update Net Position Chart (Break-Even Analysis) - Direct Investment Only
|
||||
this.charts.netPosition.data.labels = monthLabels;
|
||||
this.charts.netPosition.data.datasets = scenarios.filter(s => this.calculator.results[s]).map(scenario => {
|
||||
const scenarioBase = scenario.replace('_direct', '').replace('_loan', '');
|
||||
const model = scenario.includes('_loan') ? 'loan' : 'direct';
|
||||
const isDirect = model === 'direct';
|
||||
this.charts.netPosition.data.datasets = scenarios.filter(s =>
|
||||
this.calculator.results[s] && s.includes('_direct')
|
||||
).map(scenario => {
|
||||
const scenarioBase = scenario.replace('_direct', '');
|
||||
const scenarioName = this.calculator.scenarios[scenarioBase]?.name || scenarioBase;
|
||||
|
||||
return {
|
||||
label: `${scenarioName} (${model.charAt(0).toUpperCase() + model.slice(1)}) Net Position`,
|
||||
label: `${scenarioName} Net Position`,
|
||||
data: this.calculator.monthlyData[scenario].map(d => d.netPosition),
|
||||
borderColor: colors[scenarioBase],
|
||||
backgroundColor: colors[scenarioBase] + (isDirect ? '30' : '15'),
|
||||
borderDash: isDirect ? [] : [5, 5],
|
||||
borderWidth: isDirect ? 3 : 2,
|
||||
backgroundColor: colors[scenarioBase] + '30',
|
||||
borderWidth: 3,
|
||||
tension: 0.4,
|
||||
fill: {
|
||||
target: 'origin',
|
||||
above: colors[scenarioBase] + (isDirect ? '20' : '10'),
|
||||
above: colors[scenarioBase] + '20',
|
||||
below: '#dc354510'
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue