Marimekko chart
Stacked columns as wide as their total. Good for market size and market share together.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'marimekko',
columns: ['North', 'South', 'East', 'West'],
series: [
{ name: 'Shop', data: [36, 29, 18, 34] },
{ name: 'Web', data: [16, 16, 41, 37] },
{ name: 'Phone', data: [20, 22, 20, 20] },
],
};
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 marimekko takes:
/** Columns as wide as their total. */
interface MarimekkoSpec extends Base {
type: 'marimekko';
columns: string[];
series: { name: string; data: number[]; color?: 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