How to Calculate Weighted Average Outstanding Shares

Calculate Weighted Average Outstanding Shares – Your Expert Guide body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; background-color: #f8f9fa; color: #333; margin: 0; padding: 0; } .container { max-width: 980px; margin: 20px auto; padding: 20px; background-color: #ffffff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); border-radius: 8px; } header { background-color: #004a99; color: #ffffff; padding: 15px 0; text-align: center; border-radius: 8px 8px 0 0; } header h1 { margin: 0; font-size: 2em; } main { padding: 20px 0; } h1, h2, h3 { color: #004a99; } h1 { font-size: 2.2em; } h2 { font-size: 1.8em; margin-top: 1.5em; border-bottom: 2px solid #004a99; padding-bottom: 5px;} h3 { font-size: 1.4em; margin-top: 1.2em; } .loan-calc-container { margin-top: 20px; padding: 25px; border: 1px solid #e0e0e0; border-radius: 8px; background-color: #fdfdfd; } .input-group { margin-bottom: 20px; text-align: left; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: #004a99; } .input-group input[type="number"], .input-group input[type="text"], .input-group select { width: calc(100% – 22px); padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 1em; } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; display: block; } .error-message { color: #dc3545; font-size: 0.9em; margin-top: 5px; min-height: 1.2em; /* Prevent layout shift */ } button { background-color: #007bff; color: white; border: none; padding: 12px 25px; border-radius: 5px; cursor: pointer; font-size: 1em; margin-right: 10px; transition: background-color 0.3s ease; } button:hover { background-color: #0056b3; } button.secondary { background-color: #6c757d; } button.secondary:hover { background-color: #5a6268; } .result-box { background-color: #28a745; color: white; padding: 15px 20px; border-radius: 8px; margin-top: 25px; text-align: center; box-shadow: inset 0 1px 5px rgba(0,0,0,0.2); } .result-box h3 { color: white; margin: 0 0 10px 0; font-size: 1.3em; } .result-box p { margin: 0; font-size: 1.8em; font-weight: bold; } .intermediate-results { margin-top: 25px; border: 1px solid #eee; border-radius: 5px; padding: 15px; background-color: #f9f9f9; } .intermediate-results h4 { margin-top: 0; color: #004a99; font-size: 1.1em; } .intermediate-results p { margin: 5px 0; font-size: 0.95em; } .intermediate-results span { font-weight: bold; } .formula-explanation { margin-top: 25px; padding: 15px; background-color: #e9ecef; border-left: 4px solid #004a99; border-radius: 4px; } .formula-explanation h4 { margin-top: 0; color: #004a99; font-size: 1.1em; } table { width: 100%; border-collapse: collapse; margin-top: 20px; } th, td { border: 1px solid #ddd; padding: 10px; text-align: right; } th { background-color: #004a99; color: white; text-align: center; } td { text-align: right; } caption { font-size: 1.1em; font-weight: bold; color: #004a99; margin-bottom: 10px; text-align: left; } #chartContainer { width: 100%; max-width: 700px; margin: 30px auto; text-align: center; } footer { text-align: center; margin-top: 40px; padding: 20px; font-size: 0.9em; color: #666; } .internal-links ul { list-style: none; padding: 0; } .internal-links li { margin-bottom: 10px; } .internal-links a { color: #007bff; text-decoration: none; } .internal-links a:hover { text-decoration: underline; } .copy-button { background-color: #ffc107; color: #212529; } .copy-button:hover { background-color: #e0a800; } .section-summary { background-color: #e7f3ff; padding: 15px; border-left: 5px solid #004a99; border-radius: 5px; margin-bottom: 30px; font-size: 1.1em; color: #004a99; }

How to Calculate Weighted Average Outstanding Shares

This tool helps you calculate the weighted average outstanding shares, a crucial metric for understanding a company's earnings per share (EPS) and overall shareholder dilution. Input your share issuance and repurchase data to see the weighted average.

Weighted Average Outstanding Shares Calculator

The number of shares at the beginning of the period.
Number of shares issued (e.g., through stock options, new offerings).
Number of shares bought back by the company.
The total number of days in the accounting period (e.g., 90 for a quarter, 365 for a year).
Number of days the newly issued shares were outstanding in the period.
Number of days the repurchased shares were NOT outstanding in the period. (This is the number of days they were held in treasury or retired).

Weighted Average Shares Outstanding

