Marimekko chart
Columns as wide as their totals, each split into its parts.
On this page
A marimekko shows two shares at once. Each label is a column as wide as its share of the grand total, and each series is a part of the column as tall as its share of it. So a reader sees how large each group is and what it is made of in one drawing, which stacked bars of equal width cannot show.
Marimekko chart
<div class="card max-w(560) mx-auto"> <div class="card-header"> <h3 class="card-title">Revenue</h3> <p class="card-description">By region and product, in millions of dollars</p> </div> <figure class="chart" id="mix"></figure></div><script>addEventListener('DOMContentLoaded', function () {MasterUI.chart(document.getElementById('mix'), { type: 'marimekko', label: 'Revenue by region and product, in millions of dollars', labels: ['Americas', 'Europe', 'Asia', 'Other'], series: [ { name: 'Hardware', values: [320, 180, 260, 40] }, { name: 'Software', values: [280, 220, 140, 30] }, { name: 'Services', values: [160, 120, 60, 20] } ]})})</script><script type="module"> import { attach } from '@master/ui/behaviors' attach()</script>import { Chart } from './ui/chart'<div className="card max-w(560) mx-auto"> <div className="card-header"> <h3 className="card-title">Revenue</h3> <p className="card-description">By region and product, in millions of dollars</p> </div> <Chart id="mix" type="marimekko" label="Revenue by region and product, in millions of dollars" labels={['Americas', 'Europe', 'Asia', 'Other']} series={[ { name: 'Hardware', values: [320, 180, 260, 40] }, { name: 'Software', values: [280, 220, 140, 30] }, { name: 'Services', values: [160, 120, 60, 20] } ]} /></div><script> import Chart from './ui/Chart.svelte'</script><div class="card max-w(560) mx-auto"> <div class="card-header"> <h3 class="card-title">Revenue</h3> <p class="card-description">By region and product, in millions of dollars</p> </div> <Chart id="mix" type="marimekko" label="Revenue by region and product, in millions of dollars" labels={['Americas', 'Europe', 'Asia', 'Other']} series={[ { name: 'Hardware', values: [320, 180, 260, 40] }, { name: 'Software', values: [280, 220, 140, 30] }, { name: 'Services', values: [160, 120, 60, 20] } ]} /></div><script setup>import Chart from './ui/Chart.vue'</script><template> <div class="card max-w(560) mx-auto"> <div class="card-header"> <h3 class="card-title">Revenue</h3> <p class="card-description">By region and product, in millions of dollars</p> </div> <Chart id="mix" type="marimekko" label="Revenue by region and product, in millions of dollars" :labels="['Americas', 'Europe', 'Asia', 'Other']" :series="[ { name: 'Hardware', values: [320, 180, 260, 40] }, { name: 'Software', values: [280, 220, 140, 30] }, { name: 'Services', values: [160, 120, 60, 20] } ]" /> </div></template>The scale up the plot is shares of a column, from none to all of it; the widths have no scale, so the readout's title says each column's total and its share of the whole. Areas are harder to compare than lengths: use a marimekko for the overall picture and stacked bars when one part has to be compared across groups.
#Options
| Option | Default | |
|---|---|---|
label | none | What the chart shows and in what unit: the plot's accessible name |
labels | [] | The names along the scale, around a radar or over a heatmap's columns |
series | [] | Each with a name and what its form reads: values, a value, points, ranges or children; optionally a category, a type, low and high, and a ring's max |
format, tickFormat | the locale's | How a value and a tick are written; xFormat for a scatter's scale across |
current | none | The index of the point marked aria-current |
legend, toggle | with two series, true | Whether a legend is written, and whether its entries are checkboxes |
The readout, the keys, the legend, the colors and the scale are the same in every form: Chart holds them, with every option, class and custom property.