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

Defines the fluent interface for configuring the ChartArea.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ChartAreaBuilder

Inheritance: objectChartAreaBuilder

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 ChartAreaBuilder class.

C#
public ChartAreaBuilder(ChartArea chartArea)
Parameters:chartAreaChartArea

The chart area.

Methods

Sets the background color of the Chart area. The option accepts a valid CSS color string, including HEX and RGB.

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

The value that configures the background color.

Returns:

ChartAreaBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ChartArea(chartArea => chartArea.Background("#aa00bb"))
)

Configures the border settings of the Chart area.

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

The action that configures the border options.

Returns:

ChartAreaBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ChartArea(chartArea =&gt; chartArea.Border(border=&gt;border.Width(2).Color("green")))
)

Sets the border of the Chart area.

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

The border width in pixels.

colorstring

The border color (CSS syntax).

dashTypeChartDashType

The border dash type.

Returns:

ChartAreaBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ChartArea(chartArea =&gt; chartArea.Border(1, "#000", ChartDashType.Dot))
)

Sets the height of the Chart area. The default height is 400px.

C#
public ChartAreaBuilder Height(int height)
Parameters:heightint

The value that configures the height.

Returns:

ChartAreaBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ChartArea(chartArea =&gt; chartArea.Height(200))
)

Sets the margin of the Chart area.

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

The value that sets the top margin.

rightint

The value that sets the right margin.

bottomint

The value that sets the bottom margin.

leftint

TThe value that sets the left margin.

Returns:

ChartAreaBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ChartArea(chartArea =&gt; chartArea.Margin(0, 5, 5, 0))
)

Sets the margin of the Chart area. The specified value will be applied to all margins.

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

The value that configures the margins.

Returns:

ChartAreaBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ChartArea(chartArea =&gt; chartArea.Margin(5))
)

Sets the width of the Chart area. The default width is 600px.

C#
public ChartAreaBuilder Width(int width)
Parameters:widthint

The value that configures the width.

Returns:

ChartAreaBuilder

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ChartArea(chartArea =&gt; chartArea.Width(600))
)