Key Intermediate Values:

Weighted Shares Issued:

Weighted Shares Repurchased:

Total Weighted Shares (Numerator):

Formula Explanation

The weighted average outstanding shares are calculated by taking the initial shares, adding the weighted value of shares issued during the period, and subtracting the weighted value of shares repurchased. The weighting accounts for how long each group of shares was outstanding during the period.

Formula: (Initial Shares + (Shares Issued * Days Issued / Period Days) – (Shares Repurchased * Days Repurchased / Period Days))

Outstanding Shares Over Time

Daily Share Count Projection (Example)

What is Weighted Average Outstanding Shares?

Weighted average outstanding shares (WAOS) is a critical financial metric used by companies to calculate earnings per share (EPS). It represents the average number of shares that were outstanding during a specific period, taking into account any changes (issuances or repurchases) that occurred and how long those changes were effective. Unlike a simple average, WAOS provides a more accurate picture of shareholder dilution and equity by weighting each share transaction by the time it was outstanding. This calculation is fundamental for investors and analysts trying to understand a company's profitability on a per-share basis and its overall financial health. Anyone analyzing financial statements, particularly the income statement, will encounter this figure. Investors use it to compare EPS across different companies and over time, while management uses it for internal performance tracking and strategic decision-making. A common misconception is that it's a simple average of the beginning and ending shares; however, this ignores the timing of significant transactions, which can materially impact the true average.

Who Should Use It?

The primary users of weighted average outstanding shares include:

  • Financial Analysts: To accurately compute and compare Earnings Per Share (EPS).
  • Investors: To assess a company's profitability per share and understand potential dilution.
  • Company Management: For performance reporting, stock-based compensation calculations, and understanding the impact of capital structure changes.
  • Accountants: To ensure accurate financial reporting according to Generally Accepted Accounting Principles (GAAP) and International Financial Reporting Standards (IFRS).

Common Misconceptions

One frequent misunderstanding is that the weighted average outstanding shares are simply the average of the shares at the beginning and end of a reporting period. This is incorrect because it fails to account for the specific dates when shares were issued or repurchased. If a company issues a large block of shares late in the period, those shares only affect the weighted average for a fraction of that period, not the entire duration. Another misconception is that the number of days a share was *not* outstanding (for repurchased shares) should be calculated based on the entire period; instead, it's the days it *was* outstanding after repurchase before the period ended.

Weighted Average Outstanding Shares Formula and Mathematical Explanation

The core of calculating weighted average outstanding shares lies in understanding how to properly weight share transactions by the time they were outstanding within a given reporting period. The formula ensures that partial periods for share issuances and repurchases are correctly accounted for.

Step-by-Step Derivation

Let's break down the calculation:

  1. Start with Initial Shares: Identify the number of shares outstanding at the very beginning of the accounting period (e.g., January 1st for a fiscal year).
  2. Calculate Weighted Shares Issued: For any shares issued during the period, determine how many days they were outstanding. This is calculated as: (Number of Shares Issued) × (Number of Days Issued Shares Were Outstanding) / (Total Days in the Period).
  3. Calculate Weighted Shares Repurchased: For any shares repurchased (buybacks) during the period, determine how many days they were *not* outstanding. This is calculated as: (Number of Shares Repurchased) × (Number of Days Shares Were NOT Outstanding After Repurchase) / (Total Days in the Period). Note: Sometimes this is presented as the days they *were* outstanding after repurchase, but the standard approach focuses on the net effect. Our calculator uses the common "days not outstanding" interpretation for buybacks.
  4. Combine the Values: The weighted average outstanding shares are then: Initial Shares + Weighted Shares Issued – Weighted Shares Repurchased.

Variable Explanations

Here are the key variables involved in the calculation:

Variables in Weighted Average Outstanding Shares Calculation
Variable Meaning Unit Typical Range
Initial Shares Outstanding Number of shares at the beginning of the reporting period. Shares ≥ 0
Shares Issued Number of new shares issued during the period. Shares ≥ 0
Shares Repurchased Number of shares bought back (treasury stock) during the period. Shares ≥ 0
Period Days Total number of days in the reporting period (e.g., 90, 91, 92 for a quarter; 365, 366 for a year). Days Integer ≥ 1
Days Issued Shares Were Outstanding Number of days from the issuance date to the end of the period. Days 0 to Period Days
Days Shares Repurchased Were NOT Outstanding Number of days from the repurchase date to the end of the period. Days 0 to Period Days
Weighted Average Outstanding Shares The average number of shares outstanding, weighted by time. Shares Generally positive, can fluctuate.

