Waffle chart

Show the share of a whole as a grid of square cells in a waffle chart, one panel per category, with the total on top and shares rounded to whole cells.

React
import { WaffleChart } from 'boardplot/react/waffle';
Use for
One share of 100%, such as 30% of customers · Several shares side by side with one baseline · Stacked segments of one whole
Not for
Levels or values that are not shares of a whole; waffle fills part of 100%. Use bar or column for levels, pie for slices of a total.

Orders by delivery speed

Waffle chart, 1 panel and 3 series, each panel a 10 × 10 grid of 100 cells; one cell is 1%. Orders by delivery speed, % of all orders: Same day 41.3% = 41 of 100 cells, Next day 27.4% = 28 of 100 cells, Later 18.3% = 18 of 100 cells, 87.0% in all, 13 of 100 cells empty. Two in three orders arrive within a day Orders by delivery speed, % of all orders Source: Illustrative data 1 square = 1% of orders within a day 68.7% Rest of orders Later Next day Same day 13.0% 18.3% 27.4% 41.3%

Waffle grid of 100 squares split into same day 41.3%, next day 27.4%, later 18.3% and rest 13.0%, with a bracket showing 68.7% within a day.

Download SVG Fixture IDstacked-segments
JSON spec

This spec includes the theme shown and the options you selected.

{
  "type": "waffle",
  "data": {
    "categories": [
      {
        "id": "orders",
        "label": "Orders by delivery speed, % of all orders"
      }
    ],
    "series": [
      {
        "id": "same-day",
        "label": "Same day",
        "values": [
          41.3
        ]
      },
      {
        "id": "next-day",
        "label": "Next day",
        "values": [
          27.4
        ]
      },
      {
        "id": "later",
        "label": "Later",
        "colorRole": "series-4",
        "values": [
          18.3
        ]
      }
    ]
  },
  "options": {
    "title": "Two in three orders arrive within a day",
    "source": "Illustrative data",
    "format": "0.0%",
    "variant": "cells",
    "subtotal": {
      "series": [
        "same-day",
        "next-day"
      ],
      "label": "within a day"
    },
    "strings": {
      "others": "Rest of orders"
    },
    "footnotes": [
      "1 square = 1% of orders"
    ]
  }
}

Regional share against company total

Waffle chart of share squares, 5 panels and 1 series: each panel is a square for 100%, and the area of its solid square is the share. Headcount: 6% of the whole. Revenue: 31% of the whole. Operating profit: 54% of the whole. New product launches: 47% of the whole. Patent filings: 22% of the whole. A dashed outline in the other panels marks the reference, Headcount 6%. North earns more than its size today North region share of company total in % Source: Illustrative data Dashed outline = Headcount 6% 6% 47% 22% 54% 31% Headcount New product launches Patent filings Operating profit Revenue Today, North carries the business Staying ahead needs more launches and patents

Five nested squares show the North region's share of headcount (6%), revenue (31%), operating profit (54%), product launches (47%) and patent filings (22%), with a dashed headcount outline.

Download SVG Fixture IDshare-squares
JSON spec

This spec includes the theme shown and the options you selected.

Changed from the fixture: options.title.

{
  "type": "waffle",
  "data": {
    "categories": [
      {
        "id": "headcount",
        "label": "Headcount"
      },
      {
        "id": "revenue",
        "label": "Revenue"
      },
      {
        "id": "profit",
        "label": "Operating profit"
      },
      {
        "id": "launches",
        "label": "New product launches"
      },
      {
        "id": "patents",
        "label": "Patent filings"
      }
    ],
    "series": [
      {
        "id": "share",
        "label": "North region share",
        "colorRole": "neutral",
        "values": [
          6,
          31,
          54,
          47,
          22
        ]
      }
    ]
  },
  "options": {
    "title": "North earns more than its size today",
    "subtitle": {
      "measure": "North region share of company total",
      "company": ""
    },
    "unit": "%",
    "variant": "square",
    "reference": {
      "categoryId": "headcount",
      "label": "Headcount 6%"
    },
    "panelGroups": [
      {
        "id": "today",
        "panels": [
          "revenue",
          "profit"
        ],
        "label": "Today, North carries the business",
        "colorRole": "series-1"
      },
      {
        "id": "tomorrow",
        "panels": [
          "launches",
          "patents"
        ],
        "label": "Staying ahead needs more launches and patents",
        "colorRole": "series-2"
      }
    ],
    "source": "Illustrative data",
    "size": {
      "width": 960
    }
  }
}

Two customer shares side by side

Waffle chart, 2 panels and 1 series, each panel a 10 × 10 grid of 100 cells; one cell is 1%. Share of high-spending customers out of all customers in the urban region: 30% = 30 of 100 cells. Share of repeat buyers: 64% = 64 of 100 cells. Repeat buyers are twice as common as high spenders Source: Illustrative data 64% 30% Share of repeat buyers Share of high-spending customers out of all customers in the urban region

Two 10 by 10 waffle grids: 30% of customers are high spenders and 64% are repeat buyers.

Download SVG Fixture IDtwo-panels
JSON spec

This spec includes the theme shown and the options you selected.

{
  "type": "waffle",
  "data": {
    "categories": [
      {
        "id": "urban",
        "label": "Share of high-spending customers out of all customers in the urban region"
      },
      {
        "id": "rural",
        "label": "Share of repeat buyers"
      }
    ],
    "series": [
      {
        "id": "share",
        "label": "Share",
        "values": [
          30,
          64
        ]
      }
    ]
  },
  "options": {
    "title": "Repeat buyers are twice as common as high spenders",
    "source": "Illustrative data"
  }
}

Steps that outgrow a target

Waffle chart of share squares, 3 panels and 1 series: each panel is a square for 100%, and the area of its solid square is the share. Store count: 12% of the whole. Sales: 35% of the whole. Online orders: 58% of the whole. A dashed outline in each panel marks the reference, Target 20%. Each step outgrows the store count Source: Illustrative data Dashed outline = Target 20% 58% 35% 12% Online orders Sales Store count

Three squares show store count 12%, sales 35% and online orders 58% against a dashed 20% target outline, joined by arrows.

Download SVG Fixture IDshare-squares-arrows
JSON spec

This spec includes the theme shown and the options you selected.

{
  "type": "waffle",
  "data": {
    "categories": [
      {
        "id": "stores",
        "label": "Store count"
      },
      {
        "id": "sales",
        "label": "Sales"
      },
      {
        "id": "online",
        "label": "Online orders"
      }
    ],
    "series": [
      {
        "id": "share",
        "label": "Share",
        "values": [
          12,
          35,
          58
        ]
      }
    ]
  },
  "options": {
    "title": "Each step outgrows the store count",
    "variant": "square",
    "arrows": true,
    "reference": {
      "value": 20,
      "label": "Target 20%"
    },
    "source": "Illustrative data",
    "size": {
      "width": 720
    }
  }
}

Minimal spec

Save this spec as waffle.json and run the command.

{
  "type": "waffle",
  "data": {
    "categories": [{ "id": "high-spend", "label": "Share of high-spending customers out of all customers" }],
    "series": [{ "id": "share", "label": "High spenders", "values": [30] }]
  },
  "options": { "title": "Three in ten customers are high spenders", "source": "Illustrative data" }
}
npx boardplot render waffle.json --out waffle.svg