How to Calculate Weighted Average Remaining Lease Term

How to Calculate Weighted Average Remaining Lease Term :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ddd; –input-border-color: #ccc; –shadow-color: rgba(0, 0, 0, 0.1); –card-background: #ffffff; –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; display: flex; justify-content: center; padding-top: 20px; padding-bottom: 20px; } .container { max-width: 960px; width: 100%; margin: 0 auto; background-color: var(–card-background); padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px var(–shadow-color); text-align: center; } h1, h2, h3 { color: var(–primary-color); margin-bottom: 15px; } h1 { font-size: 2.2em; margin-bottom: 25px; } h2 { font-size: 1.8em; border-bottom: 2px solid var(–primary-color); padding-bottom: 5px; margin-top: 30px; } h3 { font-size: 1.4em; margin-top: 20px; } .calculator-section { margin-bottom: 40px; padding: 25px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–card-background); box-shadow: 0 2px 10px var(–shadow-color); } .loan-calc-container { display: flex; flex-direction: column; gap: 20px; align-items: center; } .input-group { width: 100%; max-width: 400px; text-align: left; margin-bottom: 15px; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group select { width: calc(100% – 22px); padding: 12px; border: 1px solid var(–input-border-color); border-radius: 4px; font-size: 1em; box-sizing: border-box; } .input-group input[type="number"]:focus, .input-group select:focus { outline: none; border-color: var(–primary-color); box-shadow: 0 0 0 3px 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; height: 1.2em; /* Reserve space for error messages */ } .button-group { display: flex; justify-content: center; gap: 15px; margin-top: 25px; flex-wrap: wrap; } button { padding: 12px 25px; border: none; border-radius: 4px; font-size: 1em; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; font-weight: bold; } button.primary { background-color: var(–primary-color); color: white; } button.primary:hover { background-color: #003366; transform: translateY(-1px); } button.secondary { background-color: #6c757d; color: white; } button.secondary:hover { background-color: #5a6268; transform: translateY(-1px); } button.tertiary { background-color: var(–success-color); color: white; } button.tertiary:hover { background-color: #218838; transform: translateY(-1px); } #results { margin-top: 30px; padding: 25px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–background-color); box-shadow: 0 2px 10px var(–shadow-color); text-align: left; } #results h3 { margin-top: 0; color: var(–primary-color); text-align: center; } .result-item { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dashed var(–border-color); } .result-item:last-child { border-bottom: none; padding-bottom: 0; } .result-label { font-weight: bold; color: var(–primary-color); display: block; margin-bottom: 5px; } .result-value { font-size: 1.3em; font-weight: bold; color: var(–primary-color); } .primary-result .result-value { font-size: 1.8em; color: var(–success-color); background-color: #e9f7ef; padding: 10px 15px; border-radius: 5px; display: inline-block; margin-top: 5px; } .formula-explanation { font-size: 0.9em; color: #555; margin-top: 20px; padding: 15px; border-left: 4px solid var(–primary-color); background-color: #eef5fa; text-align: left; } table { width: 100%; border-collapse: collapse; margin-top: 25px; margin-bottom: 25px; box-shadow: 0 2px 8px var(–shadow-color); } th, td { padding: 12px 15px; text-align: left; border: 1px solid var(–border-color); } thead th { background-color: var(–primary-color); color: white; font-weight: bold; } tbody tr:nth-child(even) { background-color: #f2f2f2; } caption { font-size: 1.1em; font-weight: bold; margin-bottom: 10px; color: var(–primary-color); caption-side: top; text-align: left; } canvas { display: block; margin: 25px auto; border: 1px solid var(–border-color); border-radius: 4px; background-color: white; } .article-content { text-align: left; margin-top: 30px; font-size: 1.05em; color: #333; } .article-content p { margin-bottom: 15px; } .article-content a { color: var(–primary-color); text-decoration: none; } .article-content a:hover { text-decoration: underline; } .section-divider { height: 1px; background-color: var(–border-color); margin: 40px 0; } .faq-item { margin-bottom: 20px; padding: 15px; border: 1px solid var(–border-color); border-radius: 5px; background-color: var(–card-background); } .faq-item h4 { margin: 0 0 10px 0; color: var(–primary-color); cursor: pointer; display: flex; justify-content: space-between; align-items: center; } .faq-item h4::after { content: '+'; font-size: 1.4em; transition: transform 0.3s ease; } .faq-item.open h4::after { transform: rotate(45deg); } .faq-item .answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; font-size: 0.95em; color: #555; padding-top: 0; } .faq-item.open .answer { max-height: 200px; /* Adjust as needed */ padding-top: 15px; } #related-tools ul { list-style: none; padding: 0; } #related-tools li { margin-bottom: 10px; } #related-tools a { font-weight: bold; } @media (max-width: 768px) { .container { padding: 20px; } h1 { font-size: 1.8em; } h2 { font-size: 1.5em; } button { width: 100%; max-width: 200px; } .button-group { flex-direction: column; align-items: center; } }

