Pictogram
Small figures, each worth the same amount. Good for numbers of people or things, for a wide audience.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'pictogram',
unit: 10,
shape: 'star',
data: [
{ name: 'Centre', value: 74 },
{ name: 'West', value: 68 },
{ name: 'South', value: 42 },
{ name: 'North', value: 44 },
{ name: 'East', value: 41 },
],
};
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 pictogram takes:
interface PictogramSpec extends Base {
type: 'pictogram';
data: Item[];
/** Value of one figure. */ unit?: number;
shape?: 'person' | 'circle' | 'square' | 'star' | 'house';
}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