New to Telerik UI for ASP.NET MVC? Start a free 30-day trial

Defines the fluent API for configuring ChartSeriesLegendItemSettings

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ChartSeriesLegendItemSettingsBuilder

Inheritance: objectChartSeriesLegendItemSettingsBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

C#
public ChartSeriesLegendItemSettingsBuilder(ChartSeriesLegendItemSettings container)
Parameters:containerChartSeriesLegendItemSettings

Properties

C#
protected ChartSeriesLegendItemSettings Container { get; }

Methods

Sets the configuration of the legend items of type area. By default, all series except line and scatter use this legend type.

C#
public ChartSeriesLegendItemSettingsBuilder Area(Action<ChartSeriesLegendItemAreaSettingsBuilder> configurator)
Parameters:configuratorAction<ChartSeriesLegendItemAreaSettingsBuilder>

The configurator for the area setting.

Returns:

ChartSeriesLegendItemSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =&gt;
{
series.Column(model =&gt; model.UnitPrice).Name("Unit Price").LegendItem(legendItem =&gt; legendItem.Area(area =&gt; area.Background("lightgreen")));
})
)

The cursor style of the legend item.

C#
public ChartSeriesLegendItemSettingsBuilder Cursor(string value)
Parameters:valuestring

The value for Cursor

Returns:

ChartSeriesLegendItemSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =&gt;
{
series.Column(model =&gt; model.UnitPrice).Name("Unit Price").LegendItem(legendItem =&gt; legendItem.Cursor("crosshair"));
})
)

The highlight configuration of the legend item.

C#
public ChartSeriesLegendItemSettingsBuilder Highlight(Action<ChartSeriesLegendItemHighlightSettingsBuilder> configurator)
Parameters:configuratorAction<ChartSeriesLegendItemHighlightSettingsBuilder>

The configurator for the highlight setting.

Returns:

ChartSeriesLegendItemSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =&gt;
{
series.Column(model =&gt; model.UnitPrice).Name("Unit Price").LegendItem(legendItem =&gt; legendItem.Highlight(h =&gt; h.Visible(false)));
})
)

Sets the configuration of the legend items of type line. This is the default legend item type for all line and scatter series.

C#
public ChartSeriesLegendItemSettingsBuilder Line(Action<ChartSeriesLegendItemLineSettingsBuilder> configurator)
Parameters:configuratorAction<ChartSeriesLegendItemLineSettingsBuilder>

The configurator for the line setting.

Returns:

ChartSeriesLegendItemSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =&gt;
{
series.Column(model =&gt; model.UnitPrice).Name("Unit Price").LegendItem(legendItem =&gt; legendItem.Line(line =&gt; line.Opacity(0.5)));
})
)

The configuration of the Chart legend item markers.By default, the marker configuration will be the same as the series.markers settings of the displayed series.

C#
public ChartSeriesLegendItemSettingsBuilder Markers(Action<ChartSeriesLegendItemMarkersSettingsBuilder> configurator)
Parameters:configuratorAction<ChartSeriesLegendItemMarkersSettingsBuilder>

The configurator for the markers setting.

Returns:

ChartSeriesLegendItemSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =&gt;
{
series.Column(model =&gt; model.UnitPrice).Name("Unit Price").LegendItem(legendItem =&gt; legendItem.Markers(markers =&gt; markers.Type(ChartMarkerShape.Rect)));
})
)

Sets the type of the legend items. The default value is based on the series type.The supported values are: "line"—the legend items are rendered as a line. This is the default value for line charts. or "area"—the legend items are rendered as a filled rectangle. This is the default value for area charts..

C#
public ChartSeriesLegendItemSettingsBuilder Type(string value)
Parameters:valuestring

The value for Type

Returns:

ChartSeriesLegendItemSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =&gt;
{
series.Column(model =&gt; model.UnitPrice).Name("Unit Price").LegendItem(legendItem =&gt; legendItem.Type("line"));
})
)

A function that can be used to create a custom visual for the legend items. The available argument fields are: options—The item options.; createVisual—A function for getting the default visual.; series—The item series. or pointIndex—The index of the point in the series. Available for the Pie, Donut, and Funnel series..

C#
public ChartSeriesLegendItemSettingsBuilder Visual(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChartSeriesLegendItemSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =&gt;
{
series.Column(model =&gt; model.UnitPrice).Name("Unit Price").LegendItem(legendItem =&gt; legendItem.Visual(@&lt;text&gt;
function() {
//code
}
&lt;/text&gt;));
})
)

A function that can be used to create a custom visual for the legend items. The available argument fields are: options—The item options.; createVisual—A function for getting the default visual.; series—The item series. or pointIndex—The index of the point in the series. Available for the Pie, Donut, and Funnel series..

C#
public ChartSeriesLegendItemSettingsBuilder Visual(string handler)
Parameters:handlerstring

The name of the JavaScript function that will be evaluated.

Returns:

ChartSeriesLegendItemSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =&gt;
{
series.Column(model =&gt; model.UnitPrice).Name("Unit Price").LegendItem(legendItem =&gt; legendItem.Visual("visualHandler"));
})
)