Wheel Tire Offset Calculator

Wheel Tire Offset Calculator & Guide :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –border-color: #ddd; –card-background: #fff; –shadow: 0 4px 8px rgba(0,0,0,0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); line-height: 1.6; margin: 0; padding: 0; } .container { max-width: 960px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); } header { background-color: var(–primary-color); color: white; padding: 20px 0; text-align: center; margin-bottom: 20px; border-radius: 8px 8px 0 0; } header h1 { margin: 0; font-size: 2.5em; } h2, h3 { color: var(–primary-color); margin-top: 1.5em; margin-bottom: 0.5em; } .loan-calc-container { background-color: var(–card-background); padding: 25px; border-radius: 8px; box-shadow: var(–shadow); margin-bottom: 30px; } .input-group { margin-bottom: 20px; text-align: left; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group select { width: calc(100% – 22px); padding: 10px; border: 1px solid var(–border-color); border-radius: 4px; font-size: 1em; box-sizing: border-box; } .input-group .helper-text { font-size: 0.85em; color: #6c757d; margin-top: 5px; display: block; } .error-message { color: #dc3545; font-size: 0.85em; margin-top: 5px; display: block; min-height: 1.2em; /* Prevent layout shift */ } .button-group { display: flex; justify-content: space-between; margin-top: 25px; gap: 10px; } button { padding: 12px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s ease; } .btn-primary { background-color: var(–primary-color); color: white; } .btn-primary:hover { background-color: #003366; } .btn-secondary { background-color: #6c757d; color: white; } .btn-secondary:hover { background-color: #5a6268; } .btn-success { background-color: var(–success-color); color: white; } .btn-success:hover { background-color: #218838; } #results { margin-top: 30px; padding: 20px; background-color: #e9ecef; border-radius: 8px; border: 1px solid var(–border-color); } #results h3 { margin-top: 0; color: var(–primary-color); } .result-item { margin-bottom: 10px; 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: #d4edda; padding: 15px; border-radius: 5px; margin-bottom: 15px; text-align: center; } .formula-explanation { font-size: 0.9em; color: #6c757d; margin-top: 15px; padding-top: 10px; border-top: 1px dashed var(–border-color); } table { width: 100%; border-collapse: collapse; margin-top: 20px; margin-bottom: 30px; } th, td { border: 1px solid var(–border-color); padding: 10px; text-align: left; } th { background-color: var(–primary-color); color: white; } 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; box-shadow: var(–shadow); } .article-content { margin-top: 30px; background-color: var(–card-background); padding: 25px; border-radius: 8px; box-shadow: var(–shadow); } .article-content h2, .article-content h3 { margin-top: 1.5em; margin-bottom: 0.5em; color: var(–primary-color); } .article-content p { margin-bottom: 1em; } .article-content ul, .article-content ol { margin-bottom: 1em; padding-left: 20px; } .article-content li { margin-bottom: 0.5em; } .faq-item { margin-bottom: 15px; } .faq-item strong { display: block; color: var(–primary-color); cursor: pointer; } .faq-item p { margin-top: 5px; display: none; /* Hidden by default */ padding-left: 15px; border-left: 2px solid var(–primary-color); } .internal-links { margin-top: 30px; background-color: var(–card-background); padding: 25px; border-radius: 8px; box-shadow: var(–shadow); } .internal-links h3 { margin-top: 0; color: var(–primary-color); } .internal-links ul { list-style: none; padding: 0; } .internal-links li { margin-bottom: 10px; } .internal-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; } .internal-links a:hover { text-decoration: underline; } .internal-links span { font-size: 0.9em; color: #6c757d; display: block; margin-top: 3px; } footer { text-align: center; margin-top: 30px; padding: 20px; font-size: 0.9em; color: #6c757d; } @media (max-width: 768px) { .container { margin: 10px; padding: 15px; } header h1 { font-size: 1.8em; } button { padding: 10px 15px; font-size: 0.9em; } .button-group { flex-direction: column; } }

Wheel Tire Offset Calculator

Calculate Your Wheel Offset

Enter your current wheel specifications and desired changes to see the impact on your vehicle's offset.

Diameter of your current wheel in inches.
Width of your current wheel in inches.
Offset of your current wheel in millimeters (mm). Use positive (+) for ET, negative (-) for deep dish.
Diameter of your new wheel in inches.
Width of your new wheel in inches.
Offset of your new wheel in millimeters (mm). Use positive (+) for ET, negative (-) for deep dish.

