Recharts Treemap

A flat treemap — every leaf rectangle carries a category name and a colour, with the rectangle area proportional to the value. Recharts' `<Treemap>` recursively packs the rectangles using the standard squarified algorithm, supports per-cell colour via the `content` render prop, a

Template details

  • chart
  • treemap
  • categorical
  • share
  • recharts
  • react

When to use this template

This visualization excels at showing the relative proportions of 12-30 distinct categories within a total. An analyst would reach for it to quickly identify the largest contributors and understand their magnitudes at a glance, especially when precise numerical comparison isn't the primary goal but rather a sense of scale and share. It helps in understanding the overall composition of a single, non-hierarchical set of items.

  • Single-level categorical data with 12 to 30 distinct items.
  • Quantitative values representing parts of a whole.
  • Data where relative proportion and magnitude comparison is primary.
  • Each category requires a unique label for identification.
  • Values are non-negative and sum to a meaningful total.
  • Data for a single point in time or aggregated period.

Browse all Koan templates