How to Calculate Weighted Average Remaining Lease Term

Understand and calculate the weighted average remaining lease term (WARLT) with our easy-to-use tool. Essential for real estate investors, portfolio managers, and financial analysts.

Weighted Average Remaining Lease Term Calculator

Enter lease data as a JSON array of objects, each with "area" and "term" (in years). Example: [{"area": 1000, "term": 5}, {"area": 2500, "term": 10}]

Calculation Results

Weighted Average Remaining Lease Term (WARLT) Years
Total Leased Area Sq Units
Total Lease Value (Sum of Area * Term) Sq Unit-Years
Average Lease Term (Unweighted) Years
Formula Used:

The Weighted Average Remaining Lease Term (WARLT) is calculated by summing the product of each lease's area and its remaining term, and then dividing by the total leased area across all leases. Mathematically: WARLT = Σ (Areai * Termi) / Σ Areai

Lease Term Distribution

Distribution of remaining lease terms by leased area.

Individual Lease Details

Lease # Leased Area (Sq Units) Remaining Term (Years) Weighted Term (Area * Term)
Enter lease data and click "Calculate WARLT".

What is Weighted Average Remaining Lease Term (WARLT)?

The Weighted Average Remaining Lease Term (WARLT) is a critical financial metric used primarily in commercial real estate portfolio analysis. It represents the average duration of leases within a property or portfolio, weighted by the size (typically rentable area) of each lease. Unlike a simple average, WARLT gives more significance to larger leases, providing a more accurate picture of the portfolio's future revenue stability and vacancy risk. Understanding how to calculate weighted average remaining lease term is essential for investors, landlords, and property managers seeking to assess the long-term financial health and predictability of their assets.

Who Should Use It: Property investors, real estate fund managers, asset managers, leasing agents, and financial analysts analyzing commercial real estate portfolios. It's particularly useful for understanding the stability of income streams and planning for future leasing activities.

Common Misconceptions: A common misconception is that WARLT is the same as the average lease term. While related, the weighting factor of area makes WARLT a more nuanced metric. Another misconception is that it only applies to single buildings; WARLT is frequently used to evaluate entire portfolios across multiple properties. Properly calculating weighted average remaining lease term helps avoid these errors.

WARLT Formula and Mathematical Explanation

The calculation of the Weighted Average Remaining Lease Term (WARLT) involves a straightforward formula that accounts for the varying sizes of leases. Here's a breakdown:

The WARLT Formula

WARLT = Σ (Areai * Termi) / Σ Areai

Where:

  • Areai is the leased area of the i-th lease.
  • Termi is the remaining lease term (in years) of the i-th lease.
  • Σ denotes the summation across all leases in the portfolio.

Variable Explanations and Table

Let's break down the variables involved in how to calculate weighted average remaining lease term:

Variables in WARLT Calculation
Variable Meaning Unit Typical Range
Areai The rentable square footage or unit size of an individual lease. Square Feet (or Units) 100 – 50,000+
Termi The number of years remaining until an individual lease expires. Years 0.1 – 20+
Σ Areai The total leased area across all leases in the portfolio. Square Feet (or Units) Varies significantly by portfolio size
Σ (Areai * Termi) The sum of the products of area and remaining term for each lease. This represents the total "lease term value" weighted by area. Square Feet * Years (or Unit-Years) Varies significantly by portfolio size and lease durations
WARLT The final weighted average remaining lease term. Years Typically 1 – 15 years for commercial properties