Calculation Results

Offset Change: mm
Inner Clearance Change: mm
Outer Clearance Change: mm
New Wheel Position Relative to Fender:
Formula Explanation:
Offset is the distance from the wheel's mounting surface to the centerline of the wheel. A positive offset moves the wheel inward, while a negative offset moves it outward. Clearance changes are calculated based on the difference in wheel width and offset.

Offset Comparison Chart

Offset Calculation Variables
Variable Meaning Unit Typical Range
Wheel Diameter The overall diameter of the wheel rim. Inches (in) 14 – 24+
Wheel Width The width of the wheel rim, measured bead seat to bead seat. Inches (in) 4 – 12+
Offset (ET) Distance from the wheel's mounting surface to its centerline. Millimeters (mm) -50 to +70+
Offset Change The net difference between the new and old offset values. Millimeters (mm) Varies
Clearance Change How much closer or further the wheel edge moves relative to the suspension or fender. Millimeters (mm) Varies

What is Wheel Tire Offset?

Wheel tire offset is a critical measurement that defines how a wheel is positioned within the wheel well of a vehicle. It's the distance between the wheel's mounting surface (where it bolts to the hub) and the centerline of the wheel rim. Understanding wheel tire offset is fundamental for anyone looking to customize their vehicle's stance, improve handling, or ensure proper fitment of new wheels and tires. The correct wheel tire offset ensures that your wheels sit flush with the fenders or have the desired aggressive stance without rubbing against suspension components or the fender liners.

Who should use a wheel tire offset calculator?

  • Vehicle owners planning to install aftermarket wheels.
  • Enthusiasts aiming for a specific aesthetic (flush, tucked, or aggressive stance).
  • Individuals upgrading to larger or wider tires.
  • Anyone experiencing rubbing issues with their current wheel setup.
  • Mechanics and tire shops verifying fitment.

Common Misconceptions about Wheel Tire Offset:

  • "More negative offset always looks better." While a more aggressive stance is popular, excessive negative offset can lead to rubbing, stress on wheel bearings, and poor handling.
  • "Offset is the same as backspacing." While related, they are different measurements. Offset is measured from the centerline, while backspacing is from the mounting surface to the outer lip.
  • "All wheels for my car model have the same offset." While manufacturers recommend a range, different wheel designs and widths can accommodate various offsets.
  • "Offset doesn't affect handling." Changes in offset alter the scrub radius and track width, which directly impact steering feel, stability, and tire wear.

Wheel Tire Offset Formula and Mathematical Explanation

The core concept of wheel tire offset revolves around the relationship between the wheel's width, its offset value, and how these affect clearance. The offset (often denoted as 'ET' in Europe) is the distance from the wheel's hub mounting surface to the wheel's centerline.

Formula Derivation:

Let's break down the calculations:

  1. Wheel Width Conversion: Wheel width is typically in inches, while offset is in millimeters. We need a consistent unit. 1 inch = 25.4 mm.
    • Current Wheel Radius (in) = Current Wheel Diameter (in) / 2
    • New Wheel Radius (in) = New Wheel Diameter (in) / 2
    • Current Wheel Width (mm) = Current Wheel Width (in) * 25.4
    • New Wheel Width (mm) = New Wheel Width (in) * 25.4
  2. Centerline Position:
    • Current Wheel Centerline Position (mm) = Current Wheel Radius (in) * 25.4 – Current Offset (mm)
    • New Wheel Centerline Position (mm) = New Wheel Radius (in) * 25.4 – New Offset (mm)
    *Note: A positive offset means the centerline is further *inward* than the mounting surface. A negative offset means it's further *outward*. The formula above assumes offset is measured from the mounting surface to the centerline. A more common way to think about it for clearance is:
    • Distance from mounting surface to inner lip (mm) = (Wheel Width (mm) / 2) – Offset (mm)
    • Distance from mounting surface to outer lip (mm) = (Wheel Width (mm) / 2) + Offset (mm)
  3. Offset Change: This is the direct difference between the new and old offset values.

    Offset Change (mm) = New Offset (mm) – Current Offset (mm)

    A positive result means the new wheel is positioned further inward (more positive offset or less negative offset). A negative result means it's positioned further outward.

  4. Clearance Changes: These calculations determine how much the inner and outer edges of the wheel move relative to their original positions.
    • Inner Clearance Change (mm): This measures how much the inner edge of the wheel moves towards or away from the suspension components.

      Inner Clearance Change (mm) = (New Wheel Width (mm) / 2) – (Current Wheel Width (mm) / 2) + New Offset (mm) – Current Offset (mm)

      A positive value means the inner edge has moved *outward* (more clearance).

    • Outer Clearance Change (mm): This measures how much the outer edge of the wheel moves towards or away from the fender.

      Outer Clearance Change (mm) = (Current Wheel Width (mm) / 2) + Current Offset (mm) – (New Wheel Width (mm) / 2) – New Offset (mm)

      A positive value means the outer edge has moved *outward* (closer to the fender).

  5. New Wheel Position Relative to Fender: This is a simplified interpretation of the outer clearance change.

    New Wheel Position = Outer Clearance Change (mm)

    A positive value indicates the wheel edge is further out (closer to the fender). A negative value indicates it's further in.

