ChartSeriesLegendItemSettingsBuilder

Methods

Area(System.Action)

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

Parameters

configurator - System.Action<ChartSeriesLegendItemAreaSettingsBuilder>

The configurator for the area setting.

Example

Razor
 
            @(Html.Kendo().Chart()
                .Name("chart")
                .Series(series =>
                {
                    series.Column(model => model.UnitPrice).Name("Unit Price").LegendItem(legendItem => legendItem.Area(area => area.Background("lightgreen")));
                })
            )
             

Cursor(System.String)

The cursor style of the legend item.

Parameters

value - System.String

The value for Cursor

Example

Razor
 
            @(Html.Kendo().Chart()
                .Name("chart")
                .Series(series =>
                {
                    series.Column(model => model.UnitPrice).Name("Unit Price").LegendItem(legendItem => legendItem.Cursor("crosshair"));
                })
            )
             

Highlight(System.Action)

The highlight configuration of the legend item.

Parameters

configurator - System.Action<ChartSeriesLegendItemHighlightSettingsBuilder>

The configurator for the highlight setting.

Example

Razor
 
            @(Html.Kendo().Chart()
                .Name("chart")
                .Series(series =>
                {
                    series.Column(model => model.UnitPrice).Name("Unit Price").LegendItem(legendItem => legendItem.Highlight(h => h.Visible(false)));
                })
            )
             

Line(System.Action)

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

Parameters

configurator - System.Action<ChartSeriesLegendItemLineSettingsBuilder>

The configurator for the line setting.

Example

Razor
 
            @(Html.Kendo().Chart()
                .Name("chart")
                .Series(series =>
                {
                    series.Column(model => model.UnitPrice).Name("Unit Price").LegendItem(legendItem => legendItem.Line(line => line.Opacity(0.5)));
                })
            )
             

Markers(System.Action)

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.

Parameters

configurator - System.Action<ChartSeriesLegendItemMarkersSettingsBuilder>

The configurator for the markers setting.

Example

Razor
 
            @(Html.Kendo().Chart()
                .Name("chart")
                .Series(series =>
                {
                    series.Column(model => model.UnitPrice).Name("Unit Price").LegendItem(legendItem => legendItem.Markers(markers => markers.Type(ChartMarkerShape.Rect)));
                })
            )
             

Type(System.String)

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..

Parameters

value - System.String

The value for Type

Example

Razor
 
            @(Html.Kendo().Chart()
                .Name("chart")
                .Series(series =>
                {
                    series.Column(model => model.UnitPrice).Name("Unit Price").LegendItem(legendItem => legendItem.Type("line"));
                })
            )
             

Visual(System.String)

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..

Parameters

handler - System.String

The name of the JavaScript function that will be evaluated.

Example

Razor
 
            @(Html.Kendo().Chart()
                .Name("chart")
                .Series(series =>
                {
                    series.Column(model => model.UnitPrice).Name("Unit Price").LegendItem(legendItem => legendItem.Visual("visualHandler"));
                })
            )
             

Visual(System.Func)

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..

Parameters

handler - System.Func<Object,Object>

The handler code wrapped in a text tag.

Example

Razor
 
            @(Html.Kendo().Chart()
                .Name("chart")
                .Series(series =>
                {
                    series.Column(model => model.UnitPrice).Name("Unit Price").LegendItem(legendItem => legendItem.Visual(@<text>
                       function() {
                          //code
                       }
                    </text>));
                })
            )