The core idea is to give larger leases a proportionally larger influence on the average. A portfolio with one large 20-year lease and ten small 2-year leases will have a significantly higher WARLT than a simple average would suggest.

Practical Examples (Real-World Use Cases)

Understanding how to calculate weighted average remaining lease term is best illustrated with examples.

Example 1: Office Building Portfolio

A real estate investment trust (REIT) owns an office building with three major tenants:

  • Tenant A: Leased Area = 15,000 sq ft, Remaining Term = 7 years
  • Tenant B: Leased Area = 8,000 sq ft, Remaining Term = 4 years
  • Tenant C: Leased Area = 12,000 sq ft, Remaining Term = 10 years

Calculation Steps:

  1. Calculate Weighted Term for each lease:
    • Tenant A: 15,000 sq ft * 7 years = 105,000 sq ft-years
    • Tenant B: 8,000 sq ft * 4 years = 32,000 sq ft-years
    • Tenant C: 12,000 sq ft * 10 years = 120,000 sq ft-years
  2. Calculate Total Leased Area:

    15,000 + 8,000 + 12,000 = 35,000 sq ft

  3. Calculate Total Weighted Term:

    105,000 + 32,000 + 120,000 = 257,000 sq ft-years

  4. Calculate WARLT:

    WARLT = 257,000 sq ft-years / 35,000 sq ft = 7.34 years (approx.)

Interpretation: The WARLT of 7.34 years indicates a reasonably stable income stream. The longer lease term of Tenant C significantly influences the average upwards, mitigating the impact of Tenant B's shorter lease.

Example 2: Retail Shopping Center

A shopping center has the following key tenants:

  • Anchor Store: Leased Area = 30,000 sq ft, Remaining Term = 12 years
  • Specialty Shops (Bundle): Total Leased Area = 10,000 sq ft, Remaining Term = 3 years
  • Restaurant: Leased Area = 5,000 sq ft, Remaining Term = 6 years

Calculation Steps:

  1. Calculate Weighted Term:
    • Anchor Store: 30,000 sq ft * 12 years = 360,000 sq ft-years
    • Specialty Shops: 10,000 sq ft * 3 years = 30,000 sq ft-years
    • Restaurant: 5,000 sq ft * 6 years = 30,000 sq ft-years
  2. Total Leased Area:

    30,000 + 10,000 + 5,000 = 45,000 sq ft

  3. Total Weighted Term:

    360,000 + 30,000 + 30,000 = 420,000 sq ft-years

  4. Calculate WARLT:

    WARLT = 420,000 sq ft-years / 45,000 sq ft = 9.33 years (approx.)

Interpretation: The WARLT of 9.33 years suggests strong long-term stability, primarily driven by the anchor store's long lease. However, the cluster of specialty shops with only 3 years remaining represents a potential future risk that needs monitoring.

How to Use This WARLT Calculator

Our calculator simplifies the process of how to calculate weighted average remaining lease term. Follow these simple steps:

  1. Input Lease Data: In the "Lease Data (JSON Format)" field, enter your lease information as a JSON array. Each object in the array should represent a single lease and contain two key-value pairs: `"area"` (the leased square footage or unit count) and `"term"` (the remaining number of years on the lease). For instance: `[{"area": 5000, "term": 8}, {"area": 10000, "term": 5}]`.
  2. Calculate: Click the "Calculate WARLT" button. The calculator will process your input.
  3. Review Results: The calculator will display:
    • Weighted Average Remaining Lease Term (WARLT): The primary highlighted result in years.
    • Total Leased Area: The sum of all areas entered.
    • Total Lease Value (Sum of Area * Term): The sum of each lease's area multiplied by its term.
    • Average Lease Term (Unweighted): A simple average of the terms, for comparison.
  4. Interpret the Data: The WARLT gives you a weighted perspective on lease expirations. A higher WARLT generally suggests greater income stability.
  5. Visualize: Observe the "Lease Term Distribution" chart and the "Individual Lease Details" table for a visual and detailed breakdown of your lease portfolio.
  6. Copy Results: Use the "Copy Results" button to easily transfer the key findings to reports or other documents.
  7. Reset: Click "Reset" to clear all fields and start over with new data.

