Amortization Calculator Monthly – Calculate Loan Payments
:root {
–primary-color: #004a99;
–secondary-color: #e9ecef;
–background-color: #f8f9fa;
–card-background: #ffffff;
–text-color: #333;
–border-color: #dee2e6;
–error-color: #dc3545;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: var(–background-color);
color: var(–text-color);
margin: 0;
padding: 0;
line-height: 1.6;
}
.container {
max-width: 960px;
margin: 20px auto;
padding: 0 15px;
display: flex;
flex-direction: column;
align-items: center;
}
header {
width: 100%;
background-color: var(–card-background);
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
text-align: center;
margin-bottom: 20px;
}
header h1 {
color: var(–primary-color);
margin: 0;
font-size: 2.2em;
}
.loan-calc-container {
background-color: var(–card-background);
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 100%;
box-sizing: border-box;
margin-bottom: 30px;
}
.loan-calc-container h2 {
text-align: center;
color: var(–primary-color);
margin-top: 0;
margin-bottom: 25px;
font-size: 1.8em;
}
.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% – 24px);
padding: 12px;
border: 1px solid var(–border-color);
border-radius: 4px;
font-size: 1em;
box-sizing: border-box;
transition: border-color 0.3s ease;
}
.input-group input[type="number"]:focus,
.input-group input[type="text"]:focus,
.input-group select:focus {
outline: none;
border-color: var(–primary-color);
}
.input-group .helper-text {
font-size: 0.85em;
color: #6c757d;
margin-top: 5px;
display: block;
}
.error-message {
color: var(–error-color);
font-size: 0.85em;
margin-top: 5px;
display: block;
min-height: 1.2em; /* Prevent layout shifts */
}
.button-group {
display: flex;
justify-content: space-between;
margin-top: 30px;
flex-wrap: wrap;
gap: 10px;
}
.button-group button {
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 1em;
font-weight: bold;
transition: background-color 0.3s ease, transform 0.2s ease;
flex: 1;
min-width: 150px;
}
.button-group button.calculate-btn {
background-color: var(–primary-color);
color: white;
}
.button-group button.calculate-btn:hover {
background-color: #003366;
transform: translateY(-1px);
}
.button-group button.reset-btn {
background-color: var(–secondary-color);
color: var(–primary-color);
border: 1px solid var(–primary-color);
}
.button-group button.reset-btn:hover {
background-color: #d3d9e0;
transform: translateY(-1px);
}
.button-group button.copy-btn {
background-color: #28a745;
color: white;
}
.button-group button.copy-btn:hover {
background-color: #218838;
transform: translateY(-1px);
}
#results {
background-color: var(–card-background);
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 100%;
box-sizing: border-box;
margin-top: 30px;
text-align: center;
}
#results h2 {
margin-top: 0;
margin-bottom: 20px;
color: var(–primary-color);
font-size: 1.8em;
}
.primary-result {
font-size: 2.5em;
font-weight: bold;
color: var(–primary-color);
margin: 15px 0;
padding: 15px;
background-color: var(–secondary-color);
border-radius: 4px;
display: inline-block;
}
.intermediate-results div {
margin-bottom: 10px;
font-size: 1.1em;
}
.intermediate-results span {
font-weight: bold;
color: var(–primary-color);
}
.formula-explanation {
font-size: 0.9em;
color: #6c757d;
margin-top: 20px;
padding-top: 15px;
border-top: 1px solid var(–border-color);
}
.chart-container {
background-color: var(–card-background);
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 100%;
box-sizing: border-box;
margin-top: 30px;
text-align: center;
}
.chart-container h2 {
margin-top: 0;
margin-bottom: 20px;
color: var(–primary-color);
font-size: 1.8em;
}
canvas {
max-width: 100%;
height: auto !important; /* Override potential fixed height */
display: block; /* Remove extra space below canvas */
margin: 0 auto; /* Center canvas */
}
.table-container {
background-color: var(–card-background);
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 100%;
box-sizing: border-box;
margin-top: 30px;
overflow-x: auto; /* Enable horizontal scrolling for mobile */
}
.table-container h2 {
margin-top: 0;
margin-bottom: 20px;
color: var(–primary-color);
font-size: 1.8em;
text-align: center;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 15px;
min-width: 600px; /* Ensure table is scrollable on mobile */
}
th, td {
padding: 12px 15px;
text-align: right;
border: 1px solid var(–border-color);
}
th {
background-color: var(–secondary-color);
color: var(–primary-color);
font-weight: bold;
position: sticky;
top: 0; /* Sticky header */
z-index: 10;
}
td {
background-color: var(–card-background);
}
tr:nth-child(even) td {
background-color: var(–secondary-color);
}
caption {
font-size: 0.9em;
color: #6c757d;
margin-top: 10px;
display: block;
text-align: left;
}
.article-section {
background-color: var(–card-background);
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 100%;
box-sizing: border-box;
margin-top: 30px;
text-align: left;
}
.article-section h2,
.article-section h3 {
color: var(–primary-color);
margin-bottom: 15px;
}
.article-section h2 {
font-size: 1.8em;
text-align: center;
margin-top: 0;
}
.article-section h3 {
font-size: 1.4em;
margin-top: 25px;
}
.article-section p {
margin-bottom: 15px;
}
.article-section ul {
margin-left: 20px;
margin-bottom: 15px;
}
.article-section li {
margin-bottom: 8px;
}
.article-section a {
color: var(–primary-color);
text-decoration: none;
font-weight: bold;
}
.article-section a:hover {
text-decoration: underline;
}
.faq-list {
list-style: none;
padding: 0;
}
.faq-list li {
margin-bottom: 15px;
padding: 15px;
background-color: var(–secondary-color);
border-radius: 4px;
}
.faq-list li strong {
color: var(–primary-color);
display: block;
margin-bottom: 5px;
}
footer {
text-align: center;
margin-top: 30px;
padding: 20px;
font-size: 0.9em;
color: #6c757d;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.container {
margin: 10px auto;
padding: 0 10px;
}
.loan-calc-container,
#results,
.chart-container,
.table-container,
.article-section {
padding: 20px;
}
header h1 {
font-size: 1.8em;
}
.loan-calc-container h2,
#results h2,
.chart-container h2,
.table-container h2,
.article-section h2 {
font-size: 1.6em;
}
.article-section h3 {
font-size: 1.2em;
}
.primary-result {
font-size: 2em;
}
.button-group button {
flex: 1 1 100%; /* Stack buttons on small screens */
min-width: unset;
}
table {
min-width: 100%; /* Allow table to shrink */
}
}
Loan Amortization Details
Your Loan Payment Summary
$0.00
The monthly payment is calculated using the loan amortization formula: M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1], where P is the principal loan amount, i is the monthly interest rate, and n is the total number of payments.
Loan Amortization Breakdown
This chart visualizes the breakdown of your principal and interest payments over the life of the loan.
Amortization Schedule
| Payment # |
Payment Date |
Starting Balance |
Monthly Payment |
Principal Paid |
Interest Paid |
Ending Balance |
Detailed breakdown of each payment, showing principal and interest components.
What is Amortization?
Amortization is a fundamental concept in finance, particularly for loans and other forms of debt. It refers to the process of gradually paying off a debt over time through a series of regular payments. Each payment made during the amortization period consists of two parts: a portion that goes towards reducing the principal amount borrowed and a portion that covers the interest accrued on the outstanding balance. Understanding amortization is crucial for borrowers to grasp the true cost of their loan and how their payments are applied.
The most common type of loan that utilizes amortization is a mortgage, but it's also applied to auto loans, personal loans, and business loans. The structure of amortization ensures that as the loan matures, the proportion of each payment allocated to interest decreases, while the proportion allocated to principal increases. This means you pay more interest in the early stages of the loan and more principal in the later stages. Our monthly amortization calculator helps visualize this process.
Amortization Formula and Mathematical Explanation
The core of monthly loan amortization lies in a specific mathematical formula used to calculate the fixed periodic payment. The standard formula for calculating the monthly payment (M) of an amortizing loan is:
M = P [ i(1 + i)^n ] / [ (1 + i)^n – 1]
Where:
- M is your total monthly mortgage payment.
- P is the principal loan amount (the amount you borrowed).
- i is your monthly interest rate. This is calculated by dividing your annual interest rate by 12 (e.g., a 5% annual rate is 0.05 / 12 = 0.004167 monthly).
- n is the total number of payments over the loan's lifetime. This is calculated by multiplying the number of years in your loan term by 12 (e.g., a 30-year loan has 30 * 12 = 360 payments).
This formula ensures that each payment is the same amount throughout the loan term, making budgeting easier for borrowers. However, it's important to note that while the total payment remains constant, the allocation between principal and interest changes with each payment. Early payments are heavily weighted towards interest, while later payments are weighted more towards principal. This is a key characteristic of an amortizing loan and is clearly illustrated by an amortization schedule.
Practical Examples (Real-World Use Cases)
The amortization calculator is incredibly useful for various financial scenarios. Here are a few practical examples:
- Mortgage Planning: A couple is looking to buy a home and wants to understand the monthly payments for a $300,000 mortgage at a 6% annual interest rate over 30 years. Using the calculator, they can see their estimated monthly principal and interest payment, the total interest paid over the loan's life, and how much of their initial payments go towards interest versus principal. This helps them budget effectively and compare different loan offers.
- Auto Loan Comparison: Someone is considering a $25,000 car loan with a 4.5% annual interest rate for 5 years. They can use the calculator to determine the monthly payment and total interest cost. This information is vital for comparing financing options offered by dealerships versus banks or credit unions.
- Personal Loan Assessment: An individual needs a $10,000 personal loan at 10% annual interest for 3 years. The calculator will show them the monthly payment and the total interest they'll pay, helping them decide if the loan fits their budget and if it's a wise financial decision. This is similar to understanding a personal loan amortization.
- Investment Property Financing: An investor is evaluating an investment property requiring a $500,000 loan at 7% annual interest over 20 years. The amortization schedule provided by the calculator helps them project cash flow and understand the long-term cost of financing.
By inputting different loan amounts, interest rates, and terms, users can gain a clear picture of their financial obligations and make informed borrowing decisions. Our tool provides a clear breakdown, making complex financial calculations accessible.
How to Use This Amortization Calculator Monthly
Using our monthly amortization calculator is straightforward. Follow these simple steps:
- Enter Loan Amount: Input the total amount of money you are borrowing into the "Loan Amount ($)" field.
- Enter Annual Interest Rate: Type in the annual interest rate for your loan in the "Annual Interest Rate (%)" field. Ensure you use the percentage value (e.g., 5 for 5%).
- Enter Loan Term: Specify the duration of your loan in years in the "Loan Term (Years)" field.
- Click Calculate: Once all fields are populated, click the "Calculate" button.
The calculator will instantly display:
- Your estimated monthly payment (principal and interest).
- Total principal paid (which will be equal to your initial loan amount).
- Total interest paid over the entire loan term.
- Total payments made (monthly payment multiplied by the number of payments).
You will also see a detailed amortization schedule table and a visual chart breaking down your payments over time. Use the "Reset" button to clear the fields and start over, or "Copy Results" to save your calculations.
Key Factors That Affect Amortization Results
Several key factors significantly influence the outcome of your loan amortization:
- Loan Principal Amount: A larger principal amount will naturally result in higher monthly payments and a greater total amount of interest paid over the life of the loan, assuming all other factors remain constant.
- Interest Rate: This is one of the most impactful factors. A higher annual interest rate means more money paid towards interest with each payment, leading to higher monthly payments and a substantially larger total interest cost over time. Conversely, a lower interest rate reduces both the monthly payment and the total interest paid. This highlights the importance of securing the best possible interest rate.
- Loan Term (Duration): The length of the loan term directly affects the monthly payment amount. A longer loan term (e.g., 30 years vs. 15 years) will result in lower monthly payments because the principal is spread over more payments. However, a longer term also means you will pay significantly more interest overall because the principal balance remains higher for a longer period.
- Payment Frequency: While this calculator focuses on monthly payments, making extra payments or increasing payment frequency (e.g., bi-weekly payments) can significantly shorten the loan term and reduce the total interest paid. This is a common strategy for accelerating debt repayment.
Understanding how these variables interact is essential for effective financial planning and debt management.
Frequently Asked Questions (FAQ)
-
What is the difference between principal and interest?
Principal is the original amount of money borrowed. Interest is the cost of borrowing that money, typically expressed as a percentage of the principal. In an amortizing loan, each payment covers both.
-
Why does the interest portion of my payment decrease over time?
As you make payments, the outstanding loan balance (principal) decreases. Since interest is calculated on the remaining principal, the interest portion of each subsequent payment naturally gets smaller, while the principal portion increases.
-
Can I pay off my loan early?
Yes, most loans allow for early payoff. Making extra payments towards the principal can significantly reduce the total interest paid and shorten the loan term. Check your loan agreement for any prepayment penalties.
-
What is an amortization schedule?
An amortization schedule is a table that details each periodic payment on an amortizing loan. It shows how much of each payment goes towards principal and interest, the remaining balance after each payment, and the cumulative interest paid.
-
Does the calculator include taxes and insurance (like for a mortgage)?
No, this calculator specifically calculates the principal and interest (P&I) portion of your loan payment. For mortgages, additional costs like property taxes, homeowner's insurance, and private mortgage insurance (PMI) are often included in the total monthly payment (escrow), but they are not part of the loan amortization itself.
Related Tools and Internal Resources
var chartInstance = null; // Global variable to hold chart instance
function validateInput(inputElement, minValue) {
var errorElement = document.getElementById(inputElement.id + "Error");
var value = parseFloat(inputElement.value);
if (isNaN(value)) {
errorElement.textContent = "Please enter a valid number.";
inputElement.style.borderColor = 'var(–error-color)';
return false;
} else if (value < minValue) {
errorElement.textContent = "Value cannot be negative or less than " + minValue + ".";
inputElement.style.borderColor = 'var(–error-color)';
return false;
} else {
errorElement.textContent = "";
inputElement.style.borderColor = 'var(–border-color)';
return true;
}
}
function calculateAmortization() {
var loanAmount = parseFloat(document.getElementById("loanAmount").value);
var annualInterestRate = parseFloat(document.getElementById("annualInterestRate").value);
var loanTermYears = parseInt(document.getElementById("loanTermYears").value);
var loanAmountError = document.getElementById("loanAmountError");
var annualInterestRateError = document.getElementById("annualInterestRateError");
var loanTermYearsError = document.getElementById("loanTermYearsError");
var isValid = true;
if (isNaN(loanAmount) || loanAmount <= 0) {
loanAmountError.textContent = "Please enter a valid loan amount.";
document.getElementById("loanAmount").style.borderColor = 'var(–error-color)';
isValid = false;
} else {
loanAmountError.textContent = "";
document.getElementById("loanAmount").style.borderColor = 'var(–border-color)';
}
if (isNaN(annualInterestRate) || annualInterestRate < 0) {
annualInterestRateError.textContent = "Please enter a valid annual interest rate.";
document.getElementById("annualInterestRate").style.borderColor = 'var(–error-color)';
isValid = false;
} else {
annualInterestRateError.textContent = "";
document.getElementById("annualInterestRate").style.borderColor = 'var(–border-color)';
}
if (isNaN(loanTermYears) || loanTermYears 0) {
monthlyPayment = loanAmount * (monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments)) / (Math.pow(1 + monthlyInterestRate, numberOfPayments) – 1);
} else {
monthlyPayment = loanAmount / numberOfPayments;
}
var totalInterestPaid = (monthlyPayment * numberOfPayments) – loanAmount;
var totalPayments = monthlyPayment * numberOfPayments;
document.getElementById("monthlyPayment").textContent = "$" + monthlyPayment.toFixed(2);
document.getElementById("totalPrincipal").textContent = "$" + loanAmount.toFixed(2);
document.getElementById("totalInterest").textContent = "$" + totalInterestPaid.toFixed(2);
document.getElementById("totalPayments").textContent = "$" + totalPayments.toFixed(2);
generateAmortizationTable(loanAmount, monthlyInterestRate, numberOfPayments, monthlyPayment);
updateChart(loanAmount, monthlyInterestRate, numberOfPayments, monthlyPayment);
}
function generateAmortizationTable(principal, monthlyRate, numPayments, monthlyPayment) {
var tableBody = document.getElementById("amortizationTableBody");
tableBody.innerHTML = ""; // Clear previous table data
var balance = principal;
var totalInterest = 0;
var totalPrincipal = 0;
var paymentDate = new Date(); // Start date for payments
for (var i = 0; i 0) {
interestPayment = balance * monthlyRate;
principalPayment = monthlyPayment – interestPayment;
} else {
principalPayment = monthlyPayment;
interestPayment = 0;
}
// Adjust last payment to ensure balance is exactly zero
if (i === numPayments – 1) {
principalPayment = balance;
monthlyPayment = balance + interestPayment; // Recalculate last payment if needed
totalInterest += interestPayment;
totalPrincipal += principalPayment;
} else {
totalInterest += interestPayment;
totalPrincipal += principalPayment;
}
balance -= principalPayment;
if (balance < 0.01) balance = 0; // Handle floating point inaccuracies
var row = tableBody.insertRow();
row.insertCell().textContent = (i + 1);
row.insertCell().textContent = paymentDate.toLocaleDateString(); // Format date
row.insertCell().textContent = "$" + (principal – totalPrincipal + principalPayment).toFixed(2); // Starting Balance for this row
row.insertCell().textContent = "$" + monthlyPayment.toFixed(2);
row.insertCell().textContent = "$" + principalPayment.toFixed(2);
row.insertCell().textContent = "$" + interestPayment.toFixed(2);
row.insertCell().textContent = "$" + balance.toFixed(2);
paymentDate.setMonth(paymentDate.getMonth() + 1); // Move to next month
}
}
function updateChart(principal, monthlyRate, numPayments, monthlyPayment) {
var ctx = document.getElementById('amortizationChart').getContext('2d');
// Destroy previous chart instance if it exists
if (chartInstance) {
chartInstance.destroy();
}
var labels = [];
var principalData = [];
var interestData = [];
var balance = principal;
for (var i = 0; i 0) {
interestPayment = balance * monthlyRate;
principalPayment = monthlyPayment – interestPayment;
} else {
principalPayment = monthlyPayment;
interestPayment = 0;
}
// Adjust last payment
if (i === numPayments – 1) {
principalPayment = balance;
monthlyPayment = balance + interestPayment;
}
balance -= principalPayment;
if (balance < 0.01) balance = 0;
principalData.push(principalPayment);
interestData.push(interestPayment);
}
chartInstance = new Chart(ctx, {
type: 'bar', // Changed to bar for better visualization of components
data: {
labels: labels,
datasets: [{
label: 'Principal Paid',
data: principalData,
backgroundColor: 'rgba(0, 74, 153, 0.6)', // Primary color
borderColor: 'rgba(0, 74, 153, 1)',
borderWidth: 1
}, {
label: 'Interest Paid',
data: interestData,
backgroundColor: 'rgba(255, 159, 64, 0.6)', // A contrasting color
borderColor: 'rgba(255, 159, 64, 1)',
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false, // Allow chart to fill container height
scales: {
x: {
stacked: true, // Stack bars for principal and interest
title: {
display: true,
text: 'Payment Number'
}
},
y: {
stacked: true,
title: {
display: true,
text: 'Amount ($)'
},
beginAtZero: true
}
},
plugins: {
tooltip: {
mode: 'index',
intersect: false
},
legend: {
position: 'top',
}
}
}
});
}
function copyResults() {
var monthlyPayment = document.getElementById("monthlyPayment").textContent;
var totalPrincipal = document.getElementById("totalPrincipal").textContent;
var totalInterest = document.getElementById("totalInterest").textContent;
var totalPayments = document.getElementById("totalPayments").textContent;
var loanAmount = document.getElementById("loanAmount").value;
var annualInterestRate = document.getElementById("annualInterestRate").value;
var loanTermYears = document.getElementById("loanTermYears").value;
var textToCopy = "Loan Amortization Results:\n\n";
textToCopy += "Loan Amount: $" + loanAmount + "\n";
textToCopy += "Annual Interest Rate: " + annualInterestRate + "%\n";
textToCopy += "Loan Term: " + loanTermYears + " years\n\n";
textToCopy += "—————————————-\n";
textToCopy += "Monthly Payment: " + monthlyPayment + "\n";
textToCopy += "Total Principal Paid: " + totalPrincipal + "\n";
textToCopy += "Total Interest Paid: " + totalInterest + "\n";
textToCopy += "Total Payments: " + totalPayments + "\n";
textToCopy += "—————————————-\n";
// Use a temporary textarea to copy text to clipboard
var textArea = document.createElement("textarea");
textArea.value = textToCopy;
textArea.style.position = "fixed";
textArea.style.left = "-9999px";
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 feedback
} catch (err) {
alert('Oops, unable to copy. Please copy manually.');
}
document.body.removeChild(textArea);
}
function resetForm() {
document.getElementById("loanAmount").value = "";
document.getElementById("annualInterestRate").value = "";
document.getElementById("loanTermYears").value = "";
document.getElementById("monthlyPayment").textContent = "$0.00";
document.getElementById("totalPrincipal").textContent = "$0.00";
document.getElementById("totalInterest").textContent = "$0.00";
document.getElementById("totalPayments").textContent = "$0.00";
document.getElementById("amortizationTableBody").innerHTML = ""; // Clear table
var ctx = document.getElementById('amortizationChart').getContext('2d');
if (chartInstance) {
chartInstance.destroy();
chartInstance = null;
}
// Optionally clear canvas or draw a placeholder
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
// Clear error messages
document.getElementById("loanAmountError").textContent = "";
document.getElementById("annualInterestRateError").textContent = "";
document.getElementById("loanTermYearsError").textContent = "";
// Reset input borders
document.getElementById("loanAmount").style.borderColor = 'var(–border-color)';
document.getElementById("annualInterestRate").style.borderColor = 'var(–border-color)';
document.getElementById("loanTermYears").style.borderColor = 'var(–border-color)';
}
// Initial calculation on load if default values are set (optional)
// calculateAmortization();
// Add event listener for Enter key press on input fields to trigger calculation
document.getElementById("loanAmount").addEventListener("keypress", function(event) { if (event.key === "Enter") calculateAmortization(); });
document.getElementById("annualInterestRate").addEventListener("keypress", function(event) { if (event.key === "Enter") calculateAmortization(); });
document.getElementById("loanTermYears").addEventListener("keypress", function(event) { if (event.key === "Enter") calculateAmortization(); });
// — Chart.js library (included inline for self-contained HTML) —
// NOTE: In a real-world scenario, you'd include Chart.js via a CDN or local file.
// For this self-contained HTML, we'll simulate its presence.
// The code above assumes Chart.js is available globally.
// If running this directly, you'd need to add:
//
// before the script block. For this exercise, we assume it's available.
// Placeholder for Chart.js if not loaded externally
if (typeof Chart === 'undefined') {
var Chart = function() {
this.destroy = function() { console.log('Chart.js not loaded, destroy called.'); };
console.warn('Chart.js library is not loaded. Chart functionality will be disabled.');
};
Chart.defaults = {
datasets: {
bar: {
backgroundColor: 'rgba(0,0,0,0.1)',
borderColor: 'rgba(0,0,0,0.1)',
borderWidth: 1
}
}
};
Chart.prototype.destroy = function() { console.log('Chart.js not loaded, destroy called.'); };
}