Home›Dashboard›Treemap Chart
NEWDashboard

Treemap Chart

Hierarchical data as nested rectangles. Great for showing proportions within categories.

Loading chart…
#treemap#hierarchy#nested#proportions
Customization Guides & Code Snippets

◆Responsive Sizing with ResponsiveContainer

Always wrap your Dashboard chart inside <ResponsiveContainer width="100%" height={320}> to ensure it scales cleanly across mobile and desktop displays.

◆Custom Dark Theme Tooltip

Style the hover tooltip to match your dark UI with contentStyle={{ background: '#13161a', border: '1px solid #2a3038', borderRadius: 8 }}.

When to use a Treemap Chart

A Treemap Chart is ideal for developers and designers who need to display data clearly and effectively. Use this chart type when:

  • ✓Building analytics overview pages with multiple metrics
  • ✓SaaS product dashboards showing user activity
  • ✓Business intelligence reporting screens
  • ✓Admin panels with KPI summaries
Tips for Recharts Treemap Chart
TIP 1Use a grid layout with consistent card sizes for visual rhythm
TIP 2Always show a time period selector (Today / 7d / 30d / 90d)
TIP 3Load charts progressively — KPI cards first, then charts
TIP 4Use skeleton loaders while data is fetching to prevent layout shift
TIP 5Keep color usage minimal — pick 2-3 accent colors maximum
Key Recharts Props
PROPTYPEDESCRIPTION
dataarrayArray of objects with your data values
dataKeystringThe key in your data objects to use for bar height
fillstringBar color — accepts hex, rgb, or CSS variable
radius[number,number,number,number]Corner radius [topLeft, topRight, bottomRight, bottomLeft]
stackIdstringGroup bars with the same stackId into a stacked bar
Related Charts