Practical Examples (Real-World Use Cases)

Understanding how these calculations work in practice is crucial. Let's look at two scenarios:

Example 1: Annual Calculation with Issuance and Repurchase

Company Alpha begins the year with 1,000,000 shares outstanding. On April 1st (after 90 days of the 365-day year), they issue 100,000 new shares. On October 1st (after 273 days of the year), they repurchase 50,000 shares.

  • Initial Shares: 1,000,000
  • Shares Issued: 100,000
  • Shares Repurchased: 50,000
  • Period Days: 365
  • Days Issued Shares Were Outstanding: 365 – 90 = 275 days
  • Days Shares Repurchased Were NOT Outstanding: 365 – 273 = 92 days

Calculations:

  • Weighted Shares Issued = 100,000 × (275 / 365) ≈ 75,342 shares
  • Weighted Shares Repurchased = 50,000 × (92 / 365) ≈ 12,603 shares
  • Weighted Average Outstanding Shares = 1,000,000 + 75,342 – 12,603 = 1,062,739 shares

Interpretation: Despite ending the year with 1,050,000 shares (1,000,000 + 100,000 – 50,000), the weighted average is higher due to the issuance occurring earlier in the year than the repurchase. This figure is crucial for calculating Alpha's annual EPS.

Example 2: Quarterly Calculation with Only Issuance

Beta Corp starts Q2 (April 1st) with 5,000,000 shares. On May 1st (after 30 days of the 91-day quarter), they issue 500,000 shares via an employee stock option plan. There are no repurchases.

  • Initial Shares: 5,000,000
  • Shares Issued: 500,000
  • Shares Repurchased: 0
  • Period Days: 91
  • Days Issued Shares Were Outstanding: 91 – 30 = 61 days
  • Days Shares Repurchased Were NOT Outstanding: 0 (N/A)

Calculations:

  • Weighted Shares Issued = 500,000 × (61 / 91) ≈ 335,165 shares
  • Weighted Shares Repurchased = 0
  • Weighted Average Outstanding Shares = 5,000,000 + 335,165 – 0 = 5,335,165 shares

Interpretation: The issuance significantly increased the weighted average shares for the quarter. This higher number will reduce the calculated EPS for Q2 compared to what it would have been if the shares hadn't been issued, reflecting the dilution of earnings over the quarter.

How to Use This Weighted Average Outstanding Shares Calculator

Our interactive calculator simplifies the process of determining the weighted average outstanding shares. Follow these steps:

  1. Enter Initial Shares: Input the total number of shares your company had outstanding at the very beginning of the accounting period (e.g., year or quarter).
  2. Input Shares Issued: Enter the total number of shares issued during the period.
  3. Input Shares Repurchased: Enter the total number of shares repurchased (buybacks) during the period.
  4. Specify Period Days: Enter the total number of days in the accounting period (365/366 for annual, typically 90/91/92 for quarterly).
  5. Enter Days Issued Outstanding: Specify how many days the newly issued shares were outstanding within the period. This is the number of days from the issuance date until the end of the period.
  6. Enter Days Repurchased NOT Outstanding: Specify how many days the repurchased shares were *not* outstanding. This is the number of days from the repurchase date until the end of the period.

How to Read Results

The calculator will display:

  • Primary Result: The calculated Weighted Average Outstanding Shares for the period. This is the key figure used for EPS calculations.
  • Key Intermediate Values: It shows the weighted contribution of issued shares, the weighted reduction from repurchased shares, and the total numerator used in the calculation.
  • Formula Explanation: A reminder of the formula used.
  • Chart: A visual representation showing the projected daily share count based on your inputs.

Decision-Making Guidance

A rising weighted average outstanding shares can indicate share dilution, potentially lowering EPS. Conversely, a decreasing average (due to significant buybacks) can increase EPS. Understanding these dynamics helps in evaluating a company's capital management strategies and their impact on shareholder value. Use this calculation to compare trends over time and assess the effectiveness of share issuance or repurchase programs.

Key Factors That Affect Weighted Average Outstanding Shares Results

