alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class Chart3DLegendSettings

    Gets or sets the legend customization options for the 3D Chart component.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    Chart3DSubComponent
    Chart3DLegendSettings
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.Dispose(bool)
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.Chart3D
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class Chart3DLegendSettings : Chart3DSubComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Remarks

    Use this class to customize the legend appearance in the 3D Chart. The legend can be positioned at the top, left, bottom, or right of the chart area.

    Examples
    <SfChart3D>
        <Chart3DSeriesCollection>
            <Chart3DSeries XName="Browser" YName="Users" DataSource="@StatisticsDetails">
            </Chart3DSeries>
        </Chart3DSeriesCollection>
    
        <Chart3DPrimaryXAxis ValueType="Syncfusion.Blazor.Chart3D.ValueType.Category">
        </Chart3DPrimaryXAxis>
    
        <Chart3DLegendSettings Alignment="Alignment.Center" Background="red" Visible="true" Width="350px" Height="50px" Position="LegendPosition.Bottom" ShapeHeight="20" ShapeWidth="20"
        ToggleVisibility="false" Reverse="true">
            <Chart3DLegendBorder Color="red" Width="2"></Chart3DLegendBorder>
            <Chart3DLegendMargin Bottom="5" Left="5" Top="5" Right="5"></Chart3DLegendMargin>
            <Chart3DLegendTextStyle FontFamily="Arial" Color="Gray" FontStyle="Bold" FontWeight="600" FontSize="14px" Opacity="0.9" TextOverflow="TextOverflow.Trim"></Chart3DLegendTextStyle>
            <Chart3DLegendTitleStyle FontFamily="Arial" Color="Gray" FontStyle="Bold" FontWeight="600" FontSize="14px" Opacity="0.9" TextOverflow="TextOverflow.Trim"></Chart3DLegendTitleStyle>
        </Chart3DLegendSettings>
    </SfChart3D>
    @code {
        public class Statistics
        {
            public string Browser { get; set; }
            public double Users { get; set; }
            public string Color { get; set; }
        }
    
        public List<Statistics> StatisticsDetails = new List<Statistics>
        {
            new Statistics { Browser = "Chrome", Users = 65.3, Color = "red" },
            new Statistics { Browser = "Safari", Users = 18.3, Color = "blue" },
            new Statistics { Browser = "Edge", Users = 5, Color = "green" },
            new Statistics { Browser = "Firefox", Users = 3, Color = "orange"  },
            new Statistics { Browser = "Samsung Internet", Users = 2.6, Color = "yellow" },
            new Statistics { Browser = "Opera", Users = 2.4, Color = "pink" },
        };
    }

    Constructors

    Chart3DLegendSettings()

    Declaration
    public Chart3DLegendSettings()

    Properties

    AccessibilityDescription

    Gets or sets the description for accessibility purposes, particularly when focused on the legend element by screen readers.

    Declaration
    [Parameter]
    public string AccessibilityDescription { get; set; }
    Property Value
    Type Description
    string

    A string representing the accessibility description for the legend. The default value is empty string.

    Remarks

    Use this property to provide a description for the legend element for accessibility purposes.

    Alignment

    Gets or sets the alignment of the legend.

    Declaration
    [Parameter]
    public Alignment Alignment { get; set; }
    Property Value
    Type Description
    Alignment

    One of the Alignment enumerations that specifies the legend alignment. Options include:

    • Near: Aligns the legend to the left or top based on the Position.
    • Center: Aligns the legend to the center of the 3D chart.
    • Far: Aligns the legend to the right or bottom based on the Position.
      The default value is Alignment.Center.
    Remarks

    The alignment of the legend works as follows:

    • Near: Aligns the legend to the top-left of the 3D chart if Position is LegendPosition.Top and to the right-top of the 3D chart if Position is LegendPosition.Right.
    • Center: Aligns the legend to the top center of the 3D chart if Position is LegendPosition.Top and to the right center of the 3D chart if Position is LegendPosition.Right.
    • Far: Aligns the legend to the top-right of the 3D chart if Position is LegendPosition.Top and to the right-bottom of the 3D chart if Position is LegendPosition.Right.

    AllowPaging

    Gets or sets a value indicating whether to enable the pages for the legend item.

    Declaration
    [Parameter]
    public bool AllowPaging { get; set; }
    Property Value
    Type Description
    bool

    true if the legend content should be paged with respective contents; otherwise, false. The default value is true.

    Remarks

    When set to true, the legend elements will display in the respective page. This is different from the default.

    Background

    Gets or sets the background color of the 3D Chart legend area.

    Declaration
    [Parameter]
    public string Background { get; set; }
    Property Value
    Type Description
    string

    A string value specifying the background color of the 3D Chart legend area. The default value is "transparent".

    Remarks

    The value can be specified in hex or rgba format, following valid CSS color string conventions.

    EnableHighlight

    Gets or sets a value indicating whether to enable highlighting when hovered over the legend element.

    Declaration
    [Parameter]
    public bool EnableHighlight { get; set; }
    Property Value
    Type Description
    bool

    true if highlight options are enabled; otherwise, false. The default value is false.

    Remarks

    If set to true, when hovered over the legend element, the respective series will be highlighted.

    Height

    Gets or sets the height for the legend.

    Declaration
    [Parameter]
    public string Height { get; set; }
    Property Value
    Type Description
    string

    A string representing the height of the legend element. The default value is null. Based on the legend position, the height of the legend will be calculated.

    Remarks

    Accepts values in either pixels or percentage.

    IsInversed

    Gets or sets a value indicating whether to inverse legend item content (image and text).

    Declaration
    [Parameter]
    public bool IsInversed { get; set; }
    Property Value
    Type Description
    bool

    true if the legend content should be inversed; otherwise, false. The default value is false.

    Remarks

    When set to true, the legend element will display the text before the associated shape. This is different from the default, where the shape is shown first, followed by the text.

    ItemPadding

    Gets or sets the padding between legend items.

    Declaration
    [Parameter]
    public double ItemPadding { get; set; }
    Property Value
    Type Description
    double

    A double representing the padding between legend items. The default value is 0.

    Remarks

    Use this property to increase or decrease the padding between legend items.

    MaximumLabelWidth

    Gets or sets the maximum width of the individual legend item after which they get trimmed, wrapped, or clipped.

    Declaration
    [Parameter]
    public double MaximumLabelWidth { get; set; }
    Property Value
    Type Description
    double

    Specifies the maximum width for the legend text. The default value is null.

    Remarks

    Use this property to set the maximum width of the individual legend item. If the legend text exceeds the specified width, it will be trimmed, wrapped, or clipped based on the TextOverflow property.

    MaximumTitleWidth

    Gets or sets the maximum width of the legend title after which they get trimmed, wrapped, or clipped.

    Declaration
    [Parameter]
    public double MaximumTitleWidth { get; set; }
    Property Value
    Type Description
    double

    Specifies the maximum width for the legend title. The default value is 100.

    Remarks

    Use this property to set the maximum width of the legend title. If the legend title exceeds the specified width, it will be trimmed, wrapped, or clipped based on the TextOverflow property.

    Mode

    Gets or sets the mode of the legend in the 3D Chart.

    Declaration
    [Parameter]
    public Chart3DLegendMode Mode { get; set; }
    Property Value
    Type Description
    Chart3DLegendMode

    One of the Chart3DLegendMode enumeration that specifies the position of the legend. The options include:

    • Series: Displays the legend based on the series in the 3D Chart.
    • Point: Displays the legend based on the data points in the 3D Chart.
    The default value is Series.
    Remarks

    Use this property to display the legend based on the series or data points in the 3D Chart.

    Opacity

    Gets or sets the opacity of the legend background.

    Declaration
    [Parameter]
    public double Opacity { get; set; }
    Property Value
    Type Description
    double

    A double representing the opacity of the legend background. The default value is 1.

    Remarks

    The provided background color will be rendered with the applied opacity value.

    Padding

    Gets or sets the padding around the legend collection.

    Declaration
    [Parameter]
    public double Padding { get; set; }
    Property Value
    Type Description
    double

    A double representing the padding around the legend collection. The default value is 8.

    Remarks

    Use this property to increase or decrease the padding around the legend collection.

    Position

    Gets or sets the position of the legend in the SfChart3D.

    Declaration
    [Parameter]
    public LegendPosition Position { get; set; }
    Property Value
    Type Description
    LegendPosition

    One of the LegendPosition enumerations that specifies the position of the legend. Options include:

    • Auto: Places the legend based on the width and height of the chart.
    • Top: Displays the legend at the top of the chart.
    • Left: Displays the legend at the left of the chart.
    • Bottom: Displays the legend at the bottom of the chart.
    • Right: Displays the legend at the right of the chart.
    • Custom: Displays the legend based on the given x and y location values.
    The default mode is Auto.
    Remarks

    Use this property to position the legend at the top, left, bottom, or right of the 3D Chart. By default, the legend will be placed at the bottom of the 3D Chart.

    Reverse

    Gets or sets a value indicating whether to reverse the order of legend items.

    Declaration
    [Parameter]
    public bool Reverse { get; set; }
    Property Value
    Type Description
    bool

    true if the legend items should be reversed; otherwise, false. The default value is false.

    Remarks

    If set to true, the last series in the collection will be placed first.

    ShapeHeight

    Gets or sets the height of the legend shape.

    Declaration
    [Parameter]
    public double ShapeHeight { get; set; }
    Property Value
    Type Description
    double

    A double representing the height of the legend shape. The default value is 10.

    Remarks

    Use this property to customize the height of the legend shape.

    ShapePadding

    Gets or sets the padding between the legend shape and legend text.

    Declaration
    [Parameter]
    public double ShapePadding { get; set; }
    Property Value
    Type Description
    double

    A double representing the padding between the legend shape and legend text. The default value is 8.

    Remarks

    Set this property to increase or decrease the padding between the legend shape and legend text to enhance the visual appearance.

    ShapeWidth

    Gets or sets the width of the legend shape.

    Declaration
    [Parameter]
    public double ShapeWidth { get; set; }
    Property Value
    Type Description
    double

    A double representing the width of the legend shape. The default value is 10.

    Remarks

    Use this property to customize the width of the legend shape.

    TextOverflow

    Gets or sets the text overflow behavior to employ when the individual legend text overflows the legend bounds or MaximumLabelWidth.

    Declaration
    [Parameter]
    public LabelOverflow TextOverflow { get; set; }
    Property Value
    Type Description
    LabelOverflow

    One of the LabelOverflow enumeration values that specifies the text overflow option. The options include:

    • Ellipse: Specifies to display an ellipsis when the text overflows the legend bounds or MaximumLabelWidth.
    • Clip: Specifies to clip the text when it overflows the legend bounds or MaximumLabelWidth.

    The default value is Ellipse.
    Remarks

    Use this property to set the text overflow behavior when the individual legend text overflows the legend bounds or MaximumLabelWidth.

    TextWrap

    Gets or sets the text wrap behavior when the individual legend text overflows the legend bounds or MaximumLabelWidth.

    Declaration
    [Parameter]
    public TextWrap TextWrap { get; set; }
    Property Value
    Type Description
    TextWrap

    One of the TextWrap enumeration values that specify the text wrap option. The options include:

    • Normal: Specifies to break words only at allowed break points.
    • Wrap: Specifies to break a word once it is too long to fit on a line by itself.
    • AnyWhere: Specifies to break a word at any point if there are no otherwise-acceptable break points in the line.
    The default value is Normal.
    Remarks

    This property is applicable only when TextOverflow is set to LabelOverflow.Ellipse.

    Title

    Gets or sets the title for the 3D Chart legend.

    Declaration
    [Parameter]
    public string Title { get; set; }
    Property Value
    Type Description
    string

    Accepts a string value representing the title of the legend. The default value is an empty string.

    Remarks

    33 Use this property to provide brief information about the legend content.

    TitlePosition

    Gets or sets the position of the legend title in the 3D Chart. The possible values are:

    • Top: Displays the legend title at the top of the legend.
    • Bottom: Displays the legend title at the bottom of the legend.
    • Left: Displays the legend title at the left of the legend.
    • Right: Displays the legend title at the right of the legend.
    Declaration
    [Parameter]
    public Chart3DLegendTitlePosition TitlePosition { get; set; }
    Property Value
    Type Description
    Chart3DLegendTitlePosition

    Accepts one of the Chart3DLegendTitlePosition enumerations. The default value is Top.

    Remarks

    Use this property to position the legend title at the top, left, bottom, or right of the legend area. This is only applicable when the Title property is set.

    ToggleVisibility

    Gets or sets a value indicating whether the series' visibility collapses on the legend click.

    Declaration
    [Parameter]
    public bool ToggleVisibility { get; set; }
    Property Value
    Type Description
    bool

    true if the series' visibility collapses on the legend click; otherwise, false. The default value is true.

    Remarks

    If set to true, the series' visibility collapses on the legend click. Otherwise based on the SelectionMode or HighlightMode the series selection or highlight will be toggled.

    Visible

    Gets or sets a value indicating the visibility of the legend.

    Declaration
    [Parameter]
    public bool Visible { get; set; }
    Property Value
    Type Description
    bool

    true if the legend is visible; otherwise, false. The default value is true.

    Remarks

    When the Name has been set, the legend will be visible by default.

    Width

    Gets or sets the width for the legend.

    Declaration
    [Parameter]
    public string Width { get; set; }
    Property Value
    Type Description
    string

    A string representing the width of the legend. Based on the legend position, the width will be calculated. The default value is null.

    Remarks

    Accepts values in either pixels or percentage.

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved