Usage
WaffleChart displays parts of a whole as a grid of cells. Each segment gets a number of cells proportional to its value:
Total
By default, the sum of all values fills the entire grid. Set total to a larger number to leave the remaining cells empty,
for example, to display progress towards a goal. A total smaller than the sum of values is ignored.
Use emptyColor to change the color of empty cells:
Tooltip
Set withTooltip to display the segment name and value on cell hover. Use getTooltipLabel to change the tooltip content:
Legend
Use legendPosition to move the legend or set withLegend={false} to hide it.
Like fillDirection, left and right positions do not flip in right-to-left direction:
Gap and grid size
Use rows and columns props to change the number of cells, gap and cellRadius to change their spacing and border radius:
Fill direction
fillDirection controls the order in which cells are filled:
Value formatter
Use valueFormatter to format values and the total in the tooltip and in the label announced by screen readers:
Accessibility
Set aria-label to summarize the chart in your own words: