Treemap Chart

Displays hierarchical data as nested rectangles. Each rectangle’s area is proportional to its value, using a squarified layout algorithm.

Basic Usage

<ArcadiaTreemapChart TItem="DeptBudget" Data="@data"
                   NameField="@(d => d.Dept)" ValueField="@(d => d.Budget)"
                   Height="400" Width="600" Title="Department Allocation" />

@code {
    record DeptBudget(string Dept, double Budget);

    List<DeptBudget> data = new()
    {
        new("Engineering", 450000), new("Marketing", 180000),
        new("Sales", 220000), new("Operations", 120000),
        new("HR", 80000), new("Design", 95000),
    };
}

Parameters

ParameterTypeDefaultDescription
NameFieldFunc<T, string>requiredExtracts the category name
ValueFieldFunc<T, double>requiredExtracts the numeric value (determines area)
CellStrokeWidthdouble2Stroke width for each treemap cell border
CellStrokeColorstringvar(--arcadia-color-surface)Stroke color for each treemap cell border
CellLabelColorstringwhiteFill color for the cell name label text

Plus all shared ChartBase parameters.

Events

EventTypeDescription
OnPointClickEventCallback<PointClickEventArgs<T>>Fired when a cell is clicked
OnSeriesClickEventCallback<int>Fired when a series is clicked

Features

  • Squarified treemap algorithm for optimal aspect ratios
  • Color coding from the chart palette
  • Cell labels with name and formatted value
  • Hover tooltips
  • PNG/SVG export via toolbar
  • Screen reader accessible data table