Skip to content

Property card ​

A home with its price, area and rooms, and its price per m² against the places around. Good for real estate listings, valuations and reports.

The smallest code that works. change the code, then press Run

In your framework

import { Chart } from 'nervure/react';

const spec = {
  type: 'property',
  format: { currency: 'EUR' },
  name: 'Three-room flat with a balcony',
  place: 'Lyon, Croix-Rousse',
  price: 313000,
  area: 80,
  rooms: 3,
  bedrooms: 2,
  floor: '4 of 6',
  energy: 'C',
  compare: [
    { name: 'This street', value: 4384 },
    { name: 'Croix-Rousse', value: 4157 },
    { name: 'Lyon', value: 4100 },
    { name: 'Villeurbanne', value: 3195 },
  ],
};

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 property takes:

/** Property card: price, area, rooms, and its price per m² against the places around. */
interface PropertySpec extends Base {
  type: 'property';
  name: string;
  /** Town or street. */
  place?: string;
  price: number;
  /** Living area in m². */
  area: number;
  rooms?: number;
  bedrooms?: number;
  floor?: string;
  /** Energy class, A to G. */
  energy?: string;
  /** Prices per m² to compare with: the street, the district, the town. */
  compare?: { name: string; value: number }[];
}

Style it

  • Colours: theme.palette, chart.setColor(name, colour), or --nervure-palette in your CSS. More
  • Marks: [data-series="name"], parts: [data-part="axes"], legend, series. What you change is kept in exports.
  • Movement: animation: false draws at once. More
  • Files: chart.download('png'), svg, csv. More

Close to it