menu

ASP.NET Core - EJ2

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChartLegendSettingsBuilder - ASP.NETCore-EJ2 API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartLegendSettingsBuilder

    Inheritance
    System.Object
    Syncfusion.EJ2.ControlBuilder
    ChartLegendSettingsBuilder
    Namespace: Syncfusion.EJ2.Charts
    Assembly: Syncfusion.EJ2.dll
    Syntax
    public class ChartLegendSettingsBuilder : ControlBuilder

    Constructors

    ChartLegendSettingsBuilder()

    Declaration
    public ChartLegendSettingsBuilder()

    ChartLegendSettingsBuilder(ChartLegendSettings)

    Declaration
    public ChartLegendSettingsBuilder(ChartLegendSettings model)
    Parameters
    Type Name Description
    ChartLegendSettings model

    Methods

    Accessibility(LegendSettingsAccessibility)

    Options to improve accessibility for legend elements.

    Declaration
    public ChartLegendSettingsBuilder Accessibility(LegendSettingsAccessibility value)
    Parameters
    Type Name Description
    LegendSettingsAccessibility value
    Returns
    Type
    ChartLegendSettingsBuilder

    Accessibility(Action<ChartAccessibilityBuilder>)

    Declaration
    public ChartLegendSettingsBuilder Accessibility(Action<ChartAccessibilityBuilder> accessibility)
    Parameters
    Type Name Description
    System.Action<ChartAccessibilityBuilder> accessibility
    Returns
    Type
    ChartLegendSettingsBuilder

    Alignment(Alignment)

    Defines the alignment of the legend in the chart. The options are: Near - Aligns the legend to the left of the chart. Center - Aligns the legend to the center of the chart. Far - Aligns the legend to the right of the chart.

    Declaration
    public ChartLegendSettingsBuilder Alignment(Alignment value)
    Parameters
    Type Name Description
    Alignment value
    Returns
    Type
    ChartLegendSettingsBuilder

    Background(String)

    The background color of the legend, which accepts values in hex and rgba as valid CSS color strings.

    Declaration
    public ChartLegendSettingsBuilder Background(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type
    ChartLegendSettingsBuilder

    Border(ChartLegendBorder)

    Options for customizing the border of the legend.

    Declaration
    public ChartLegendSettingsBuilder Border(ChartLegendBorder value)
    Parameters
    Type Name Description
    ChartLegendBorder value
    Returns
    Type
    ChartLegendSettingsBuilder

    Border(Action<ChartBorderBuilder>)

    Declaration
    public ChartLegendSettingsBuilder Border(Action<ChartBorderBuilder> border)
    Parameters
    Type Name Description
    System.Action<ChartBorderBuilder> border
    Returns
    Type
    ChartLegendSettingsBuilder

    ContainerPadding(Object)

    Options to customize the left, right, top, and bottom padding for the chart legend container.

    Declaration
    public ChartLegendSettingsBuilder ContainerPadding(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type
    ChartLegendSettingsBuilder

    Description(String)

    A description of the legend that provides additional information for screen readers.

    Declaration
    public ChartLegendSettingsBuilder Description(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type
    ChartLegendSettingsBuilder

    EnableHighlight(Boolean)

    If set to true, the series will be highlighted when hovering over the legend.

    Declaration
    public ChartLegendSettingsBuilder EnableHighlight(bool value)
    Parameters
    Type Name Description
    System.Boolean value
    Returns
    Type
    ChartLegendSettingsBuilder

    EnablePages(Boolean)

    If set to true, the legend will be displayed using pages.

    Declaration
    public ChartLegendSettingsBuilder EnablePages(bool value)
    Parameters
    Type Name Description
    System.Boolean value
    Returns
    Type
    ChartLegendSettingsBuilder

    FixedWidth(Boolean)

    When set to true, all legend items are rendered with an equal width, which is the maximum width of all items.

    Declaration
    public ChartLegendSettingsBuilder FixedWidth(bool value)
    Parameters
    Type Name Description
    System.Boolean value
    Returns
    Type
    ChartLegendSettingsBuilder

    Height(String)

    Specifies the height of the legend in pixels.

    Declaration
    public ChartLegendSettingsBuilder Height(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type
    ChartLegendSettingsBuilder

    IsInversed(Boolean)

    If isInversed is set to true, it inverses the legend item content (image and text).

    Declaration
    public ChartLegendSettingsBuilder IsInversed(bool value)
    Parameters
    Type Name Description
    System.Boolean value
    Returns
    Type
    ChartLegendSettingsBuilder

    ItemPadding(Double)

    Option to customize the padding between legend items.

    Declaration
    public ChartLegendSettingsBuilder ItemPadding(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartLegendSettingsBuilder

    Layout(LegendLayout)

    Specifies the layout of the legend items in the chart. Available options are: Vertical: Legend items are arranged in a single column. If the legend items exceed the available space, paging is automatically applied to allow the user to navigate through the legend. Horizontal: Legend items are arranged in a single row. If the legend items exceed the available space, paging is automatically applied to allow the user to navigate through the legend. Auto (default): Legend items are placed based on the available space.

    Declaration
    public ChartLegendSettingsBuilder Layout(LegendLayout value)
    Parameters
    Type Name Description
    LegendLayout value
    Returns
    Type
    ChartLegendSettingsBuilder

    Location(ChartLocation)

    Specifies the location of the legend relative to the chart. If x is 20, the legend moves 20 pixels to the right of the chart.

    Note that the position must be set to Custom for this feature to work.

    Declaration
    public ChartLegendSettingsBuilder Location(ChartLocation value)
    Parameters
    Type Name Description
    ChartLocation value
    Returns
    Type
    ChartLegendSettingsBuilder

    Location(Action<ChartLocationBuilder>)

    Declaration
    public ChartLegendSettingsBuilder Location(Action<ChartLocationBuilder> location)
    Parameters
    Type Name Description
    System.Action<ChartLocationBuilder> location
    Returns
    Type
    ChartLegendSettingsBuilder

    Margin(Object)

    Options for customizing the left, right, top, and bottom margins of the chart.

    Declaration
    public ChartLegendSettingsBuilder Margin(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type
    ChartLegendSettingsBuilder

    MaximumColumns(Double)

    Specifies the maximum number of columns to allow in the available space when the layout is set to 'Auto'.

    Declaration
    public ChartLegendSettingsBuilder MaximumColumns(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartLegendSettingsBuilder

    MaximumLabelWidth(Double)

    Specifies the maximum width of the legend text labels.

    Declaration
    public ChartLegendSettingsBuilder MaximumLabelWidth(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartLegendSettingsBuilder

    MaximumTitleWidth(Double)

    Specifies the maximum width of the legend title.

    Declaration
    public ChartLegendSettingsBuilder MaximumTitleWidth(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartLegendSettingsBuilder

    Mode(LegendMode)

    Defines the mode for displaying legend items. Series - Legend items are generated based on the count of series. Point - Legend items are created according to each unique data point. Range - Legend items are generated based on the range color mapping property. Gradient - Displays a single linear bar that represents the range color mapping property.

    Note that this property is applicable only for the chart component.

    Declaration
    public ChartLegendSettingsBuilder Mode(LegendMode value)
    Parameters
    Type Name Description
    LegendMode value
    Returns
    Type
    ChartLegendSettingsBuilder

    Opacity(Double)

    Customizes the opacity of the legend.

    Declaration
    public ChartLegendSettingsBuilder Opacity(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartLegendSettingsBuilder

    Padding(Double)

    Option to customize the padding around the legend items.

    Declaration
    public ChartLegendSettingsBuilder Padding(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartLegendSettingsBuilder

    Position(LegendPosition)

    Sets the position of the legend in the chart. Available options include: Auto - Places the legend according to the area type. Top - Displays the legend at the top of the chart. Left - Displays the legend on the left side of the chart. Bottom - Displays the legend at the bottom of the chart. Right - Displays the legend to the right of the chart. Custom - Displays the legend according to the given x and y position values.

    Declaration
    public ChartLegendSettingsBuilder Position(LegendPosition value)
    Parameters
    Type Name Description
    LegendPosition value
    Returns
    Type
    ChartLegendSettingsBuilder

    Reverse(Boolean)

    If reverse is set to true, it reverses the order of the legend items.

    Declaration
    public ChartLegendSettingsBuilder Reverse(bool value)
    Parameters
    Type Name Description
    System.Boolean value
    Returns
    Type
    ChartLegendSettingsBuilder

    ShapeHeight(Double)

    Specify the height of the legend in pixels.

    Declaration
    public ChartLegendSettingsBuilder ShapeHeight(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartLegendSettingsBuilder

    ShapePadding(Double)

    Padding between the legend shape and text.

    Declaration
    public ChartLegendSettingsBuilder ShapePadding(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartLegendSettingsBuilder

    ShapeWidth(Double)

    Specify the width of the legend in pixels.

    Declaration
    public ChartLegendSettingsBuilder ShapeWidth(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartLegendSettingsBuilder

    TabIndex(Double)

    The tabIndex property determines the order in which the legend receives focus when navigating through elements with the keyboard.

    Declaration
    public ChartLegendSettingsBuilder TabIndex(double value)
    Parameters
    Type Name Description
    System.Double value
    Returns
    Type
    ChartLegendSettingsBuilder

    TextOverflow(LabelOverflow)

    Defines the behavior for handling the overflow of legend text. Clip - Specifies that the text is clipped and not accessible. Ellipsis - Specifies an ellipsis (“...”) for the clipped text.

    Declaration
    public ChartLegendSettingsBuilder TextOverflow(LabelOverflow value)
    Parameters
    Type Name Description
    LabelOverflow value
    Returns
    Type
    ChartLegendSettingsBuilder

    TextStyle(ChartLegendTextStyle)

    The textStyle property provides options to customize the appearance of the text in the legend, including the font family, size, style, weight, and color.

    Declaration
    public ChartLegendSettingsBuilder TextStyle(ChartLegendTextStyle value)
    Parameters
    Type Name Description
    ChartLegendTextStyle value
    Returns
    Type
    ChartLegendSettingsBuilder

    TextStyle(Action<ChartFontBuilder>)

    Declaration
    public ChartLegendSettingsBuilder TextStyle(Action<ChartFontBuilder> textStyle)
    Parameters
    Type Name Description
    System.Action<ChartFontBuilder> textStyle
    Returns
    Type
    ChartLegendSettingsBuilder

    TextWrap(TextWrap)

    Defines the text wrap behavior for the legend text when it overflows. Available options are: Normal - Specifies that words should only break at allowed break points. Wrap - Specifies that a word should break if it is too long to fit on a line by itself. AnyWhere - Specifies to break a word at any point if there are no acceptable break points in the line.

    Declaration
    public ChartLegendSettingsBuilder TextWrap(TextWrap value)
    Parameters
    Type Name Description
    TextWrap value
    Returns
    Type
    ChartLegendSettingsBuilder

    Title(String)

    Specifies the title of the legend.

    Declaration
    public ChartLegendSettingsBuilder Title(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type
    ChartLegendSettingsBuilder

    TitlePosition(LegendTitlePosition)

    The titlePosition property specifies the position of the legend title. Available options are: Top - Aligns the title to the top of the legend. Left - Aligns the title to the left of the legend. Right - Aligns the title to the right of the legend.

    Declaration
    public ChartLegendSettingsBuilder TitlePosition(LegendTitlePosition value)
    Parameters
    Type Name Description
    LegendTitlePosition value
    Returns
    Type
    ChartLegendSettingsBuilder

    TitleStyle(ChartLegendTitleStyle)

    The titleStyle property configures the font settings for the legend title, including font family, size, style, weight, and color.

    Declaration
    public ChartLegendSettingsBuilder TitleStyle(ChartLegendTitleStyle value)
    Parameters
    Type Name Description
    ChartLegendTitleStyle value
    Returns
    Type
    ChartLegendSettingsBuilder

    TitleStyle(Action<ChartFontBuilder>)

    Declaration
    public ChartLegendSettingsBuilder TitleStyle(Action<ChartFontBuilder> titleStyle)
    Parameters
    Type Name Description
    System.Action<ChartFontBuilder> titleStyle
    Returns
    Type
    ChartLegendSettingsBuilder

    ToggleVisibility(Boolean)

    If set to true, the series visibility will collapse based on the legend's visibility.

    Declaration
    public ChartLegendSettingsBuilder ToggleVisibility(bool value)
    Parameters
    Type Name Description
    System.Boolean value
    Returns
    Type
    ChartLegendSettingsBuilder

    Visible(Boolean)

    If set to true, the legend will be displayed for the chart.

    Declaration
    public ChartLegendSettingsBuilder Visible(bool value)
    Parameters
    Type Name Description
    System.Boolean value
    Returns
    Type
    ChartLegendSettingsBuilder

    Width(String)

    Specifies the width of the legend in pixels.

    Declaration
    public ChartLegendSettingsBuilder Width(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type
    ChartLegendSettingsBuilder
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved