Calculating Weighted Number of Shares Outstanding

Weighted Average Shares Outstanding Calculator :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ccc; –white: #fff; –light-gray: #eee; –error-color: #dc3545; } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); margin: 0; padding: 0; line-height: 1.6; } .container { max-width: 980px; margin: 20px auto; padding: 20px; background-color: var(–white); border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; align-items: center; } header { text-align: center; margin-bottom: 30px; width: 100%; } h1 { color: var(–primary-color); font-size: 2.5em; margin-bottom: 10px; } .subtitle { font-size: 1.1em; color: #555; } .loan-calc-container { width: 100%; max-width: 600px; padding: 30px; background-color: var(–white); border-radius: 8px; box-shadow: inset 0 1px 3px rgba(0,0,0,.1); margin-bottom: 30px; } .input-group { margin-bottom: 20px; width: 100%; } .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% – 20px); padding: 12px 10px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; box-sizing: border-box; transition: border-color 0.3s ease; } .input-group input:focus, .input-group select:focus { border-color: var(–primary-color); outline: none; } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; display: block; } .input-group .error-message { color: var(–error-color); font-size: 0.8em; margin-top: 5px; height: 1.2em; /* Reserve space for error message */ } .button-group { display: flex; justify-content: space-between; margin-top: 30px; gap: 10px; } button { padding: 12px 25px; font-size: 1em; border: none; border-radius: 5px; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; flex-grow: 1; } button.primary { background-color: var(–primary-color); color: var(–white); } button.primary:hover { background-color: #003366; transform: translateY(-2px); } button.secondary { background-color: var(–light-gray); color: var(–text-color); border: 1px solid var(–border-color); } button.secondary:hover { background-color: #ddd; transform: translateY(-2px); } #results { width: 100%; max-width: 600px; margin-top: 30px; padding: 30px; background-color: var(–primary-color); color: var(–white); border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 74, 153, 0.3); text-align: center; } #results h2 { margin-top: 0; font-size: 1.8em; color: var(–white); } #results .main-result { font-size: 2.5em; font-weight: bold; margin: 15px 0; color: #fff; background: rgba(255,255,255,0.1); padding: 10px; border-radius: 4px; } #results .intermediate-values { margin-top: 20px; display: flex; justify-content: space-around; flex-wrap: wrap; gap: 15px; text-align: left; } #results .intermediate-values div { background-color: rgba(255,255,255,0.15); padding: 10px 15px; border-radius: 4px; text-align: center; min-width: 120px; } #results .intermediate-values span { display: block; font-weight: bold; font-size: 1.3em; margin-top: 5px; } #results .formula-explanation { margin-top: 25px; font-size: 0.9em; opacity: 0.8; border-top: 1px solid rgba(255, 255, 255, 0.2); padding-top: 15px; } #copyResultsBtn { background-color: var(–success-color); color: var(–white); margin-top: 15px; width: auto; display: inline-block; } #copyResultsBtn:hover { background-color: #218838; } .chart-container { width: 100%; max-width: 600px; margin-top: 30px; padding: 20px; background-color: var(–white); border-radius: 8px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); display: flex; flex-direction: column; align-items: center; } .chart-container canvas { max-width: 100%; height: auto; } .chart-caption { font-size: 0.9em; color: #666; margin-top: 10px; text-align: center; } table.data-table { width: 100%; max-width: 600px; margin-top: 30px; border-collapse: collapse; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); } .table-caption { font-size: 1em; color: var(–text-color); margin-bottom: 10px; text-align: left; font-weight: bold; } .data-table th, .data-table td { padding: 12px 15px; text-align: right; border: 1px solid var(–border-color); } .data-table th { background-color: var(–light-gray); color: var(–text-color); font-weight: bold; } .data-table tbody tr:nth-child(even) { background-color: var(–background-color); } .data-table td:first-child, .data-table th:first-child { text-align: left; } .article-content { width: 100%; max-width: 960px; margin-top: 40px; padding: 20px; background-color: var(–white); border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); } .article-content h2 { color: var(–primary-color); font-size: 1.8em; margin-top: 30px; border-bottom: 2px solid var(–light-gray); padding-bottom: 5px; } .article-content h3 { color: var(–primary-color); font-size: 1.4em; margin-top: 25px; } .article-content p { margin-bottom: 15px; color: #444; } .article-content ul, .article-content ol { margin-left: 20px; margin-bottom: 15px; } .article-content li { margin-bottom: 8px; } .article-content .highlight { font-weight: bold; color: var(–primary-color); } .article-content .variable-table { width: 100%; margin: 20px 0; } .article-content .variable-table th, .article-content .variable-table td { border: 1px solid var(–border-color); padding: 10px; text-align: left; } .article-content .variable-table th { background-color: var(–light-gray); } .article-content .faq-item { margin-bottom: 15px; border-left: 3px solid var(–primary-color); padding-left: 10px; } .article-content .faq-item strong { color: var(–primary-color); } .related-links { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(–light-gray); } .related-links h3 { color: var(–primary-color); font-size: 1.6em; margin-bottom: 15px; } .related-links ul { list-style: none; padding: 0; } .related-links li { margin-bottom: 10px; } .related-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .related-links a:hover { text-decoration: underline; } .related-links p { font-size: 0.9em; color: #555; margin-top: 5px; } @media (max-width: 768px) { .container { margin: 10px; padding: 15px; } h1 { font-size: 2em; } button { padding: 10px 15px; } .button-group { flex-direction: column; align-items: center; } button.primary, button.secondary { width: 80%; margin-bottom: 10px; } #results .main-result { font-size: 2em; } .article-content h2 { font-size: 1.5em; } .article-content h3 { font-size: 1.2em; } }

Weighted Average Shares Outstanding Calculator

Accurately calculate your company's Weighted Average Shares Outstanding (WASO) for financial reporting.

Input Shares Data

Total shares at the start of the period.
Number of shares issued (e.g., from stock options, new offerings).
Number of shares bought back by the company.
This value is calculated automatically.

Weighted Average Shares Outstanding (WASO)

0
Total Shares Added 0
Total Shares Removed 0
Net Change in Shares 0
Formula: (Beginning Shares + Shares Issued – Shares Repurchased)
Comparison: Beginning Shares vs. Ending Shares Outstanding
Shares Outstanding Over Time
Period Beginning Shares Shares Issued Shares Repurchased Ending Shares Weighted Average Shares
Current Period 0 0 0 0 0

What is Weighted Average Shares Outstanding (WASO)?

The Weighted Average Shares Outstanding (WASO) is a crucial financial metric used by companies to calculate earnings per share (EPS). Unlike a simple count of shares, WASO accounts for the timing of when new shares were issued or outstanding shares were repurchased during a reporting period. This smoothing effect provides a more accurate representation of the share dilution or consolidation that impacts an investor's ownership stake over time.

Who should use it? WASO is primarily used by public companies preparing their financial statements for investors, analysts, and regulatory bodies. Investors and financial analysts use WASO to compare EPS across different companies and periods, understanding the impact of share count changes on profitability per share. Management uses it for internal performance tracking and strategic decision-making related to share issuance and buybacks.

Common misconceptions: A frequent misunderstanding is that WASO is simply the average of the shares at the beginning and end of the period. This is incorrect because it doesn't account for the _timing_ of share transactions. Another misconception is that basic WASO is the final figure; however, for companies with potential stock issuances (like options or warrants), diluted WASO is also a critical calculation.

WASO Formula and Mathematical Explanation

The calculation of weighted average shares outstanding is designed to reflect the average number of shares that were outstanding during a specific period, weighted by the amount of time they were outstanding.

Basic Weighted Average Shares Outstanding

For a basic calculation, assuming all transactions occur within a single reporting period (e.g., a quarter or a year), the formula simplifies significantly if we consider the net effect. However, a more robust understanding involves considering each transaction's duration:

Weighted Average Shares Outstanding = Σ (Shares Outstanding * Time Weighting)

Where 'Time Weighting' is the fraction of the period during which those shares were outstanding. For a simple period where shares are only added or removed at one point, it can be simplified. For a single period calculation using our calculator:

Weighted Average Shares Outstanding = Beginning Shares + (Shares Issued * Time Weighting of Issued Shares) – (Shares Repurchased * Time Weighting of Repurchased Shares)

In a simplified single-period calculation where we don't have exact dates for each transaction, and assuming they are spread evenly or we are calculating a general weighted average for the period, we can approximate:

