Dscr Calculator Rental Property

DSCR Calculator Rental Property – Calculate Your Debt Service Coverage Ratio :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –card-background: #fff; –error-color: #dc3545; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; } .container { max-width: 960px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); } h1, h2, h3 { color: var(–primary-color); text-align: center; } h1 { margin-bottom: 10px; } h2 { margin-top: 30px; margin-bottom: 15px; border-bottom: 2px solid var(–primary-color); padding-bottom: 5px; } h3 { margin-top: 20px; margin-bottom: 10px; } .loan-calc-container { background-color: var(–card-background); padding: 25px; border-radius: 8px; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08); margin-bottom: 30px; } .input-group { margin-bottom: 20px; text-align: left; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group input[type="text"], .input-group select { width: calc(100% – 22px); padding: 10px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1rem; box-sizing: border-box; } .input-group input[type="number"]:focus, .input-group input[type="text"]:focus, .input-group select:focus { outline: none; border-color: var(–primary-color); box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85em; color: #6c757d; margin-top: 5px; display: block; } .error-message { color: var(–error-color); font-size: 0.85em; margin-top: 5px; display: none; /* Hidden by default */ } .error-message.visible { display: block; } .button-group { display: flex; justify-content: space-between; margin-top: 25px; gap: 10px; } .button-group button { padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 1rem; font-weight: bold; transition: background-color 0.3s ease; } .btn-calculate { background-color: var(–primary-color); color: white; flex-grow: 1; } .btn-calculate:hover { background-color: #003366; } .btn-reset { background-color: #6c757d; color: white; } .btn-reset:hover { background-color: #5a6268; } .btn-copy { background-color: #17a2b8; color: white; } .btn-copy:hover { background-color: #138496; } #results { margin-top: 30px; padding: 20px; background-color: var(–primary-color); color: white; border-radius: 8px; text-align: center; box-shadow: 0 2px 8px rgba(0, 74, 153, 0.3); } #results h3 { color: white; margin-top: 0; margin-bottom: 15px; } #results .main-result { font-size: 2.5em; font-weight: bold; margin-bottom: 15px; display: block; } #results .intermediate-values div { margin-bottom: 8px; font-size: 1.1em; } #results .formula-explanation { font-size: 0.9em; margin-top: 15px; opacity: 0.8; } table { width: 100%; border-collapse: collapse; margin-top: 20px; margin-bottom: 30px; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08); } th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(–border-color); } thead { background-color: var(–primary-color); color: white; } th { font-weight: bold; } tbody tr:nth-child(even) { background-color: #f2f2f2; } caption { font-size: 1.1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; text-align: left; } canvas { display: block; margin: 20px auto; background-color: var(–card-background); border-radius: 4px; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08); } .chart-container { text-align: center; margin-top: 30px; } .chart-caption { font-size: 0.9em; color: #6c757d; margin-top: 5px; } .article-section { margin-top: 40px; padding-top: 20px; border-top: 1px solid #eee; } .article-section h2 { text-align: left; border-bottom: none; margin-bottom: 15px; } .article-section h3 { text-align: left; margin-top: 25px; margin-bottom: 10px; color: var(–primary-color); } .article-section p, .article-section ul, .article-section ol { margin-bottom: 15px; } .article-section ul, .article-section ol { padding-left: 20px; } .article-section li { margin-bottom: 8px; } .faq-item { margin-bottom: 15px; padding: 10px; border: 1px solid #e0e0e0; border-radius: 4px; background-color: #fdfdfd; } .faq-item h3 { margin: 0; font-size: 1.1em; cursor: pointer; color: var(–primary-color); text-align: left; } .faq-item p { margin-top: 10px; margin-bottom: 0; font-size: 0.95em; display: none; /* Hidden by default */ } .faq-item.open p { display: block; } .internal-links ul { list-style: none; padding: 0; } .internal-links li { margin-bottom: 10px; } .internal-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .internal-links a:hover { text-decoration: underline; } .internal-links span { font-size: 0.9em; color: #6c757d; display: block; margin-top: 3px; } .highlight { background-color: var(–success-color); color: white; padding: 2px 5px; border-radius: 3px; font-weight: bold; } .text-muted { color: #6c757d; }

DSCR Calculator Rental Property

