menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfTreeMap<TValue> - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfTreeMap<TValue>

    The treemap control is used to visualize both hierarchical and flat data in the form of nodes along with built-in features like color mapping, legends, label templates, and more.

    Inheritance
    System.Object
    SfBaseComponent
    SfDataBoundComponent
    SfTreeMap<TValue>
    Implements
    ITreeMap
    Inherited Members
    SfBaseComponent.Dispose()
    SfDataBoundComponent.DataManager
    SfDataBoundComponent.MainParent
    SfDataBoundComponent.SetDataManager<T>(Object)
    Namespace: Syncfusion.Blazor.TreeMap
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SfTreeMap<TValue> : SfDataBoundComponent, ITreeMap
    Type Parameters
    Name Description
    TValue

    Represents the generic data type of the treemap control.

    Constructors

    SfTreeMap()

    Declaration
    public SfTreeMap()

    Properties

    AllowImageExport

    Enables or disables the export to image functionality in the TreeMap.

    Declaration
    public bool AllowImageExport { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the image export option can be enabled; otherwise, false.

    Remarks

    Allows users to export the TreeMap as an image, supporting the sharing and saving of visual representations of data.

    AllowPdfExport

    Enables or disables the export to PDF functionality in the TreeMap.

    Declaration
    public bool AllowPdfExport { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the PDF export option can be enabled; otherwise, false.

    Remarks

    Provides the ability to export the TreeMap component to a PDF file, enabling document generation and reporting features.

    AllowPrint

    Enables or disables the print functionality in the TreeMap.

    Declaration
    public bool AllowPrint { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the print option can be enabled; otherwise, false.

    Remarks

    Allows the TreeMap component to be printed directly from the browser, facilitating hardcopy distribution of the data visualization.

    Background

    Sets and gets the background color of the TreeMap.

    Declaration
    public string Background { get; set; }
    Property Value
    Type Description
    System.String

    A string value representing the color to be used as the background.

    Remarks

    This property specifies the TreeMap's background color, which can be customized to match the application's theme or design.

    BreadcrumbConnector

    Specifies the connector string between breadcrumb nodes in the TreeMap.

    Declaration
    public string BreadcrumbConnector { get; set; }
    Property Value
    Type Description
    System.String

    A string value representing the connector, with a default of " - ".

    Remarks

    The BreadcrumbConnector defines the character or string used to separate breadcrumb items, enhancing navigation context.

    ChildContent

    Sets and gets the content of the UI element for the TreeMap component.

    Declaration
    public RenderFragment ChildContent { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment

    Accepts a Microsoft.AspNetCore.Components.RenderFragment that defines the content of the UI element.

    Remarks

    This property allows you to specify custom content for the TreeMap, providing flexibility in rendering UI elements within the component.

    ColorValuePath

    Sets and gets the value path from the data source, based on which color is applied in the TreeMap.

    Declaration
    public string ColorValuePath { get; set; }
    Property Value
    Type Description
    System.String

    A string value specifying the data source field used for color mapping.

    Remarks

    This property determines how colors are assigned to individual TreeMap items based on their data values.

    DataSource

    Sets and gets the data source for the TreeMap component.

    Declaration
    public IEnumerable<TValue> DataSource { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<TValue>

    An System.Collections.Generic.IEnumerable<> that represents the collection of data items displayed in the TreeMap.

    Remarks

    The DataSource property defines the set of data visualized in the TreeMap, either directly or via data binding.

    Description

    Sets and gets the description of the TreeMap.

    Declaration
    public string Description { get; set; }
    Property Value
    Type Description
    System.String

    A string value providing a textual description of the TreeMap component.

    Remarks

    This description can be used for accessibility purposes, providing additional context about the TreeMap's data or functionality.

    DrillDownView

    Enables or disables the initial drill-down feature in the TreeMap.

    Declaration
    public bool DrillDownView { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the drill-down view is enabled; otherwise, false.

    Remarks

    Allows users to interactively explore hierarchical data by delving into specific branches of the TreeMap.

    EnableBreadcrumb

    Enables or disables breadcrumb visibility in the TreeMap header.

    Declaration
    public bool EnableBreadcrumb { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if breadcrumb navigation is enabled; otherwise, false.

    Remarks

    The breadcrumb provides a visual representation of the user's current path within the TreeMap, aiding navigation.

    EnableDrillDown

    Enables or disables the drill-down functionality in the TreeMap.

    Declaration
    public bool EnableDrillDown { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the drill-down functionality can be enabled; otherwise, false.

    Remarks

    Drill-down enables users to analyze data hierarchies in more detail by interacting with TreeMap elements.

    EnableGroupingSeparator

    Enables or disables the visibility state of the separator for grouping in the TreeMap.

    Declaration
    public bool EnableGroupingSeparator { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the grouping separator is enabled; otherwise, false.

    Remarks

    This property enhances the visual separation and organization of grouped data in the TreeMap.

    EnableRtl

    Enables or disables rendering the component in right-to-left direction.

    Declaration
    public bool EnableRtl { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if right-to-left (RTL) rendering is enabled; otherwise, false. Default is false.

    Remarks

    This property adapts the TreeMap layout to support languages and locales that are read from right to left.

    EqualColorValuePath

    Sets and gets the value path from the data source for uniform color mapping in the TreeMap.

    Declaration
    public string EqualColorValuePath { get; set; }
    Property Value
    Type Description
    System.String

    A string value that specifies the data source field for equal color assignment.

    Remarks

    This property allows colors to be uniformly applied across TreeMap items based on a specified data field.

    Format

    Sets and gets the format for text elements in the TreeMap.

    Declaration
    public string Format { get; set; }
    Property Value
    Type Description
    System.String

    A string value representing the format, with the default being empty.

    Remarks

    This property configures how text, such as labels and tooltips, is formatted in the TreeMap.

    Height

    Sets and gets the height of the TreeMap component.

    Declaration
    public string Height { get; set; }
    Property Value
    Type Description
    System.String

    A string value specifying the component's height.

    Remarks

    The Height property determines the vertical size of the TreeMap within its container or page.

    ID

    Sets and gets the unique ID string for the TreeMap component.

    Declaration
    public string ID { get; set; }
    Property Value
    Type Description
    System.String

    A string representing the ID name of the TreeMap.

    Remarks

    This ID is used as a unique identifier for the TreeMap component, useful for CSS styling and JavaScript interactions.

    LayoutType

    Specifies the rendering type of layout for the TreeMap component.

    Declaration
    public LayoutMode LayoutType { get; set; }
    Property Value
    Type Description
    LayoutMode

    A LayoutMode enumeration value specifying the layout, with default Squarified.

    Remarks

    The LayoutType property configures how TreeMap items are arranged visually within the component.

    Palette

    Sets and gets the array of colors to apply to TreeMap items.

    Declaration
    public string[] Palette { get; set; }
    Property Value
    Type Description
    System.String[]

    An array of strings representing color values.

    Remarks

    Colors in the Palette are used sequentially or according to data values to enhance visual differentiation of TreeMap items.

    Query

    Sets and gets the query used to select data from the shape data when a data manager creates the data source.

    Declaration
    public Query Query { get; set; }
    Property Value
    Type Description
    Query

    A Query object representing the query to be executed on the data source.

    Remarks

    This property allows fine-grained control over data selection and retrieval when integrating with complex data services.

    RangeColorValuePath

    Sets and gets the value path from the data source for range color mapping in the TreeMap.

    Declaration
    public string RangeColorValuePath { get; set; }
    Property Value
    Type Description
    System.String

    A string specifying the field used for range color application.

    Remarks

    The RangeColorValuePath property facilitates the application of gradient or range-based colors based on data values.

    RenderDirection

    Specifies the rendering direction of layout for TreeMap items.

    Declaration
    public RenderingMode RenderDirection { get; set; }
    Property Value
    Type Description
    RenderingMode

    A RenderingMode enum value with default TopLeftBottomRight.

    Remarks

    The RenderDirection specifies the primary orientation and direction in which TreeMap items are drawn.

    TabIndex

    Sets and gets the tab index value for the TreeMap component.

    Declaration
    public int TabIndex { get; set; }
    Property Value
    Type Description
    System.Int32

    An integer representing the tab index. The default value is 0.

    Remarks

    This property determines the tab order for keyboard navigation, enhancing accessibility and user navigation within the TreeMap.

    Theme

    Sets and gets the options for customizing the theme of the TreeMap component.

    Declaration
    public Theme Theme { get; set; }
    Property Value
    Type Description
    Theme

    A value from the Theme enumeration. The default is Material.

    Remarks

    The Theme property allows setting visual themes to style the TreeMap, ensuring consistency with application aesthetics.

    WeightValuePath

    Sets and gets the path for the value that determines the weight of items in the TreeMap from the data source.

    Declaration
    public string WeightValuePath { get; set; }
    Property Value
    Type Description
    System.String

    A string specifying the data source field for item weight.

    Remarks

    The WeightValuePath influences how space is allocated to items, supporting proportional representation based on data significance.

    Width

    Sets and gets the width of the TreeMap component.

    Declaration
    public string Width { get; set; }
    Property Value
    Type Description
    System.String

    A string specifying the width of the treemap. Default is "auto".

    Remarks

    The Width property specifies the horizontal size of the TreeMap, impacting its display layout and responsiveness.

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder

    Dispose(Boolean)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    Overrides
    SfBaseComponent.Dispose(Boolean)

    ExportAsync(ExportType, String, Nullable<PdfPageOrientation>, Boolean)

    The method is used to perform the export functionality for the rendered treemap.

    Declaration
    public Task<string> ExportAsync(ExportType type, string fileName, Nullable<PdfPageOrientation> orientation = null, bool allowDownload = true)
    Parameters
    Type Name Description
    ExportType type

    Specifies the export type for the rendered treemap.

    System.String fileName

    Specifies the filename.

    System.Nullable<Syncfusion.PdfExport.PdfPageOrientation> orientation

    Specifies the portrait or landscape orientation of the page.

    System.Boolean allowDownload

    Specifies whether to download or not.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    Returns a base64 string representing the exported content.

    Remarks

    This method exports the current TreeMap visualization to the specified format and returns a base64 string. If allowDownload is true, the exported content is also automatically downloaded.

    OnAfterRenderAsync(Boolean)

    Method invoked after each time the component has been rendered.

    Declaration
    protected override Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    System.Boolean firstRender

    Specifies the first render of the component.

    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous operation.

    Overrides
    SfDataBoundComponent.OnAfterRenderAsync(Boolean)

    OnInitializedAsync()

    Method invoked when the component is ready to start.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous operation.

    Overrides
    SfDataBoundComponent.OnInitializedAsync()

    OnObservableChange(String, Object, Boolean, NotifyCollectionChangedEventArgs)

    INotifyCollectionChanged event handler to track the changes in the TreeMap data source.

    Declaration
    protected override void OnObservableChange(string propertyName, object sender, bool isCollectionChanged = false, NotifyCollectionChangedEventArgs e = null)
    Parameters
    Type Name Description
    System.String propertyName

    Observable property name.

    System.Object sender

    Observable model object.

    System.Boolean isCollectionChanged

    Sets true if the observable collection changed.

    System.Collections.Specialized.NotifyCollectionChangedEventArgs e

    Changed Event Args

    Overrides
    SfBaseComponent.OnObservableChange(String, Object, Boolean, NotifyCollectionChangedEventArgs)

    OnParametersSetAsync()

    Method invoked when the component has received parameters from its parent in the render tree and the incoming values have been assigned to properties.

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous operation.

    Overrides
    SfDataBoundComponent.OnParametersSetAsync()

    PrintAsync()

    The method is used to perform the print functionality in treemap.

    Declaration
    public Task PrintAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous operation.

    Remarks

    This method sends a print command for the current view of the treemap. Ensure that the print dialog is allowed by the browser.

    RefreshAsync()

    The method is used to render the treemap again.

    Declaration
    public Task RefreshAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous operation.

    Remarks

    This method refreshes the treemap by recalculating its layout and redrawing the components. Use this method when data or settings have changed.

    SelectItemAsync(String[], Boolean)

    The method is used to select or remove the selection of a treemap item based on the provided selection settings.

    Declaration
    public Task SelectItemAsync(string[] levelOrder, bool isSelected = true)
    Parameters
    Type Name Description
    System.String[] levelOrder

    Specifies the level order name for the treemap item.

    System.Boolean isSelected

    Specifies whether the treemap item is selected or not. Default value is true.

    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous operation.

    Remarks

    This method allows for the selection or deselection of items within the treemap, enhancing user interaction with treemap elements.

    Implements

    ITreeMap
    Back to top Generated by DocFX
    OSZAR »
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved
    OSZAR »