Weighted Average Shares Outstanding = Beginning Shares + Net Change in Shares

Where Net Change in Shares = Shares Issued – Shares Repurchased. This calculator assumes a single period and provides this simplified, commonly used calculation for basic WASO.

Variable Explanations

Let's break down the variables used in the calculation:

Variable Meaning Unit Typical Range
Beginning Shares Outstanding The number of shares held by all shareholders at the start of the reporting period. Shares ≥ 0
Shares Issued The number of new shares created and distributed by the company during the period. This can include stock options exercised, secondary offerings, or convertible securities converted. Shares ≥ 0
Shares Repurchased The number of shares bought back by the company from the open market or directly from shareholders during the period. This reduces the total number of outstanding shares. Shares ≥ 0
Weighted Average Shares Outstanding (WASO) The average number of a company's shares outstanding over a period, adjusted for the timing of share issuances and repurchases. It smooths out the impact of these transactions. Shares Typically ≥ 0. Can be less than beginning shares if significant repurchases occur.
Net Change in Shares The difference between shares issued and shares repurchased during the period. Shares Can be positive or negative.

Practical Examples (Real-World Use Cases)

Example 1: A Growing Tech Company

Scenario: 'Innovate Solutions Inc.' starts the year with 5,000,000 shares outstanding. In March, they issue 500,000 new shares through an employee stock option plan. In September, they repurchase 200,000 shares as part of a share buyback program. The reporting period is the full year.

Inputs:

  • Beginning Shares Outstanding: 5,000,000
  • Shares Issued During Period: 500,000
  • Shares Repurchased During Period: 200,000

Calculation (using the simplified formula for the period):

  • Total Shares Added: 500,000
  • Total Shares Removed: 200,000
  • Net Change in Shares: 500,000 – 200,000 = 300,000
  • Weighted Average Shares Outstanding: 5,000,000 + 300,000 = 5,300,000

Financial Interpretation: Even though the company bought back shares, the issuance of new shares had a greater net effect. The WASO of 5,300,000 indicates that, on average, there were more shares outstanding throughout the year compared to the beginning of the year. This would dilute EPS slightly compared to what it would have been if the share count remained static.

Example 2: A Mature Company Conducting Buybacks

Scenario: 'Legacy Corp.' begins the quarter with 10,000,000 shares outstanding. They do not issue any new shares but actively repurchase 750,000 shares throughout the quarter.

Inputs:

  • Beginning Shares Outstanding: 10,000,000
  • Shares Issued During Period: 0
  • Shares Repurchased During Period: 750,000

Calculation (using the simplified formula for the period):

  • Total Shares Added: 0
  • Total Shares Removed: 750,000
  • Net Change in Shares: 0 – 750,000 = -750,000
  • Weighted Average Shares Outstanding: 10,000,000 + (-750,000) = 9,250,000

Financial Interpretation: Legacy Corp.'s WASO of 9,250,000 is significantly lower than its beginning share count. This indicates a substantial reduction in the average number of shares outstanding for the quarter due to aggressive share buybacks. This action typically aims to increase EPS by distributing profits over fewer shares.

How to Use This WASO Calculator

Our Weighted Average Shares Outstanding calculator is designed for simplicity and accuracy. Follow these steps:

  1. Input Beginning Shares: Enter the total number of shares outstanding at the very start of your reporting period (e.g., January 1st for an annual report, or April 1st for a Q2 report).
  2. Enter Shares Issued: Input the total number of new shares that were issued by the company during the entire reporting period. This includes shares from stock options, new public offerings, or conversions.
  3. Enter Shares Repurchased: Input the total number of shares the company bought back (treasury stock) during the reporting period.
  4. Review Calculated Values: The calculator will automatically compute:
    • Total Shares Added (same as Shares Issued)
    • Total Shares Removed (same as Shares Repurchased)
    • Net Change in Shares
    • The primary result: Weighted Average Shares Outstanding (WASO)
  5. Interpret the Results: The main result (WASO) is the most critical figure for EPS calculations. It represents the average number of shares outstanding, adjusted for the timing of transactions.
  6. Update Table and Chart: The table and chart will automatically update to visually represent your inputs and the calculated WASO.
  7. Copy or Reset: Use the "Copy Results" button to easily transfer the WASO and key figures to your financial reports. Use "Reset" to clear the fields and start over.

Decision-Making Guidance: A rising WASO (more shares issued than repurchased) generally dilutes EPS, while a declining WASO (more shares repurchased than issued) tends to boost EPS. Understanding these movements helps in assessing the company's capital structure management and its impact on shareholder value.

Key Factors That Affect WASO Results

Several factors influence the calculation and interpretation of Weighted Average Shares Outstanding:

  1. Timing of Share Transactions: This is the fundamental concept behind WASO. A share issued on the first day of the period has a full period weighting, while one issued on the last day has minimal impact. Similarly, repurchases reduce the average if they occur early in the period. Our calculator uses a simplified model for a single period.
  2. Issuance of Stock Options and Warrants: When employees or investors exercise options or warrants, new shares are issued, increasing the share count. The timing of exercise directly impacts WASO.
  3. Share Buyback Programs: Companies repurchase shares to reduce dilution, boost EPS, or return capital to shareholders. The volume and timing of these buybacks significantly decrease WASO.
  4. Convertible Securities: If a company has convertible bonds or preferred stock, their conversion into common stock during the period will increase the number of outstanding shares and affect WASO.
  5. Mergers and Acquisitions (M&A): If a company acquires another company and issues its stock as payment, this increases the share count. The date of the acquisition determines the weighting. Conversely, if the company is acquired, its shares are no longer outstanding for future periods.
  6. Stock Splits and Reverse Splits: While these actions change the number of shares outstanding and the par value, they do not change the total equity. WASO calculations for periods before and after a stock split must be adjusted retrospectively to be comparable. A forward stock split increases shares outstanding and WASO; a reverse split decreases them.
  7. Capital Structure Decisions: Management's strategic choices regarding debt financing versus equity financing (issuing stock) directly influence the share count and, consequently, WASO.

Frequently Asked Questions (FAQ)

Q1: What is the difference between Basic WASO and Diluted WASO?
A1: Basic WASO is calculated using only the shares currently outstanding. Diluted WASO includes the potential impact of all dilutive securities (like stock options, warrants, and convertible bonds) that could be converted into common stock, assuming they were exercised or converted.
Q2: Why is WASO important for EPS calculation?
A2: Earnings Per Share (EPS) is net income divided by the number of outstanding shares. Using WASO instead of the ending share count provides a more accurate EPS figure because it reflects the average number of shares that participated in generating the earnings throughout the period.
Q3: Does a stock split affect WASO?
A3: Yes, a stock split increases the number of shares outstanding. For periods encompassing a stock split, historical share counts and WASO figures must be retroactively adjusted to reflect the split ratio, ensuring comparability.
Q4: How do share buybacks impact WASO?
A4: Share buybacks reduce the number of shares outstanding. If buybacks occur during the period, they will decrease the Weighted Average Shares Outstanding, assuming they are not offset by new share issuances.
Q5: Can WASO be negative?
A5: No, the number of shares outstanding cannot be negative. WASO will typically be positive and generally falls between the beginning and ending share counts, reflecting the weighted average.
Q6: What if shares were issued and repurchased on the same day?
A6: For a precise calculation, the timing matters. If both happen simultaneously, their net effect on that specific day is zero. However, for simplified period calculations like in this tool, we sum up all issuances and all repurchases for the period.
Q7: Does this calculator handle multiple periods?
A7: This specific calculator is designed for a single reporting period (e.g., a quarter or a year). Calculating WASO for multiple periods requires more detailed data on the exact dates and amounts of each transaction within each period.
Q8: How is WASO used in valuation?
A8: WASO is a key component in calculating EPS, which is a fundamental metric for company valuation. A lower WASO (due to buybacks) can lead to higher EPS, potentially increasing a company's valuation multiples (like P/E ratio) if earnings remain constant.
var chartInstance = null; // Global variable to hold chart instance function validateInput(inputId, errorId, maxVal) { var input = document.getElementById(inputId); var errorDiv = document.getElementById(errorId); var value = parseFloat(input.value); errorDiv.textContent = "; // Clear previous error input.style.borderColor = '#ccc'; if (input.value === ") { errorDiv.textContent = 'This field cannot be empty.'; input.style.borderColor = 'var(–error-color)'; return false; } if (isNaN(value)) { errorDiv.textContent = 'Please enter a valid number.'; input.style.borderColor = 'var(–error-color)'; return false; } if (value maxVal) { errorDiv.textContent = 'Value cannot exceed ' + maxVal.toLocaleString() + '.'; input.style.borderColor = 'var(–error-color)'; return false; } return true; } function calculateWASO() { var beginningSharesInput = document.getElementById('beginningShares'); var sharesIssuedInput = document.getElementById('sharesIssued'); var sharesRepurchasedInput = document.getElementById('sharesRepurchased'); var weightedAverageSharesOutput = document.getElementById('weightedAverageShares'); var mainResultOutput = document.getElementById('mainResult'); var totalSharesAddedOutput = document.getElementById('totalSharesAdded'); var totalSharesRemovedOutput = document.getElementById('totalSharesRemoved'); var netChangeSharesOutput = document.getElementById('netChangeShares'); var tableBeginningSharesTd = document.getElementById('tableBeginningShares'); var tableSharesIssuedTd = document.getElementById('tableSharesIssued'); var tableSharesRepurchasedTd = document.getElementById('tableSharesRepurchased'); var tableEndingSharesTd = document.getElementById('tableEndingShares'); var tableWeightedAverageSharesTd = document.getElementById('tableWeightedAverageShares'); var isValid = true; isValid = validateInput('beginningShares', 'beginningSharesError') && isValid; isValid = validateInput('sharesIssued', 'sharesIssuedError') && isValid; isValid = validateInput('sharesRepurchased', 'sharesRepurchasedError') && isValid; if (!isValid) { // Reset outputs if any input is invalid weightedAverageSharesOutput.value = '0'; mainResultOutput.textContent = '0'; totalSharesAddedOutput.textContent = '0'; totalSharesRemovedOutput.textContent = '0'; netChangeSharesOutput.textContent = '0'; updateTable(0, 0, 0, 0, 0); updateChart([0, 0], [0, 0]); // Reset chart return; } var beginningShares = parseFloat(beginningSharesInput.value); var sharesIssued = parseFloat(sharesIssuedInput.value); var sharesRepurchased = parseFloat(sharesRepurchasedInput.value); var totalSharesAdded = sharesIssued; var totalSharesRemoved = sharesRepurchased; var netChangeShares = sharesIssued – sharesRepurchased; var endingShares = beginningShares + netChangeShares; var waso = beginningShares + netChangeShares; // Simplified WASO for the period weightedAverageSharesOutput.value = waso.toLocaleString(undefined, { maximumFractionDigits: 0 }); mainResultOutput.textContent = waso.toLocaleString(undefined, { maximumFractionDigits: 0 }); totalSharesAddedOutput.textContent = totalSharesAdded.toLocaleString(undefined, { maximumFractionDigits: 0 }); totalSharesRemovedOutput.textContent = totalSharesRemoved.toLocaleString(undefined, { maximumFractionDigits: 0 }); netChangeSharesOutput.textContent = netChangeShares.toLocaleString(undefined, { maximumFractionDigits: 0 }); updateTable(beginningShares, sharesIssued, sharesRepurchased, endingShares, waso); updateChart([beginningShares, endingShares], [waso, waso]); // Compare beginning/ending with WASO } function resetInputs() { document.getElementById('beginningShares').value = '1000000'; document.getElementById('sharesIssued').value = '0'; document.getElementById('sharesRepurchased').value = '0'; document.getElementById('beginningSharesError').textContent = "; document.getElementById('sharesIssuedError').textContent = "; document.getElementById('sharesRepurchasedError').textContent = "; document.getElementById('beginningShares').style.borderColor = '#ccc'; document.getElementById('sharesIssued').style.borderColor = '#ccc'; document.getElementById('sharesRepurchased').style.borderColor = '#ccc'; calculateWASO(); } function copyResults() { var mainResult = document.getElementById('mainResult').textContent; var totalSharesAdded = document.getElementById('totalSharesAdded').textContent; var totalSharesRemoved = document.getElementById('totalSharesRemoved').textContent; var netChangeShares = document.getElementById('netChangeShares').textContent; var beginningShares = document.getElementById('beginningShares').value; var sharesIssued = document.getElementById('sharesIssued').value; var sharesRepurchased = document.getElementById('sharesRepurchased').value; var wasoVal = document.getElementById('weightedAverageShares').value; var assumptions = "Key Assumptions:\n"; assumptions += "- Beginning Shares: " + beginningShares.toLocaleString() + "\n"; assumptions += "- Shares Issued: " + sharesIssued.toLocaleString() + "\n"; assumptions += "- Shares Repurchased: " + sharesRepurchased.toLocaleString() + "\n"; var resultsText = "Weighted Average Shares Outstanding (WASO):\n"; resultsText += mainResult + "\n\n"; resultsText += "Intermediate Values:\n"; resultsText += "- Total Shares Added: " + totalSharesAdded + "\n"; resultsText += "- Total Shares Removed: " + totalSharesRemoved + "\n"; resultsText += "- Net Change in Shares: " + netChangeShares + "\n"; resultsText += "- Calculated WASO: " + wasoVal + "\n\n"; resultsText += assumptions; navigator.clipboard.writeText(resultsText).then(function() { // Show a temporary success message var originalText = document.getElementById('copyResultsBtn').textContent; document.getElementById('copyResultsBtn').textContent = 'Copied!'; setTimeout(function() { document.getElementById('copyResultsBtn').textContent = originalText; }, 1500); }).catch(function(err) { console.error('Failed to copy text: ', err); alert('Failed to copy results. Please copy manually.'); }); } function updateTable(begShares, issued, repurchased, endShares, avgShares) { document.getElementById('tableBeginningShares').textContent = begShares.toLocaleString(undefined, { maximumFractionDigits: 0 }); document.getElementById('tableSharesIssued').textContent = issued.toLocaleString(undefined, { maximumFractionDigits: 0 }); document.getElementById('tableSharesRepurchased').textContent = repurchased.toLocaleString(undefined, { maximumFractionDigits: 0 }); document.getElementById('tableEndingShares').textContent = endShares.toLocaleString(undefined, { maximumFractionDigits: 0 }); document.getElementById('tableWeightedAverageShares').textContent = avgShares.toLocaleString(undefined, { maximumFractionDigits: 0 }); } function updateChart(data1, data2) { var ctx = document.getElementById('wasoChart').getContext('2d'); // Destroy previous chart instance if it exists if (chartInstance) { chartInstance.destroy(); } var labels = ['Beginning Shares', 'Ending Shares']; var beginningShares = parseFloat(document.getElementById('beginningShares').value) || 0; var endingShares = beginningShares + (parseFloat(document.getElementById('sharesIssued').value) || 0) – (parseFloat(document.getElementById('sharesRepurchased').value) || 0); var wasoValue = beginningShares + (parseFloat(document.getElementById('sharesIssued').value) || 0) – (parseFloat(document.getElementById('sharesRepurchased').value) || 0); chartInstance = new Chart(ctx, { type: 'bar', data: { labels: labels, datasets: [{ label: 'Share Count', data: [beginningShares, endingShares], backgroundColor: [ 'rgba(0, 74, 153, 0.6)', // Primary color for beginning 'rgba(40, 167, 69, 0.6)' // Success color for ending ], borderColor: [ 'rgba(0, 74, 153, 1)', 'rgba(40, 167, 69, 1)' ], borderWidth: 1 }, { label: 'Weighted Average Shares', data: [wasoValue, wasoValue], // WASO is constant across the period conceptually type: 'line', // Use line for WASO to show it's a weighted average borderColor: 'rgba(255, 165, 0, 0.8)', // Orange line backgroundColor: 'rgba(255, 165, 0, 0.2)', fill: false, tension: 0.1, pointRadius: 5, pointBackgroundColor: 'rgba(255, 165, 0, 1)' }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, title: { display: true, text: 'Number of Shares' } } }, plugins: { legend: { position: 'top', }, title: { display: true, text: 'Share Count Comparison: Beginning, End, and WASO' } } } }); } // Initial calculation on load window.onload = function() { resetInputs(); // Set initial defaults and calculate var canvas = document.getElementById('wasoChart'); var ctx = canvas.getContext('2d'); // Ensure chart is created on load even if inputs are initially zero updateChart([0, 0], [0, 0]); };

Leave a Comment