Price per m² ladder
Districts placed on one ladder by their price per m², their range beside, and a home placed on it. Good for valuations, listings and market reports.
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: 'priceladder',
format: { currency: 'EUR' },
data: [
{ name: 'Old town', value: 5100, low: 3876, high: 6222 },
{ name: 'Harbour', value: 4900, low: 3528, high: 5929 },
{ name: 'Station', value: 5500, low: 4290, high: 6765 },
{ name: 'University', value: 3800, low: 2774, high: 4636 },
{ name: 'Riverside', value: 7000, low: 4900, high: 9240 },
{ name: 'Hills', value: 2800, low: 2128, high: 3444 },
{ name: 'North park', value: 3900, low: 3159, high: 4602 },
{ name: 'Market', value: 4700, low: 3713, high: 6016 },
],
mark: { name: 'This flat', value: 5600 },
};
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 priceladder takes:
/** Price per m² of districts on one ladder, from the cheapest to the dearest, with a home placed on it. */
interface PriceLadderSpec extends Base {
type: 'priceladder';
data: { name: string; value: number; low?: number; high?: number }[];
/** A home or an offer to place on the ladder. */
mark?: { name: string; value: number };
/** `/m²` by default. */
unit?: string;
onItemClick?: (name: string) => void;
}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