Several elements can influence the final weighted average outstanding shares calculation and its interpretation:

  1. Timing of Transactions: As demonstrated, when shares are issued or repurchased within a period is the most critical factor. Transactions closer to the beginning of the period have a greater impact than those occurring near the end.
  2. Magnitude of Transactions: Large issuances or repurchases will naturally have a more significant effect on the weighted average than smaller ones.
  3. Period Length: Whether the calculation is for a quarter (approx. 90 days) or a full year (365/366 days) changes the denominator and thus the weighting factor applied to transactions.
  4. Stock Splits and Reverse Splits: These actions retroactively adjust the number of shares outstanding for all periods presented. Financial statements typically restate prior periods to reflect these events, meaning the weighted average shares for previous periods would be updated.
  5. Complex Share Structures: Companies with convertible securities (bonds, preferred stock) or outstanding stock options and warrants may need to calculate a "diluted" weighted average outstanding shares, which considers the potential issuance of shares from these instruments. Our basic calculator focuses on the simple weighted average.
  6. Reporting Standards (GAAP/IFRS): Accounting rules dictate precisely how these calculations must be performed, including requirements for restating prior periods after stock splits or accounting for specific types of share issuances (e.g., those related to acquisitions).
  7. Cash Flow Impact: While not directly in the share calculation, the cash generated or used for share issuance (inflow) or repurchase (outflow) is a vital financial context for understanding management's decisions driving these share count changes.
  8. Inflation and Interest Rates: These macroeconomic factors influence a company's cost of capital and investment opportunities, which in turn can affect decisions about issuing new equity (to fund growth) or repurchasing shares (if internally generated cash is abundant and share price is deemed undervalued).

Frequently Asked Questions (FAQ)

Q1: What is the difference between basic and diluted weighted average shares?

A1: Basic weighted average shares consider only the shares currently outstanding. Diluted weighted average shares include the potential issuance of shares from convertible securities, options, and warrants, providing a worst-case scenario for EPS. Our calculator focuses on the basic weighted average.

Q2: Do I need to account for stock splits in the weighted average calculation?

A2: Yes, stock splits and reverse splits require restating prior periods' weighted average shares to ensure comparability. Our calculator assumes no splits have occurred within the entered period unless manually adjusted.

Q3: How often is weighted average outstanding shares calculated?

A3: Companies typically calculate weighted average outstanding shares for each reporting period: quarterly and annually. This is essential for their financial statements.

Q4: Can weighted average outstanding shares be negative?

A4: No, the weighted average outstanding shares cannot be negative. It represents an average count of shares, which must be a non-negative value.

Q5: What if shares were issued and repurchased on the same day?

A5: If transactions occur on the same day, their net effect for that day should be considered. For simplicity in calculation, often the impact is calculated based on the weighted average effect throughout the period.

Q6: Does the weighted average calculation include treasury stock?

A6: Treasury stock (repurchased shares) reduces the number of outstanding shares. When calculating the weighted average, repurchased shares reduce the average, weighted by the time they were held as treasury stock (i.e., not outstanding).

Q7: Why is weighting by days important?

A7: Weighting by days is crucial because it accurately reflects the number of shares that were actually outstanding and entitled to earnings or dividends during each portion of the reporting period. A share issued for only one day should have minimal impact, unlike a share outstanding for the entire year.

Q8: How does this affect my company's P/E ratio?

A8: The Price-to-Earnings (P/E) ratio is calculated as Share Price / Earnings Per Share (EPS). Since EPS = Net Income / Weighted Average Outstanding Shares, an increase in weighted average shares (dilution) will decrease EPS, thereby increasing the P/E ratio, assuming the share price remains constant. Conversely, a decrease in weighted average shares (buybacks) increases EPS and decreases the P/E ratio.

Related Tools and Internal Resources

© 2023 Your Financial Calculator Co. All rights reserved.

