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

Defines the fluent API for configuring ChartCategoryAxisPlotBandLabelSettings

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ChartPlotBandLabelBuilder

Inheritance: objectChartPlotBandLabelBuilder

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

Constructors

C#
public ChartPlotBandLabelBuilder(ChartPlotBandLabel container)
Parameters:containerChartPlotBandLabel

Properties

C#
protected ChartPlotBandLabel Container { get; }

Methods

The position of the plotband label.The supported values are: "left" - the plotband label is positioned on the left; "right" - the plotband label is positioned on the right or "center" - the plotband label is positioned in the center.

C#
public ChartPlotBandLabelBuilder Align(string value)
Parameters:valuestring

The value for Align

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis => axis.Numeric()
.PlotBands(bands =>
{
bands.Add().From(10000).To(30000).Label(label => label.Align("right"));
})
)
)

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

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

The value for Background

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis => axis.Numeric()
.PlotBands(bands =>
{
bands.Add().From(10000).To(30000).Label(label => label.Background("lightblue"));
})
)
)

The border of the label.

C#
public ChartPlotBandLabelBuilder Border(Action<ChartPlotBandLabelBorderBuilder> configurator)
Parameters:configuratorAction<ChartPlotBandLabelBorderBuilder>

The configurator for the border setting.

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis =&gt; axis.Numeric()
.PlotBands(bands =&gt;
{
bands.Add().From(10000).To(30000).Label(label =&gt; label.Border(border =&gt; border.Color("red")));
})
)
)

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

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

The value for Color

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis =&gt; axis.Numeric()
.PlotBands(bands =&gt;
{
bands.Add().From(10000).To(30000).Label(label =&gt; label.Color("red"));
})
)
)

The font style of the label.

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

The value for Font

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis =&gt; axis.Numeric()
.PlotBands(bands =&gt;
{
bands.Add().From(10000).To(30000).Label(label =&gt; label.Font("12px Courier New"));
})
)
)

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

C#
public ChartPlotBandLabelBuilder Margin(Action<ChartPlotBandLabelSpacingBuilder> configurator)
Parameters:configuratorAction<ChartPlotBandLabelSpacingBuilder>

The configurator for the margin setting.

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis =&gt; axis.Numeric()
.PlotBands(bands =&gt;
{
bands.Add().From(10000).To(30000).Label(label =&gt; label.Margin(margin =&gt; margin.Top(10)));
})
)
)

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

C#
public ChartPlotBandLabelBuilder Padding(Action<ChartPlotBandLabelSpacingBuilder> configurator)
Parameters:configuratorAction<ChartPlotBandLabelSpacingBuilder>

The configurator for the padding setting.

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis =&gt; axis.Numeric()
.PlotBands(bands =&gt;
{
bands.Add().From(10000).To(30000).Label(label =&gt; label.Padding(padding =&gt; padding.Left(5)));
})
)
)

The position of the label.The supported values are: "top" - the axis label is positioned on the top; "bottom" - the axis label is positioned on the bottom or "center" - the axis label is positioned in the center.

C#
public ChartPlotBandLabelBuilder Position(string value)
Parameters:valuestring

The value for Position

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis =&gt; axis.Numeric()
.PlotBands(bands =&gt;
{
bands.Add().From(10000).To(30000).Label(label =&gt; label.Position("top"));
})
)
)

The rotation angle of the label. By default the label is not rotated.

C#
public ChartPlotBandLabelBuilder Rotation(double value)
Parameters:valuedouble

The value for Rotation

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis =&gt; axis.Numeric()
.PlotBands(bands =&gt;
{
bands.Add().From(10000).To(30000).Label(label =&gt; label.Rotation(90));
})
)
)

The text of the label.

C#
public ChartPlotBandLabelBuilder Text(string value)
Parameters:valuestring

The value for Text

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis =&gt; axis.Numeric()
.PlotBands(bands =&gt;
{
bands.Add().From(10000).To(30000).Label(label =&gt; label.Text("My Label"));
})
)
)

If set to false the chart will not display the label.

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

The value for Visible

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis =&gt; axis.Numeric()
.PlotBands(bands =&gt;
{
bands.Add().From(10000).To(30000).Label(label =&gt; label.Visible(false));
})
)
)

A function that can be used to create a custom visual for the label. The available argument fields are: text - the label text.; rect - the kendo.geometry.Rect that defines where the visual should be rendered.; sender - the chart instance (may be undefined).; options - the label options. or createVisual - a function that can be used to get the default visual..

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

The handler code wrapped in a text tag.

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis =&gt; axis.Numeric()
.PlotBands(bands =&gt;
{
bands.Add().From(10000).To(30000).Label(label =&gt; label.Visual(
@&lt;text&gt;
function(e) {
return e.createVisual(); // returns the default visual
}
&lt;/text&gt;
);
})
)
)

A function that can be used to create a custom visual for the label. The available argument fields are: text - the label text.; rect - the kendo.geometry.Rect that defines where the visual should be rendered.; sender - the chart instance (may be undefined).; options - the label options. or createVisual - a function that can be used to get the default visual..

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

The name of the JavaScript function that will be evaluated.

Returns:

ChartPlotBandLabelBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(axis =&gt; axis.Numeric()
.PlotBands(bands =&gt;
{
bands.Add().From(10000).To(30000).Label(label =&gt; label.Visual("labelsVisual"));
})
)
)