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

ChartRangeBarLabelsBuilder

Defines the fluent interface for configuring the chart range bar labels.

Methods

From(System.Boolean)

Sets the from label visibility

Parameters

visible - System.Boolean

Boolean parameter to configure the visibility

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                          .RangeBar(m => m.WiFiFrom, m => m.WiFiTo)
                          .Labels(labels => labels.From(true))
                       )
            )

From(System.Action)

Configures the from label

Parameters

configurator - System.Action<ChartBarLabelsBuilder>

The from label configuration

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                          .RangeBar(m => m.WiFiFrom, m => m.WiFiTo)
                          .Labels(labels => labels.From(f => f.Visible(true)))
                       )
            )

To(System.Boolean)

Sets the to label visibility

Parameters

visible - System.Boolean

Boolean parameter to configure the visibility

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                          .RangeBar(m => m.WiFiFrom, m => m.WiFiTo)
                          .Labels(labels => labels.To(true))
                       )
            )

To(System.Action)

Configures the to label

Parameters

configurator - System.Action<ChartBarLabelsBuilder>

The to label configuration

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                          .RangeBar(m => m.WiFiFrom, m => m.WiFiTo)
                          .Labels(labels => labels.To(t => t.Visible(true)))
                       )
            )

Font(System.String)

Sets the labels font

Parameters

font - System.String

The labels font (CSS format).

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                          .Bar(s => s.Sales)
                          .Labels(labels => labels
                              .Font("14px Arial,Helvetica,sans-serif")
                              .Visible(true)
                          )
                      )
            )

Visible(System.Boolean)

Sets the labels visibility

Parameters

visible - System.Boolean

The labels visibility.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                          .Bar(s => s.Sales)
                          .Labels(labels => labels
                              .Visible(true)
                          )
                      )
            )

VisibleHandler(System.String)

Sets the function used to set the labels visibility.

Parameters

visibleFunction - System.String

The JavaScript function that will be executed to retrieve the visible state of each label.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                          .Bar(s => s.Sales)
                          .Labels(labels => labels
                              .VisibleHandler("labelVisible")
                          )
                      )
            )

VisibleHandler(System.Func)

Sets the function used to set the labels visibility.

Parameters

visibleFunction - System.Func<Object,Object>

The JavaScript function that will be executed to retrieve the visible state of each label.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                          .Bar(s => s.Sales)
                          .Labels(labels => labels
                              .VisibleHandler(
                                   @<text>
                                   function(point) {
                                       return point.value > 5;
                                   }
                                   </text>
                               )
                          )
                      )
            )

Background(System.String)

Sets the labels background color

Parameters

background - System.String

The labels background color.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                            .Bar(s => s.Sales)
                            .Labels(labels => labels
                                .Background("Red")
                                .Visible(true)
                            )
                      )          
            )

Color(System.String)

Sets the labels text color

Parameters

color - System.String

The labels text color.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                            .Bar(s => s.Sales)
                            .Labels(labels => labels
                                .Color("Red")
                                .Visible(true)
                            )
                      )    
            )

Color(System.Func)

Sets a Function that returns the JavaScript handler for the labels color.

Parameters

handler - System.Func<Object,Object>

The labels text color.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                            .Bar(s => s.Sales)
                            .Labels(labels => labels
                                .Color(o => "colorHandler")
                                .Visible(true)
                            )
                      )    
            )

Margin(System.Int32,System.Int32,System.Int32,System.Int32)

Sets the labels margin

Parameters

top - System.Int32

The labels top margin.

right - System.Int32

The labels right margin.

bottom - System.Int32

The labels bottom margin.

left - System.Int32

The labels left margin.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                            .Bar(s => s.Sales)
                            .Labels(labels => labels
                                .Margin(0, 5, 5, 0)
                                .Visible(true)
                            )
                      ) 
            )

Margin(System.Int32)

Sets the labels margin

Parameters

margin - System.Int32

The labels margin.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                            .Bar(s => s.Sales)
                            .Labels(labels => labels
                                .Margin(20)
                                .Visible(true)
                            )
                      ) 
            )

Padding(System.Int32,System.Int32,System.Int32,System.Int32)

Sets the labels padding

Parameters

top - System.Int32

The labels top padding.

right - System.Int32

The labels right padding.

bottom - System.Int32

The labels bottom padding.

left - System.Int32

The labels left padding.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                           .Bar(s => s.Sales)
                           .Labels(labels => labels
                                .Padding(0, 5, 5, 0)
                                .Visible(true)
                           )
                      )
            )

Padding(System.Int32)

Sets the labels padding

Parameters

padding - System.Int32

The labels padding.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                           .Bar(s => s.Sales)
                           .Labels(labels => labels
                                .Padding(20)
                                .Visible(true)
                           )
                      )
            )

Border(System.Int32,System.String,Kendo.Mvc.UI.ChartDashType)

Sets the labels border

Parameters

width - System.Int32

The labels border width.

color - System.String

The labels border color (CSS syntax).

dashType - ChartDashType

The labels border dash type.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                           .Bar(s => s.Sales)
                           .Labels(labels => labels
                                .Border(1, "Red", ChartDashType.Dot)
                                .Visible(true)
                           )
                      )
            )

Border(System.Action)

Configures the labels border

Parameters

configurator - System.Action<ChartBorderBuilder>

The border configuration action

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                           .Bar(s => s.Sales)
                           .Labels(labels => labels
                                .Border(border => border.Width(2).Color("green"))
                                .Visible(true)
                           )
                      )
            )

Format(System.String)

Sets the labels format.

Parameters

format - System.String

The labels format.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                            .Bar(s => s.Sales)
                            .Labels(labels => labels
                                .Format("{0:C}")
                                .Visible(true)
                            )
                      )          
            )

Template(System.String)

Sets the labels template.

Parameters

template - System.String

The labels template.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                            .Bar(s => s.Sales)
                            .Labels(labels => labels
                                .Template("#:Sales#")
                                .Visible(true)
                            )
                      )          
            )

Opacity(System.Double)

Sets the labels opacity.

Parameters

opacity - System.Double

The series opacity in the range from 0 (transparent) to 1 (opaque). The default value is 1.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                            .Bar(s => s.Sales)
                            .Labels(labels => labels
                                .Opacity(0.5)
                                .Visible(true)
                            )
                      )          
            )

Rotation(System.Int32)

Sets the labels text rotation

Parameters

rotation - System.Int32

The labels text rotation.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                            .Bar(s => s.Sales)
                            .Labels(labels => labels
                                .Rotation(45)
                                .Visible(true)
                            )
                      )    
            )

Visual(System.String)

Sets the labels visual handler

Parameters

handler - System.String

The JavaScript visual handler name.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .Series(series => series
                            .Bar(s => s.Sales)
                            .Labels(labels => labels
                                .Visual("labelsVisual")
                            )
                      )    
            )

Visual(System.Func)

Sets the labels visual handler

Parameters

handler - System.Func<Object,Object>

The handler

Example


            @(Html.Kendo().Chart()
                 .Name("Chart")
                 .Series(series => series
                       .Bar(s => s.Sales)
                       .Labels(labels => labels
                           .Visual(
                               @<text>
                                   function(e) {
                                       return e.createVisual(); // returns the default visual
                                   }
                               </text>
                           )
                       )
                 )
            )

In this article
Not finding the help you need?