Decision-Making Guidance: A low WARLT might signal an upcoming need for proactive leasing strategies to avoid significant vacancy. Conversely, a high WARLT indicates stability, allowing focus on asset optimization or long-term planning. Use the WARLT alongside other metrics like tenant creditworthiness and market rental rates for comprehensive analysis.

Key Factors That Affect WARLT Results

Several factors influence the Weighted Average Remaining Lease Term (WARLT) and its interpretation:

  1. Lease Expiration Scenarios: If multiple large leases expire around the same time, even with a high overall WARLT, there's a concentrated risk of vacancy. The WARLT smooths this out but doesn't eliminate concurrent expirations.
  2. Tenant Diversification: A portfolio heavily reliant on a single large tenant, even with a long lease, carries significant risk if that tenant leaves. WARLT helps quantify the duration of reliance but doesn't inherently measure tenant risk. Consider tenant credit ratings alongside WARLT.
  3. Economic Conditions: In a strong economy, landlords may achieve higher rents upon renewal, making longer lease terms more valuable. In a downturn, shorter leases might be preferable to adapt to falling market rates. WARLT is a static snapshot; dynamic market conditions require ongoing assessment.
  4. Lease Structure and Options: Terms like renewal options, rent escalations, or tenant improvement allowances can affect the perceived stability and value of a lease, even if not directly in the WARLT calculation. A lease with multiple 5-year renewal options might be considered more stable than its stated remaining term suggests.
  5. Property Type: Different property types (office, retail, industrial, residential) have different typical lease durations and market dynamics. WARLT interpretations should consider these industry norms. For example, industrial leases are often longer than retail leases.
  6. Market Demand and Vacancy Rates: High market demand and low vacancy rates reduce the risk associated with lease expirations, potentially allowing for higher rental rates upon renewal. A low WARLT in a strong market might be less concerning than in a weak market with high vacancy rates.
  7. Inflation and Interest Rates: While not directly in the WARLT calculation, these macroeconomic factors influence the present value of future rental income. Higher inflation might make shorter, adjustable leases more attractive, while higher interest rates increase the discount rate applied to future cash flows, impacting the overall investment valuation. Understanding the impact of inflation on real estate is crucial.
  8. Sublease Space: Significant amounts of sublease space can impact effective occupancy and rental income, even if the primary leases are long-term. The WARLT calculation typically uses the primary lease term, not sublease terms.

Frequently Asked Questions (FAQ)

What is the difference between WARLT and average lease term?

The average lease term calculates a simple arithmetic mean of all lease durations. The Weighted Average Remaining Lease Term (WARLT) gives more importance to leases with larger areas. For instance, a portfolio with one 50,000 sq ft lease expiring in 5 years and ten 5,000 sq ft leases expiring in 3 years will have a significantly higher WARLT than its simple average, because the large lease heavily influences the weighted calculation.

Can WARLT be negative?

No, the WARLT cannot be negative. Lease terms are measured in positive years, and leased areas are positive quantities. Therefore, the resulting weighted average will always be zero or positive.

Does WARLT account for rent per square foot?

No, the standard WARLT calculation does not directly account for rent per square foot. It weights leases solely by their physical area. However, some advanced analyses might use rent as a weighting factor instead of area to calculate a "Weighted Average Remaining Lease Term by Rent."

How often should WARLT be recalculated?

WARLT should ideally be recalculated quarterly or semi-annually, and certainly whenever there is a significant change in the portfolio, such as a new lease, a lease renewal, or a lease expiration. This ensures the metric remains relevant for portfolio management.

What is considered a 'good' WARLT?

A "good" WARLT is relative to the specific asset type, market conditions, and investment strategy. Generally, a higher WARLT suggests more stable, predictable income streams. For stable, income-producing assets like core office buildings, a WARLT of 7-10+ years might be considered strong. For properties with shorter lease cycles or in rapidly changing markets, a lower WARLT might be acceptable or even strategic.

Can WARLT be used for residential properties?

While technically possible, WARLT is less commonly used for typical residential properties (like single-family homes or apartments) where leases are often much shorter (1-2 years) and the concept of "area weighting" might be less critical than analyzing overall occupancy rates or unit mix. It's far more prevalent in commercial real estate portfolios.

