Borrowing capacity
How much one can borrow over 10 to 25 years, with the deposit and the price aimed at. Good for mortgage simulators and home buying plans.
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: 'borrowing',
format: { currency: 'EUR', compact: true },
income: 4800,
charges: 0,
insurance: 0.3,
deposit: 34000,
price: 290000,
rates: [
{ years: 10, rate: 3.3 },
{ years: 15, rate: 3.45 },
{ years: 20, rate: 3.6 },
{ years: 25, rate: 3.75 },
],
};
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 borrowing takes:
/** How much one can borrow for each length of loan, with the deposit and the price aimed at. */
interface BorrowingSpec extends Base {
type: 'borrowing';
/** Monthly income. */
income: number;
/** Monthly charges already paid. */
charges?: number;
/** Highest debt ratio, in %: 35 by default. */
ratio?: number;
/** Rate of each length, in years and %. */
rates: { years: number; rate: number }[];
/** Yearly insurance, in % of the amount. */
insurance?: number;
deposit?: number;
/** Price of the home sought, fees included. */
price?: 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