Dot plot
Each value as a dot, piled up in stacks. Good for small samples, where people should count the values.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'wilkinson',
xLabel: 'Score',
values: [
49, 52.9, 64.5, 43.9, 60.9, 62.4, 89.2, 76.7, 61.5, 58.8, 58.1, 45.3, 69.5, 48.4, 65.7,
51.4, 60, 50.9, 79.5, 67.4, 45.5, 46.6, 70.7, 61.8, 68.7, 69.6, 57, 44.6, 75.9, 52.8, 50.8,
42.3, 41.7, 67.5, 55.4, 49.1, 48.4, 76.1, 63.7, 75.3, 73.4, 38.8, 57.1, 56.8, 38.3, 59.4,
64.4, 63.1, 72.7, 56.8, 45.9, 53.1, 45.7, 77.9, 49.7, 61.9, 52.5, 68.7, 51.9, 56.8, 80.1,
36.7, 64.2, 96.8, 69.6, 74.4, 55.6, 42.1, 51.2, 71.2,
],
};
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 wilkinson takes:
interface WilkinsonSpec extends Base {
type: 'wilkinson';
values: number[];
/** About how many stacks across the axis. */ bins?: number;
color?: string;
xLabel?: string;
}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