Skip to content

Human body ​

Figures on the organs of a body. Good for check-ups and lessons. It explains; it is not a medical tool.

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

In your framework

import { Chart } from 'nervure/react';

const spec = {
  type: 'body',
  format: { percent: true },
  max: 100,
  values: { brain: 66, lungs: 57, heart: 41, liver: 63, stomach: 38, kidneys: 38 },
};

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

/** Figures on the organs of a body. A picture to explain, not a medical tool. */
interface BodySpec extends Base {
  type: 'body';
  values: Partial<Record<OrganName, number>>;
  labels?: Partial<Record<OrganName, string>>;
  max?: number;
  color?: string;
  onOrganClick?: (organ: OrganName) => void;
}

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