Calculating Weighted Average Diluted Shares Outstanding

Weighted Average Diluted Shares Outstanding Calculator & Guide :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; line-height: 1.6; color: var(–text-color); background-color: var(–background-color); margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; } .container { width: 100%; max-width: 1000px; margin: 20px auto; padding: 20px; background-color: var(–card-background); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); border-radius: 8px; display: flex; flex-direction: column; align-items: center; } h1, h2, h3 { color: var(–primary-color); text-align: center; } h1 { font-size: 2.5em; margin-bottom: 10px; } h2 { font-size: 1.8em; margin-top: 30px; margin-bottom: 15px; border-bottom: 2px solid var(–primary-color); padding-bottom: 5px; } h3 { font-size: 1.4em; margin-top: 25px; margin-bottom: 10px; } .calculator-header { text-align: center; margin-bottom: 20px; } .calculator-header p { font-size: 1.1em; color: #555; } .loan-calc-container { width: 100%; max-width: 600px; margin: 20px auto; padding: 30px; background-color: var(–card-background); border: 1px solid var(–border-color); border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); } .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% – 22px); padding: 12px; border: 1px solid var(–border-color); border-radius: 5px; font-size: 1em; box-sizing: border-box; } .input-group input[type="number"]:focus, .input-group input[type="text"]:focus, .input-group select:focus { border-color: var(–primary-color); outline: none; box-shadow: 0 0 0 2px rgba(0, 74, 153, 0.2); } .input-group small { display: block; margin-top: 8px; font-size: 0.9em; color: #6c757d; } .error-message { color: var(–error-color); font-size: 0.85em; margin-top: 5px; min-height: 1.2em; } .button-group { display: flex; justify-content: space-between; margin-top: 30px; } .button-group button { padding: 12px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s ease, transform 0.2s ease; } .btn-calculate { background-color: var(–primary-color); color: white; } .btn-calculate:hover { background-color: #003366; transform: translateY(-1px); } .btn-reset { background-color: #6c757d; color: white; } .btn-reset:hover { background-color: #5a6268; transform: translateY(-1px); } .btn-copy { background-color: #17a2b8; color: white; margin-top: 10px; width: 100%; } .btn-copy:hover { background-color: #117a8b; transform: translateY(-1px); } #results { margin-top: 30px; padding: 25px; background-color: #e9ecef; border: 1px solid #dee2e6; border-radius: 8px; text-align: center; width: 100%; box-sizing: border-box; } #results h3 { margin-top: 0; color: var(–primary-color); font-size: 1.6em; } .result-item { margin-bottom: 15px; font-size: 1.1em; } .result-item strong { color: var(–primary-color); } .primary-result { font-size: 1.8em; font-weight: bold; color: var(–success-color); background-color: #fff; padding: 15px; border-radius: 5px; margin-top: 10px; display: inline-block; border: 2px solid var(–success-color); } #formula-explanation { margin-top: 20px; font-size: 0.95em; color: #555; border-top: 1px dashed #ccc; padding-top: 15px; } #formula-explanation strong { color: var(–primary-color); } table { width: 100%; margin-top: 25px; border-collapse: collapse; box-shadow: 0 1px 3px rgba(0,0,0,0.1); } th, td { border: 1px solid #ddd; padding: 10px 12px; text-align: left; } th { background-color: var(–primary-color); color: white; font-weight: bold; } tr:nth-child(even) { background-color: #f2f2f2; } caption { font-size: 1.1em; font-weight: bold; color: var(–primary-color); margin-bottom: 10px; caption-side: top; text-align: left; } canvas { display: block; margin: 20px auto; background-color: var(–card-background); border-radius: 5px; border: 1px solid var(–border-color); } .chart-container { width: 100%; max-width: 700px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border: 1px solid var(–border-color); border-radius: 8px; text-align: center; } .chart-legend { display: flex; justify-content: center; gap: 20px; margin-top: 15px; flex-wrap: wrap; } .chart-legend-item { display: flex; align-items: center; font-size: 0.95em; color: #555; } .legend-color-box { width: 15px; height: 15px; margin-right: 8px; border-radius: 3px; display: inline-block; } .article-section { margin-top: 40px; padding: 20px; background-color: var(–card-background); border: 1px solid var(–border-color); border-radius: 8px; width: 100%; max-width: 1000px; box-sizing: border-box; } .article-section h2 { margin-top: 0; } .article-section p { margin-bottom: 15px; } .article-section ul, .article-section ol { margin-left: 25px; margin-bottom: 15px; } .article-section li { margin-bottom: 8px; } .faq-item { margin-bottom: 15px; padding: 10px; background-color: #e9ecef; border-radius: 5px; } .faq-item strong { display: block; color: var(–primary-color); margin-bottom: 5px; cursor: pointer; } .faq-item p { margin-bottom: 0; display: none; /* Hidden by default */ font-size: 0.95em; color: #555; } .faq-item.open p { display: block; } a { color: var(–primary-color); text-decoration: none; transition: color 0.3s ease; } a:hover { color: #003366; text-decoration: underline; } .internal-links-list { list-style: none; padding: 0; } .internal-links-list li { margin-bottom: 12px; } .internal-links-list a { font-weight: bold; } .internal-links-list p { font-size: 0.9em; color: #555; margin-top: 3px; } @media (max-width: 768px) { h1 { font-size: 2em; } h2 { font-size: 1.5em; } .loan-calc-container, .container, .chart-container, .article-section { padding: 15px; } .button-group button { padding: 10px 18px; font-size: 0.95em; } #results { padding: 15px; } .primary-result { font-size: 1.5em; } }

Weighted Average Diluted Shares Outstanding Calculator

Calculate and understand your company's weighted average diluted shares outstanding (WADSO) to assess equity dilution.

Diluted Shares Calculator

Input your company's share data to calculate the weighted average diluted shares outstanding.

Total number of common shares currently outstanding.
Number of shares issuable from options, warrants, convertible debt, etc.
Number of months these dilutive securities were outstanding during the reporting period.
Total number of months in the reporting period (e.g., 12 for a full year).

Calculation Results

Weighted Average Basic Shares:
Weighted Dilutive Shares:
Total Weighted Average Diluted Shares:
Formula Used:

Weighted Average Diluted Shares Outstanding (WADSO) = Weighted Average Basic Shares + Weighted Dilutive Shares. Weighted Average Basic Shares = Basic Shares Outstanding. Weighted Dilutive Shares = Dilutive Securities Issued * (Dilutive Securities Period / Total Reporting Period).

Dilution Impact Over Time

Basic Shares
Dilutive Shares
Diluted Shares

What is Weighted Average Diluted Shares Outstanding?

Weighted Average Diluted Shares Outstanding ({primary_keyword}) is a crucial financial metric used to calculate a company's earnings per share (EPS). It represents the total number of common shares that would be outstanding if all convertible securities, such as stock options, warrants, and convertible bonds, were exercised or converted into common stock. This calculation is vital because it accounts for potential future dilution of existing shareholders' equity. Understanding {primary_keyword} helps investors and analysts get a more conservative and realistic view of a company's profitability on a per-share basis.

Who should use it? Financial analysts, investors, company management, and accountants use {primary_keyword} primarily for calculating diluted EPS. It's essential for companies with complex capital structures that include potential dilutive instruments. Publicly traded companies are required by accounting standards (like GAAP and IFRS) to report diluted EPS, making the calculation of {primary_keyword} a mandatory reporting requirement.

Common Misconceptions: A common misconception is that diluted shares are simply the sum of basic shares and all potential shares from dilutive instruments. However, the "weighted average" aspect is key, meaning only those dilutive securities outstanding for a portion of the period are included proportionally. Another misunderstanding is that all dilutive securities always dilute EPS; in certain scenarios (e.g., loss-making periods), some anti-dilutive securities might be excluded from the diluted EPS calculation. Our {primary_keyword} calculator focuses on the standard weighted average calculation for simplicity.

Weighted Average Diluted Shares Outstanding Formula and Mathematical Explanation

The calculation of Weighted Average Diluted Shares Outstanding ({primary_keyword}) involves two main components: the weighted average basic shares outstanding and the weighted effect of dilutive securities.

The Formula:

Total Weighted Average Diluted Shares Outstanding = Weighted Average Basic Shares + Weighted Dilutive Shares

Let's break down each component:

1. Weighted Average Basic Shares Outstanding

For simplicity in most standard calculations, the weighted average basic shares outstanding is considered equal to the basic shares outstanding during the period. If there were significant changes in basic shares (e.g., large stock issuance or buyback) throughout the period, a more complex weighted average calculation would be applied, similar to how dilutive securities are weighted. However, for this calculator, we assume basic shares outstanding are constant or their weighting is handled separately.

2. Weighted Dilutive Shares

This component accounts for the dilutive impact of securities like stock options, warrants, and convertible preferred stock that could be converted into common stock. These securities are only weighted for the portion of the reporting period they were outstanding.

Weighted Dilutive Shares = Dilutive Securities Issued * (Number of Months Dilutive Securities Outstanding / Total Months in Reporting Period)

For example, if a company issued 1,000,000 stock options on April 1st of a fiscal year (9 months remaining in a 12-month period), the weighted dilutive shares from these options would be 1,000,000 * (9 / 12) = 750,000.

Variable Explanations:

Variables in Weighted Average Diluted Shares Outstanding Calculation
Variable Meaning Unit Typical Range
Basic Shares Outstanding The number of common shares currently issued and outstanding, excluding any potential dilutive securities. Shares Positive integer (e.g., 1,000,000 to billions)
Dilutive Securities Issued The total number of shares that would be issued if all dilutive securities (options, warrants, convertible bonds/stock) were exercised or converted. Shares Non-negative integer (e.g., 0 to millions)
Number of Months Dilutive Securities Outstanding The number of full or partial months within the reporting period that the dilutive securities were outstanding and potentially exercisable. Months 0 to Total Reporting Period (e.g., 0 to 12)
Total Months in Reporting Period The total number of months covered by the financial reporting period (e.g., 3 for a quarter, 12 for a year). Months Positive integer (e.g., 3, 6, 12)

The core idea behind {primary_keyword} is to provide a conservative estimate of EPS by assuming the worst-case scenario – that all potentially dilutive securities are converted. This ensures that investors are aware of the maximum possible dilution.

Practical Examples (Real-World Use Cases)

Understanding {primary_keyword} is crucial for financial analysis. Here are a couple of practical examples:

Example 1: Tech Startup with Stock Options

"Innovate Solutions Inc." is a growing tech company reporting its annual results.

  • Basic Shares Outstanding: 5,000,000 shares
  • Dilutive Securities Issued (Stock Options): 750,000 options
  • Number of Months Dilutive Securities Outstanding: The options were granted on July 1st, meaning they were outstanding for 6 months of the 12-month reporting period.
  • Total Reporting Period (Months): 12 months

Calculation:

  • Weighted Average Basic Shares = 5,000,000
  • Weighted Dilutive Shares = 750,000 * (6 / 12) = 375,000
  • Total Weighted Average Diluted Shares Outstanding = 5,000,000 + 375,000 = 5,375,000 shares

Financial Interpretation: Even though Innovate Solutions only has 5,000,000 basic shares outstanding, its diluted shares are 5,375,000. This means the company's earnings would be spread across more shares, potentially lowering the reported EPS compared to a basic EPS calculation. Investors would look at the diluted EPS to gauge the true per-share profitability, considering the full potential equity structure. This calculation is vital for assessing the impact of employee stock options.

Example 2: Mature Company with Convertible Bonds

"Global Manufacturing Corp." is a well-established company releasing its quarterly financial statement.

  • Basic Shares Outstanding: 20,000,000 shares
  • Dilutive Securities Issued (Convertible Bonds): These bonds are convertible into 1,200,000 shares of common stock.
  • Number of Months Dilutive Securities Outstanding: The bonds were issued on January 1st of the reporting year, and this is the end of the first quarter (3 months).
  • Total Reporting Period (Months): 3 months (for this quarterly report)

Calculation:

  • Weighted Average Basic Shares = 20,000,000
  • Weighted Dilutive Shares = 1,200,000 * (3 / 3) = 1,200,000
  • Total Weighted Average Diluted Shares Outstanding = 20,000,000 + 1,200,000 = 21,200,000 shares

Financial Interpretation: The convertible bonds add significant potential dilution. Investors will use the 21,200,000 figure to calculate the diluted EPS for the quarter. The inclusion of convertible debt in the calculation signifies potential future dilution that impacts the share value. This is a key consideration when evaluating the company's overall financial health and equity structure.

How to Use This Weighted Average Diluted Shares Outstanding Calculator

Our free {primary_keyword} calculator is designed to be simple and intuitive. Follow these steps to get your results:

  1. Enter Basic Shares Outstanding: Input the total number of common shares your company currently has issued and outstanding.
  2. Enter Dilutive Securities Issued: Input the total number of shares that could be issued if all dilutive securities (like stock options, warrants, convertible preferred stock, or convertible bonds) were exercised or converted.
  3. Enter Dilutive Securities Period: Specify the number of months within the current reporting period (quarterly or annual) that these dilutive securities have been outstanding. For example, if securities were issued halfway through a 12-month period, this would be 6 months. If they were outstanding for the entire period, enter the total reporting period months.
  4. Enter Total Reporting Period: Input the total number of months covered by your financial report (typically 3 for a quarter or 12 for a year).
  5. Click "Calculate WADSO": The calculator will instantly process your inputs.

How to Read Results:

The calculator displays:

  • Weighted Average Basic Shares: The baseline number of shares.
  • Weighted Dilutive Shares: The proportional impact of dilutive securities outstanding during the period.
  • Total Weighted Average Diluted Shares Outstanding: The primary result, representing the most conservative estimate of shares outstanding for EPS calculations.
The chart visually represents the contribution of basic and dilutive shares to the total diluted shares.

Decision-Making Guidance:

A higher {primary_keyword} figure, relative to basic shares, indicates greater potential dilution. Companies should monitor this metric and its trend. A consistently increasing WADSO might signal a need to manage the issuance of dilutive securities or explore share buyback programs. For investors, a high WADSO relative to earnings growth warrants careful consideration regarding future EPS performance and share valuation. Understanding this metric is key to evaluating the true ownership stake per share.

Key Factors That Affect Weighted Average Diluted Shares Outstanding Results

Several factors influence the calculation and interpretation of {primary_keyword}:

  1. Volume of Dilutive Securities: The sheer number of outstanding stock options, warrants, or convertible instruments is the most direct driver. More potential shares mean a higher potential WADSO.
  2. Timing of Issuance/Grant: As shown in the formula, securities are weighted by the period they are outstanding. Securities issued late in a reporting period have a less significant dilutive impact on that period's WADSO than those outstanding throughout.
  3. Conversion Ratios/Terms: The specific terms of convertible securities matter. A convertible bond that converts into a large number of shares will have a greater dilutive effect than one that converts into fewer shares, all else being equal. This is captured in the "Dilutive Securities Issued" input.
  4. Changes in Basic Shares Outstanding: While simplified in our calculator, significant share buybacks or issuances during a period would require a more complex weighted average calculation for basic shares, thus affecting the starting point for diluted EPS.
  5. Company Performance (Profitability): While not directly in the WADSO calculation itself, a company's net income (or loss) is critical for calculating Diluted EPS. If a company is highly profitable, dilution from a higher WADSO might be absorbed more easily. Conversely, in a loss-making period, the impact of dilutive securities can be more pronounced on the EPS (which would be a loss per share).
  6. Market Conditions & Share Price: For stock options and warrants, their "in-the-money" status (i.e., strike price below the current market price) determines if they are dilutive. Options far out-of-the-money are typically considered anti-dilutive and excluded from the WADSO calculation under certain accounting rules. This calculator assumes all listed securities are dilutive.
  7. Accounting Standards (GAAP/IFRS): Specific rules dictate which securities are considered dilutive and how they are weighted. For instance, certain convertible securities might be treated differently based on their embedded features.

Frequently Asked Questions (FAQ)

What is the difference between basic and diluted EPS?

Basic EPS is calculated using basic shares outstanding, while diluted EPS is calculated using weighted average diluted shares outstanding. Diluted EPS provides a more conservative view of profitability by assuming all dilutive securities are exercised or converted.

Are all convertible securities dilutive?

Not necessarily. Securities are considered dilutive only if their conversion or exercise would decrease EPS. In periods of net loss, most potentially dilutive securities are considered anti-dilutive and are excluded from the calculation. This calculator assumes all entered securities are dilutive for simplicity.

How do stock options affect WADSO?

When stock options are "in-the-money" (market price > strike price), they are considered potentially dilutive. The weighted average impact is calculated based on the number of options outstanding and the portion of the reporting period they were outstanding.

What if dilutive securities were issued mid-period?

This is precisely why the "weighted average" is used. The number of dilutive securities is multiplied by a fraction representing the portion of the reporting period they were outstanding (e.g., 6 months out of 12). Our calculator handles this weighting.

Does WADSO include preferred stock?

It depends on whether the preferred stock is convertible into common stock. If it is, and if its conversion would be dilutive, then the potential common shares from converting the preferred stock are included in the WADSO calculation.

How often should WADSO be calculated?

WADSO is calculated for each financial reporting period – typically quarterly and annually – as part of the earnings per share calculation.

Can WADSO be lower than basic shares outstanding?

No. Diluted shares outstanding will always be greater than or equal to basic shares outstanding. The dilutive effect can only increase or maintain the share count for EPS calculation purposes.

What is the "Treasury Stock Method" for options?

The Treasury Stock Method is a common accounting technique used to calculate the dilutive effect of stock options and warrants. It assumes the company uses the proceeds from the exercise of options/warrants and any "in-the-money" amount (excess of market price over exercise price) to buy back its own shares at the average market price. The net increase in shares is then added to basic EPS. Our calculator simplifies this by taking the number of shares issuable directly.

Related Tools and Internal Resources

function isValidNumber(value) { return !isNaN(parseFloat(value)) && isFinite(value); } function validateInput(id, min, max) { var input = document.getElementById(id); var errorDiv = document.getElementById(id + "Error"); var value = parseFloat(input.value); errorDiv.textContent = ""; // Clear previous error if (input.value === "") { errorDiv.textContent = "This field is required."; return false; } if (isNaN(value)) { errorDiv.textContent = "Please enter a valid number."; return false; } if (value max) { errorDiv.textContent = "Value is too high."; return false; } return true; } function calculateWADSO() { var basicShares = document.getElementById("basicShares"); var dilutiveSecurities = document.getElementById("dilutiveSecurities"); var dilutivePeriod = document.getElementById("dilutiveSecuritiesPeriod"); var reportingPeriod = document.getElementById("reportingPeriod"); var resultsDiv = document.getElementById("results"); var allValid = true; allValid = validateInput("basicShares", 0) && allValid; allValid = validateInput("dilutiveSecurities", 0) && allValid; allValid = validateInput("dilutiveSecuritiesPeriod", 0) && allValid; allValid = validateInput("reportingPeriod", 1) && allValid; // Reporting period must be at least 1 month if (!allValid) { resultsDiv.style.display = "none"; return; } var basicSharesVal = parseFloat(basicShares.value); var dilutiveSecuritiesVal = parseFloat(dilutiveSecurities.value); var dilutivePeriodVal = parseFloat(dilutivePeriod.value); var reportingPeriodVal = parseFloat(reportingPeriod.value); var weightedBasicShares = basicSharesVal; // Simplified assumption var weightedDilutiveShares = dilutiveSecuritiesVal * (dilutivePeriodVal / reportingPeriodVal); var totalWeightedDilutedShares = weightedBasicShares + weightedDilutiveShares; document.getElementById("weightedBasicShares").textContent = weightedBasicShares.toLocaleString(undefined, { maximumFractionDigits: 0 }); document.getElementById("weightedDilutiveShares").textContent = weightedDilutiveShares.toLocaleString(undefined, { maximumFractionDigits: 0 }); document.getElementById("totalWeightedDilutedShares").textContent = totalWeightedDilutedShares.toLocaleString(undefined, { maximumFractionDigits: 0 }); resultsDiv.style.display = "block"; updateChart(weightedBasicShares, weightedDilutiveShares, totalWeightedDilutedShares); } function resetCalculator() { document.getElementById("basicShares").value = "10,000,000"; document.getElementById("dilutiveSecurities").value = "1,500,000"; document.getElementById("dilutiveSecuritiesPeriod").value = "6"; document.getElementById("reportingPeriod").value = "12"; document.getElementById("basicSharesError").textContent = ""; document.getElementById("dilutiveSecuritiesError").textContent = ""; document.getElementById("dilutiveSecuritiesPeriodError").textContent = ""; document.getElementById("reportingPeriodError").textContent = ""; document.getElementById("results").style.display = "none"; if (window.myChart) { window.myChart.destroy(); } } function copyResults() { var weightedBasic = document.getElementById("weightedBasicShares").textContent; var weightedDilutive = document.getElementById("weightedDilutiveShares").textContent; var totalDiluted = document.getElementById("totalWeightedDilutedShares").textContent; var basicSharesInput = document.getElementById("basicShares").value; var dilutiveSecuritiesInput = document.getElementById("dilutiveSecurities").value; var dilutivePeriodInput = document.getElementById("dilutiveSecuritiesPeriod").value; var reportingPeriodInput = document.getElementById("reportingPeriod").value; var formulaText = document.getElementById("formula-explanation").textContent.replace("Formula Used:", "Formula:\n").trim(); var textToCopy = "Weighted Average Diluted Shares Outstanding Calculation Results:\n\n"; textToCopy += "Inputs:\n"; textToCopy += "- Basic Shares Outstanding: " + basicSharesInput + "\n"; textToCopy += "- Dilutive Securities Issued: " + dilutiveSecuritiesInput + "\n"; textToCopy += "- Dilutive Securities Period (Months): " + dilutivePeriodInput + "\n"; textToCopy += "- Total Reporting Period (Months): " + reportingPeriodInput + "\n\n"; textToCopy += "Key Assumptions:\n"; textToCopy += "- Weighted Average Basic Shares: " + weightedBasic + "\n"; textToCopy += "- Weighted Dilutive Shares: " + weightedDilutive + "\n\n"; textToCopy += "Primary Result:\n"; textToCopy += "Total Weighted Average Diluted Shares Outstanding: " + totalDiluted + "\n\n"; textToCopy += formulaText; // Use a temporary textarea to copy text var textArea = document.createElement("textarea"); textArea.value = textToCopy; textArea.style.position = "fixed"; // Avoid scrolling to bottom of page in MS Edge. textArea.style.top = 0; textArea.style.left = 0; textArea.style.width = '2em'; textArea.style.height = '2em'; textArea.style.padding = '0'; textArea.style.border = 'none'; textArea.style.outline = 'none'; textArea.style.boxShadow = 'none'; textArea.style.background = 'transparent'; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'Results copied successfully!' : 'Failed to copy results.'; alert(msg); // Simple alert for feedback } catch (err) { alert('Oops, unable to copy. Please copy manually.'); } document.body.removeChild(textArea); } function toggleFaq(element) { var parent = element.parentElement; parent.classList.toggle('open'); } // Charting Logic var chartData = { labels: ['Basic Shares', 'Dilutive Shares', 'Total Diluted Shares'], datasets: [{ label: 'Share Count', data: [0, 0, 0], backgroundColor: [ 'rgba(0, 74, 153, 0.8)', // Basic Shares Blue 'rgba(40, 167, 69, 0.8)', // Dilutive Shares Green 'rgba(23, 162, 184, 0.8)' // Total Diluted Shares Teal ], borderColor: [ 'rgba(0, 74, 153, 1)', 'rgba(40, 167, 69, 1)', 'rgba(23, 162, 184, 1)' ], borderWidth: 1 }] }; function updateChart(weightedBasic, weightedDilutive, totalDiluted) { var canvas = document.getElementById('dilutionChart'); var ctx = canvas.getContext('2d'); // Destroy previous chart instance if it exists if (window.myChart) { window.myChart.destroy(); } chartData.datasets[0].data = [weightedBasic, weightedDilutive, totalDiluted]; window.myChart = new Chart(ctx, { type: 'bar', data: chartData, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, title: { display: true, text: 'Number of Shares' } } }, plugins: { legend: { display: false // Using custom legend }, title: { display: true, text: 'Dilution Impact Breakdown' } } } }); } // Initial chart setup document.addEventListener('DOMContentLoaded', function() { var canvas = document.getElementById('dilutionChart'); var ctx = canvas.getContext('2d'); // Initialize with zero data window.myChart = new Chart(ctx, { type: 'bar', data: { labels: ['Basic Shares', 'Dilutive Shares', 'Total Diluted Shares'], datasets: [{ label: 'Share Count', data: [0, 0, 0], backgroundColor: [ 'rgba(0, 74, 153, 0.8)', // Basic Shares Blue 'rgba(40, 167, 69, 0.8)', // Dilutive Shares Green 'rgba(23, 162, 184, 0.8)' // Total Diluted Shares Teal ], borderColor: [ 'rgba(0, 74, 153, 1)', 'rgba(40, 167, 69, 1)', 'rgba(23, 162, 184, 1)' ], borderWidth: 1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, title: { display: true, text: 'Number of Shares' } } }, plugins: { legend: { display: false // Using custom legend }, title: { display: true, text: 'Dilution Impact Breakdown' } } } }); }); // Add Chart.js library via CDN var script = document.createElement('script'); script.src = 'https://cdn.jsdelivr.net/npm/chart.js'; document.head.appendChild(script);

Leave a Comment