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

ChartAxisTitleBuilder

Methods

Text(System.String)

Sets the axis title text.

Parameters

text - System.String

The text of the axis title.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .CategoryAxis(axis => axis
                          .Title(title => title
                              .Text("Axis")
                          )
                      )
            )

Font(System.String)

Sets the axis title font.

Parameters

font - System.String

The axis title font (CSS format).

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .CategoryAxis(axis => axis
                          .Title(title => title
                              .Font("16px Arial,Helvetica,sans-serif")
                          )
                      )
            )

Background(System.String)

Sets the axis title background color.

Parameters

background - System.String

The axis background color.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .CategoryAxis(axis => axis
                          .Title(title => title
                              .Background("red")
                          )
                      )
            )

Color(System.String)

Sets the axis title text color.

Parameters

color - System.String

The axis text color.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .CategoryAxis(axis => axis
                          .Title(title => title
                              .Color("red")
                          )
                      )
            )

Position(Kendo.Mvc.UI.ChartAxisTitlePosition)

Sets the axis title position.

Parameters

position - ChartAxisTitlePosition

The axis title position.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .CategoryAxis(axis => axis
                          .Title(title => title
                              .Position(ChartTitlePosition.Center)
                          )
                      )
            )

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

Sets the axis title margin.

Parameters

top - System.Int32

The axis title top margin.

right - System.Int32

The axis title right margin.

bottom - System.Int32

The axis title bottom margin.

left - System.Int32

The axis title left margin.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .CategoryAxis(axis => axis
                          .Title(title => title
                              .Margin(20, 20, 20, 20)
                          )
                      )
            )

Margin(System.Int32)

Sets the axis title margin.

Parameters

margin - System.Int32

The axis title margin.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .CategoryAxis(axis => axis
                          .Title(title => title
                              .Margin(20)
                          )
                      )
            )

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

Sets the axis title padding.

Parameters

top - System.Int32

The axis title top padding.

right - System.Int32

The axis title right padding.

bottom - System.Int32

The axis title bottom padding.

left - System.Int32

The axis title left padding.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .CategoryAxis(axis => axis
                          .Title(title => title
                              .Padding(20, 20, 20, 20)
                          )
                      )
            )

Padding(System.Int32)

Sets the axis title padding

Parameters

padding - System.Int32

The axis title padding.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .CategoryAxis(axis => axis
                          .Title(title => title
                              .Padding(20)
                          )
                      )
            )

Rotation(System.Double)

Sets the axis title rotation.

Parameters

rotation - System.Double

The axis title rotation.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .CategoryAxis(axis => axis
                          .Title(title => title
                              .Rotation(30)
                          )
                      )
            )

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

Sets the axis title border

Parameters

width - System.Int32

The axis title border width.

color - System.String

The axis title border color.

dashType - ChartDashType

The axis title dash type.

Example


            @(Html.Kendo().Chart()
                      .Name("Chart")
                      .CategoryAxis(axis => axis
                          .Title(title => title
                              .Border(1, "#000", ChartDashType.Dot)
                          )
                      )
            )

Border(System.Action)

Configures the title border

Parameters

configurator - System.Action<ChartBorderBuilder>

The border configuration action

Example


            @(Html.Kendo().Chart()
                       .Name("Chart")
                       .CategoryAxis(axis => axis
                           .Title(title => title
                                .Text("Names")
                                .Border(border => border
                                    .Color("green")
                                    .Width(1)
                                )
                           )
                       )
            )

Opacity(System.Double)

Sets the axis title 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")
                      .CategoryAxis(axis => axis
                          .Title(title => title
                              .Opacity(0.5)
                          )
                      )
            )

Visible(System.Boolean)

Sets the axis title visibility

Parameters

visible - System.Boolean

The axis title visibility.

Example


            @(Html.Kendo().Chart()
                       .Name("Chart")
                       .CategoryAxis(axis => axis
                           .Title(title => title
                                .Text("Names")
                                .Visible(false)
                           )
                       )
            )

Visual(System.Func)

Sets the function used to render the axis title.

Parameters

visualFunction - System.Func<Object,Object>

The JavaScript function that will be executed to retrieve the visual of the axis title.

Visual(System.String)

Sets the function used to render the axis title.

Parameters

visualFunction - System.String

The JavaScript function that will be executed to retrieve the visual of the axis title.

Example


            @(Html.Kendo().Chart()
                       .Name("Chart")
                       .CategoryAxis(axis => axis
                           .Title(title => title
                                .Text("Multiple Lines")
                                .Visual("getTitleVisual")
                           )
                       )
            )
            <script>
                function getTitleVisual(e) {
                    var layout = new kendo.drawing.Layout(e.rect, {
                        orientation: "vertical",
                        alignContent: "center",
                        justifyContent: "end"
                    });
                    var words = e.text.split(" ");
                    for (var i = 0; i < words.length; i++) {
                        layout.append(new kendo.drawing.Text(words[i]));
                    }
                    layout.reflow();
                    return layout;
                }
            </script>

In this article
Not finding the help you need?