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

Defines the fluent interface for configuring the ChartAxisTitle.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ChartAxisTitleBuilder

Inheritance: objectChartAxisTitleBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the ChartAxisTitleBuilder class.

C#
public ChartAxisTitleBuilder(ChartAxisTitle title)
Parameters:titleChartAxisTitle

The chart axis title.

Methods

Sets the background color of the axis title.

C#
public ChartAxisTitleBuilder Background(string background)
Parameters:backgroundstring

The background color value.

Returns:

ChartAxisTitleBuilder

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

Configures the border of the title.

C#
public ChartAxisTitleBuilder Border(Action<ChartBorderBuilder> configurator)
Parameters:configuratorAction<ChartBorderBuilder>

The action that configures the border settings.

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title
.Text("Names")
.Border(border =&gt; border.Color("green").Width(1))
)
)
)

Sets the border of the axis title.

C#
public ChartAxisTitleBuilder Border(int width, string color, ChartDashType dashType)
Parameters:widthint

The border width.

colorstring

The border color.

dashTypeChartDashType

The border dash type.

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title.Border(1, "#000", ChartDashType.Dot))
)
)

Sets the text color of the axis title.

C#
public ChartAxisTitleBuilder Color(string color)
Parameters:colorstring

The value that sets the color.

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title
.Color("red")
)
)
)

Sets the font of the axis title.

C#
public ChartAxisTitleBuilder Font(string font)
Parameters:fontstring

The axis title font (CSS format).

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title
.Font("16px Arial,Helvetica,sans-serif")
)
)
)

Sets the margin of the axis title.

C#
public ChartAxisTitleBuilder Margin(int top, int right, int bottom, int left)
Parameters:topint

The top margin.

rightint

The right margin.

bottomint

The bottom margin.

leftint

The left margin.

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title
.Margin(20, 20, 20, 20)
)
)
)

Sets all margins of the axis title.

C#
public ChartAxisTitleBuilder Margin(int margin)
Parameters:marginint

The value that configures the margin.

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title
.Margin(20)
)
)
)

Sets the axis title opacity.

C#
public ChartAxisTitleBuilder Opacity(double opacity)
Parameters:opacitydouble

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

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title
.Opacity(0.5)
)
)
)

Sets the padding of the axis title.

C#
public ChartAxisTitleBuilder Padding(int top, int right, int bottom, int left)
Parameters:topint

The top padding.

rightint

The right padding.

bottomint

The bottom padding.

leftint

The left padding.

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title
.Padding(20, 20, 20, 20)
)
)
)

Sets all paddings of the axis title.

C#
public ChartAxisTitleBuilder Padding(int padding)
Parameters:paddingint

The value that sets the padding.

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title
.Padding(20)
)
)
)

Sets the position of the axis title.

C#
public ChartAxisTitleBuilder Position(ChartAxisTitlePosition position)
Parameters:positionChartAxisTitlePosition

The enum value that sets the position.

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title
.Position(ChartTitlePosition.Center)
)
)
)

Sets the rotation angle of the axis title.

C#
public ChartAxisTitleBuilder Rotation(double rotation)
Parameters:rotationdouble

The value that configures the rotation angle.

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title
.Rotation(30)
)
)
)

Sets the axis title text.

C#
public ChartAxisTitleBuilder Text(string text)
Parameters:textstring

The value that sets the title text.

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title
.Text("Axis")
)
)
)

Sets the visibility of the axis title.

C#
public ChartAxisTitleBuilder Visible(bool visible)
Parameters:visiblebool

The value that toggles the visibility of the title.

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title.Text("Names").Visible(false))
)
)

Defines a handler that renders the axis title.

C#
public ChartAxisTitleBuilder Visual(Func<object, object> visualFunction)
Parameters:visualFunctionFunc<object, object>

The handler code wrapped in a text tag (Razor syntax).

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title.Visual(@&lt;text&gt;
function(e) {
// Return the title layout.
}
&lt;/text&gt;)
)
)

Sets a JavaScript function that renders the axis title.

C#
public ChartAxisTitleBuilder Visual(string visualFunction)
Parameters:visualFunctionstring

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

Returns:

ChartAxisTitleBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Title(title =&gt; title
.Text("Multiple Lines")
.Visual("getTitleVisual")
)
)
)
&lt;script&gt;
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 &lt; words.length; i++) {
layout.append(new kendo.drawing.Text(words[i]));
}
layout.reflow();
return layout;
}
&lt;/script&gt;