Variables Table:

Offset Calculation Variables Explained
Variable Meaning Unit Typical Range
Current Wheel Diameter Diameter of the existing wheel rim. Inches (in) 14 – 24+
Current Wheel Width Width of the existing wheel rim. Inches (in) 4 – 12+
Current Offset Offset of the existing wheel. Positive ET values move the wheel inward, negative values move it outward. Millimeters (mm) -50 to +70+
New Wheel Diameter Diameter of the intended new wheel rim. Inches (in) 14 – 24+
New Wheel Width Width of the intended new wheel rim. Inches (in) 4 – 12+
New Offset Offset of the intended new wheel. Millimeters (mm) -50 to +70+
Offset Change Net difference in offset between new and old wheels. Millimeters (mm) Varies
Inner Clearance Change Change in space between the inner wheel edge and suspension components. Millimeters (mm) Varies
Outer Clearance Change Change in space between the outer wheel edge and the fender. Millimeters (mm) Varies
New Wheel Position Indicates how much further out the new wheel sits relative to the fender. Millimeters (mm) Varies

Practical Examples (Real-World Use Cases)

Example 1: Upgrading to Wider Wheels for a Sportier Stance

Scenario: A car owner wants to upgrade their stock wheels to wider, more aggressive-looking wheels. They currently have 17×7.5 wheels with an offset of +45mm. They are considering new 18×8.5 wheels with an offset of +35mm.

Inputs:

  • Current Wheel Diameter: 17 in
  • Current Wheel Width: 7.5 in
  • Current Offset: 45 mm
  • New Wheel Diameter: 18 in
  • New Wheel Width: 8.5 in
  • New Offset: 35 mm

