Loan amortization
Principal, interest and insurance of each year of a loan, and what is left to pay. Good for mortgage and car loan simulators.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
import 'nervure/themes';
const spec = { type: 'amortization', format: { currency: 'EUR' }, amount: 250000, rate: 3.3, years: 20, insurance: 0.3, start: 2026 };
export default function Example() {
return <Chart spec={spec} style={{ height: 340 }} />;
}Or import this chart alone: what each import weighs.
Options
Beside the fields shared by every chart (title, format, heading, export…), type amortization takes:
/** A loan paid back in equal monthly payments: principal and interest of each year, and what is left to pay. */
interface AmortizationSpec extends Base {
type: 'amortization';
amount: number;
/** Yearly rate, in %. */
rate: number;
years: number;
/** Yearly insurance, in % of the amount borrowed. */
insurance?: number;
/** First year, for the labels: 1 by default. */
start?: number;
legend?: boolean | LegendOptions;
}Style it
- Colours:
theme.palette,chart.setColor(name, colour), or--nervure-palettein your CSS. More - Marks:
[data-series="name"], parts:[data-part="axes"],legend,series. What you change is kept in exports. - Movement:
animation: falsedraws at once. More - Files:
chart.download('png'),svg,csv. More