Quilt Border Calculator
Calculate Your Quilt Border Fabric Needs
Adding borders to a quilt is a rewarding step that can dramatically change its appearance and size. Whether you’re aiming for a simple frame or an intricate design, knowing how much fabric to purchase is crucial. Our **Quilt Border Calculator** is designed to simplify this process, providing you with accurate fabric yardage estimations so you can focus on the creative aspects of quilting.
What is a Quilt Border Calculator?
A **Quilt Border Calculator** is a specialized tool that helps quilters determine the exact amount of fabric needed to create borders for their quilt projects. It takes into account the dimensions of the quilt top, the desired width of the borders, the number of border layers, and the standard width of quilting fabric. This ensures you buy the right amount of fabric, minimizing waste and avoiding last-minute trips to the fabric store.
Who should use it:
- Beginner quilters unsure about fabric calculations.
- Experienced quilters planning complex border designs.
- Anyone wanting to maximize fabric efficiency and minimize waste.
- Longarm quilters estimating backing and binding fabric needs (though this calculator focuses on borders).
Common misconceptions:
- “I can just eyeball it.” While experienced quilters might have a good sense, precise calculations prevent errors that can lead to insufficient fabric or awkward piecing.
- “Fabric width is always 44 inches.” Most quilting cottons have a usable width closer to 40-42 inches after accounting for selvages and shrinkage. The calculator uses a standard 42″ as a default.
- “Just multiply width x height.” This simple multiplication doesn’t account for the piecing of border strips, especially the critical corner measurements and how fabric widths are utilized.
Quilt Border Fabric Calculation Formula and Mathematical Explanation
Calculating quilt border fabric involves several steps to ensure accuracy. We need to determine the total length of fabric required for all border strips and then figure out how many “cuts” from the fabric bolt this translates to.
The fundamental idea is to calculate the length of each border strip needed, considering how borders are typically attached. Borders are usually added to the sides first, then the top and bottom, or vice-versa. For precise calculations, especially with multiple borders, it’s best to calculate the required length for each side independently.
Let’s break down the calculation for a single border layer:
- Side Border Strips: You need two strips, each the height of the quilt top plus seam allowances.
Length per side strip = Quilt Height + (2 * Seam Allowance) - Top/Bottom Border Strips: You need two strips. These strips need to cover the width of the quilt top PLUS the width of the two side border strips already added, plus seam allowances.
Width needed for top/bottom = Quilt Width + (2 * Border Width) + (2 * Seam Allowance)
Length per top/bottom strip = Width needed for top/bottom + (2 * Seam Allowance)
However, a more common and often fabric-saving method involves calculating the length for all four sides based on the quilt’s dimensions at the time the border is added. For simplicity and efficient fabric use, we’ll calculate the total length of border strips needed and then determine cuts from the fabric width.
The core calculation considers the total perimeter needed and how many fabric widths are required to achieve that length.
Step 1: Calculate the length of each border strip.
For the first border:
- Two side strips: Each length = `quiltHeight` + (2 * `seamAllowance`)
- Two top/bottom strips: Each length = `quiltWidth` + (2 * `borderWidth`) + (2 * `seamAllowance`)
For subsequent borders, the dimensions of the quilt effectively increase. A simpler approach for fabric estimation is to calculate the total linear inches of border strips required and then divide by the usable fabric width.
Simplified Calculation for Total Linear Inches:
Let’s consider the total length of border fabric needed. For `n` borders, each of `borderWidth`:
The dimensions of the quilt *after* adding `k` borders are:
- Width: `quiltWidth` + 2 * (`k` * `borderWidth`) + 2 * (`k` * `seamAllowance`)
- Height: `quiltHeight` + 2 * (`k` * `borderWidth`) + 2 * (`k` * `seamAllowance`)
For border `k+1`:
- Side strips length = Height after `k` borders + (2 * `seamAllowance`)
- Top/Bottom strips length = Width after `k` borders + (2 * `seamAllowance`)
This iterative calculation can be complex. A more practical approach used by the calculator:
Estimate Total Linear Inches Required:
For each border, calculate the perimeter it will cover and add allowance for joining. A common estimation adds the quilt dimensions, the border width, and seam allowances. A simplified formula for the total linear inches of border fabric needed (before considering fabric width cuts) is:
Total Linear Inches ≈ (Quilt Width + Quilt Height) * 2 * (Number of Borders) + (Number of Borders * Border Width * 4) + (Total number of strips * Seam Allowance * 2)
A more accurate approach implemented in the calculator calculates strip lengths iteratively. For each border, it determines the required length for the side strips and the top/bottom strips based on the dimensions *including* previous borders.
Length of side strips for border `i` = (Quilt Height + 2 * (`i`-1) * `borderWidth` + 2 * (`i`-1) * `seamAllowance`) + (2 * `seamAllowance`)
Length of top/bottom strips for border `i` = (Quilt Width + 2 * (`i`-1) * `borderWidth` + 2 * (`i`-1) * `seamAllowance`) + (2 * `seamAllowance`)
The total required length is the sum of all these strip lengths.
Step 2: Determine Fabric Cuts.
Once the total required length of fabric strips is known, we divide this by the usable `fabricWidth` to find out how many “cuts” are needed. Since fabric is usually sold by the yard (36 inches), we calculate the total yards needed.
Total Fabric Length Needed (inches) = Sum of all required border strip lengths.
Number of Fabric Widths = Total Fabric Length Needed / fabricWidth
Total Yards Needed = (Number of Fabric Widths * fabricWidth) / 36
Variables Table:
| Variable | Meaning | Unit | Typical Range |
|---|---|---|---|
| Quilt Top Width | The finished width of the central quilt block. | inches | 12 – 120+ |
| Quilt Top Height | The finished height of the central quilt block. | inches | 12 – 120+ |
| Border Width | The finished width of a single border strip. | inches | 1 – 6+ |
| Number of Borders | The total count of distinct border layers. | count | 1 – 5+ |
| Fabric Width | The usable width of the fabric bolt after selvages. | inches | 36 – 60+ (40-42″ common for quilting cotton) |
| Seam Allowance | The amount of fabric used in each seam (standard quilting is 1/4 inch). | inches | 0.25 (standard) |
| Total Fabric Needed | The primary output: total fabric required for all borders. | Yards | Varies widely based on quilt size and borders. |
| Side Strips Length | Length required for the two vertical border strips. | inches | Calculated |
| Top/Bottom Strips Length | Length required for the two horizontal border strips. | inches | Calculated |
Practical Examples (Real-World Use Cases)
Example 1: Simple Baby Quilt with One Border
Scenario: A quilter is making a baby quilt measuring 40 inches wide by 40 inches high. They want to add a single border that will finish at 3 inches wide. They are using standard quilting cotton with a usable width of 42 inches and a 1/4 inch seam allowance.
- Inputs:
- Quilt Top Width: 40 inches
- Quilt Top Height: 40 inches
- Border Width: 3 inches
- Number of Borders: 1
- Fabric Width: 42 inches
- Seam Allowance: 0.25 inches
- Calculations:
- Border 1 Side Strips: (40″ height + 2*0.25″ seam) = 40.5″ each. Total = 81″.
- Border 1 Top/Bottom Strips: (40″ width + 2*3″ border width + 2*0.25″ seam) = 46.5″ each. Total = 93″.
- Total Linear Inches Needed: 81″ + 93″ = 174 inches.
- Number of Fabric Widths (assuming cutting strips along the width): 174 inches / 42 inches/width ≈ 4.14 widths. Since you can’t buy partial widths, you need 5 cuts.
- Total Fabric Needed: 5 cuts * 42 inches/cut = 210 inches.
- Total Yards Needed: 210 inches / 36 inches/yard ≈ 5.83 yards. (The calculator will round this up appropriately).
- Interpretation: The quilter needs approximately 5.83 yards of fabric. It’s always wise to round up to the nearest 1/4 or 1/2 yard, so purchasing 6 yards would be a safe bet to account for any cutting errors or squaring up.
Example 2: Larger Quilt with Multiple Borders
Scenario: A quilter is making a queen-size quilt top that measures 80 inches wide by 90 inches high. They want to add three borders: the first border 2 inches wide, the second 3 inches wide, and the third 4 inches wide. They are using standard 42-inch wide fabric with a 1/4 inch seam allowance.
- Inputs:
- Quilt Top Width: 80 inches
- Quilt Top Height: 90 inches
- Border Width (for B1): 2 inches
- Border Width (for B2): 3 inches
- Border Width (for B3): 4 inches
- Number of Borders: 3
- Fabric Width: 42 inches
- Seam Allowance: 0.25 inches
- Calculations (Simplified View – Calculator performs detailed breakdown):
- Border 1 (2″): Quilt is 80×90.
- Sides: 90″ + 0.5″ = 90.5″ each (181″ total)
- Top/Bottom: (80″ + 2*2″ border + 0.5″ seam) = 84.5″ each (169″ total)
- Total B1 = 350″
- Border 2 (3″): New quilt dims approx 84.5″ x 94.5″.
- Sides: 94.5″ + 0.5″ = 95″ each (190″ total)
- Top/Bottom: (84.5″ + 2*3″ border + 0.5″ seam) = 91″ each (182″ total)
- Total B2 = 372″
- Border 3 (4″): New quilt dims approx 91″ x 98″.
- Sides: 98″ + 0.5″ = 98.5″ each (197″ total)
- Top/Bottom: (91″ + 2*4″ border + 0.5″ seam) = 100.5″ each (201″ total)
- Total B3 = 398″
- Total Linear Inches Needed: 350″ + 372″ + 398″ = 1120 inches.
- Number of Fabric Widths: 1120 inches / 42 inches/width ≈ 26.67 widths. Need 27 cuts.
- Total Fabric Needed: 27 cuts * 42 inches/cut = 1134 inches.
- Total Yards Needed: 1134 inches / 36 inches/yard = 31.5 yards.
- Border 1 (2″): Quilt is 80×90.
- Interpretation: This is a significant amount of fabric! The quilter will need 31.5 yards of fabric for the borders alone. This highlights the importance of accurate calculations for large projects. They might consider buying fabric in larger quantities or looking for bolt-end sales.
How to Use This Quilt Border Calculator
Using the **Quilt Border Calculator** is straightforward:
- Enter Quilt Top Dimensions: Input the final width and height of your quilt’s central pieced section in inches into the ‘Quilt Top Width’ and ‘Quilt Top Height’ fields.
- Define Border(s):
- Enter the desired finished width for *each* border strip in the ‘Border Width’ field. If you have multiple borders, the calculator applies the width you enter for the first border. For subsequent borders, you’ll need to mentally add the widths or use the calculator iteratively if it supported multiple border definitions (this version calculates based on sequential application).
- Specify the ‘Number of Borders’ you plan to add.
- Specify Fabric Details:
- Enter the ‘Fabric Width’ in inches. The default is 42 inches, common for quilting cotton. Adjust if using wider fabric.
- Confirm the ‘Seam Allowance’ in inches. 0.25 inches (1/4″) is standard for quilting.
- Select the ‘Grain Line Direction’ – typically “On the Width” for straight-grain border strips cut from the fabric bolt.
- Calculate: Click the ‘Calculate’ button.
- Read Results:
- The ‘Main Result’ shows the total estimated fabric needed in yards.
- ‘Intermediate Values’ provide breakdowns like total linear inches required and estimated fabric cuts needed.
- The ‘Formula Explanation’ clarifies the basic logic.
- Decision Making: Compare the calculated yards needed against your budget and fabric stash. Always consider rounding up slightly (e.g., to the nearest 1/4 or 1/2 yard) to account for squaring up, potential cutting errors, or future projects.
- Reset: If you need to start over or try different dimensions, click the ‘Reset’ button to return to default values.
- Copy: Use the ‘Copy Results’ button to quickly grab the calculated values for your project notes or order forms.
Key Factors That Affect Quilt Border Results
Several factors influence the amount of fabric needed for quilt borders:
- Quilt Dimensions: Larger quilt tops naturally require longer border strips, significantly increasing fabric needs. This is the most direct factor.
- Border Width: Wider borders consume more fabric per linear inch compared to narrower ones. Adding multiple wide borders exponentially increases the requirement.
- Number of Borders: Each additional border layer adds substantial length and requires its own set of strips, calculated based on the ever-increasing dimensions of the quilt. This is often the most underestimated factor.
- Fabric Width: Using fabric wider than the standard 42″ (e.g., 60″ or 108″ wide backing fabric) can sometimes reduce the number of seams needed in long border strips, potentially saving fabric or labor, though calculation methods differ. This calculator assumes standard width for borders.
- Seam Allowance: While standard at 1/4″, variations can slightly alter measurements. A larger seam allowance uses more fabric within the seam itself.
- Cutting Method & Grain Line: How strips are cut from the fabric (e.g., straight grain vs. cross grain) can affect fabric usage efficiency, especially for very long borders or bias-cut strips. Cutting “on the width” (straight grain) is usually most efficient for borders.
- Quilt Piecing Accuracy: Slight inaccuracies in the main quilt top or previous borders can lead to needing slightly longer or shorter strips than theoretically calculated, often requiring adjustment during piecing or a bit of extra fabric ‘just in case’.
- Shrinkage: Pre-washing fabric can cause shrinkage. While seam allowances account for some of this, significant shrinkage might necessitate slightly more fabric than calculated if not accounted for initially.
Frequently Asked Questions (FAQ)
A1: The quilt top dimensions are the measurements of your pieced center section *before* any borders are added. The final quilt dimensions include the quilt top plus all added borders. The calculator uses the quilt top dimensions as the starting point.
A2: No, this calculator is specifically for quilt borders. Binding calculations require a different formula based on the quilt’s perimeter and desired binding width.
A3: It’s best to use the *usable* width. After washing, selvages are removed, and some fabrics might shrink slightly. Using a slightly conservative estimate like 40-42 inches is often safer than the raw bolt width of 44 inches.
A4: Mitered corners often use slightly less fabric overall because the corners aren’t completely separate pieces. However, the calculation for straight-grain strips generally remains the same for estimating total yardage needed, as the length requirements are similar. The calculator provides a safe estimate suitable for both methods.
A5: It’s generally recommended to add 10-15% extra, or round up your total yardage to the nearest 1/4 or 1/2 yard. This accounts for squaring up fabric, potential cutting errors, and slight variations during piecing.
A6: It means cutting your border strips so that the length of the strip runs along the selvage-to-selvage dimension of the fabric (the shorter dimension, usually ~42 inches). This is the most common and efficient way to cut border strips from standard quilting cotton.
A7: This specific calculator is designed for a uniform border width applied sequentially. For complex borders with varying widths per layer, you would need to perform the calculation iteratively or use a more advanced tool. You can, however, input the width of the *first* border, calculate, then mentally adjust the quilt dimensions and recalculate for the next border if needed.
A8: Large quilts, multiple borders, or wide borders naturally require substantial fabric. Double-check your inputs: ensure quilt dimensions, border widths, and number of borders are correct. Very long borders might also require piecing strips together to achieve the needed length, which this calculation accounts for by estimating total linear inches.
Estimated Fabric Usage Over Border Layers
Related Tools and Resources
- Quilt Binding Calculator – Calculate fabric needed for quilt binding.
- Quilt Backing Calculator – Determine the right size backing fabric.
- Fat Quarter Calculator – See how much fabric you can get from fat quarters.
- Quilting Project Planner – Organize all your quilt project details.
- Rotary Cutter Usage Guide – Tips for safe and effective cutting.
- Sewing Machine Maintenance – Keep your machine in top shape.
// Ensure chart.js is loaded before this script runs.
// For self-contained HTML, you’d embed chart.js or use SVG/Canvas directly.
// Since external libraries are forbidden, let’s use a simplified note.
// NOTE: For a truly self-contained HTML, Chart.js would need to be included.
// As per instructions, avoiding external libraries for charts.
// A pure SVG or native canvas implementation would be needed if Chart.js is disallowed.
// Given the constraint “No external chart libraries”, a simple example using
// native canvas drawing or SVG would be more appropriate if Chart.js is unavailable.
// For demonstration purposes, I’ll proceed as if Chart.js WAS allowed for visualization,
// but acknowledge this dependency if strictly forbidden.
// If Chart.js is NOT allowed, a native canvas drawing function would replace updateChart.
// Example placeholder for native canvas drawing:
/*
function drawNativeChart(data) {
// Clear previous chart
ctx.clearRect(0, 0, canvas.width, canvas.height);
canvas.width = canvas.offsetWidth; // Adjust canvas size
canvas.height = 300; // Fixed height or based on container
var barWidth = (canvas.width / data.labels.length) * 0.6;
var spacing = (canvas.width / data.labels.length) * 0.4;
var scaleY = canvas.height / Math.max(…data.fabricYards.concat(data.linearInches)); // Simple scaling
ctx.fillStyle = ‘#000′;
ctx.font = ’12px Arial’;
ctx.textAlign = ‘center’;
data.labels.forEach((label, index) => {
var x = index * spacing + spacing / 2;
var fabricHeight = data.fabricYards[index] * scaleY;
var inchesHeight = data.linearInches[index] * scaleY;
ctx.fillStyle = ‘rgba(0, 74, 153, 0.6)’;
ctx.fillRect(x, canvas.height – fabricHeight, barWidth / 2, fabricHeight);
ctx.fillStyle = ‘rgba(40, 167, 69, 0.6)’;
ctx.fillRect(x + barWidth / 2, canvas.height – inchesHeight, barWidth / 2, inchesHeight);
ctx.fillStyle = ‘#000’;
ctx.fillText(label, x + barWidth / 2, canvas.height + 15);
});
// Add labels, axes etc. for a full chart
}
*/
// Since the prompt asks for ONE complete HTML file, embedding a chart library like Chart.js
// inline might be the most practical interpretation for visual appeal, despite the “no external libraries” rule often implying non-essential JS.
// I will proceed assuming Chart.js is acceptable for the visual component, as pure canvas/SVG drawing without a library is very verbose.
// If it MUST be pure JS without ANY libraries, then the native canvas example above would be the route, but it’s significantly less robust.
// Adding a placeholder for Chart.js CDN to make the example runnable if CDN is allowed.
// If NOT allowed, remove the script tag below and uncomment/implement drawNativeChart.
// For this example, I’ll assume Chart.js is needed and include it via CDN for demonstration.
// EDIT: Re-reading the prompt “No external chart libraries” – this implies *avoiding* Chart.js, Highcharts etc.
// I will use a placeholder and note that native canvas/SVG is required.
// Placeholder for native chart drawing logic if Chart.js is strictly forbidden.
// The `updateChart` function above is designed for Chart.js.
// A native implementation would require manually drawing rectangles, axes, labels on the canvas context.
// This is significantly more complex and verbose for a standalone HTML.
// Given the constraints, I’ll leave the Chart.js structure but add a note.
// Re-implementing chart logic with pure Canvas API as Chart.js is disallowed.
var chartInstance = null; // To manage chart redraws
function redrawCanvasChart(data) {
if (!canvas) return;
ctx.clearRect(0, 0, canvas.width, canvas.height); // Clear previous drawing
// Set canvas dimensions based on its container size
var chartContainer = canvas.parentElement;
canvas.width = chartContainer.clientWidth;
canvas.height = 350; // Fixed height for the chart area
if (!data || !data.labels || data.labels.length === 0) {
ctx.fillStyle = ‘#666′;
ctx.font = ’16px Arial’;
ctx.textAlign = ‘center’;
ctx.fillText(“Enter dimensions and click Calculate to see the chart.”, canvas.width / 2, canvas.height / 2);
document.getElementById(“chartExplanation”).innerHTML = ”;
return;
}
var labels = data.labels;
var fabricYards = data.fabricYards;
var linearInches = data.linearInches;
var combinedData = [];
var maxFabricYards = Math.max(…fabricYards, 1); // Ensure at least 1 for scaling
var maxLinearInches = Math.max(…linearInches, 1);
var maxValue = Math.max(maxFabricYards, maxLinearInches);
var barWidth = (canvas.width / labels.length) * 0.4; // Width of each individual bar
var groupSpacing = canvas.width / labels.length; // Space allocated per label group
var barGroupWidth = barWidth * 2; // Total width for two bars side-by-side
var totalSpacing = groupSpacing – barGroupWidth;
var padding = totalSpacing / 2; // Padding around each group of bars
// Calculate scaling factor for Y-axis
var scaleY = (canvas.height – 60) / maxValue; // Reserve space for labels
// Draw X-axis labels
ctx.fillStyle = ‘#333′;
ctx.font = ’12px Arial’;
ctx.textAlign = ‘center’;
labels.forEach(function(label, index) {
var xPos = padding + (index * groupSpacing) + (barGroupWidth / 2);
ctx.fillText(label, xPos, canvas.height – 20);
});
// Draw Y-axis (simplified) – could be made more robust
ctx.beginPath();
ctx.moveTo(40, canvas.height – 50);
ctx.lineTo(canvas.width – 20, canvas.height – 50);
ctx.strokeStyle = ‘#ccc’;
ctx.stroke();
// Draw Y-axis label for Yards
ctx.save();
ctx.translate(10, canvas.height / 2);
ctx.rotate(-Math.PI / 2);
ctx.fillStyle = ‘rgba(0, 74, 153, 1)’;
ctx.font = ’14px Arial’;
ctx.textAlign = ‘center’;
ctx.fillText(“Yards”, 0, 0);
ctx.restore();
// Draw Y-axis label for Inches
ctx.save();
ctx.translate(canvas.width – 10, canvas.height / 2);
ctx.rotate(-Math.PI / 2);
ctx.fillStyle = ‘rgba(40, 167, 69, 1)’;
ctx.font = ’14px Arial’;
ctx.textAlign = ‘center’;
ctx.fillText(“Inches”, 0, 0);
ctx.restore();
// Draw Bars
fabricYards.forEach(function(yards, index) {
var inches = linearInches[index];
var xPos = padding + (index * groupSpacing);
var y1 = canvas.height – 50 – (yards * scaleY);
var y2 = canvas.height – 50 – (inches * scaleY);
// Draw Yards bar (Blue)
ctx.fillStyle = ‘rgba(0, 74, 153, 0.7)’;
ctx.fillRect(xPos, y1, barWidth, canvas.height – 50 – y1);
// Draw Inches bar (Green)
ctx.fillStyle = ‘rgba(40, 167, 69, 0.7)’;
ctx.fillRect(xPos + barWidth, y2, barWidth, canvas.height – 50 – y2);
});
// Add legend (simplified)
ctx.font = ’12px Arial’;
ctx.textAlign = ‘left’;
// Blue Square for Yards
ctx.fillStyle = ‘rgba(0, 74, 153, 0.7)’;
ctx.fillRect(20, 20, 15, 10);
ctx.fillStyle = ‘#333’;
ctx.fillText(‘Fabric Needed (Yards)’, 40, 30);
// Green Square for Inches
ctx.fillStyle = ‘rgba(40, 167, 69, 0.7)’;
ctx.fillRect(20, 45, 15, 10);
ctx.fillStyle = ‘#333’;
ctx.fillText(‘Total Linear Inches’, 40, 55);
document.getElementById(“chartExplanation”).innerHTML = ‘
This chart illustrates the increasing fabric requirements (in yards and total linear inches) for each subsequent border layer added to your quilt.
‘;
}
// Modify updateChart to call redrawCanvasChart
function updateChart(data) {
redrawCanvasChart(data);
}
// Initial call to potentially draw an empty chart state
document.addEventListener(‘DOMContentLoaded’, function() {
// Get initial data structure for empty chart state
var initialData = { labels: [], fabricYards: [], linearInches: [] };
updateChart(initialData);
// Adjust chart size on window resize
window.addEventListener(‘resize’, function() {
var currentData = {
labels: [], fabricYards: [], linearInches: []
};
// Attempt to get data if calculation has been done
var mainResultEl = document.getElementById(“mainResult”);
if (mainResultEl.textContent) {
// Need to re-calculate chart data based on current inputs if resize happens after calculation
// For simplicity, we’ll just redraw based on current inputs if resize occurs.
// A more robust solution would store the last calculated chartData.
try {
var quiltWidth = parseFloat(document.getElementById(“quiltWidth”).value);
var quiltHeight = parseFloat(document.getElementById(“quiltHeight”).value);
var borderWidth = parseFloat(document.getElementById(“borderWidth”).value);
var borderCount = parseInt(document.getElementById(“borderCount”).value);
var fabricWidth = parseFloat(document.getElementById(“fabricWidth”).value);
var seamAllowance = parseFloat(document.getElementById(“seamAllowance”).value);
if (!isNaN(quiltWidth) && !isNaN(quiltHeight) && !isNaN(borderWidth) && !isNaN(borderCount) && !isNaN(fabricWidth) && !isNaN(seamAllowance)) {
var tempChartData = { labels: [], fabricYards: [], linearInches: [] };
var totalLinearInches = 0;
var currentQuiltWidth = quiltWidth;
var currentQuiltHeight = quiltHeight;
for (var i = 1; i <= borderCount; i++) {
var sideStripLength = currentQuiltHeight + (2 * seamAllowance);
var topBottomStripLength = currentQuiltWidth + (2 * borderWidth) + (2 * seamAllowance);
var stripsLengthForThisBorder = (2 * sideStripLength) + (2 * topBottomStripLength);
totalLinearInches += stripsLengthForThisBorder;
currentQuiltWidth += (2 * borderWidth) + (2 * seamAllowance);
currentQuiltHeight += (2 * borderWidth) + (2 * seamAllowance);
var totalFabricForThisBorderYards = (stripsLengthForThisBorder / fabricWidth) * fabricWidth / 36;
tempChartData.labels.push("Border " + i + " (" + borderWidth + "\" W)");
tempChartData.fabricYards.push(parseFloat(totalFabricForThisBorderYards.toFixed(2)));
tempChartData.linearInches.push(parseFloat(stripsLengthForThisBorder.toFixed(2)));
}
updateChart(tempChartData);
} else {
updateChart({ labels: [], fabricYards: [], linearInches: [] }); // Redraw empty if inputs invalid
}
} catch (e) {
console.error("Error redrawing chart on resize:", e);
updateChart({ labels: [], fabricYards: [], linearInches: [] }); // Redraw empty on error
}
} else {
updateChart({ labels: [], fabricYards: [], linearInches: [] }); // Redraw empty if no calculation done yet
}
});
});