Calculated Results:

  • Offset Change: 35 mm – 45 mm = -10 mm (The new wheel is effectively 10mm further outward)
  • Inner Clearance Change: ( (8.5 * 25.4) / 2 ) – ( (7.5 * 25.4) / 2 ) + 35 – 45 = 107.95 – 95.25 + 35 – 45 = 12.7 + (-10) = 2.7 mm (Slightly more inner clearance)
  • Outer Clearance Change: ( (7.5 * 25.4) / 2 ) + 45 – ( (8.5 * 25.4) / 2 ) – 35 = 95.25 + 45 – 107.95 – 35 = 140.25 – 142.95 = -2.7 mm (The outer edge moves 2.7mm inward relative to the fender)
  • New Wheel Position Relative to Fender: -2.7 mm (The wheel edge is 2.7mm further *in* from the fender's original line)

Interpretation: The new wheels are 1 inch wider and have a lower offset. The offset change (-10mm) indicates the wheel moves outward. However, the increased width means the inner edge moves outward by 12.7mm, and the outer edge moves inward by 2.7mm. This setup results in the wheel sitting slightly more flush with the fender (outer edge is 2.7mm further in) while gaining a small amount of clearance on the inside. This is generally a safe and desirable upgrade for a sportier look without significant rubbing concerns, assuming the tire sidewall doesn't increase dramatically.

Example 2: Fitting Larger Diameter Wheels with Minimal Stance Change

Scenario: A driver wants to upgrade to larger diameter wheels but maintain a similar stance to their current setup. They have 18×8 wheels with +40mm offset and want to move to 20×8.5 wheels with +45mm offset.

Inputs:

  • Current Wheel Diameter: 18 in
  • Current Wheel Width: 8 in
  • Current Offset: 40 mm
  • New Wheel Diameter: 20 in
  • New Wheel Width: 8.5 in
  • New Offset: 45 mm

Calculated Results:

  • Offset Change: 45 mm – 40 mm = +5 mm (The new wheel is effectively 5mm further inward)
  • Inner Clearance Change: ( (8.5 * 25.4) / 2 ) – ( (8 * 25.4) / 2 ) + 45 – 40 = 107.95 – 101.6 + 45 – 40 = 6.35 + 5 = 11.35 mm (More inner clearance)
  • Outer Clearance Change: ( (8 * 25.4) / 2 ) + 40 – ( (8.5 * 25.4) / 2 ) – 45 = 101.6 + 40 – 107.95 – 45 = 141.6 – 152.95 = -11.35 mm (Outer edge moves 11.35mm inward relative to the fender)
  • New Wheel Position Relative to Fender: -11.35 mm (The wheel edge is 11.35mm further *in* from the fender's original line)

Interpretation: The new wheels are larger in diameter and slightly wider, with a higher offset. The offset change (+5mm) pushes the wheel inward. The increased width adds 6.35mm to the inner side and 11.35mm to the outer side. Combined, the new wheel sits 11.35mm further inward relative to the fender line compared to the old wheel. This setup provides more inner clearance and tucks the wheel in slightly, which might be desirable for clearance with wide body kits or specific suspension setups, but requires careful consideration of tire profile to avoid rubbing on the inside.

How to Use This Wheel Tire Offset Calculator

Using our wheel tire offset calculator is straightforward. Follow these steps to understand how new wheels will fit on your vehicle:

  1. Identify Current Wheel Specs: Find the diameter (in inches), width (in inches), and offset (in millimeters) of your current wheels. This information is usually found on the tire sidewall (diameter), the inside of the wheel rim, or in your vehicle's owner's manual.
  2. Identify New Wheel Specs: Determine the diameter (in inches), width (in inches), and offset (in millimeters) of the wheels you are considering purchasing.
  3. Input Data: Enter these values accurately into the corresponding fields in the calculator: "Current Wheel Diameter," "Current Wheel Width," "Current Offset," "New Wheel Diameter," "New Wheel Width," and "New Offset." Remember that offset is typically positive (ET) for wheels that sit further inward and negative for wheels that stick out further.
  4. Calculate: Click the "Calculate Offset" button.

How to Read Results:

  • Primary Result (Offset Change): This is the most direct indicator. A positive number means the new wheel sits further inward (more positive offset or less negative offset). A negative number means it sits further outward (less positive offset or more negative offset).
  • Inner Clearance Change: A positive value means the inner edge of the wheel has moved outward, providing more space between the wheel and suspension components (like control arms or struts). A negative value means it has moved inward, potentially causing interference.
  • Outer Clearance Change: A positive value means the outer edge of the wheel has moved outward, closer to the fender. A negative value means it has moved inward, away from the fender.
  • New Wheel Position Relative to Fender: This is a simplified view of the Outer Clearance Change. A positive number means the wheel edge is further out (closer to the fender). A negative number means it's further in.

Decision-Making Guidance:

  • Rubbing: Pay close attention to the "Outer Clearance Change." If this value is positive and large, you risk the tire rubbing against the fender or fender liner, especially during turns or when the suspension compresses. Similarly, a negative "Inner Clearance Change" can cause rubbing on suspension components.
  • Stance: The "Offset Change" and "New Wheel Position" help visualize the final look. A value closer to 0mm for "New Wheel Position" means the wheel is flush with the original fender line. Negative values tuck the wheel in, while positive values push it out.
  • Handling: Significant changes in offset can affect your vehicle's scrub radius and track width, impacting steering feel and stability. Consult with a professional if making drastic changes.
  • Tire Size: Remember that tire size (especially sidewall height and width) also plays a crucial role in clearance. This calculator focuses on wheel fitment, but tire dimensions must also be considered.

Key Factors That Affect Wheel Tire Offset Results

While the calculator provides precise numerical outputs, several real-world factors influence the actual fitment and performance of your chosen wheel tire offset:

  1. Tire Sidewall Profile and Width: The calculator assumes the tire fits the new wheel width appropriately. However, a taller or wider tire sidewall can easily cause rubbing issues even if the wheel offset calculation looks good. Always ensure your tire choice complements your wheel dimensions.
  2. Suspension Modifications: Aftermarket suspension components (coilovers, lowering springs, control arms) can alter the suspension geometry and available clearance, potentially affecting how a specific wheel tire offset fits.
  3. Fender Modifications (Rolling/Pulling): To accommodate wider wheels or more aggressive offsets, many enthusiasts modify their fenders (rolling or pulling). This increases the available clearance, allowing for fitments that would otherwise rub.
  4. Brake Clearance: Larger brake kits (big brake kits) require more internal clearance. A wheel with a high offset or a very wide barrel might not clear the brake caliper, even if the offset calculation suggests it should fit the hub. Always check brake clearance specifically.
  5. Vehicle Load and Ride Height: The amount of clearance can change depending on how heavily the vehicle is loaded and its current ride height (especially with air or hydraulic suspension). A fully loaded vehicle or a significantly lowered car will have less clearance.
  6. Manufacturing Tolerances: Wheel and tire manufacturing isn't always perfectly precise. Minor variations in rim width, offset, or tire dimensions can exist between different brands or even batches, potentially leading to slight differences in fitment.
  7. Hub Centricity vs. Lug Centricity: While most modern vehicles use hub-centric mounting (where the wheel is centered on the hub bore), some aftermarket wheels might be lug-centric. This can slightly affect the wheel's final seating position and stress on the lugs.
  8. Tire Pressure: While seemingly minor, underinflated tires can bulge more at the sidewall, potentially reducing clearance, especially on the inner side.

Frequently Asked Questions (FAQ)

What is the difference between offset and backspacing?

Offset is the distance from the wheel's mounting surface to its centerline. Backspacing is the distance from the mounting surface to the *outer lip* of the wheel. They are related but measure different aspects of wheel position.

Can I use wheels with a different offset than stock?

Yes, you can often use wheels with different offsets, but it's crucial to stay within a reasonable range to avoid rubbing, excessive wear on suspension components, and adverse handling effects. Our calculator helps determine these changes.

What does ET mean on a wheel?

ET is the German abbreviation for "Einpresstiefe," which translates to "insertion depth." It is equivalent to the wheel offset, measured in millimeters.

Will a lower offset make my wheels stick out more?

Yes, a lower offset (e.g., going from +40mm to +30mm, or from 0mm to -10mm) will cause the wheel to sit further outward, closer to the fender.

What is considered a "safe" offset change?

Generally, staying within +/- 5-10mm of the factory offset is considered safe for most vehicles without significant modifications. However, this can vary greatly depending on the vehicle, wheel width, and tire size. Always check for clearance.

How does offset affect handling?

Offset influences the vehicle's scrub radius and track width. Changes can affect steering effort, stability under braking and acceleration, and tire wear patterns. Significant deviations from stock offset can negatively impact handling dynamics.

Can I mix wheels with different offsets on my car?

It is strongly advised against mixing wheels with different offsets on the same axle (front or rear). This can lead to uneven tire wear, poor handling, and potential damage to the drivetrain and suspension components due to differing track widths.

Does wheel diameter affect offset calculations?

Wheel diameter itself doesn't directly change the offset calculation formula, but it affects the overall tire height and sidewall profile. A larger diameter wheel often means a shorter tire sidewall to maintain similar overall diameter, which can influence clearance. The calculator uses diameter to help conceptualize the wheel size but the core offset math relies on width and offset values.

What is the ideal offset for my car?

The ideal offset depends heavily on your specific vehicle model, the width and diameter of the wheels you're installing, and the tire size you plan to use. Consult your vehicle's manual, reputable forums for your car model, or a professional wheel specialist for recommendations.

Offset Comparison Chart (Mobile View)

© 2023 Your Website Name. All rights reserved.

var chartInstance = null; var chartInstanceMobile = null; function getInputValue(id) { var element = document.getElementById(id); if (!element) return null; var value = parseFloat(element.value); return isNaN(value) ? null : value; } function setError(id, message) { var errorElement = document.getElementById(id); if (errorElement) { errorElement.textContent = message; } } function clearErrors() { setError("currentWheelDiameterError", ""); setError("currentWheelWidthError", ""); setError("currentOffsetError", ""); setError("newWheelDiameterError", ""); setError("newWheelWidthError", ""); setError("newOffsetError", ""); } function validateInputs() { clearErrors(); var valid = true; var currentWheelDiameter = getInputValue("currentWheelDiameter"); if (currentWheelDiameter === null || currentWheelDiameter <= 0) { setError("currentWheelDiameterError", "Please enter a valid positive wheel diameter."); valid = false; } var currentWheelWidth = getInputValue("currentWheelWidth"); if (currentWheelWidth === null || currentWheelWidth <= 0) { setError("currentWheelWidthError", "Please enter a valid positive wheel width."); valid = false; } var currentOffset = getInputValue("currentOffset"); if (currentOffset === null) { setError("currentOffsetError", "Please enter a valid offset value."); valid = false; } var newWheelDiameter = getInputValue("newWheelDiameter"); if (newWheelDiameter === null || newWheelDiameter <= 0) { setError("newWheelDiameterError", "Please enter a valid positive wheel diameter."); valid = false; } var newWheelWidth = getInputValue("newWheelWidth"); if (newWheelWidth === null || newWheelWidth = 0 ? 'rgba(40, 167, 69, 0.7)' : 'rgba(220, 53, 69, 0.7)'; // Green for positive, Red for negative var innerColor = innerClearanceChange >= 0 ? 'rgba(0, 74, 153, 0.7)' : 'rgba(220, 53, 69, 0.7)'; // Primary Blue for positive, Red for negative var outerColor = outerClearanceChange >= 0 ? 'rgba(255, 193, 7, 0.7)' : 'rgba(40, 167, 69, 0.7)'; // Yellow for positive (closer to fender), Green for negative (further from fender) var backgroundColors = [offsetColor, innerColor, outerColor]; var borderColors = [offsetChange >= 0 ? 'rgba(40, 167, 69, 1)' : 'rgba(220, 53, 69, 1)', innerClearanceChange >= 0 ? 'rgba(0, 74, 153, 1)' : 'rgba(220, 53, 69, 1)', outerClearanceChange >= 0 ? 'rgba(255, 193, 7, 1)' : 'rgba(40, 167, 69, 1)']; var chartData = { labels: labels, datasets: [{ label: 'Change (mm)', data: dataValues, backgroundColor: backgroundColors, borderColor: borderColors, borderWidth: 1 }] }; var options = { responsive: true, maintainAspectRatio: false, scales: { y: { beginAtZero: true, title: { display: true, text: 'Change in Millimeters (mm)' } } }, plugins: { legend: { display: false // Legend handled by custom text below }, title: { display: true, text: 'Wheel Offset & Clearance Changes' } } }; chartInstance = new Chart(ctx, { type: 'bar', data: chartData, options: options }); chartInstanceMobile = new Chart(ctxMobile, { type: 'bar', data: chartData, options: options }); // Custom Legend var legendHtml = '
    '; legendHtml += '
  • Offset Change: ' + offsetChange.toFixed(2) + ' mm
  • '; legendHtml += '
  • Inner Clearance Change: ' + innerClearanceChange.toFixed(2) + ' mm
  • '; legendHtml += '
  • Outer Clearance Change: ' + outerClearanceChange.toFixed(2) + ' mm
  • '; legendHtml += '
'; document.getElementById('chartLegend').innerHTML = legendHtml; document.getElementById('chartLegendMobile').innerHTML = legendHtml; // Use same legend for mobile // Style the custom legend var style = document.createElement('style'); style.innerHTML = ` #chartLegend ul, #chartLegendMobile ul { list-style: none; padding: 0; margin: 10px 0 0 0; } #chartLegend li, #chartLegendMobile li { margin-bottom: 8px; display: flex; align-items: center; font-size: 0.9em; } #chartLegend span, #chartLegendMobile span { display: inline-block; width: 15px; height: 15px; margin-right: 8px; border-radius: 3px; border-width: 1px; border-style: solid; } `; document.head.appendChild(style); } // Function to toggle FAQ answers function toggleFaq(element) { var p = element.nextElementSibling; if (p.style.display === "block") { p.style.display = "none"; } else { p.style.display = "block"; } } // Initial calculation on page load window.onload = function() { // Add Chart.js library dynamically var script = document.createElement('script'); script.src = 'https://cdn.jsdelivr.net/npm/chart.js@3.7.0/dist/chart.min.js'; script.onload = function() { calculateOffset(); // Calculate after chart library is loaded }; document.head.appendChild(script); };

Leave a Comment