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

ChartAxisLabelsBuilder

Methods

Mirror(System.Boolean)

If set to "true", the Chart will mirror the axis labels and ticks. If the labels are normally on the left side of the axis, mirroring the axis will render them to the right.

Parameters

mirror - System.Boolean

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

Example


            @(Html.Kendo().Chart()
                       .Name("chart")
                       .CategoryAxis(axis => axis
                           .Labels(labels => labels.Mirror(true))
                       )
            )

Position(Kendo.Mvc.UI.ChartAxisLabelsPosition)

Specifies the position of the labels.

Parameters

position - ChartAxisLabelsPosition

The value that configures the position.

Example


            @(Html.Kendo().Chart()
                       .Name("chart")
                       .CategoryAxis(axis => axis
                           .Labels(labels => labels.Position(ChartAxisLabelsPosition.End))
                       )
            )

Step(System.Int32)

Defines the label rendering step (render every n-th label). By default, every label is rendered.

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")
                       .CategoryAxis(axis => axis
                           .Labels(labels => labels.Step(2))
                       )
            )

Skip(System.Int32)

Defines the number of labels to skip. By default, no labels are skipped.

Parameters

skip - System.Int32

The value that configures the number of labels to skip.

Example


            @(Html.Kendo().Chart()
                       .Name("chart")
                       .CategoryAxis(axis => axis
                           .Labels(labels => labels.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")
                       .CategoryAxis(axis => axis
                           .Labels(labels => labels.Rotation("90"))
                       )
            )

Rotation(System.Action)

Specifies the rotation settings of the labels.

Parameters

configurator - System.Action<ChartAxisLabelsRotationBuilder>

The action that configures the rotation settings.

Example


            @(Html.Kendo().Chart()
                       .Name("chart")
                       .CategoryAxis(axis => axis
                           .Labels(labels => labels.Rotation(r => r.Angle(30).Align(ChartAxisLabelRotationAlignment.Center)))
                       )
            )

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

Example


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

Example


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

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

Example

 "))))
            )

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

Example


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

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.

Example


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

In this article
Not finding the help you need?