Skip to content
daisyBlazor

MarimekkoChart

Two breakdowns at once: each column is as wide as its share of the total and split 100 % by segment, so every cell's area is its share of everything, such as customers by region and plan. D3 scales place the columns and cells.
Composition and progress
Cover · <MarimekkoChart>
Marimekko chartNorth America (42% of total): Free 51%, Starter 26%, Pro 18%, Enterprise 5%; Europe (30% of total): Free 55%, Starter 26%, Pro 16%, Enterprise 3%; Asia Pacific (20% of total): Free 69%, Starter 20%, Pro 9%, Enterprise 2%; Latin America (8% of total): Free 71%, Starter 20%, Pro 7%, Enterprise 1%0%20%40%60%80%100%North America, Free: 820 (51% of North America)North America, Starter: 410 (26% of North America)North America, Pro: 290 (18% of North America)North America, Enterprise: 85 (5% of North America)Europe, Free: 640 (55% of Europe)Europe, Starter: 300 (26% of Europe)Europe, Pro: 180 (16% of Europe)Europe, Enterprise: 40 (3% of Europe)Asia Pacific, Free: 520 (69% of Asia Pacific)Asia Pacific, Starter: 150 (20% of Asia Pacific)Asia Pacific, Pro: 70 (9% of Asia Pacific)Asia Pacific, Enterprise: 12 (2% of Asia Pacific)Latin America, Free: 210 (71% of Latin America)Latin America, Starter: 60 (20% of Latin America)Latin America, Pro: 20 (7% of Latin America)Latin America, Enterprise: 4 (1% of Latin America)North America 42%Europe 30%Asia Pacific 20%

Examples

Basic

Each MarimekkoCell gives the Value of a Segment in a Column. Cells show their share of the column where they fit; columns show their share of the total.

Customers by region and plan
Customers by region and planNorth America (42% of total): Free 51%, Starter 26%, Pro 18%, Enterprise 5%; Europe (30% of total): Free 55%, Starter 26%, Pro 16%, Enterprise 3%; Asia Pacific (20% of total): Free 69%, Starter 20%, Pro 9%, Enterprise 2%; Latin America (8% of total): Free 71%, Starter 20%, Pro 7%, Enterprise 1%0%20%40%60%80%100%North America, Free: 820 customers (51% of North America)51%North America, Starter: 410 customers (26% of North America)26%North America, Pro: 290 customers (18% of North America)18%North America, Enterprise: 85 customers (5% of North America)5%Europe, Free: 640 customers (55% of Europe)55%Europe, Starter: 300 customers (26% of Europe)26%Europe, Pro: 180 customers (16% of Europe)16%Europe, Enterprise: 40 customers (3% of Europe)Asia Pacific, Free: 520 customers (69% of Asia Pacific)69%Asia Pacific, Starter: 150 customers (20% of Asia Pacific)20%Asia Pacific, Pro: 70 customers (9% of Asia Pacific)9%Asia Pacific, Enterprise: 12 customers (2% of Asia Pacific)Latin America, Free: 210 customers (71% of Latin America)71%Latin America, Starter: 60 customers (20% of Latin America)20%Latin America, Pro: 20 customers (7% of Latin America)7%Latin America, Enterprise: 4 customers (1% of Latin America)North America 42%Europe 30%Asia Pacific 20%Latin America 8%
Free Starter Pro Enterprise
website/Examples/Charts/MarimekkoChartBasicExample.razor Source

Segment colours

SegmentColors maps a segment name to any CSS colour; ShowValues="false" leaves the cells plain.

Marimekko chartNorth America (42% of total): Free 51%, Starter 26%, Pro 18%, Enterprise 5%; Europe (30% of total): Free 55%, Starter 26%, Pro 16%, Enterprise 3%; Asia Pacific (20% of total): Free 69%, Starter 20%, Pro 9%, Enterprise 2%; Latin America (8% of total): Free 71%, Starter 20%, Pro 7%, Enterprise 1%0%20%40%60%80%100%North America, Free: 820 customers (51% of North America)North America, Starter: 410 customers (26% of North America)North America, Pro: 290 customers (18% of North America)North America, Enterprise: 85 customers (5% of North America)Europe, Free: 640 customers (55% of Europe)Europe, Starter: 300 customers (26% of Europe)Europe, Pro: 180 customers (16% of Europe)Europe, Enterprise: 40 customers (3% of Europe)Asia Pacific, Free: 520 customers (69% of Asia Pacific)Asia Pacific, Starter: 150 customers (20% of Asia Pacific)Asia Pacific, Pro: 70 customers (9% of Asia Pacific)Asia Pacific, Enterprise: 12 customers (2% of Asia Pacific)Latin America, Free: 210 customers (71% of Latin America)Latin America, Starter: 60 customers (20% of Latin America)Latin America, Pro: 20 customers (7% of Latin America)Latin America, Enterprise: 4 customers (1% of Latin America)North America 42%Europe 30%Asia Pacific 20%Latin America 8%
Free Starter Pro Enterprise
website/Examples/Charts/MarimekkoChartColorsExample.razor Source

