How to Calculate Weight by Volume Percentage: Your Ultimate Guide & Calculator
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f8f9fa;
color: #333;
line-height: 1.6;
margin: 0;
padding: 0;
}
.container {
max-width: 960px;
margin: 20px auto;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
header {
background-color: #004a99;
color: #fff;
padding: 20px 0;
text-align: center;
border-radius: 8px 8px 0 0;
}
header h1 {
margin: 0;
font-size: 2.5em;
letter-spacing: -0.5px;
}
.calculator-section {
padding: 30px 0;
border-bottom: 1px solid #eee;
}
.calculator-section:last-child {
border-bottom: none;
}
.calculator-section h2 {
color: #004a99;
text-align: center;
margin-bottom: 25px;
font-size: 1.8em;
}
.loan-calc-container {
background-color: #eef5ff;
padding: 30px;
border-radius: 8px;
box-shadow: inset 0 1px 5px rgba(0,0,0,0.05);
}
.input-group {
margin-bottom: 20px;
text-align: left;
}
.input-group label {
display: block;
font-weight: bold;
margin-bottom: 8px;
color: #004a99;
}
.input-group input[type="number"],
.input-group select {
width: calc(100% – 24px);
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1em;
box-sizing: border-box;
}
.input-group input[type="number"]:focus,
.input-group select:focus {
border-color: #004a99;
outline: none;
box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.2);
}
.input-group .helper-text {
font-size: 0.85em;
color: #555;
margin-top: 5px;
display: block;
}
.error-message {
color: #dc3545;
font-size: 0.8em;
margin-top: 5px;
display: block;
min-height: 1.2em; /* Prevents layout shift */
}
.button-group {
display: flex;
justify-content: space-between;
margin-top: 30px;
}
.button-group button {
padding: 12px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1em;
font-weight: bold;
transition: background-color 0.3s ease;
}
.calculate-btn {
background-color: #004a99;
color: white;
}
.calculate-btn:hover {
background-color: #003366;
}
.reset-btn, .copy-btn {
background-color: #6c757d;
color: white;
}
.reset-btn:hover, .copy-btn:hover {
background-color: #5a6268;
}
#results {
margin-top: 30px;
padding: 25px;
background-color: #e9ecef;
border-radius: 8px;
text-align: center;
border: 1px solid #dee2e6;
}
#results h3 {
color: #004a99;
margin-top: 0;
font-size: 1.5em;
margin-bottom: 15px;
}
.main-result {
font-size: 2.5em;
font-weight: bold;
color: #28a745;
margin: 15px 0;
padding: 15px;
background-color: #d4edda;
border-radius: 5px;
display: inline-block;
min-width: 50%; /* Ensures it has some width */
}
.intermediate-results div, .formula-explanation {
margin-bottom: 10px;
font-size: 0.95em;
}
.intermediate-results strong, .formula-explanation strong {
color: #004a99;
margin-right: 5px;
}
.formula-explanation {
font-style: italic;
color: #555;
margin-top: 15px;
border-top: 1px dashed #ccc;
padding-top: 15px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
margin-bottom: 30px;
}
th, td {
border: 1px solid #dee2e6;
padding: 10px;
text-align: right;
}
th {
background-color: #004a99;
color: #fff;
font-weight: bold;
}
td:first-child {
text-align: left;
font-weight: bold;
}
caption {
font-size: 1.1em;
font-weight: bold;
color: #004a99;
margin-bottom: 10px;
text-align: left;
}
canvas {
display: block;
margin: 20px auto;
background-color: #f8f9fa;
border: 1px solid #eee;
border-radius: 4px;
}
.chart-legend {
text-align: center;
margin-top: 10px;
font-size: 0.9em;
color: #555;
}
.chart-legend span {
display: inline-block;
margin: 0 10px;
}
.chart-legend .color-box {
display: inline-block;
width: 12px;
height: 12px;
margin-right: 5px;
border-radius: 3px;
vertical-align: middle;
}
.article-section {
margin-top: 40px;
padding: 30px 0;
border-bottom: 1px solid #eee;
}
.article-section:last-child {
border-bottom: none;
}
.article-section h2, .article-section h3 {
color: #004a99;
margin-bottom: 15px;
}
.article-section h2 {
font-size: 2em;
border-bottom: 2px solid #004a99;
padding-bottom: 5px;
}
.article-section h3 {
font-size: 1.5em;
}
.article-section p {
margin-bottom: 15px;
}
.faq-item {
margin-bottom: 15px;
}
.faq-item strong {
display: block;
color: #004a99;
margin-bottom: 5px;
}
.internal-links-section ul {
list-style: none;
padding: 0;
}
.internal-links-section li {
margin-bottom: 10px;
}
.internal-links-section a {
color: #004a99;
text-decoration: none;
font-weight: bold;
}
.internal-links-section a:hover {
text-decoration: underline;
}
footer {
text-align: center;
margin-top: 40px;
padding: 20px;
font-size: 0.9em;
color: #777;
}
Weight by Volume Percentage Calculator
Your Results
— %
Formula Used: (Mass of Solute / Volume of Solution) * 100
Mass of Solute
Volume of Solution
Weight by Volume Percentage Breakdown
| Component |
Value |
Unit |
| Mass of Solute |
— |
Grams |
| Volume of Solution |
— |
Milliliters |
| Weight by Volume Percentage |
— |
% |
What is Weight by Volume Percentage?
Weight by volume percentage (w/v %) is a common unit of concentration used primarily in chemistry, biology, and pharmaceuticals. It expresses the mass of a solute (the substance being dissolved) in grams per 100 milliliters of a solution (the total mixture). This measurement is particularly useful when the density of the solute or solvent is variable or not precisely known, and it simplifies calculations for many practical applications.
Understanding how to calculate weight by volume percentage is crucial for accurate preparation of solutions, whether you're in a research lab, a pharmacy dispensing medication, or a food science setting. It ensures that the correct amount of active ingredient is present in a given volume of product, which is critical for efficacy and safety.
A common misconception is that weight by volume percentage is the same as mass percentage or volume by volume percentage. While all are measures of concentration, they use different combinations of mass and volume for solute and solution. Weight by volume percentage specifically relates the mass of the solute to the *total volume* of the solution.
Anyone working with chemical solutions, preparing laboratory reagents, formulating pharmaceuticals, or performing biological assays will encounter and need to use the concept of weight by volume percentage. This includes students learning chemistry, researchers in academic institutions, quality control analysts in manufacturing, and healthcare professionals.
Weight by Volume Percentage Formula and Mathematical Explanation
The calculation for weight by volume percentage is straightforward. It's designed to tell you how many grams of a solute are present in every 100 milliliters of the final solution.
The Formula
The core formula to determine weight by volume percentage is:
Weight by Volume Percentage (%) = (Mass of Solute / Volume of Solution) × 100
Variable Explanations
Let's break down the components of this formula:
- Mass of Solute: This is the weight or mass of the substance you are dissolving. It's typically measured in grams (g).
- Volume of Solution: This is the *total volume* of the final mixture after the solute has been dissolved in the solvent. It's crucial to use the final volume, not just the volume of the solvent, as the solute itself can occupy some space. This is typically measured in milliliters (mL).
- 100: This factor converts the ratio into a percentage, making it easier to interpret as "grams per 100 mL".
Variables Table
Weight by Volume Percentage Variables
| Variable |
Meaning |
Unit |
Typical Range/Considerations |
| Mass of Solute |
The absolute mass of the substance being dissolved. |
Grams (g) |
Varies widely depending on concentration and scale. Must be a positive value. |
| Volume of Solution |
The total final volume of the mixture. |
Milliliters (mL) |
Varies widely. Must be a positive value. Crucially, this is the *final* volume. |
| Weight by Volume Percentage |
The concentration of the solute in the solution. |
Percent (%) |
Calculated value, typically non-negative. A higher percentage indicates a more concentrated solution. |
Understanding these variables is key to correctly applying the formula and interpreting the results from our Weight by Volume Percentage Calculator.
Practical Examples (Real-World Use Cases)
Weight by volume percentage is widely used across various scientific and industrial fields. Here are a couple of practical examples:
Example 1: Preparing a Saline Solution
A common use is preparing normal saline solution for medical purposes. Normal saline is typically a 0.9% w/v solution of sodium chloride (NaCl) in water.
- Scenario: You need to prepare 500 mL of a 0.9% w/v NaCl solution.
- Formula: Weight by Volume Percentage (%) = (Mass of Solute / Volume of Solution) × 100
- Rearranging for Mass of Solute: Mass of Solute = (Weight by Volume Percentage / 100) × Volume of Solution
- Calculation:
Mass of NaCl = (0.9 / 100) × 500 mL
Mass of NaCl = 0.009 × 500 mL
Mass of NaCl = 4.5 grams
- Interpretation: To make 500 mL of a 0.9% w/v saline solution, you would dissolve 4.5 grams of sodium chloride in enough water to reach a final volume of 500 mL.
Example 2: Diluting a Stock Solution in a Laboratory
Researchers often use stock solutions and need to calculate dilutions for experiments. Let's say you have a concentrated stock solution and need to create a weaker one.
- Scenario: You have a 20% w/v stock solution of glucose and need to create 250 mL of a 5% w/v glucose solution for cell culture.
- Formula: Mass of Solute = (Weight by Volume Percentage / 100) × Volume of Solution
- Target Calculation:
Mass of Glucose needed for 250 mL of 5% solution = (5 / 100) × 250 mL
Mass of Glucose = 0.05 × 250 mL
Mass of Glucose = 12.5 grams
- How to achieve this from the stock: You need to find out what volume of the 20% stock solution contains 12.5 grams of glucose.
Volume of Stock = Mass of Solute / (Concentration of Stock / 100)
Volume of Stock = 12.5 g / (20 / 100)
Volume of Stock = 12.5 g / 0.20
Volume of Stock = 62.5 mL
- Interpretation: You would take 62.5 mL of the 20% w/v glucose stock solution and add enough solvent (e.g., water) to bring the *total volume* up to 250 mL. This results in the desired 5% w/v solution. Our Weight by Volume Percentage Calculator can simplify these types of calculations.
How to Use This Weight by Volume Percentage Calculator
Our interactive calculator is designed to make calculating weight by volume percentage quick and easy. Follow these simple steps:
Step-by-Step Instructions:
- Enter Mass of Solute: In the "Mass of Solute" field, input the exact weight (in grams) of the substance you are dissolving.
- Enter Volume of Solution: In the "Volume of Solution" field, input the total final volume (in milliliters) of the mixture you are creating.
- Calculate: Click the "Calculate" button.
How to Read Results:
- Primary Result: The large, green percentage displayed prominently is your calculated Weight by Volume Percentage. This tells you the concentration in grams per 100 mL.
- Intermediate Values: You'll see the values you entered for Mass of Solute and Volume of Solution, along with the units, to confirm the inputs used.
- Formula Explanation: A reminder of the formula used is provided for clarity.
- Table: A structured breakdown of your inputs and the calculated percentage in a clear table format.
- Chart: A visual representation comparing the mass of the solute to the volume of the solution, helping to grasp the proportions.
Decision-Making Guidance:
Use the results to ensure accuracy in your preparations. If the calculated percentage is higher than intended, you may need to dilute the solution by adding more solvent. If it's lower, you might need to add more solute or start over with a more concentrated preparation, depending on your specific needs and the limitations of solution preparation.
Use the "Copy Results" button to easily transfer your findings to notes or reports. The "Reset" button clears the fields for a new calculation.
Key Factors That Affect Weight by Volume Percentage Results
While the formula itself is simple, several real-world factors can influence the accuracy and interpretation of weight by volume percentage calculations and preparations:
-
Accuracy of Measurements:
Reasoning: The precision of your scales for weighing the solute and your volumetric glassware (like graduated cylinders or volumetric flasks) for measuring the final solution volume directly impacts the calculated percentage. Even small errors can lead to significant discrepancies, especially in sensitive applications like pharmaceuticals.
-
Solubility Limits:
Reasoning: Every solute has a maximum amount that can dissolve in a given solvent at a specific temperature. If you attempt to exceed this limit, the solute will not fully dissolve, and your measured final volume might be inaccurate, leading to a lower-than-expected w/v percentage and potentially undissolved solid.
-
Temperature Effects:
Reasoning: The volume of liquids can change slightly with temperature. For highly precise work, it's important to prepare solutions at a standard temperature (often 20°C or 25°C) and use calibrated volumetric glassware designed for that temperature. Density and volume changes due to temperature can affect the true concentration.
-
Density Changes:
Reasoning: While w/v percentage uses the final volume, the density of the solution does change as concentration increases. Understanding density can be important for relating w/v% to other concentration units like molarity or mass percentage, and for tasks like hydrometer readings. It also affects the total mass of the solution.
-
pH and Chemical Reactions:
Reasoning: For some solutes, especially weak acids or bases, their solubility or stability can be affected by the pH of the solution. Chemical reactions occurring within the solution could also alter the amount of "active" solute or change the overall volume. This requires careful consideration during chemical solution preparation.
-
Hygroscopic Nature of Solute:
Reasoning: Some solids readily absorb moisture from the air. If a hygroscopic solute is weighed carelessly, it might contain absorbed water, meaning the actual mass of the pure solute is less than what was measured. This leads to a lower concentration than calculated. Proper storage and rapid handling are essential.
-
Volume Additivity:
Reasoning: It's often assumed that the volume of a solution is simply the volume of the solvent. However, when a solute dissolves, it can occupy space differently, leading to a final volume that is not perfectly additive. For accurate w/v calculations, the *total final volume* must be precisely measured using volumetric flasks.
Frequently Asked Questions (FAQ)
Q1: What's the difference between weight by volume percentage (w/v %) and mass percentage (w/w %)?
A1: Weight by volume percentage (w/v %) relates the mass of the solute (in grams) to the *total volume* of the solution (in mL), expressed as grams per 100 mL. Mass percentage (w/w %) relates the mass of the solute (in grams) to the *total mass* of the solution (in grams), expressed as grams per 100 grams.
Q2: Can I use kilograms and liters instead of grams and milliliters?
A2: Yes, as long as you are consistent. If you use kilograms for mass and liters for volume, the formula still holds: % w/v = (kg solute / L solution) * 100. However, the standard unit for w/v % is grams per 100 mL.
Q3: What if the solute doesn't fully dissolve?
A3: If the solute doesn't fully dissolve, you have likely exceeded its solubility limit or made an error in measurement. The calculated percentage will not accurately reflect the concentration of *dissolved* solute. You should aim for complete dissolution or re-evaluate your preparation method.
Q4: Is weight by volume percentage the same as molarity?
A4: No. Molarity (M) is defined as moles of solute per liter of solution. Weight by volume percentage is mass of solute per 100 mL of solution. You can convert between them if you know the molar mass of the solute.
Q5: How do I calculate the mass of solute needed for a specific volume and percentage?
A5: Rearrange the formula: Mass of Solute = (Weight by Volume Percentage / 100) × Volume of Solution. Our calculator does this automatically when you input the desired volume and percentage.
Q6: What is a typical range for weight by volume percentage?
A6: The range is highly variable depending on the application. For instance, medical saline is 0.9% w/v, while some concentrated laboratory reagents or industrial chemicals might be 10%, 20%, or even higher, limited by solubility.
Q7: Does "weight" mean mass in this context?
A7: Yes, in chemistry and science, "weight" is often used interchangeably with "mass" when referring to measurements in grams or kilograms. The term "weight by volume" is a traditional way of expressing this concentration.
Q8: How accurate do my measurements need to be?
A8: This depends on the application. For general laboratory use, precision to the nearest 0.1 g for mass and nearest mL for volume is often sufficient. For pharmaceutical preparations or high-precision scientific work, you would need more accurate balances and volumetric glassware (e.g., Class A). Always refer to specific protocols.
Related Tools and Internal Resources
function validateInput(value, id, errorId, minValue = null, maxValue = null) {
var errorElement = document.getElementById(errorId);
errorElement.textContent = ";
if (value === ") {
errorElement.textContent = 'This field cannot be empty.';
return false;
}
var numValue = parseFloat(value);
if (isNaN(numValue)) {
errorElement.textContent = 'Please enter a valid number.';
return false;
}
if (minValue !== null && numValue maxValue) {
errorElement.textContent = 'Value cannot be greater than ' + maxValue + '.';
return false;
}
return true;
}
function calculateWeightByVolumePercentage() {
var massInput = document.getElementById('mass');
var volumeInput = document.getElementById('volume');
var mass = massInput.value;
var volume = volumeInput.value;
var massError = document.getElementById('massError');
var volumeError = document.getElementById('volumeError');
massError.textContent = ";
volumeError.textContent = ";
var isValidMass = validateInput(mass, 'mass', 'massError', 0);
var isValidVolume = validateInput(volume, 'volume', 'volumeError', 0);
if (!isValidMass || !isValidVolume) {
return;
}
var numMass = parseFloat(mass);
var numVolume = parseFloat(volume);
var weightByVolumePercentage = (numMass / numVolume) * 100;
var mainResultElement = document.getElementById('mainResult');
var intermediateMassElement = document.getElementById('intermediateMass');
var intermediateVolumeElement = document.getElementById('intermediateVolume');
var intermediateUnitsElement = document.getElementById('intermediateUnits');
mainResultElement.textContent = weightByVolumePercentage.toFixed(2) + ' %';
intermediateMassElement.textContent = 'Mass of Solute: ' + numMass.toFixed(2) + ' g';
intermediateVolumeElement.textContent = 'Volume of Solution: ' + numVolume.toFixed(2) + ' mL';
intermediateUnitsElement.textContent = 'Units: Mass (g) / Volume (mL)';
// Update table
document.getElementById('tableMassSolute').textContent = numMass.toFixed(2);
document.getElementById('tableVolumeSolution').textContent = numVolume.toFixed(2);
document.getElementById('tableWvPercentage').textContent = weightByVolumePercentage.toFixed(2);
// Update chart
updateChart(numMass, numVolume);
}
function resetCalculator() {
document.getElementById('mass').value = '15';
document.getElementById('volume').value = '100';
document.getElementById('massError').textContent = ";
document.getElementById('volumeError').textContent = ";
var mainResultElement = document.getElementById('mainResult');
var intermediateMassElement = document.getElementById('intermediateMass');
var intermediateVolumeElement = document.getElementById('intermediateVolume');
var intermediateUnitsElement = document.getElementById('intermediateUnits');
mainResultElement.textContent = '– %';
intermediateMassElement.textContent = 'Mass of Solute: –';
intermediateVolumeElement.textContent = 'Volume of Solution: –';
intermediateUnitsElement.textContent = 'Units: –';
document.getElementById('tableMassSolute').textContent = '–';
document.getElementById('tableVolumeSolution').textContent = '–';
document.getElementById('tableWvPercentage').textContent = '–';
resetChart();
}
function copyResults() {
var mainResult = document.getElementById('mainResult').textContent;
var intermediateMass = document.getElementById('intermediateMass').textContent;
var intermediateVolume = document.getElementById('intermediateVolume').textContent;
var intermediateUnits = document.getElementById('intermediateUnits').textContent;
var formula = document.querySelector('.formula-explanation strong:last-child').textContent.replace('Formula Used: ', ");
var tableMassSolute = document.getElementById('tableMassSolute').textContent;
var tableVolumeSolution = document.getElementById('tableVolumeSolution').textContent;
var tableWvPercentage = document.getElementById('tableWvPercentage').textContent;
var resultText = "Weight by Volume Percentage Calculation:\n\n";
resultText += "Main Result: " + mainResult + "\n";
resultText += intermediateMass + "\n";
resultText += intermediateVolume + "\n";
resultText += intermediateUnits + "\n\n";
resultText += "Formula: " + formula + "\n\n";
resultText += "Table Breakdown:\n";
resultText += "Mass of Solute: " + tableMassSolute + " g\n";
resultText += "Volume of Solution: " + tableVolumeSolution + " mL\n";
resultText += "Weight by Volume Percentage: " + tableWvPercentage + " %\n";
if (navigator.clipboard) {
navigator.clipboard.writeText(resultText).then(function() {
alert('Results copied to clipboard!');
}).catch(function(err) {
console.error('Failed to copy: ', err);
alert('Failed to copy results.');
});
} else {
// Fallback for older browsers (less reliable)
var textArea = document.createElement("textarea");
textArea.value = resultText;
textArea.style.position = "fixed";
textArea.style.left = "-9999px";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand('copy');
alert('Results copied to clipboard!');
} catch (err) {
console.error('Fallback: Oops, unable to copy', err);
alert('Failed to copy results.');
}
document.body.removeChild(textArea);
}
}
// Chart Initialization
var myChart;
var chartContext = document.getElementById('myChart').getContext('2d');
function updateChart(soluteMass, solutionVolume) {
var ctx = document.getElementById('myChart').getContext('2d');
if (myChart) {
myChart.destroy();
}
var dataPoints = [];
var labels = [];
var increment = Math.max(1, Math.min(solutionVolume, soluteMass) / 5); // Dynamic increment
var maxVal = Math.max(solutionVolume, soluteMass) * 1.2; // Ensure maxVal is sufficiently large
for (var i = 0; i <= maxVal; i += increment) {
labels.push(i.toFixed(1));
// Mass of solute is constant in this context for the 'volume' line
dataPoints.push({
x: i, // Represents volume
y: soluteMass // Constant mass
});
}
var solutionVolumeLine = [];
for (var i = 0; i <= maxVal; i += increment) {
// Volume of solution is constant in this context for the 'mass' line
solutionVolumeLine.push({
x: i, // Represents mass
y: solutionVolume // Constant volume
});
}
myChart = new Chart(ctx, {
type: 'scatter', // Using scatter for better control over axes and points
data: {
datasets: [{
label: 'Mass of Solute (g)',
data: [{ x: 0, y: soluteMass }, { x: solutionVolume, y: soluteMass }], // Line representing constant mass
borderColor: 'rgba(54, 162, 235, 0.6)',
backgroundColor: 'rgba(54, 162, 235, 0.6)',
borderWidth: 2,
pointRadius: 0, // Hide points, show line
showLine: true
}, {
label: 'Volume of Solution (mL)',
data: [{ x: soluteMass, y: 0 }, { x: soluteMass, y: solutionVolume }], // Line representing constant volume
borderColor: 'rgba(255, 99, 132, 0.6)',
backgroundColor: 'rgba(255, 99, 132, 0.6)',
borderWidth: 2,
pointRadius: 0,
showLine: true
}]
},
options: {
responsive: true,
maintainAspectRatio: true,
aspectRatio: 1.5, // Adjust aspect ratio for better visualization
scales: {
x: {
title: {
display: true,
labelString: 'Volume (mL) / Mass (g)'
},
suggestedMin: 0,
suggestedMax: maxVal
},
y: {
title: {
display: true,
labelString: 'Mass (g) / Volume (mL)'
},
suggestedMin: 0,
suggestedMax: maxVal
}
},
plugins: {
tooltip: {
callbacks: {
label: function(context) {
var label = context.dataset.label || '';
if (label) {
label += ': ';
}
if (context.parsed.y !== undefined) {
label += context.parsed.y + (label.includes('Mass') ? ' g' : ' mL');
}
return label;
}
}
},
legend: {
display: false // Custom legend is used
}
}
}
});
}
function resetChart() {
var ctx = document.getElementById('myChart').getContext('2d');
if (myChart) {
myChart.destroy();
}
myChart = new Chart(ctx, {
type: 'scatter',
data: {
datasets: [{
label: 'Mass of Solute (g)',
data: [], borderColor: 'rgba(54, 162, 235, 0.6)', backgroundColor: 'rgba(54, 162, 235, 0.6)', borderWidth: 2, pointRadius: 0, showLine: true
}, {
label: 'Volume of Solution (mL)',
data: [], borderColor: 'rgba(255, 99, 132, 0.6)', backgroundColor: 'rgba(255, 99, 132, 0.6)', borderWidth: 2, pointRadius: 0, showLine: true
}]
},
options: {
responsive: true,
maintainAspectRatio: true,
aspectRatio: 1.5,
scales: { x: { title: { display: true, labelString: 'Volume (mL) / Mass (g)' }}, y: { title: { display: true, labelString: 'Mass (g) / Volume (mL)' }}},
plugins: { tooltip: { enabled: false }, legend: { display: false }}
}
});
}
// Initial calculation on load
document.addEventListener('DOMContentLoaded', function() {
calculateWeightByVolumePercentage();
resetChart(); // Initialize empty chart
});