Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Treemap Chart Google Sheets: How to Create and Customize

· 4 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

A treemap chart in Google Sheets displays hierarchical data as a set of nested rectangles. Each branch of the hierarchy is given a rectangle, which is then tiled with smaller rectangles representing sub-branches. The size of the rectangles corresponds to a quantitative value, allowing you to quickly spot which categories or sub-categories contribute most to a total. To create one, you need a dataset organized with labels, parents, and values.

What You'll Need

  • A Google account with access to Google Sheets.
  • A dataset structured specifically for hierarchy (Labels, Parents, and Values).
  • A desktop browser (the chart editor is significantly more limited on the mobile app).

Step-by-Step

  1. Structure Your Data: Treemaps require a specific three-column format to function. Arrange your data as follows:
    • Column A (Labels): The name of the item (e.g., "Apples", "Oranges", "Fruit").
    • Column B (Parents): The category the label belongs to. For the top-level category (the root), leave the parent cell blank. For sub-items, the parent must exactly match a label listed in Column A.
    • Column C (Values): The numerical value that determines the size of the rectangle.
  2. Select Your Data: Click and drag to highlight the entire range of your data, including the header row.
  3. Insert the Chart: Go to the top menu and select Insert > Chart.
  4. Change the Chart Type: Google Sheets may default to a column or pie chart. In the Chart editor panel that appears on the right, click the Chart type dropdown menu. Scroll down to the "Other" section and select the Treemap chart icon.
  5. Verify Data Ranges: In the Setup tab of the Chart editor, ensure the following are correctly assigned:
    • Labels: Should point to your first column.
    • Parents: Should point to your second column.
    • Values: Should point to your third column.
  6. Customize the Appearance: Switch to the Customize tab in the Chart editor. Here you can:
    • Min/Max Color: Change the colors used to represent the lowest and highest values in your data.
    • Chart Style: Adjust the background color or font.
  7. Finalize and Position: Click outside the Chart editor to save your changes. You can now click and drag the chart to move it or pull the corners to resize it.

Common Mistakes

  • Circular References: This occurs when a parent is listed as its own child, or a child is listed as the parent of its own parent. This will cause the chart to fail to render.
  • Typing Errors in Parents: If a parent is listed as "Fruit" in one cell and "Fruits" in another, Google Sheets will treat them as two different categories, breaking the hierarchy.
  • Missing Root Node: Every treemap needs at least one item with a blank parent cell to act as the "top" of the map. Without this, the chart cannot establish a starting point.
  • Non-Numeric Values: Placing text or symbols (like currency signs typed manually) in the Value column can prevent the chart from calculating the rectangle sizes.

Tips

  • Use Data Validation: To avoid typos in the Parent column, use Insert > Dropdown to ensure you are selecting existing labels from the Label column.
  • Limit Hierarchy Depth: While Google Sheets supports multiple levels, treemaps become difficult to read if you go more than three or four levels deep.
  • Contrast Colors: Use a high-contrast color scale in the Customize tab (e.g., red for low and green for high) to make the data insights jump out immediately.
  • Sort Your Data: While the treemap organizes by size, keeping your spreadsheet sorted logically makes it easier for you to audit the hierarchy before generating the chart.

Troubleshooting

If your chart is not appearing or looks incorrect, try these steps in order:

  1. Check for Blank Rows: Ensure there are no completely empty rows within your selected data range.
  2. Verify Exact Matches: Double-check that every entry in the Parent column matches a Label in the Label column exactly, including spaces and capitalization.
  3. Remove Duplicate Labels: Each item in the Label column must be unique. If you have two items named "Sales," the chart will not know which one is the parent for sub-items.
  4. Refresh the Page: Occasionally, the Chart editor may glitch during the initial switch to a Treemap; refreshing the browser often resolves rendering issues.

Frequently Asked Questions

Can I have multiple root nodes in one treemap?

No. A treemap requires a single root node (one item with a blank parent) to encompass all other data. If you have multiple top-level categories, create a "Grand Total" or "All Categories" label as the parent for all of them.

Why is my treemap showing as a blank white box?

This usually happens because of a hierarchy error, such as a circular reference or a parent label that doesn't exist in the label column. Check your Parent column for typos.

Can I change the color of individual rectangles?

No. Treemap colors in Google Sheets are based on a gradient scale determined by the values. You cannot manually assign a specific color to a specific rectangle.

Does the treemap work on the Google Sheets mobile app?

You can view existing treemaps on the mobile app, but creating and customizing them requires the full Chart editor, which is only available on the desktop web version.

How do I add more data to an existing treemap?

Add the new rows to your spreadsheet, then double-click the chart to open the Chart editor. In the Setup tab, update the data range to include the new rows.