Calculate your rental property's Debt Service Coverage Ratio (DSCR) to assess its financial health and loan repayment capacity.

Rental Property DSCR Calculator

Total expected income from rent per year.
Includes property taxes, insurance, maintenance, property management fees, etc. (excluding mortgage payments).
Total annual payments for mortgage principal and interest.
Any other annual debt payments related to the property (e.g., HELOC).

Your Rental Property DSCR

Net Operating Income (NOI): —
Total Debt Service: —
DSCR = NOI / Total Debt Service
DSCR Comparison: Net Operating Income vs. Total Debt Service
DSCR Calculation Breakdown
Metric Value Unit
Annual Rental Income Currency
Annual Operating Expenses Currency
Net Operating Income (NOI) Currency
Annual Mortgage P&I Currency
Annual Other Debt Service Currency
Total Debt Service Currency
Debt Service Coverage Ratio (DSCR) Ratio

What is DSCR for Rental Properties?

The Debt Service Coverage Ratio (DSCR) for a rental property is a crucial financial metric that lenders and investors use to evaluate a property's ability to generate enough income to cover its debt obligations. In simpler terms, it measures how many times the property's net operating income can pay for its annual debt payments, including mortgage principal and interest, and any other associated debts.

A DSCR of 1.0 means the property's income exactly covers its debt payments. A DSCR greater than 1.0 indicates that the property generates more income than needed to cover its debts, providing a buffer. Conversely, a DSCR less than 1.0 signifies that the property's income is insufficient to cover its debt obligations, posing a risk to lenders and investors.

Who Should Use a DSCR Calculator?

  • Real Estate Investors: To assess the viability of a potential rental property investment and its cash flow potential.
  • Lenders: To determine the risk associated with lending money for a rental property and to ensure loan repayment capacity.
  • Property Owners: To monitor the financial health of their existing rental properties and identify areas for improvement.
  • Syndicators and Fund Managers: To evaluate the performance of portfolios and individual assets.

Common Misconceptions about DSCR

  • DSCR is the same as Cash-on-Cash Return: While related to cash flow, DSCR specifically focuses on debt repayment capacity, not the investor's overall return on their invested capital.
  • A DSCR of 1.0 is always acceptable: Many lenders require a DSCR significantly above 1.0 (e.g., 1.20 or 1.25) to provide a safety margin.
  • Only applies to commercial properties: While more common in commercial real estate, DSCR is increasingly important for multi-family and even single-family rental properties seeking financing.

DSCR Formula and Mathematical Explanation

The Debt Service Coverage Ratio (DSCR) is calculated by dividing the Net Operating Income (NOI) of a rental property by its Total Debt Service (TDS). Understanding each component is key to interpreting the ratio accurately.

The Core Formula:

DSCR = Net Operating Income (NOI) / Total Debt Service (TDS)

Step-by-Step Derivation:

  1. Calculate Net Operating Income (NOI): This is the property's gross rental income minus all operating expenses. Operating expenses typically include property taxes, insurance, property management fees, repairs, maintenance, utilities (if paid by owner), and vacancy reserves. Crucially, NOI *excludes* mortgage payments (principal and interest) and depreciation.
  2. Calculate Total Debt Service (TDS): This is the sum of all annual debt obligations related to the property. For most rental properties, this primarily includes the annual principal and interest payments on the mortgage. It may also include payments on other loans secured by the property, such as a second mortgage or a home equity line of credit (HELOC).
  3. Divide NOI by TDS: The resulting number is the DSCR.

Variable Explanations:

  • Annual Rental Income: The total amount of rent collected from tenants over a 12-month period.
  • Annual Operating Expenses: Costs associated with running and maintaining the property, excluding debt service.
  • Net Operating Income (NOI): Annual Rental Income – Annual Operating Expenses.
  • Annual Mortgage Principal & Interest (P&I): The sum of principal and interest payments made on the primary mortgage loan over a year.
  • Annual Other Debt Service: Payments on any additional loans secured by the property.
  • Total Debt Service (TDS): Annual Mortgage P&I + Annual Other Debt Service.

Variables Table:

Variable Meaning Unit Typical Range
Annual Rental Income Gross income from rent Currency Varies widely based on location and property type
Annual Operating Expenses Costs to run the property (excl. debt) Currency 15% – 50% of Gross Rental Income
Net Operating Income (NOI) Profit before debt service Currency Gross Rental Income – Operating Expenses
Annual Mortgage P&I Mortgage loan payments Currency Depends on loan amount, interest rate, term
Annual Other Debt Service Other loan payments Currency 0 to significant, depending on financing structure
Total Debt Service (TDS) All annual debt payments Currency Mortgage P&I + Other Debt Service
DSCR Ability to cover debt payments Ratio Typically 1.0 to 1.5+ (higher is better)

Practical Examples (Real-World Use Cases)

Let's illustrate how the DSCR calculator works with practical scenarios for rental properties.

Example 1: A Promising Single-Family Rental

An investor is considering purchasing a single-family home to rent out. They've gathered the following estimates:

  • Annual Rental Income: $48,000
  • Annual Operating Expenses (Taxes, Insurance, Maintenance, Management): $15,000
  • Annual Mortgage Principal & Interest: $22,000
  • Annual Other Debt Service: $0

Calculation:

  • NOI = $48,000 (Income) – $15,000 (Expenses) = $33,000
  • TDS = $22,000 (Mortgage P&I) + $0 (Other Debt) = $22,000
  • DSCR = $33,000 (NOI) / $22,000 (TDS) = 1.50

Interpretation: A DSCR of 1.50 is excellent. It means the property is projected to generate 1.5 times the income needed to cover its annual debt payments. This indicates a strong investment with a good safety margin, likely attractive to lenders.

Example 2: A Multi-Family Property with Higher Leverage

An investor is looking at a small apartment building. They anticipate higher income but also higher debt due to the purchase price.

  • Annual Rental Income: $120,000
  • Annual Operating Expenses (Taxes, Insurance, Management, Repairs): $45,000
  • Annual Mortgage Principal & Interest: $65,000
  • Annual Other Debt Service (HELOC): $5,000

Calculation:

  • NOI = $120,000 (Income) – $45,000 (Expenses) = $75,000
  • TDS = $65,000 (Mortgage P&I) + $5,000 (Other Debt) = $70,000
  • DSCR = $75,000 (NOI) / $70,000 (TDS) ≈ 1.07

Interpretation: A DSCR of approximately 1.07 is acceptable but tight. It shows the property can cover its debts, but there's very little room for error. Unexpected vacancies, higher-than-anticipated repairs, or increased operating costs could quickly push the DSCR below 1.0, making it difficult to service the debt. Lenders might require a higher DSCR or additional collateral.

How to Use This DSCR Calculator for Rental Properties

Our free online DSCR calculator is designed for ease of use, providing quick insights into your rental property's financial viability. Follow these simple steps:

Step-by-Step Instructions:

  1. Gather Property Financial Data: Before using the calculator, collect accurate figures for your rental property. This includes projected annual rental income, estimated annual operating expenses (property taxes, insurance, maintenance, property management fees, etc.), and the total annual mortgage principal and interest payments. If there are any other loans secured by the property, gather those annual payments too.
  2. Input Annual Rental Income: Enter the total amount you expect to receive from rent over a full year into the "Annual Rental Income" field.
  3. Input Annual Operating Expenses: Enter the sum of all costs associated with operating and maintaining the property, *excluding* mortgage payments.
  4. Input Annual Mortgage Principal & Interest: Enter the total amount of principal and interest you will pay on your primary mortgage over one year.
  5. Input Annual Other Debt Service: If applicable, enter the total annual payments for any other loans secured by the property. If there are no other debts, leave this at 0.
  6. Click "Calculate DSCR": Once all fields are populated with accurate data, click the "Calculate DSCR" button.

How to Read the Results:

  • Main Result (DSCR): This is the most important number. It's displayed prominently and indicates the property's debt coverage.
    • DSCR > 1.25: Generally considered strong. Indicates a healthy buffer and good loan repayment capacity.
    • DSCR between 1.10 and 1.25: Acceptable, but may be considered borderline by some lenders.
    • DSCR between 1.0 and 1.10: Tight. Minimal buffer, higher risk of default if income drops or expenses rise.
    • DSCR < 1.0: Unsustainable. The property is not generating enough income to cover its debts.
  • Intermediate Values: The calculator also shows your Net Operating Income (NOI) and Total Debt Service (TDS). These help you understand the components driving the DSCR.
  • Formula Explanation: A reminder of the basic formula (DSCR = NOI / TDS) is provided for clarity.
  • Chart: The dynamic chart visually compares your NOI against your Total Debt Service, offering an intuitive understanding of the margin.
  • Table: A detailed breakdown of all input values and calculated metrics is presented in a table for easy review and verification.

