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

Defines the fluent API for configuring ChartSeriesLabelsToSettings

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ChartSeriesLabelsToSettingsBuilder

Inheritance: objectChartSeriesLabelsToSettingsBuilder

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

Constructors

Initializes a new instance of the ChartSeriesLabelsToSettingsBuilder<T> class.

C#
public ChartSeriesLabelsToSettingsBuilder(ChartSeriesLabelsToSettings container)
Parameters:containerChartSeriesLabelsToSettings

The ChartSeriesLabelsToSettings<T> container

Properties

Gets the ChartSeriesLabelsToSettings<T> container.

C#
protected ChartSeriesLabelsToSettings Container { get; }

Methods

The background color of the to labels. Accepts a valid CSS color string, including hex and rgb.

C#
public ChartSeriesLabelsToSettingsBuilder Background(string value)
Parameters:valuestring

The value for Background

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.Background("green")
)
)
)
)

The background color of the to labels. Accepts a valid CSS color string, including hex and rgb.

C#
public ChartSeriesLabelsToSettingsBuilder BackgroundHandler(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.BackgroundHandler(
@&lt;text&gt;
function(e) {
// event handler code
}
&lt;/text&gt;
)
)
)
)
)

The background color of the to labels. Accepts a valid CSS color string, including hex and rgb.

C#
public ChartSeriesLabelsToSettingsBuilder BackgroundHandler(string handler)
Parameters:handlerstring

The name of the JavaScript function that will be evaluated.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.BackgroundHandler("backgroundHandler")
)
)
)
)

The border of the to labels.

C#
public ChartSeriesLabelsToSettingsBuilder Border(Action<ChartSeriesLabelsToBorderSettingsBuilder> configurator)
Parameters:configuratorAction<ChartSeriesLabelsToBorderSettingsBuilder>

The configurator for the border setting.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.Border(b =&gt; b
.Color("red")
)
)
)
)
)

The text color of the to labels. Accepts a valid CSS color string, including hex and rgb.

C#
public ChartSeriesLabelsToSettingsBuilder Color(string value)
Parameters:valuestring

The value for Color

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.Color("red")
)
)
)
)

The text color of the to labels. Accepts a valid CSS color string, including hex and rgb.

C#
public ChartSeriesLabelsToSettingsBuilder ColorHandler(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.ColorHandler(
@&lt;text&gt;
function(e) {
// event handler code
}
&lt;/text&gt;
)
)
)
)
)

The text color of the to labels. Accepts a valid CSS color string, including hex and rgb.

C#
public ChartSeriesLabelsToSettingsBuilder ColorHandler(string handler)
Parameters:handlerstring

The name of the JavaScript function that will be evaluated.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.ColorHandler("colorHandler")
)
)
)
)

The font style of the to labels.

C#
public ChartSeriesLabelsToSettingsBuilder Font(string value)
Parameters:valuestring

The value for Font

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.Font("14px Arial,Helvetica,sans-serif")
)
)
)
)

The font style of the to labels.

C#
public ChartSeriesLabelsToSettingsBuilder FontHandler(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.FontHandler(
@&lt;text&gt;
function(e) {
// event handler code
}
&lt;/text&gt;
)
)
)
)
)

The font style of the to labels.

C#
public ChartSeriesLabelsToSettingsBuilder FontHandler(string handler)
Parameters:handlerstring

The name of the JavaScript function that will be evaluated.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.FontHandler("fontHandler")
)
)
)
)

The format of the to labels. Uses kendo.format.

C#
public ChartSeriesLabelsToSettingsBuilder Format(string value)
Parameters:valuestring

The value for Format

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.Format("{0:C}")
)
)
)
)

The format of the to labels. Uses kendo.format.

C#
public ChartSeriesLabelsToSettingsBuilder FormatHandler(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.FormatHandler(
@&lt;text&gt;
function(e) {
// event handler code
}
&lt;/text&gt;
)
)
)
)
)

The format of the to labels. Uses kendo.format.

C#
public ChartSeriesLabelsToSettingsBuilder FormatHandler(string handler)
Parameters:handlerstring

