Bubble matrix
Circles as large as their value, in rows and columns. Good for two dimensions crossed, when sizes speak better than colours.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'bubblematrix',
rows: ['North', 'South', 'East', 'West', 'Centre'],
columns: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
values: [
[52, 39, 16, 48, 12, 11, 61],
[53, 21, 23, 20, 20, 95, 3],
[62, 0, 41, 23, 25, 73, 2],
[43, 58, 44, 83, 18, 38, 53],
[88, 21, 55, 34, 6, 75, 28],
],
};
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 bubblematrix takes:
/** Circles as large as their value, in rows and columns. */
interface BubbleMatrixSpec extends Base {
type: 'bubblematrix';
rows: string[];
columns: string[];
values: (number | null)[][];
color?: string;
/** Figures in the circles large enough. */
labels?: 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