Decision-Making Guidance:

Use the DSCR result to inform your investment decisions:

  • Acquisition: If the DSCR is too low for a potential investment, consider negotiating the purchase price, seeking better financing terms, or re-evaluating the projected income and expenses.
  • Refinancing: A strong DSCR can improve your chances of securing favorable refinancing terms. A low DSCR might indicate that refinancing is necessary to improve cash flow or reduce risk.
  • Property Management: For existing properties, a declining DSCR could signal a need to increase rents, reduce operating costs, or address deferred maintenance.

Key Factors That Affect DSCR Results

Several variables significantly influence the Debt Service Coverage Ratio of a rental property. Understanding these factors is crucial for accurate forecasting and effective property management.

  1. Rental Income Stability and Growth: The most direct factor. Consistent, reliable rental income is paramount. Factors like tenant quality, lease terms, market demand, and rental rate competitiveness directly impact this. Unexpected vacancies or rent concessions can drastically reduce income and lower DSCR.
  2. Operating Expense Management: Controlling costs like property taxes, insurance premiums, maintenance, and repairs is vital. Unexpected large expenses (e.g., major roof repair, HVAC failure) can significantly reduce NOI. Proactive maintenance can mitigate these risks.
  3. Financing Structure (Leverage): The amount of debt taken on has a huge impact. Higher loan amounts mean higher principal and interest payments, increasing Total Debt Service (TDS) and thus lowering DSCR, assuming NOI remains constant. Investors must balance leverage for potential returns against the risk of insufficient cash flow.
  4. Interest Rates: For variable-rate loans or when refinancing, changes in interest rates directly affect the P&I payments. Higher interest rates increase TDS, lowering the DSCR. This highlights the importance of securing favorable, fixed rates where possible.
  5. Property Management Efficiency: Effective property management can optimize rental income (e.g., minimizing vacancies, setting competitive rents) and control operating expenses. Poor management can lead to lost income and inflated costs, negatively impacting DSCR.
  6. Economic Conditions and Market Trends: Broader economic factors like inflation, local job growth, and housing market demand influence rental rates and vacancy rates. A recession could lead to lower rents and higher vacancies, reducing NOI and DSCR.
  7. Capital Expenditures vs. Operating Expenses: While routine maintenance is an operating expense, major capital improvements (e.g., a new roof, significant renovations) are often capitalized. How these are accounted for and financed can indirectly affect cash flow available for debt service.
  8. Inflation: Inflation can increase operating expenses (taxes, insurance, materials for repairs) faster than rental income, squeezing NOI and reducing DSCR over time if rents cannot be adjusted accordingly.

Frequently Asked Questions (FAQ)

What is a good DSCR for a rental property?

A DSCR of 1.20 or higher is generally considered good by most lenders, indicating a healthy buffer. A DSCR of 1.0 means the income exactly covers the debt. Anything below 1.0 is a concern, as the property isn't generating enough income to pay its debts.

Does DSCR include principal payments?

Yes, the Debt Service Coverage Ratio (DSCR) calculation typically includes both the principal and interest portions of mortgage payments, as well as any other debt service payments related to the property. This is because both principal repayment and interest are obligations that must be met from the property's income.

How is Net Operating Income (NOI) different from Net Profit?

NOI is calculated before debt service, depreciation, and income taxes. Net Profit (or Net Cash Flow) is calculated after all expenses, including debt service, depreciation, and taxes. DSCR uses NOI because it focuses specifically on the property's ability to cover its operational and debt costs, independent of the owner's tax situation or financing structure.

Can DSCR be negative?

Yes, a DSCR can be negative if the Total Debt Service (TDS) is positive and the Net Operating Income (NOI) is negative. This occurs when the property's operating expenses exceed its rental income, meaning it's losing money even before considering any debt payments. A negative DSCR is a critical red flag.

How often should I calculate DSCR?

