Strip plot
Every value of each category, spread a little sideways, with the median. Good for small samples per group, without hiding a single value.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'strip',
data: [
{
name: 'North',
values: [
52.7, 43, 48.5, 47.7, 51.1, 44.7, 45.4, 46.2, 58.8, 38.7, 50.1, 42.3, 53, 40.8, 52.9, 43.4,
54.3, 37.3, 45.7, 38.3, 41.6, 30, 46.5, 45.7, 45.1, 34.5, 45.2, 47.2,
],
},
{
name: 'South',
values: [
82, 88, 64.5, 47.6, 59, 84, 73.8, 55.5, 101.4, 78.5, 50.3, 32.9, 92, 61, 58.7, 82.9, 70,
55.5, 72.4, 57.7, 58.2, 85.6, 76.6, 53.8, 87.4, 79.8, 40.7, 50.6, 87.8, 59.3, 105.1, 81.1,
86.6,
],
},
{
name: 'East',
values: [
42.2, 41.6, 57.7, 58.3, 46.4, 54.7, 44.7, 59.3, 48.1, 56, 46.2, 57.6, 45.7, 43.7, 52, 45,
48, 44.9, 48.7, 56.1, 54.7, 54.3,
],
},
{
name: 'West',
values: [
11.1, 44.3, 37.1, 42.2, 35.1, 67, 36.7, 40.9, 61.6, 44, 63.9, 39.3, 30.6, 57.4, 59.4, 27.5,
35, 41, 38.3, 40.4, 49.6, 63.7, 52.8, 39.9, 40.7, 15.2, 67.3, 4.4, 41.3, 35.7, 43.4, 58.4,
35.7, 48, 28.8,
],
},
],
};
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 strip takes:
interface StripSpec extends Base {
type: 'strip';
data: Sample[];
}
interface Sample {
name: 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