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

Configures the category axis for the Chart<T>.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

TModel

The type of the data item to which the chart is bound to

Syntax:

C#
public class ChartCategoryAxisBuilder<TModel> : ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>> where TModel : class

Inheritance: objectChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>ChartCategoryAxisBuilder<TModel>

Inherited Members ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.MajorTicks(Action<ChartAxisTicksBuilder>)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Crosshair(Action<ChartAxisCrosshairBuilder>)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Name(string)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.MinorTicks(Action<ChartAxisTicksBuilder>)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.MajorGridLines(Action<ChartMajorGridLinesBuilder>)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.MajorGridLines(int, string, ChartDashType)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.MinorGridLines(Action<ChartMinorGridLinesBuilder>)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.MinorGridLines(int, string, ChartDashType)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Line(Action<ChartLineBuilder>)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Line(int, string, ChartDashType)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Labels(Action<ChartAxisLabelsBuilder>)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Labels(bool)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.PlotBands(Action<ChartAxisPlotBandsFactory<IChartCategoryAxis, int>>)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Title(Action<ChartAxisTitleBuilder>)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Title(string)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Pane(string)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Color(string)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Reverse(bool)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Reverse()ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Visible(bool)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.NarrowRange(bool)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Background(string)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.RangeLabels(Action<ChartAxisRangeLabelsBuilder>)ChartAxisBuilderBase<IChartCategoryAxis, int, ChartCategoryAxisBuilder<TModel>>.Axisobject.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 ChartCategoryAxisBuilder<TModel> class.

C#
public ChartCategoryAxisBuilder(Chart<TModel> chart, IChartCategoryAxis axis)
Parameters:chartChart<TModel>

The chart.

axisIChartCategoryAxis

The category axis.

Properties

The parent Chart

C#
public Chart<TModel> Container { get; }

Methods

Sets value at which the first perpendicular axis crosses this axis.

C#
public ChartCategoryAxisBuilder<TModel> AxisCrossingValue(double axisCrossingValue)
Parameters:axisCrossingValuedouble

The value at which the first perpendicular axis crosses this axis.

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.CategoryAxis(axis =&gt; axis.AxisCrossingValue(4))
.ValueAxis(axis =&gt; axis.Numeric().Title("Axis 1"))
.ValueAxis(axis =&gt; axis.Numeric("secondary").Title("Axis 2"))
)

Sets value at which perpendicular axes cross this axis.

C#
public ChartCategoryAxisBuilder<TModel> AxisCrossingValue(IEnumerable<double> axisCrossingValues)
Parameters:axisCrossingValuesIEnumerable<double>

The values at which perpendicular axes cross this axis.

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.CategoryAxis(axis =&gt; axis.AxisCrossingValue(new double[] { 0, 10 }))
.ValueAxis(axis =&gt; axis.Numeric().Title("Axis 1"))
.ValueAxis(axis =&gt; axis.Numeric("secondary").Title("Axis 2"))
)

Sets value at which perpendicular axes cross this axis.

C#
public ChartCategoryAxisBuilder<TModel> AxisCrossingValue(params double[] axisCrossingValues)
Parameters:axisCrossingValuesdouble[]

The values at which perpendicular axes cross this axis.

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.CategoryAxis(axis =&gt; axis.AxisCrossingValue(0, 10))
.ValueAxis(axis =&gt; axis.Numeric().Title("Axis 1"))
.ValueAxis(axis =&gt; axis.Numeric("secondary").Title("Axis 2"))
)

Defines categories.

C#
public ChartCategoryAxisBuilder<TModel> Categories(IEnumerable categories)
Parameters:categoriesIEnumerable

The list of categories

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.CategoryAxis(axis =&gt; axis
.Categories(Model.Categories)
)
)

Defines categories.

C#
public ChartCategoryAxisBuilder<TModel> Categories(params string[] categories)
Parameters:categoriesstring[]

The list of categories

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("chart")
.Series(series =&gt;
{
series.Column(new double[] { 1.988, 2.733, 3.994 }).Name("World");
})
.CategoryAxis(axis =&gt; axis
.Categories("2002", "2003", "2004")
)
)

Defines bound categories.

