Loading...
Loading...
Create and customize Syncfusion Angular TreeMap components for hierarchical data visualization. Use this skill when you need to implement a TreeMap, visualize hierarchical data structures, configure multi-level layouts, apply color mapping, enable drilldown navigation, add labels and tooltips, configure legends, handle selection and highlight, export to images or PDF, print, or customize internationalization and accessibility. Covers installation, data binding, layout types, levels, color mapping, labels, tooltips, legends, drilldown, interactivity, print/export, RTL, locale formatting, and accessibility.
npx skill4agent add syncfusion/angular-ui-components-skills syncfusion-angular-treemapweightValuePathlevelsgroupPathreferences/api-reference.mdreferences/getting-started.mdTreeMapModulereferences/data-binding.mdlevelsweightValuePathreferences/color-mapping.mdcolorValuePathleafItemSettings.colorMappingreferences/drilldown-and-navigation.mdlevelsdrillDownViewdrillStartdrillEndreferences/levels-and-layout.mdgroupPathSquarifiedSliceAndDiceVerticalSliceAndDiceHorizontalSliceAndDiceAutoreferences/labels-tooltips-legend.mdreferences/selection-interactivity.mdselectItem(...)references/print-export-accessibility.mdreferences/internationalization.mdsetCulture()setCurrencyCode()import { Component, signal } from '@angular/core';
import { TreeMapModule } from '@syncfusion/ej2-angular-treemap';
@Component({
selector: 'app-treemap',
standalone: true,
imports: [TreeMapModule],
template: `
<ejs-treemap
id="treemap-container"
[dataSource]="data()"
weightValuePath="Size"
[levels]="levels"
[leafItemSettings]="leafItemSettings">
</ejs-treemap>
`,
styles: [`
#treemap-container {
display: block;
width: 100%;
height: 500px;
}
`]
})
export class TreeMapComponent {
public data = signal([
{ Category: 'Electronics', Item: 'Laptops', Size: 150 },
{ Category: 'Electronics', Item: 'Phones', Size: 200 },
{ Category: 'Furniture', Item: 'Chairs', Size: 100 },
{ Category: 'Furniture', Item: 'Tables', Size: 120 }
]);
public levels = [
{ groupPath: 'Category' }
];
public leafItemSettings = {
labelPath: 'Item',
gap: 4,
border: { color: '#ffffff', width: 1 }
};
}levelsgroupPathpublic levels = [
{ groupPath: 'Region', headerFormat: '${Region}' },
{ groupPath: 'Country', headerFormat: '${Country}' }
];
public leafItemSettings = {
labelPath: 'Country'
};rangeColorValuePathleafItemSettings.colorMapping<ejs-treemap
[dataSource]="data()"
weightValuePath="Value"
rangeColorValuePath="Value"
[leafItemSettings]="leafItemSettings">
</ejs-treemap>public leafItemSettings = {
labelPath: 'Name',
colorMapping: [
{ from: 0, to: 50, color: '#3498db' },
{ from: 50, to: 100, color: '#e74c3c' }
]
};<ejs-treemap
[dataSource]="data()"
weightValuePath="Value"
[enableDrillDown]="true"
[enableBreadcrumb]="true"
breadcrumbConnector=" / "
[levels]="levels"
[leafItemSettings]="leafItemSettings">
</ejs-treemap>| Property | Type | Purpose |
|---|---|---|
| | Data collection for TreeMap items |
| | Numeric field used to size each item |
| | Leaf item configuration such as labels, borders, templates, and color mapping |
| | Hierarchy configuration using |
| | Rectangle arrangement algorithm |
| | Data field used for direct item color assignment |
| | Data field used for category-based color mapping |
| | Data field used for numeric range color mapping |
| | Enables drilldown navigation through grouped levels |
| | Displays breadcrumb navigation during drilldown |
| | Legend display and styling configuration |
| | Tooltip visibility, formatting, and template configuration |
| | Selection appearance and behavior configuration |
| | Hover highlight appearance configuration |
| | Enables right-to-left rendering |
| | Overrides the component culture |
| | Applies numeric formatting such as |
| | Enables culture-aware number grouping separators |
| | Enables print support |
| | Enables image export support |
| | Enables PDF export support |
| | Adds descriptive accessibility text for the component |
| | Controls focus order for the TreeMap container |
TreeMapModuleTreeMapLegendServiceTreeMapTooltipServiceTreeMapSelectionServiceTreeMapHighlightServicePrintServiceImageExportServicePdfExportServiceleafItemSettings.colorMappingequalColorValuePathrangeColorValuePathselectItem(levelOrder, isSelected?)