What does a decreasing WARLT signify?

A decreasing WARLT typically indicates that leases are expiring sooner relative to the total leased area. This could be due to many short-term leases coming up for renewal or expiring, or a large lease expiring while smaller ones remain. It signals potentially increasing vacancy risk and the need for proactive leasing efforts.

How does WARLT impact property valuation?

A higher WARLT generally supports a higher property valuation because it implies more predictable future cash flows and lower short-term leasing risk. Investors often pay a premium for portfolios with longer lease durations. Conversely, a low WARLT might lead to a lower valuation due to perceived higher risk and uncertainty regarding future rental income.

© 2023 Your Financial Platform. All rights reserved.

var chartInstance = null; function getElement(id) { return document.getElementById(id); } function validateInput(value, id, min, max, label) { var errorElement = getElement(id + 'Error'); if (value === "") { errorElement.textContent = label + " is required."; return false; } var number = parseFloat(value); if (isNaN(number)) { errorElement.textContent = label + " must be a number."; return false; } if (min !== undefined && number max) { errorElement.textContent = label + " cannot be greater than " + max + "."; return false; } errorElement.textContent = ""; return true; } function calculateWARLT() { var leaseDataInput = getElement('leaseData'); var leaseDataError = getElement('leaseDataError'); var mainResult = getElement('mainResult'); var totalArea = getElement('totalArea'); var totalWeightedTerm = getElement('totalWeightedTerm'); var unweightedAverageTerm = getElement('unweightedAverageTerm'); var leaseTableBody = getElement('leaseTableBody'); leaseTableBody.innerHTML = "; // Clear previous table data var leases = []; try { leases = JSON.parse(leaseDataInput.value); if (!Array.isArray(leases)) { throw new Error("Input must be a JSON array."); } for (var i = 0; i < leases.length; i++) { if (typeof leases[i] !== 'object' || leases[i] === null || !leases[i].hasOwnProperty('area') || !leases[i].hasOwnProperty('term')) { throw new Error("Each item in the array must be an object with 'area' and 'term' properties."); } var area = parseFloat(leases[i].area); var term = parseFloat(leases[i].term); if (isNaN(area) || isNaN(term) || area <= 0 || term < 0) { throw new Error("Area must be a positive number and Term must be a non-negative number for lease #" + (i + 1) + "."); } leases[i] = { area: area, term: term, id: i + 1 }; } } catch (e) { leaseDataError.textContent = "Invalid JSON format or data: " + e.message; mainResult.textContent = "–"; totalArea.textContent = "–"; totalWeightedTerm.textContent = "–"; unweightedAverageTerm.textContent = "–"; updateChart([], []); // Clear chart return; } leaseDataError.textContent = ""; // Clear error if parsing succeeds if (leases.length === 0) { mainResult.textContent = "–"; totalArea.textContent = "–"; totalWeightedTerm.textContent = "–"; unweightedAverageTerm.textContent = "–"; updateChart([], []); leaseTableBody.innerHTML = 'No lease data entered.'; return; } var totalLeasedArea = 0; var totalWeightedTermSum = 0; var totalTermSum = 0; for (var i = 0; i 0) { warlt = totalWeightedTermSum / totalLeasedArea; } var unweightedAverage = 0; if (leases.length > 0) { unweightedAverage = totalTermSum / leases.length; } mainResult.textContent = warlt.toFixed(2); totalArea.textContent = totalLeasedArea.toFixed(2); totalWeightedTerm.textContent = totalWeightedTermSum.toFixed(2); unweightedAverageTerm.textContent = unweightedAverage.toFixed(2); // Prepare data for chart var chartLabels = leases.map(function(lease) { return 'Lease ' + lease.id; }); var chartLeaseAreas = leases.map(function(lease) { return lease.area; }); var chartLeaseTerms = leases.map(function(lease) { return lease.term; }); updateChart(chartLabels, chartLeaseAreas, chartLeaseTerms); } function resetCalculator() { getElement('leaseData').value = '[{"area": 1000, "term": 5}, {"area": 2500, "term": 10}]'; getElement('leaseDataError').textContent = ""; getElement('mainResult').textContent = "–"; getElement('totalArea').textContent = "–"; getElement('totalWeightedTerm').textContent = "–"; getElement('unweightedAverageTerm').textContent = "–"; getElement('leaseTableBody').innerHTML = 'Enter lease data and click "Calculate WARLT".'; updateChart([], []); // Clear chart } function copyResults() { var mainResult = getElement('mainResult').textContent; var totalArea = getElement('totalArea').textContent; var totalWeightedTerm = getElement('totalWeightedTerm').textContent; var unweightedAverageTerm = getElement('unweightedAverageTerm').textContent; var leaseDataInput = getElement('leaseData').value; var formula = "WARLT = Σ (Area_i * Term_i) / Σ Area_i"; var textToCopy = "Weighted Average Remaining Lease Term Calculation Results:\n\n"; textToCopy += "— Key Metrics —\n"; textToCopy += "Weighted Average Remaining Lease Term (WARLT): " + mainResult + " Years\n"; textToCopy += "Total Leased Area: " + totalArea + " Sq Units\n"; textToCopy += "Total Lease Value (Sum of Area * Term): " + totalWeightedTerm + " Sq Unit-Years\n"; textToCopy += "Average Lease Term (Unweighted): " + unweightedAverageTerm + " Years\n\n"; textToCopy += "— Formula Used —\n"; textToCopy += formula + "\n\n"; textToCopy += "— Input Lease Data —\n"; textToCopy += leaseDataInput + "\n"; // Use a temporary textarea for copying var tempTextArea = document.createElement("textarea"); tempTextArea.value = textToCopy; tempTextArea.style.position = "absolute"; tempTextArea.style.left = "-9999px"; document.body.appendChild(tempTextArea); tempTextArea.select(); try { document.execCommand('copy'); alert('Results copied to clipboard!'); } catch (e) { alert('Failed to copy results. Please copy manually.'); } document.body.removeChild(tempTextArea); } function updateChart(labels, areas, terms) { var ctx = getElement('leaseTermChart').getContext('2d'); // Destroy previous chart instance if it exists if (chartInstance) { chartInstance.destroy(); } if (!labels || labels.length === 0) { // Optionally clear canvas or display a message if no data ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); return; } // Create new chart instance chartInstance = new Chart(ctx, { type: 'bar', data: { labels: labels, datasets: [{ label: 'Leased Area (Sq Units)', data: areas, backgroundColor: 'rgba(0, 74, 153, 0.6)', // Primary color variation borderColor: 'rgba(0, 74, 153, 1)', borderWidth: 1, yAxisID: 'y-axis-area' }, { label: 'Remaining Term (Years)', data: terms, backgroundColor: 'rgba(40, 167, 69, 0.6)', // Success color variation borderColor: 'rgba(40, 167, 69, 1)', borderWidth: 1, yAxisID: 'y-axis-term' }] }, options: { responsive: true, maintainAspectRatio: true, scales: { x: { title: { display: true, text: 'Lease Identifier' } }, 'y-axis-area': { type: 'linear', position: 'left', title: { display: true, text: 'Leased Area (Sq Units)' }, grid: { drawOnChartArea: true, // only want the grid lines for one axis to show up }, ticks: { beginAtZero: true } }, 'y-axis-term': { type: 'linear', position: 'right', title: { display: true, text: 'Remaining Term (Years)' }, grid: { drawOnChartArea: false, // only want the grid lines for one axis to show up }, ticks: { beginAtZero: true } } }, plugins: { title: { display: true, text: 'Lease Data Comparison' }, legend: { position: 'top', } } } }); } function toggleFaq(element) { var faqItem = element.parentElement; faqItem.classList.toggle('open'); } // Initialize calculator on page load document.addEventListener('DOMContentLoaded', function() { // Add Chart.js library dynamically var chartScript = document.createElement('script'); chartScript.src = 'https://cdn.jsdelivr.net/npm/chart.js'; chartScript.onload = function() { // Initial calculation with default values calculateWARLT(); }; document.head.appendChild(chartScript); // Set initial values getElement('leaseData').value = '[{"area": 15000, "term": 7}, {"area": 8000, "term": 4}, {"area": 12000, "term": 10}]'; calculateWARLT(); // Calculate with provided defaults });

Leave a Comment