Kendo.Mvc.UI.Fluent.ChartLegendBuilder
Defines the fluent interface for configuring the ChartLegend.
Methods
Font(System.String)
Sets the legend labels font
Parameters
font System.String
The legend labels font (CSS format).
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Font("16px Arial,Helvetica,sans-serif"))
)
Color(System.String)
Sets the legend labels color
Parameters
color System.String
The labels color (CSS format).
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Color("red"))
)
Background(System.String)
Sets the legend background color
Parameters
background System.String
The background color.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Background("red"))
)
Position(Kendo.Mvc.UI.ChartLegendPosition)
Sets the legend position
Parameters
position Kendo.Mvc.UI.ChartLegendPosition
The legend position.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Position(ChartLegendPosition.Bottom))
)
Visible(System.Boolean)
Sets the legend visibility
Parameters
visible System.Boolean
The legend visibility.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Visible(false))
)
Offset(System.Int32,System.Int32)
Sets the legend X and Y offset from its position
Parameters
offsetX System.Int32
The legend X offset from its position.
offsetY System.Int32
The legend Y offset from its position.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Offset(10, 50))
)
Margin(System.Int32,System.Int32,System.Int32,System.Int32)
Sets the legend margin
Parameters
top System.Int32
The legend top margin.
right System.Int32
The legend right margin.
bottom System.Int32
The legend bottom margin.
left System.Int32
The legend top margin.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Margin(0, 5, 5, 0))
)
Margin(System.Int32)
Sets the legend margin
Parameters
margin System.Int32
The legend margin.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Margin(20))
)
Padding(System.Int32,System.Int32,System.Int32,System.Int32)
Sets the legend padding
Parameters
top System.Int32
The legend top padding.
right System.Int32
The legend right padding.
bottom System.Int32
The legend bottom padding.
left System.Int32
The legend left padding.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Padding(0, 5, 5, 0))
)
Padding(System.Int32)
Sets the legend padding
Parameters
padding System.Int32
The legend padding.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Padding(20))
)
Border(System.Int32,System.String,Kendo.Mvc.UI.ChartDashType)
Sets the legend border
Parameters
width System.Int32
The legend border width.
color System.String
The legend border color (CSS syntax).
dashType Kendo.Mvc.UI.ChartDashType
The legend border dash type.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Border(1, "#000", ChartDashType.Dot))
)
Border(System.Action<Kendo.Mvc.UI.Fluent.ChartBorderBuilder>)
Configures the legend border
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartBorderBuilder>
The border configuration action
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Border(border => border.Width(2).Color("black")))
)
Labels(System.Action<Kendo.Mvc.UI.Fluent.ChartLegendLabelsBuilder>)
Configures the legend labels
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartLegendLabelsBuilder>
The labels configuration action
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Labels(labels => labels.Font("14px Arial,Helvetica,sans-serif")))
)
Orientation(Kendo.Mvc.UI.ChartLegendOrientation)
Sets the legend orientation
Parameters
orientation Kendo.Mvc.UI.ChartLegendOrientation
The legend orientation.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Orientation(ChartLegendOrientation.Vertical))
)
Width(System.Int32)
Sets the legend width
Parameters
width System.Int32
The legend width.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Width(100))
)
Height(System.Int32)
Sets the legend height
Parameters
height System.Int32
The legend height.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Height(100))
)
Reverse(System.Boolean)
Reverses the order of the legend items
Parameters
reverse System.Boolean
True if the items should be reversed; false otherwise.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Reverse(true))
)
Item(System.Action<Kendo.Mvc.UI.Fluent.ChartLegendItemBuilder>)
Configures the legend item
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartLegendItemBuilder>
The legend item configuration action
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Item(item => item.Cursor("pointer")))
)
Align(Kendo.Mvc.UI.ChartLegendAlign)
Sets the legend align option
Parameters
align Kendo.Mvc.UI.ChartLegendAlign
The legend align option.
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Align(ChartLegendAlign.Start))
)
Spacing(System.Double)
The spacing between the labels in pixels when the legend.orientation is "horizontal".
Parameters
value System.Double
The value for Spacing
Example (ASPX)
@(Html.Kendo().Chart()
.Name("Chart")
.Legend(legend => legend.Spacing(30))
)
Title(System.Action<Kendo.Mvc.UI.Fluent.ChartTitleBuilder>)
The legend title configuration options.
Parameters
configurator System.Action<Kendo.Mvc.UI.Fluent.ChartTitleBuilder>
The configurator for the title setting.