Skip to main content

ChartLegendBuilder Methods

Provides methods that allow you to configure nested options of the client-side legend object.
Name Description
BackgroundColor(JS) Colors the legend's background. Mirrors the client-side backgroundColor option.
BackgroundColor(String) Colors the legend's background. Mirrors the client-side backgroundColor option.
Border(Action<ChartLegendBorderBuilder>) Configures the legend's border. Mirrors the client-side border object.
ColumnCount(JS) Arranges legend items into several columns. Mirrors the client-side columnCount option.
ColumnCount(Int32) Arranges legend items into several columns. Mirrors the client-side columnCount option.
ColumnItemSpacing(JS) Specifies an empty space between item columns in pixels. Mirrors the client-side columnItemSpacing option.
ColumnItemSpacing(Double) Specifies an empty space between item columns in pixels. Mirrors the client-side columnItemSpacing option.
CustomizeHint(RazorBlock) Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. Mirrors the client-side customizeHint option.
CustomizeHint(String) Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. Mirrors the client-side customizeHint option.
CustomizeItems(RazorBlock) Allows you to change the order, text, and visibility of legend items. Mirrors the client-side customizeItems option.
CustomizeItems(String) Allows you to change the order, text, and visibility of legend items. Mirrors the client-side customizeItems option.
CustomizeText(RazorBlock) Specifies a callback function that returns the text to be displayed by a legend item. Mirrors the client-side customizeText option.
CustomizeText(String) Specifies a callback function that returns the text to be displayed by a legend item. Mirrors the client-side customizeText option.
Equals(Object, Object) static Determines whether the specified object instances are considered equal. Inherited from Object.
Equals(Object) Determines whether the specified object is equal to the current object. Inherited from Object.
Font(Action<VizFontBuilder>) Specifies the legend items' font properties. Mirrors the client-side font object.
GetHashCode() Serves as the default hash function. Inherited from Object.
GetType() Gets the Type of the current instance. Inherited from Object.
HorizontalAlignment(HorizontalAlignment) Along with verticalAlignment, specifies the legend's position. Mirrors the client-side horizontalAlignment option.
HoverMode(ChartLegendHoverMode) Specifies what series elements to highlight when a corresponding item in the legend is hovered over. Mirrors the client-side hoverMode option.
ItemsAlignment(HorizontalAlignment) Aligns items in the last column or row (depending on the legend's orientation). Applies when legend items are not divided into columns or rows equally. Mirrors the client-side itemsAlignment option.
ItemTextPosition(Position) Specifies the text's position relative to the marker in a legend item. Mirrors the client-side itemTextPosition option.
Margin(JS) Generates an empty space, measured in pixels, around the legend. Mirrors the client-side margin option.
Margin(Action<ChartLegendMarginBuilder>) Generates an empty space, measured in pixels, around the legend. Mirrors the client-side margin object.
Margin(Double) Generates an empty space, measured in pixels, around the legend. Mirrors the client-side margin option.
MarkerSize(JS) Specifies the marker's size in a legend item in pixels. Mirrors the client-side markerSize option.
MarkerSize(Double) Specifies the marker's size in a legend item in pixels. Mirrors the client-side markerSize option.
MarkerTemplate(JS) Specifies the client-side markerTemplate.
MarkerTemplate(RazorBlock) Specifies the client-side markerTemplate.
MarkerTemplate(TemplateName) Specifies the client-side markerTemplate.
MarkerTemplate(String) Specifies the client-side markerTemplate.
MemberwiseClone() protected Creates a shallow copy of the current Object. Inherited from Object.
Option(String, Object) Specifies an option by its name.
Orientation(Orientation) Arranges legend items vertically (in a column) or horizontally (in a row). The default value is 'horizontal' if the legend.horizontalAlignment is 'center'. Otherwise, it is 'vertical'. Mirrors the client-side orientation option.
PaddingLeftRight(JS) Generates an empty space, measured in pixels, between the legend's left/right border and its items. Mirrors the client-side paddingLeftRight option.
PaddingLeftRight(Double) Generates an empty space, measured in pixels, between the legend's left/right border and its items. Mirrors the client-side paddingLeftRight option.
PaddingTopBottom(JS) Generates an empty space, measured in pixels, between the legend's top/bottom border and its items. Mirrors the client-side paddingTopBottom option.
PaddingTopBottom(Double) Generates an empty space, measured in pixels, between the legend's top/bottom border and its items. Mirrors the client-side paddingTopBottom option.
Position(RelativePosition) Specifies whether the legend is located outside or inside the chart's plot. Mirrors the client-side position option.
ReferenceEquals(Object, Object) static Determines whether the specified Object instances are the same instance. Inherited from Object.
RowCount(JS) Arranges legend items in several rows. Mirrors the client-side rowCount option.
RowCount(Int32) Arranges legend items in several rows. Mirrors the client-side rowCount option.
RowItemSpacing(JS) Specifies an empty space between item rows in pixels. Mirrors the client-side rowItemSpacing option.
RowItemSpacing(Double) Specifies an empty space between item rows in pixels. Mirrors the client-side rowItemSpacing option.
Title(JS) Configures the legend title. Mirrors the client-side title option.
Title(Action<ChartLegendTitleBuilder>) Configures the legend title. Mirrors the client-side title object.
Title(String) Configures the legend title. Mirrors the client-side title option.
ToString() Returns a string that represents the current object. Inherited from Object.
VerticalAlignment(VerticalEdge) Along with horizontalAlignment, specifies the legend's position. Mirrors the client-side verticalAlignment option.
Visible(JS) Specifies the legend's visibility. Mirrors the client-side visible option.
Visible(Boolean) Specifies the legend's visibility. Mirrors the client-side visible option.
See Also