Rental yield grid
The yield of a rental for a range of prices and rents, the home studied ringed. Good for choosing a buy-to-let and how much to offer.
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: 'yieldgrid',
format: { currency: 'EUR', compact: true },
prices: [170000, 200000, 230000, 260000, 290000, 320000],
rents: [700, 800, 900, 1000, 1100, 1200],
target: 5,
mark: { price: 230000, rent: 900 },
};
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 yieldgrid takes:
/** Rental yield for a range of prices and rents: price across, monthly rent down. */
interface YieldGridSpec extends Base {
type: 'yieldgrid';
prices: number[];
rents: number[];
/** Share of the rent lost to charges, tax and empty months: 0 by default (gross yield). */
charges?: number;
/** Yield sought, in %: the cells at or above it are written in bold. */
target?: number;
/** The home studied, ringed: its price and rent. */
mark?: { price: number; rent: number };
}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