Skip to content

Quadrant chart ​

Four zones and the points that fall in them. Good for priorities, SWOT, effort against value.

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

In your framework

import { Chart } from 'nervure/react';

const spec = {
  type: 'quadrant',
  zones: ['Plan', 'Do first', 'Delegate', 'Drop'],
  xLabel: 'Urgency',
  yLabel: 'Importance',
  data: [
    { name: 'Tea', x: 11, y: 24 },
    { name: 'Fruit', x: 20, y: 7 },
    { name: 'Soup', x: 96, y: 59 },
    { name: 'Juice', x: 36, y: 3 },
    { name: 'Cheese', x: 24, y: 4 },
    { name: 'Coffee', x: 25, y: 2 },
    { name: 'Nuts', x: 60, y: 57 },
    { name: 'Honey', x: 61, y: 12 },
  ],
};

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

interface QuadrantSpec extends Base {
  type: 'quadrant';
  /** From the top left, clockwise. */ zones: [string, string, string, string];
  data: { name: string; x: number; y: number; color?: string }[];
  xLabel?: string;
  yLabel?: string;
  /** Ends of the horizontal axis, such as [0, 1]: the lines between the zones cross at its middle. From the data by default. */
  xRange?: [number, number];
  /** Ends of the vertical axis; from the data by default. */
  yRange?: [number, 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