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

ChartPlotBandLabelBuilder

Methods

Align(System.String)

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.

Parameters

value - System.String

The value for Align

Example


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

Background(System.String)

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

Parameters

value - System.String

The value for Background

Example


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

Border(System.Action)

The border of the label.

Parameters

configurator - System.Action<ChartPlotBandLabelBorderBuilder>

The configurator for the border setting.

Example


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

Color(System.String)

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

Parameters

value - System.String

The value for Color

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .ValueAxis(axis => axis.Numeric()
                          .PlotBands(bands =>
                          {
                              bands.Add().From(10000).To(30000).Label(label => label.Color("red"));
                          })
                      )
            )

Font(System.String)

The font style of the label.

Parameters

value - System.String

The value for Font

Example


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

Margin(System.Action)

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

Parameters

configurator - System.Action<ChartPlotBandLabelSpacingBuilder>

The configurator for the margin setting.

Example


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

Padding(System.Action)

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

Parameters

configurator - System.Action<ChartPlotBandLabelSpacingBuilder>

The configurator for the padding setting.

Example


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

Position(System.String)

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.

Parameters

value - System.String

The value for Position

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .ValueAxis(axis => axis.Numeric()
                          .PlotBands(bands =>
                          {
                              bands.Add().From(10000).To(30000).Label(label => label.Position("top"));
                          })
                      )
            )

Rotation(System.Double)

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

Parameters

value - System.Double

The value for Rotation

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .ValueAxis(axis => axis.Numeric()
                          .PlotBands(bands =>
                          {
                              bands.Add().From(10000).To(30000).Label(label => label.Rotation(90));
                          })
                      )
            )

Text(System.String)

The text of the label.

Parameters

value - System.String

The value for Text

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .ValueAxis(axis => axis.Numeric()
                          .PlotBands(bands =>
                          {
                              bands.Add().From(10000).To(30000).Label(label => label.Text("My Label"));
                          })
                      )
            )

Visible(System.Boolean)

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

Parameters

value - System.Boolean

The value for Visible

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .ValueAxis(axis => axis.Numeric()
                          .PlotBands(bands =>
                          {
                              bands.Add().From(10000).To(30000).Label(label => label.Visible(false));
                          })
                      )
            )

Visual(System.String)

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

Parameters

handler - System.String

The name of the JavaScript function that will be evaluated.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .ValueAxis(axis => axis.Numeric()
                          .PlotBands(bands =>
                          {
                              bands.Add().From(10000).To(30000).Label(label => label.Visual("labelsVisual"));
                          })
                      )
            )

Visual(System.Func)

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

Parameters

handler - System.Func<Object,Object>

The handler code wrapped in a text tag.

Example


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

In this article
Not finding the help you need?