ChartAxisTitleBuilder
Methods
Text(System.String)
Sets the axis title text.
Parameters
text - System.String
The value that sets the title text.
Example
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis => axis
.Title(title => title
.Text("Axis")
)
)
)
Font(System.String)
Sets the font of the axis title.
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 background color of the axis title.
Parameters
background - System.String
The background color value.
Example
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis => axis
.Title(title => title
.Background("red")
)
)
)
Color(System.String)
Sets the text color of the axis title.
Parameters
color - System.String
The value that sets the color.
Example
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis => axis
.Title(title => title
.Color("red")
)
)
)
Position(Kendo.Mvc.UI.ChartAxisTitlePosition)
Sets the position of the axis title.
Parameters
position - ChartAxisTitlePosition
The enum value that sets the 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 margin of the axis title.
Parameters
top - System.Int32
The top margin.
right - System.Int32
The right margin.
bottom - System.Int32
The bottom margin.
left - System.Int32
The left margin.
Example
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis => axis
.Title(title => title
.Margin(20, 20, 20, 20)
)
)
)
Margin(System.Int32)
Sets all margins of the axis title.
Parameters
margin - System.Int32
The value that configures the 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 padding of the axis title.
Parameters
top - System.Int32
The top padding.
right - System.Int32
The right padding.
bottom - System.Int32
The bottom padding.
left - System.Int32
The left padding.
Example
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis => axis
.Title(title => title
.Padding(20, 20, 20, 20)
)
)
)
Padding(System.Int32)
Sets all paddings of the axis title.
Parameters
padding - System.Int32
The value that sets the padding.
Example
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis => axis
.Title(title => title
.Padding(20)
)
)
)
Rotation(System.Double)
Sets the rotation angle of the axis title.
Parameters
rotation - System.Double
The value that configures the rotation angle.
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 border of the axis title.
Parameters
width - System.Int32
The border width.
color - System.String
The border color.
dashType - ChartDashType
The border dash type.
Example
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis => axis
.Title(title => title.Border(1, "#000", ChartDashType.Dot))
)
)
Border(System.Action)
Configures the border of the title.
Parameters
configurator - System.Action<ChartBorderBuilder>
The action that configures the border settings.
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 visibility of the axis title.
Parameters
visible - System.Boolean
The value that toggles the visibility of the title.
Example
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis => axis
.Title(title => title.Text("Names").Visible(false))
)
)
Visual(System.Func)
Defines a handler that renders the axis title.
Parameters
visualFunction - System.Func<Object,Object>
The handler code wrapped in a text tag (Razor syntax).
Example
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis => axis
.Title(title => title.Visual(@<text>
function(e) {
// Return the title layout.
}
</text>)
)
)
Visual(System.String)
Sets a JavaScript function that renders 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>