Pyramid diagram
Levels of a triangle. Good for needs, strategies, layers of a system.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'triangle',
data: [
{ name: 'Vision', value: 3 },
{ name: 'Goals', value: 8 },
{ name: 'Projects', value: 16 },
{ name: 'Tasks', value: 128 },
],
};
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 triangle takes:
/** Levels of a triangle, the top first. */
interface TriangleSpec extends Base {
type: 'triangle';
data: { name: string; value?: number; color?: string }[];
inverted?: boolean;
}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