You should calculate DSCR whenever you are considering acquiring a new rental property. For existing properties, it's advisable to calculate it at least annually, or whenever significant changes occur, such as a rent increase, a major expense, a change in financing, or a shift in market conditions.

What if my DSCR is exactly 1.0?

A DSCR of 1.0 means the property's net operating income precisely covers its total debt service. While technically not a loss, it leaves no room for error. Any unexpected vacancy, repair, or increase in operating costs could lead to a negative cash flow situation. Lenders typically require a DSCR above 1.0, often 1.20 or higher.

Does DSCR account for capital expenditures?

Standard DSCR calculation typically excludes major capital expenditures (CapEx) like a new roof or HVAC system from operating expenses. However, some lenders may require a modified DSCR that includes an allowance for CapEx reserves. It's important to budget separately for CapEx, as these costs can significantly impact overall profitability and cash flow.

How does DSCR differ from the Loan-to-Value (LTV) ratio?

LTV is a measure of the loan amount relative to the property's value, indicating the lender's risk based on collateral. DSCR, on the other hand, measures the property's income-generating ability to cover the debt payments, indicating the lender's risk based on cash flow. Both are critical metrics in real estate finance.

Related Tools and Internal Resources

© 2023 Your Financial Website. All rights reserved.

var annualRentalIncomeInput = document.getElementById('annualRentalIncome'); var annualOperatingExpensesInput = document.getElementById('annualOperatingExpenses'); var annualMortgagePrincipalAndInterestInput = document.getElementById('annualMortgagePrincipalAndInterest'); var annualOtherDebtServiceInput = document.getElementById('annualOtherDebtService'); var annualRentalIncomeError = document.getElementById('annualRentalIncomeError'); var annualOperatingExpensesError = document.getElementById('annualOperatingExpensesError'); var annualMortgagePrincipalAndInterestError = document.getElementById('annualMortgagePrincipalAndInterestError'); var annualOtherDebtServiceError = document.getElementById('annualOtherDebtServiceError'); var mainResultSpan = document.getElementById('mainResult'); var netOperatingIncomeSpan = document.getElementById('netOperatingIncome'); var totalDebtServiceSpan = document.getElementById('totalDebtService'); var dscrExplanationSpan = document.getElementById('dscrExplanation'); var tableAnnualRentalIncome = document.getElementById('tableAnnualRentalIncome'); var tableAnnualOperatingExpenses = document.getElementById('tableAnnualOperatingExpenses'); var tableNOI = document.getElementById('tableNOI'); var tableAnnualMortgagePI = document.getElementById('tableAnnualMortgagePI'); var tableAnnualOtherDebt = document.getElementById('tableAnnualOtherDebt'); var tableTotalDebtService = document.getElementById('tableTotalDebtService'); var tableDSCR = document.getElementById('tableDSCR'); var chart; var chartInstance = null; // To hold the Chart.js instance function formatCurrency(value) { if (isNaN(value) || value === null) return '–'; return '$' + value.toFixed(0).replace(/\d(?=(\d{3})+$)/g, '$&,'); } function formatRatio(value) { if (isNaN(value) || value === null) return '–'; return value.toFixed(2); } function validateInput(inputElement, errorElement, minValue = 0) { var value = parseFloat(inputElement.value); var isValid = true; if (isNaN(value)) { errorElement.textContent = "Please enter a valid number."; errorElement.classList.add('visible'); isValid = false; } else if (value 0) { dscr = netOperatingIncome / totalDebtService; } else if (netOperatingIncome >= 0) { dscr = Infinity; // Or a very large number if preferred } else { dscr = -Infinity; // Or a very small negative number } mainResultSpan.textContent = formatRatio(dscr); netOperatingIncomeSpan.textContent = "Net Operating Income (NOI): " + formatCurrency(netOperatingIncome); totalDebtServiceSpan.textContent = "Total Debt Service: " + formatCurrency(totalDebtService); dscrExplanationSpan.textContent = "DSCR = " + formatCurrency(netOperatingIncome) + " / " + formatCurrency(totalDebtService); tableAnnualRentalIncome.textContent = formatCurrency(annualRentalIncome); tableAnnualOperatingExpenses.textContent = formatCurrency(annualOperatingExpenses); tableNOI.textContent = formatCurrency(netOperatingIncome); tableAnnualMortgagePI.textContent = formatCurrency(annualMortgagePrincipalAndInterest); tableAnnualOtherDebt.textContent = formatCurrency(annualOtherDebtService); tableTotalDebtService.textContent = formatCurrency(totalDebtService); tableDSCR.textContent = formatRatio(dscr); updateChart(netOperatingIncome, totalDebtService); } function resetResults() { mainResultSpan.textContent = '–'; netOperatingIncomeSpan.textContent = 'Net Operating Income (NOI): –'; totalDebtServiceSpan.textContent = 'Total Debt Service: –'; dscrExplanationSpan.textContent = 'DSCR = NOI / Total Debt Service'; tableAnnualRentalIncome.textContent = '–'; tableAnnualOperatingExpenses.textContent = '–'; tableNOI.textContent = '–'; tableAnnualMortgagePI.textContent = '–'; tableAnnualOtherDebt.textContent = '–'; tableTotalDebtService.textContent = '–'; tableDSCR.textContent = '–'; if (chartInstance) { chartInstance.destroy(); chartInstance = null; } var canvas = document.getElementById('dscrChart'); var ctx = canvas.getContext('2d'); ctx.clearRect(0, 0, canvas.width, canvas.height); } function resetCalculator() { annualRentalIncomeInput.value = '60000'; annualOperatingExpensesInput.value = '20000'; annualMortgagePrincipalAndInterestInput.value = '30000'; annualOtherDebtServiceInput.value = '0'; annualRentalIncomeError.textContent = ""; annualRentalIncomeError.classList.remove('visible'); annualOperatingExpensesError.textContent = ""; annualOperatingExpensesError.classList.remove('visible'); annualMortgagePrincipalAndInterestError.textContent = ""; annualMortgagePrincipalAndInterestError.classList.remove('visible'); annualOtherDebtServiceError.textContent = ""; annualOtherDebtServiceError.classList.remove('visible'); resetResults(); } function copyResults() { var resultsText = "Rental Property DSCR Results:\n\n"; resultsText += "DSCR: " + mainResultSpan.textContent + "\n"; resultsText += netOperatingIncomeSpan.textContent + "\n"; resultsText += totalDebtServiceSpan.textContent + "\n"; resultsText += dscrExplanationSpan.textContent + "\n\n"; resultsText += "Key Assumptions:\n"; resultsText += "- Annual Rental Income: " + tableAnnualRentalIncome.textContent + "\n"; resultsText += "- Annual Operating Expenses: " + tableAnnualOperatingExpenses.textContent + "\n"; resultsText += "- Annual Mortgage P&I: " + tableAnnualMortgagePI.textContent + "\n"; resultsText += "- Annual Other Debt Service: " + tableAnnualOtherDebt.textContent + "\n"; var textArea = document.createElement("textarea"); textArea.value = resultsText; document.body.appendChild(textArea); textArea.select(); try { document.execCommand('copy'); alert('Results copied to clipboard!'); } catch (err) { console.error('Unable to copy results.', err); alert('Failed to copy results. Please copy manually.'); } document.body.removeChild(textArea); } function updateChart(noi, tds) { var canvas = document.getElementById('dscrChart'); var ctx = canvas.getContext('2d'); // Destroy previous chart instance if it exists if (chartInstance) { chartInstance.destroy(); } chartInstance = new Chart(ctx, { type: 'bar', data: { labels: ['NOI vs. TDS'], datasets: [{ label: 'Net Operating Income (NOI)', data: [noi], backgroundColor: 'rgba(0, 74, 153, 0.6)', borderColor: 'rgba(0, 74, 153, 1)', borderWidth: 1 }, { label: 'Total Debt Service (TDS)', data: [tds], backgroundColor: 'rgba(255, 99, 132, 0.6)', borderColor: 'rgba(255, 99, 132, 1)', borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, title: { display: true, text: 'Amount (Currency)' } } }, plugins: { legend: { position: 'top', }, title: { display: true, text: 'Net Operating Income vs. Total Debt Service' } } } }); } function toggleFaq(element) { var parent = element.parentElement; parent.classList.toggle('open'); } // Initial calculation on load document.addEventListener('DOMContentLoaded', function() { calculateDSCR(); });

Leave a Comment