The name of the JavaScript function that will be evaluated.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.Format("formatHandler")
)
)
)
)

The margin of the to labels. A numeric value will set all margins.

C#
public ChartSeriesLabelsToSettingsBuilder Margin(Action<ChartSeriesLabelsToMarginSettingsBuilder> configurator)
Parameters:configuratorAction<ChartSeriesLabelsToMarginSettingsBuilder>

The configurator for the margin setting.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.Margin(m =&gt; m
.Bottom(10)
)
)
)
)
)

The padding of the to labels. A numeric value will set all paddings.

C#
public ChartSeriesLabelsToSettingsBuilder Padding(Action<ChartSeriesLabelsToPaddingSettingsBuilder> configurator)
Parameters:configuratorAction<ChartSeriesLabelsToPaddingSettingsBuilder>

The configurator for the padding setting.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.Padding(p =&gt; p
.Top(10)
)
)
)
)
)

Specifies the position of the "to" labels.

C#
public ChartSeriesLabelsToSettingsBuilder Position(ChartSeriesLabelsPosition value)
Parameters:valueChartSeriesLabelsPosition

The value for Position

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.Position(ChartSeriesLabelsPosition.Above)
)
)
)
)

The template which renders the chart series to label.The fields which can be used in the template are: category - the category name.; dataItem - the original data item used to construct the point. Will be null if binding to array.; series - the data series or value - the point value. An object containing from and to values..

C#
public ChartSeriesLabelsToSettingsBuilder Template(string value)
Parameters:valuestring

The value for Template

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.Template("#=FromSales#")
)
)
)
)

The template which renders the chart series to label.The fields which can be used in the template are: category - the category name.; dataItem - the original data item used to construct the point. Will be null if binding to array.; series - the data series or value - the point value. An object containing from and to values..

C#
public ChartSeriesLabelsToSettingsBuilder Template<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the template.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.Template("template")
)
)
)
)

The template which renders the chart series to label.The fields which can be used in the template are: category - the category name.; dataItem - the original data item used to construct the point. Will be null if binding to array.; series - the data series or value - the point value. An object containing from and to values..

C#
public ChartSeriesLabelsToSettingsBuilder TemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for Template

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.TemplateHandler("templateHandler")
)
)
)
)

The template which renders the chart series to label.The fields which can be used in the template are: category - the category name.; dataItem - the original data item used to construct the point. Will be null if binding to array.; series - the data series or value - the point value. An object containing from and to values..

C#
public ChartSeriesLabelsToSettingsBuilder TemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for Template

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.TemplateId("templateId")
)
)
)
)

The template which renders the chart series to label.The fields which can be used in the template are: category - the category name.; dataItem - the original data item used to construct the point. Will be null if binding to array.; series - the data series or value - the point value. An object containing from and to values..

C#
public ChartSeriesLabelsToSettingsBuilder TemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlStringReturns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.TemplateView(new MvcHtmlString("#= FromSales #"))
)
)
)
)

If set to true the chart will display the series to labels. By default chart series to labels are not displayed.

C#
public ChartSeriesLabelsToSettingsBuilder Visible(bool value)
Parameters:valuebool

The value for Visible

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.Visible("true")
)
)
)
)

If set to true the chart will display the series to labels. By default chart series to labels are not displayed.

C#
public ChartSeriesLabelsToSettingsBuilder VisibleHandler(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.VisibleHandler(
@&lt;text&gt;
function(e) {
// event handler code
}
&lt;/text&gt;
)
)
)
)
)

If set to true the chart will display the series to labels. By default chart series to labels are not displayed.

C#
public ChartSeriesLabelsToSettingsBuilder VisibleHandler(string handler)
Parameters:handlerstring

The name of the JavaScript function that will be evaluated.

Returns:

ChartSeriesLabelsToSettingsBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.Series(series =&gt; series
.RangeArea(
m =&gt; m.FromSales,
m =&gt; m.ToSales
)
.Labels(l =&gt; l
.To(t =&gt; t
.VisibleHandler("visibleHandler")
)
)
)
)