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

ChartDateAxisLabelsBuilder

Methods

Culture(System.Globalization.CultureInfo)

Culture to use for formatting the dates.

Parameters

culture - System.Globalization.CultureInfo

Culture to use for formatting the dates.

Example


            @(Html.Kendo().Chart()
                       .Name("Chart")
                       .CategoryAxis(axis => axis
                           .Date()
                           .Categories(sale => sale.Date)
                           .Labels(labels => labels.Culture(new CultureInfo("es-ES")))
                       )
            )

DateFormats(System.Action)

Culture to use for formatting the dates. See Globalization for more information.

Parameters

configurator - System.Action<ChartAxisLabelsDateFormatsBuilder>

Culture to use for formatting the dates.

Example


            @(Html.Kendo().Chart()
                       .Name("Chart")
                       .CategoryAxis(axis => axis
                           .Date()
                           .Categories(sale => sale.Date)
                           .Labels(labels => labels
                               .DateFormats(formats => formats
                                   .Days("dd")
                               )
                           )
                       )
            )

Mirror(System.Boolean)

Renders the axis labels on the other side.

Parameters

mirror - System.Boolean

A value indicating whether to render the axis labels on the other side.

Example


            @(Html.Kendo().Chart()
                       .Name("Chart")
                       .ValueAxis(axis => axis
                           .Numeric().Labels(labels => labels.Mirror(true))
                       )
                       .CategoryAxis(axis => axis
                           .Categories(s => s.DateString)
                           // Move the value axis to the right side
                           .AxisCrossingValue(5)
                       )
            )

Position(Kendo.Mvc.UI.ChartAxisLabelsPosition)

Specifies the position of the labels.

Parameters

position - ChartAxisLabelsPosition

Example


            @(Html.Kendo().Chart()
                       .Name("Chart")
                       .ValueAxis(axis => axis
                           .Numeric().Labels(labels => labels.Position(ChartAxisLabelsPosition.End))
                       )
                       .CategoryAxis(axis => axis
                           .Categories(s => s.DateString)
                           // Move the value axis to the right side
                           .AxisCrossingValue(5)
                       )
            )

Step(System.Int32)

Label rendering step.

Parameters

step - System.Int32

A value indicating the step at which labels are rendered. Every n-th label is rendered where n is the step.

Example


            @(Html.Kendo().Chart()
                       .Name("Chart")
                       .ValueAxis(axis => axis
                           .Numeric()
                           .Min(0).Max(100)
                           .Labels(lbl=>lbl.Step(2))
                       )
            )

Skip(System.Int32)

Label rendering skip.

Parameters

skip - System.Int32

Skips rendering the first n labels.

Example


            @(Html.Kendo().Chart()
                       .Name("Chart")
                       .ValueAxis(axis => axis
                           .Numeric()
                           .Min(0).Max(100)
                           .Labels(lbl=>lbl.Skip(2))
                       )
            )

Rotation(System.String)

Specifies the labels rotation angle.

Parameters

rotation - System.String

The rotation angle of the labels.

Example


            @(Html.Kendo().Chart()
                       .Name("Chart")
                       .ValueAxis(axis => axis
                           .Numeric()
                           .Min(0).Max(100)
                           .Labels(lbl=>lbl.Rotation(-45))
                       )
            )

Rotation(System.Action)

Specifies the labels rotation.

Parameters

configurator - System.Action<ChartAxisLabelsRotationBuilder>

The labels rotation configurator.

Example


            @(Html.Kendo().Chart()
                       .Name("Chart")
                       .ValueAxis(axis => axis
                           .Numeric()
                           .Min(0).Max(100)
                           .Labels(lbl=>lbl.Rotation(rotate=>rotate.Angle(-45)))
                       )
            )

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

AriaTemplate(System.String)

The template which renders the ARIA label for the series labels.The fields which can be used in the template are: category - the category name. Available for area, bar, column, bubble, donut, line and pie series.; dataItem - the original data item used to construct the point. Will be null if binding to array.; percentage - the point value represented as a percentage value. Available only for 100% stacked charts.; series - the data series or value - the point value. Can be a number or object containing each bound field..

Parameters

value - System.String

The value for AriaTemplate

AriaTemplateId(System.String)

The template which renders the ARIA label for the series labels.The fields which can be used in the template are: category - the category name. Available for area, bar, column, bubble, donut, line and pie series.; dataItem - the original data item used to construct the point. Will be null if binding to array.; percentage - the point value represented as a percentage value. Available only for 100% stacked charts.; series - the data series or value - the point value. Can be a number or object containing each bound field..

Parameters

templateId - System.String

The ID of the template element for AriaTemplate

AriaTemplateView(System.Web.Mvc.MvcHtmlString)

The template which renders the ARIA label for the series labels.The fields which can be used in the template are: category - the category name. Available for area, bar, column, bubble, donut, line and pie series.; dataItem - the original data item used to construct the point. Will be null if binding to array.; percentage - the point value represented as a percentage value. Available only for 100% stacked charts.; series - the data series or value - the point value. Can be a number or object containing each bound field..

Parameters

templateView - System.Web.Mvc.MvcHtmlString

The view that contains the template for AriaTemplate

AriaTemplateHandler(System.String)

The template which renders the ARIA label for the series labels.The fields which can be used in the template are: category - the category name. Available for area, bar, column, bubble, donut, line and pie series.; dataItem - the original data item used to construct the point. Will be null if binding to array.; percentage - the point value represented as a percentage value. Available only for 100% stacked charts.; series - the data series or value - the point value. Can be a number or object containing each bound field..

Parameters

templateHandler - System.String

The handler that returs the template for AriaTemplate

AriaTemplate(Kendo.Mvc.UI.TemplateBuilder)

The template which renders the ARIA label for the series labels.The fields which can be used in the template are: category - the category name. Available for area, bar, column, bubble, donut, line and pie series.; dataItem - the original data item used to construct the point. Will be null if binding to array.; percentage - the point value represented as a percentage value. Available only for 100% stacked charts.; series - the data series or value - the point value. Can be a number or object containing each bound field..

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the ariatemplate.

In this article
Not finding the help you need?