Class ChartLegendSettingsBuilder
Inheritance
System.Object
Syncfusion.EJ2.ControlBuilder
ChartLegendSettingsBuilder
Assembly: Syncfusion.EJ2.dll
Syntax
public class ChartLegendSettingsBuilder : ControlBuilder
Constructors
ChartLegendSettingsBuilder()
Declaration
public ChartLegendSettingsBuilder()
ChartLegendSettingsBuilder(ChartLegendSettings)
Declaration
public ChartLegendSettingsBuilder(ChartLegendSettings model)
Parameters
Methods
Accessibility(LegendSettingsAccessibility)
Options to improve accessibility for legend elements.
Declaration
public ChartLegendSettingsBuilder Accessibility(LegendSettingsAccessibility value)
Parameters
Returns
Accessibility(Action<ChartAccessibilityBuilder>)
Declaration
public ChartLegendSettingsBuilder Accessibility(Action<ChartAccessibilityBuilder> accessibility)
Parameters
Returns
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
Returns
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
Border(ChartLegendBorder)
Options for customizing the border of the legend.
Declaration
public ChartLegendSettingsBuilder Border(ChartLegendBorder value)
Parameters
Returns
Border(Action<ChartBorderBuilder>)
Declaration
public ChartLegendSettingsBuilder Border(Action<ChartBorderBuilder> border)
Parameters
Returns
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
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
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
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
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
Height(String)
Specifies the height of the legend in pixels.
Declaration
public ChartLegendSettingsBuilder Height(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
|
Returns
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
ItemPadding(Double)
Option to customize the padding between legend items.
Declaration
public ChartLegendSettingsBuilder ItemPadding(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
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
Returns
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
Returns
Location(Action<ChartLocationBuilder>)
Declaration
public ChartLegendSettingsBuilder Location(Action<ChartLocationBuilder> location)
Parameters
Returns
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
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
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
MaximumTitleWidth(Double)
Specifies the maximum width of the legend title.
Declaration
public ChartLegendSettingsBuilder MaximumTitleWidth(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
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
Returns
Opacity(Double)
Customizes the opacity of the legend.
Declaration
public ChartLegendSettingsBuilder Opacity(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
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
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
Returns
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
ShapeHeight(Double)
Specify the height of the legend in pixels.
Declaration
public ChartLegendSettingsBuilder ShapeHeight(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
ShapePadding(Double)
Padding between the legend shape and text.
Declaration
public ChartLegendSettingsBuilder ShapePadding(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
ShapeWidth(Double)
Specify the width of the legend in pixels.
Declaration
public ChartLegendSettingsBuilder ShapeWidth(double value)
Parameters
Type |
Name |
Description |
System.Double |
value |
|
Returns
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
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
Returns
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
Returns
TextStyle(Action<ChartFontBuilder>)
Declaration
public ChartLegendSettingsBuilder TextStyle(Action<ChartFontBuilder> textStyle)
Parameters
Returns
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
Returns
Title(String)
Specifies the title of the legend.
Declaration
public ChartLegendSettingsBuilder Title(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
|
Returns
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
Returns
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
Returns
TitleStyle(Action<ChartFontBuilder>)
Declaration
public ChartLegendSettingsBuilder TitleStyle(Action<ChartFontBuilder> titleStyle)
Parameters
Returns
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
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
Width(String)
Specifies the width of the legend in pixels.
Declaration
public ChartLegendSettingsBuilder Width(string value)
Parameters
Type |
Name |
Description |
System.String |
value |
|
Returns