Playground

Customers by region and plan
Customers by region and planNorth America (42% of total): Free 51%, Starter 26%, Pro 18%, Enterprise 5%; Europe (30% of total): Free 55%, Starter 26%, Pro 16%, Enterprise 3%; Asia Pacific (20% of total): Free 69%, Starter 20%, Pro 9%, Enterprise 2%; Latin America (8% of total): Free 71%, Starter 20%, Pro 7%, Enterprise 1%0%20%40%60%80%100%North America, Free: 820 customers (51% of North America)51%North America, Starter: 410 customers (26% of North America)26%North America, Pro: 290 customers (18% of North America)18%North America, Enterprise: 85 customers (5% of North America)Europe, Free: 640 customers (55% of Europe)55%Europe, Starter: 300 customers (26% of Europe)26%Europe, Pro: 180 customers (16% of Europe)16%Europe, Enterprise: 40 customers (3% of Europe)Asia Pacific, Free: 520 customers (69% of Asia Pacific)69%Asia Pacific, Starter: 150 customers (20% of Asia Pacific)20%Asia Pacific, Pro: 70 customers (9% of Asia Pacific)9%Asia Pacific, Enterprise: 12 customers (2% of Asia Pacific)Latin America, Free: 210 customers (71% of Latin America)71%Latin America, Starter: 60 customers (20% of Latin America)20%Latin America, Pro: 20 customers (7% of Latin America)7%Latin America, Enterprise: 4 customers (1% of Latin America)North America 42%Europe 30%Asia Pacific 20%
Free Starter Pro Enterprise
<MarimekkoChart
                ValueFormat="{0:N0} customers"
                Title="Customers by region and plan"
                Cells="@_customers" />

@code {
    private readonly MarimekkoCell[] _customers =
    [
        new("North America", "Free", 820), new("North America", "Starter", 410), new("North America", "Pro", 290), new("North America", "Enterprise", 85),
        new("Europe", "Free", 640), new("Europe", "Starter", 300), new("Europe", "Pro", 180), new("Europe", "Enterprise", 40),
        new("Asia Pacific", "Free", 520), new("Asia Pacific", "Starter", 150), new("Asia Pacific", "Pro", 70), new("Asia Pacific", "Enterprise", 12),
        new("Latin America", "Free", 210), new("Latin America", "Starter", 60), new("Latin America", "Pro", 20), new("Latin America", "Enterprise", 4),
    ];
}

API

<MarimekkoChart>

DaisyBlazor.Charts

Parameters

  • AspectRatio double
    = 1.78

    Width divided by height. The chart keeps this shape at any width; its text keeps its size.

  • Cells IReadOnlyList<MarimekkoCell>
    = []

    The values: how much of each Segment there is in each Column. Columns and segments keep the order they first appear in; only positive values count.

  • RowHeight double?
    = null

    Height of each row in px, for a chart that lays its categories out as rows (horizontal bars, a Gantt's lanes, a heatmap's rows…): its height then follows its number of rows instead of AspectRatio, so a long list keeps readable rows at any width. A chart, or an orientation, without rows ignores it.

  • SegmentColors IReadOnlyDictionary<string, string>
    = null

    Optional colour per segment name (any CSS colour); other segments cycle through the theme palette.

  • ShowLegend bool
    = true

    Show the segment colours under the chart.

  • ShowTitle bool
    = true

    Draw Title as a visible heading above the chart (the default); false keeps it only as the chart's accessible name, for a chart inside a card that already has a heading.

  • ShowValues bool
    = true

    Print each cell's share of its column inside it, where it fits.

  • Title string
    = null

    Optional heading rendered above the chart; it is also the chart's accessible name.

  • ValueFormat string
    = "{0:#,0.##}"

    Format string for values in tooltips.

  • Width string
    = "100%"

    CSS width of the chart wrapper.

  • Class string
    = null

    Additional CSS classes merged onto the w-full wrapper.

  • Style string
    = null

    Inline styles appended after the width on the wrapper.

Something went wrong while running the docs. Reload