C#
public ChartCategoryAxisBuilder<TModel> Categories<TValue>(Expression<Func<TModel, TValue>> expression)
Parameters:expressionExpression<Func<TModel, TValue>>

The expression used to extract the categories value from the chart model

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("chart")
.Series(series =&gt;
{
series.Column(model =&gt; model.Value, model =&gt; model.UserColor);
})
.CategoryAxis(axis =&gt; axis
.Categories(model =&gt; model.Day)
)
)

Creates a Date category axis.

C#
public ChartDateCategoryAxisBuilder<TModel> Date()
Returns:

ChartDateCategoryAxisBuilder<TModel>

The highlight configuration options for the category axis.

C#
public ChartCategoryAxisBuilder<TModel> Highlight(Action<ChartCategoryAxisHighlightSettingsBuilder<TModel>> configurator)
Parameters:configuratorAction<ChartCategoryAxisHighlightSettingsBuilder<TModel>>

The ChartCategoryAxisHighlightSettingsBuilder<T> for the highlight setting.

Returns:

ChartCategoryAxisBuilder<TModel>

Returns the current instance of ChartCategoryAxisBuilder<TModel> .

Positions categories and series points on major ticks. This removes the empty space before and after the series. This option will be ignored if either Bar, Column, OHLC or Candlestick series are plotted on the axis.

C#
public ChartCategoryAxisBuilder<TModel> Justify()
Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis =&gt; axis.Justify())
)

Positions categories and series points on major ticks. This removes the empty space before and after the series. This option will be ignored if either Bar, Column, OHLC or Candlestick series are plotted on the axis.

C#
public ChartCategoryAxisBuilder<TModel> Justify(bool justified)
Parameters:justifiedbool

A boolean value that indicates if the empty space before and after the series should be removed. The default value is false.

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis =&gt; axis.Justify(true))
)

Sets the maximum value.

C#
public ChartCategoryAxisBuilder<TModel> Max(double value)
Parameters:valuedouble

The maximum value of the axis.

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis =&gt; axis
.Categories("2002", "2003", "2004", "2005", "2006").Max(5)
)
)

The maximum number of ticks and labels to display.

C#
public ChartCategoryAxisBuilder<TModel> MaxDivisions(double value)
Parameters:valuedouble

The value for MaxDivisions

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis =&gt; axis
.Categories("2002", "2003", "2004", "2005", "2006").MaxDivisions(5)
)
)

Sets the minimum value.

C#
public ChartCategoryAxisBuilder<TModel> Min(double value)
Parameters:valuedouble

The minimum value of the axis.

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis =&gt; axis
.Categories("2002", "2003", "2004", "2005", "2006").Min(2)
)
)

Defines the items.

C#
public ChartCategoryAxisBuilder<TModel> Notes(Action<ChartAxisNotesBuilder> configurator)
Parameters:configuratorAction<ChartAxisNotesBuilder>

The items of the notes.

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart()
.Name("Chart")
.ValueAxis(a =&gt; a.Numeric()
.Note(note =&gt; note
.Data(data =&gt;
{
data.Add().Value(1);
data.Add().Value(2);
})
)
)
)

Configures the selection

C#
public ChartCategoryAxisBuilder<TModel> Select(Action<ChartAxisSelectionBuilder> configurator)
Parameters:configuratorAction<ChartAxisSelectionBuilder>

The configuration action.

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("StockChart")
.CategoryAxis(axis =&gt; axis.Select(select =&gt;
select.Mousewheel(mw =&gt; mw.Reverse())
))
)

Sets the selection range

C#
public ChartCategoryAxisBuilder<TModel> Select(double from, double to)
Parameters:fromdouble

The selection range start.

todouble

The selection range end. Note: The category with the specified index is not included in the selected range unless the axis is justified. In order to select all categories specify a value larger than the last category index.

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("Chart")
.CategoryAxis(axis =&gt; axis.Select(0, 3))
)

Overrides the category axis type.

C#
public ChartCategoryAxisBuilder<TModel> Type(ChartCategoryAxisType type)
Parameters:typeChartCategoryAxisType

The axis type. The default is determined by the category items type.

Returns:

ChartCategoryAxisBuilder<TModel>

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.CategoryAxis(axis =&gt; axis.Type(ChartCategoryAxisType.Date))
)