# Mermaid treemap in Markdown to PDF

Nested rectangles are sized by value, with formatted numbers and styled classes.

Nested rectangles sized by value, with a value format and a styled class, for the stock of a warehouse by category.

- PDF: https://legivel.com/examples/mermaid-charts/treemap.pdf
- Page: https://legivel.com/examples/mermaid-charts/treemap
- Open in the editor: https://legivel.com/markdown-to-pdf?sample=chart-treemap
- More mermaid charts in Markdown to PDF: https://legivel.com/examples/mermaid-charts

## Markdown source

````markdown
# Treemaps

```mermaid
---
config:
  treemap:
    valueFormat: '0,0'
---
treemap
"Stock on hand, pallets"
    "Food and drink"
        "Ambient": 1840
        "Chilled": 620
        "Frozen": 410
    "Home"
        "Furniture": 530
        "Kitchen": 390
        "Textiles": 270
    "Garden"
        "Tools": 180
        "Plants and seeds": 95
    "Electronics"
        "Small appliances": 310
        "Audio and video": 140
```

A class marks the categories that need attention:

```mermaid
treemap
"Storage used, terabytes"
    "Media":::warning
        "Video": 120
        "Photos": 80
        "Audio": 25
    "Documents"
        "Contracts": 35
        "Correspondence": 15
    "Backups": 60
    "System": 40

classDef warning fill:#f59e0b,stroke:#78350f;
```
````