var chart = null; // Declare chart globally function validateInput(id, errorId, minValue, maxValue) { var input = document.getElementById(id); var errorElement = document.getElementById(errorId); var value = parseFloat(input.value); var isValid = true; errorElement.textContent = "; // Clear previous error if (isNaN(value)) { errorElement.textContent = 'Please enter a valid number.'; isValid = false; } else if (value < 0) { errorElement.textContent = 'Value cannot be negative.'; isValid = false; } else if (minValue !== undefined && value maxValue) { errorElement.textContent = 'Value cannot exceed ' + maxValue + '.'; isValid = false; } return isValid; } function calculateWeightedAverageShares() { var initialSharesValid = validateInput('initialShares', 'initialSharesError', 0); var sharesIssuedValid = validateInput('sharesIssued', 'sharesIssuedError', 0); var sharesRepurchasedValid = validateInput('sharesRepurchased', 'sharesRepurchasedError', 0); var periodDaysValid = validateInput('periodDays', 'periodDaysError', 1); var daysIssuedValid = validateInput('daysIssued', 'daysIssuedError', 0, parseFloat(document.getElementById('periodDays').value)); var daysRepurchasedValid = validateInput('daysRepurchased', 'daysRepurchasedError', 0, parseFloat(document.getElementById('periodDays').value)); if (!initialSharesValid || !sharesIssuedValid || !sharesRepurchasedValid || !periodDaysValid || !daysIssuedValid || !daysRepurchasedValid) { document.getElementById('mainResult').textContent = '–'; document.getElementById('weightedSharesIssued').textContent = '–'; document.getElementById('weightedSharesRepurchased').textContent = '–'; document.getElementById('totalWeightedSharesNumerator').textContent = '–'; updateChart([]); // Clear chart data return; } var initialShares = parseFloat(document.getElementById('initialShares').value); var sharesIssued = parseFloat(document.getElementById('sharesIssued').value); var sharesRepurchased = parseFloat(document.getElementById('sharesRepurchased').value); var periodDays = parseFloat(document.getElementById('periodDays').value); var daysIssued = parseFloat(document.getElementById('daysIssued').value); var daysRepurchased = parseFloat(document.getElementById('daysRepurchased').value); var weightedSharesIssued = (sharesIssued * daysIssued) / periodDays; var weightedSharesRepurchased = (sharesRepurchased * daysRepurchased) / periodDays; var totalWeightedSharesNumerator = initialShares + weightedSharesIssued – weightedSharesRepurchased; document.getElementById('weightedSharesIssued').textContent = weightedSharesIssued.toFixed(0); document.getElementById('weightedSharesRepurchased').textContent = weightedSharesRepurchased.toFixed(0); document.getElementById('totalWeightedSharesNumerator').textContent = totalWeightedSharesNumerator.toFixed(0); document.getElementById('mainResult').textContent = totalWeightedSharesNumerator.toFixed(0); updateChartData(initialShares, sharesIssued, sharesRepurchased, periodDays, daysIssued, daysRepurchased); } function resetForm() { document.getElementById('initialShares').value = '1000000'; document.getElementById('sharesIssued').value = '50000'; document.getElementById('sharesRepurchased').value = '10000'; document.getElementById('periodDays').value = '365'; document.getElementById('daysIssued').value = '180'; document.getElementById('daysRepurchased').value = '90'; // Clear error messages document.getElementById('initialSharesError').textContent = "; document.getElementById('sharesIssuedError').textContent = "; document.getElementById('sharesRepurchasedError').textContent = "; document.getElementById('periodDaysError').textContent = "; document.getElementById('daysIssuedError').textContent = "; document.getElementById('daysRepurchasedError').textContent = "; calculateWeightedAverageShares(); } function copyResults() { var mainResult = document.getElementById('mainResult').textContent; var weightedSharesIssued = document.getElementById('weightedSharesIssued').textContent; var weightedSharesRepurchased = document.getElementById('weightedSharesRepurchased').textContent; var totalWeightedSharesNumerator = document.getElementById('totalWeightedSharesNumerator').textContent; var initialShares = document.getElementById('initialShares').value; var sharesIssued = document.getElementById('sharesIssued').value; var sharesRepurchased = document.getElementById('sharesRepurchased').value; var periodDays = document.getElementById('periodDays').value; var daysIssued = document.getElementById('daysIssued').value; var daysRepurchased = document.getElementById('daysRepurchased').value; var resultText = "Weighted Average Outstanding Shares Calculation:\n\n"; resultText += "— Main Result —\n"; resultText += "Weighted Average Shares Outstanding: " + mainResult + "\n\n"; resultText += "— Intermediate Values —\n"; resultText += "Weighted Shares Issued: " + weightedSharesIssued + "\n"; resultText += "Weighted Shares Repurchased: " + weightedSharesRepurchased + "\n"; resultText += "Total Weighted Shares (Numerator): " + totalWeightedSharesNumerator + "\n\n"; resultText += "— Key Inputs —\n"; resultText += "Initial Shares Outstanding: " + initialShares + "\n"; resultText += "Shares Issued: " + sharesIssued + "\n"; resultText += "Shares Repurchased: " + sharesRepurchased + "\n"; resultText += "Total Days in Period: " + periodDays + "\n"; resultText += "Days Issued Shares Outstanding: " + daysIssued + "\n"; resultText += "Days Shares Repurchased NOT Outstanding: " + daysRepurchased + "\n"; navigator.clipboard.writeText(resultText).then(function() { alert('Results copied to clipboard!'); }, function(err) { console.error('Could not copy text: ', err); alert('Failed to copy results. Please copy manually.'); }); } function updateChartData(initialShares, sharesIssued, sharesRepurchased, periodDays, daysIssued, daysRepurchased) { var ctx = document.getElementById('sharesChart').getContext('2d'); var labels = []; var projectedShares = []; var theoreticalEndingShares = initialShares + sharesIssued – sharesRepurchased; var weightedIssuedPerDay = (sharesIssued * daysIssued) / periodDays; var weightedRepurchasedPerDay = (sharesRepurchased * daysRepurchased) / periodDays; var currentShares = initialShares; var sharesIssuedStartDay = parseInt(document.getElementById('daysIssued').value); // Day number when issued var sharesRepurchasedStartDay = periodDays – parseInt(document.getElementById('daysRepurchased').value); // Day number when repurchased for (var i = 0; i < periodDays; i++) { labels.push(i + 1); // Day number var sharesToAdd = 0; // Add shares if issued on this day or before and still outstanding if (i = sharesRepurchasedStartDay) { sharesToSubtract = sharesRepurchased / periodDays; } currentShares = initialShares + sharesToAdd * i – sharesToSubtract * i; // A simpler projection for the chart: linear interpolation between key points var dayFraction = i / periodDays; var projected = initialShares; if (dayFraction * periodDays = sharesRepurchasedStartDay) { projected -= (sharesRepurchased * (dayFraction * periodDays – sharesRepurchasedStartDay)) / (periodDays – sharesRepurchasedStartDay); } } projectedShares.push(projected); } // Correct calculation for chart based on actual weighted average logic var dailyWeightedShares = []; var currentDayCount = 0; var issuedDayCount = 0; var repurchasedDayCount = 0; for(var i = 0; i < periodDays; i++) { var sharesForThisDay = initialShares; if (i = (periodDays – daysRepurchased)) sharesForThisDay -= sharesRepurchased; // If it was repurchased, it's not outstanding dailyWeightedShares.push(sharesForThisDay); currentDayCount++; } var chartData = { labels: labels, datasets: [{ label: 'Projected Shares Outstanding', data: dailyWeightedShares, borderColor: 'rgb(75, 192, 192)', backgroundColor: 'rgba(75, 192, 192, 0.2)', fill: false, tension: 0.1 }] }; if (chart) { chart.data = chartData; chart.update(); } else { chart = new Chart(ctx, { type: 'line', data: chartData, options: { responsive: true, maintainAspectRatio: true, scales: { x: { title: { display: true, text: 'Day of Period' } }, y: { title: { display: true, text: 'Number of Shares' } } }, plugins: { legend: { display: true, position: 'top', }, tooltip: { mode: 'index', intersect: false, } } } }); } } // Initial calculation on page load document.addEventListener('DOMContentLoaded', function() { // Ensure canvas element exists before trying to get context var canvas = document.getElementById('sharesChart'); if (canvas) { var ctx = canvas.getContext('2d'); // Initial empty chart setup chart = new Chart(ctx, { type: 'line', data: { labels: [], datasets: [{ label: 'Projected Shares Outstanding', data: [], borderColor: 'rgb(75, 192, 192)', backgroundColor: 'rgba(75, 192, 192, 0.2)', fill: false, tension: 0.1 }] }, options: { responsive: true, maintainAspectRatio: true, scales: { x: { title: { display: true, text: 'Day of Period'} }, y: { title: { display: true, text: 'Number of Shares'} } }, plugins: { legend: { display: true, position: 'top'}, tooltip: {mode: 'index', intersect: false,} } } }); calculateWeightedAverageShares(); // Perform calculation after chart is ready } else { calculateWeightedAverageShares(); // Perform calculation even if chart fails to load } });

Leave a Comment