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

Defines the fluent API for configuring ChartXAxis

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

T

Syntax:

C#
public class ChartXAxisBuilder<T> where T : class

Inheritance: objectChartXAxisBuilder<T>

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 ChartXAxisBuilder<T> class.

C#
public ChartXAxisBuilder(ChartXAxis<T> container)
Parameters:containerChartXAxis<T>

The ChartXAxis<T> container

Properties

Gets the ChartXAxis<T> container.

C#
protected ChartXAxis<T> Container { get; }

Methods

Value at which the Y axis crosses this axis. (Only for object)Value indices at which the Y axes cross the value axis. (Only for array)Date at which the Y axis crosses this axis. (Only for date)

C#
public ChartXAxisBuilder<T> AxisCrossingValue(params object[] value)
Parameters:valueobject[]

The value for AxisCrossingValue

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The background color of the axis.

C#
public ChartXAxisBuilder<T> Background(string value)
Parameters:valuestring

The value for Background

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The base time interval for the axis labels. The default baseUnit is determined automatically from the value range. Available options: milliseconds; seconds; minutes; hours; days; weeks; months or years.

C#
public ChartXAxisBuilder<T> BaseUnit(string value)
Parameters:valuestring

The value for BaseUnit

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The category names. Applicable for charts with X and Y category axes (heatmap).

C#
public ChartXAxisBuilder<T> Categories(params object[] value)
Parameters:valueobject[]

The value for Categories

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The color of the axis. Accepts a valid CSS color string, including hex and rgb.

C#
public ChartXAxisBuilder<T> Color(string value)
Parameters:valuestring

The value for Color

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The crosshair configuration options.

C#
public ChartXAxisBuilder<T> Crosshair(Action<ChartXAxisCrosshairSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartXAxisCrosshairSettingsBuilder<T>>

The ChartXAxisCrosshairSettingsBuilder<T> for the crosshair setting.

Returns:

ChartXAxisBuilder<T>

Returns the current instance of ChartXAxisBuilder<T> .

Sets the axis type to date for displaying chronological data.

C#
public ChartXAxisBuilder<T> Date()
Returns:

ChartXAxisBuilder<T>

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("chart")
.Series(series =&gt; {
series.ScatterLine(model =&gt; model.Date, model =&gt; model.Close);
})
.XAxis(axis =&gt; axis
.Date()
)
)

The axis labels configuration.

C#
public ChartXAxisBuilder<T> Labels(Action<ChartXAxisLabelsSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartXAxisLabelsSettingsBuilder<T>>

The ChartXAxisLabelsSettingsBuilder<T> for the labels setting.

Returns:

ChartXAxisBuilder<T>

Returns the current instance of ChartXAxisBuilder<T> .

The configuration of the axis lines. Also affects the major and minor ticks, but not the grid lines.

C#
public ChartXAxisBuilder<T> Line(Action<ChartXAxisLineSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartXAxisLineSettingsBuilder<T>>

The ChartXAxisLineSettingsBuilder<T> for the line setting.

Returns:

ChartXAxisBuilder<T>

Returns the current instance of ChartXAxisBuilder<T> .

Sets the axis type to logarithmic.

C#
public ChartXAxisBuilder<T> Logarithmic()
Returns:

ChartXAxisBuilder<T>

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =&gt;
{
series.Scatter(new int[][] {
new[] { 5, 2 },
new[] { 7, 2 },
new[] { 11123, 2 }
});
})
.XAxis(axis =&gt; axis
.Logarithmic()
)
)

The configuration of the major grid lines. These are the lines that are an extension of the major ticks through the body of the chart.

C#
public ChartXAxisBuilder<T> MajorGridLines(Action<ChartXAxisMajorGridLinesSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartXAxisMajorGridLinesSettingsBuilder<T>>

The ChartXAxisMajorGridLinesSettingsBuilder<T> for the majorgridlines setting.

Returns:

ChartXAxisBuilder<T>

Returns the current instance of ChartXAxisBuilder<T> .

The configuration of the scatter chart x axis major ticks.

C#
public ChartXAxisBuilder<T> MajorTicks(Action<ChartXAxisMajorTicksSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartXAxisMajorTicksSettingsBuilder<T>>

The ChartXAxisMajorTicksSettingsBuilder<T> for the majorticks setting.

Returns:

ChartXAxisBuilder<T>

Returns the current instance of ChartXAxisBuilder<T> .

The interval between major divisions. If this is a date axis the value represents the number of xAxis.baseUnits between major divisions. If the xAxis.type is set to "log", the majorUnit value will be used for the base of the logarithm.

C#
public ChartXAxisBuilder<T> MajorUnit(double value)
Parameters:valuedouble

The value for MajorUnit

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The maximum value of the axis.

C#
public ChartXAxisBuilder<T> Max(object value)
Parameters:valueobject

The value for Max

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The minimum value of the axis.

C#
public ChartXAxisBuilder<T> Min(object value)
Parameters:valueobject

The value for Min

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The configuration of the minor grid lines. These are the lines that are an extension of the minor ticks through the body of the chart.

C#
public ChartXAxisBuilder<T> MinorGridLines(Action<ChartXAxisMinorGridLinesSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartXAxisMinorGridLinesSettingsBuilder<T>>

The ChartXAxisMinorGridLinesSettingsBuilder<T> for the minorgridlines setting.

Returns:

ChartXAxisBuilder<T>

Returns the current instance of ChartXAxisBuilder<T> .

The configuration of the x axis minor ticks.

C#
public ChartXAxisBuilder<T> MinorTicks(Action<ChartXAxisMinorTicksSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartXAxisMinorTicksSettingsBuilder<T>>

The ChartXAxisMinorTicksSettingsBuilder<T> for the minorticks setting.

Returns:

ChartXAxisBuilder<T>

Returns the current instance of ChartXAxisBuilder<T> .

The interval between minor divisions. It defaults to 1/5 of the xAxis.majorUnit. If the xAxis.type is set to "log", the minorUnit value represents the number of divisions between two major units and defaults to the major unit minus one.

C#
public ChartXAxisBuilder<T> MinorUnit(double value)
Parameters:valuedouble

The value for MinorUnit

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The unique axis name. Used to associate a series with a x axis using the series.xAxis option.

C#
public ChartXAxisBuilder<T> Name(string value)
Parameters:valuestring

The value for Name

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

If set to true the chart will prevent the automatic axis range from snapping to 0. Setting it to false will force the automatic axis range to snap to 0.

C#
public ChartXAxisBuilder<T> NarrowRange()
Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

If set to true the chart will prevent the automatic axis range from snapping to 0. Setting it to false will force the automatic axis range to snap to 0.

C#
public ChartXAxisBuilder<T> NarrowRange(bool value)
Parameters:valuebool

The value for NarrowRange

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The x axis notes configuration.

C#
public ChartXAxisBuilder<T> Notes(Action<ChartXAxisNotesSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartXAxisNotesSettingsBuilder<T>>

The ChartXAxisNotesSettingsBuilder<T> for the notes setting.

Returns:

ChartXAxisBuilder<T>

Returns the current instance of ChartXAxisBuilder<T> .

Sets the axis type to numeric.

C#
public ChartXAxisBuilder<T> Numeric()
Returns:

ChartXAxisBuilder<T>

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.Series(series =&gt;
{
series.Scatter(new double[][] {
new[] { 16.4, 5.4 },
new[] { 21.7, 2 },
new[] { 25.4, 3 }
});
})
.XAxis(axis =&gt; axis
.Numeric()
)
)

The name of the pane that the axis should be rendered in. The axis will be rendered in the first (default) pane if not set.

C#
public ChartXAxisBuilder<T> Pane(string value)
Parameters:valuestring

The value for Pane

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The plot bands of the x axis.

C#
public ChartXAxisBuilder<T> PlotBands(Action<ChartXAxisPlotBandFactory<T>> configurator)
Parameters:configuratorAction<ChartXAxisPlotBandFactory<T>>

The ChartXAxisPlotBandFactory<T> for the plotbands setting.

Returns:

ChartXAxisBuilder<T>

Returns the current instance of ChartXAxisBuilder<T> .

Sets the axis type to polar.

C#
public ChartXAxisBuilder<T> Polar()
Returns:

ChartXAxisBuilder<T>

Example:
C#
@(Html.Kendo().Chart(Model)
.Name("chart")
.Series(series =&gt;
{
series.PolarLine(model =&gt; model.Azimuth, model =&gt; model.Altitude);
})
.XAxis(axis =&gt; axis
.Polar()
.StartAngle(-90)
.MajorUnit(30)
)
)

If set to true the value axis direction will be reversed. By default values increase from left to right and from bottom to top.

C#
public ChartXAxisBuilder<T> Reverse()
Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

If set to true the value axis direction will be reversed. By default values increase from left to right and from bottom to top.

C#
public ChartXAxisBuilder<T> Reverse(bool value)
Parameters:valuebool

The value for Reverse

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The angle (degrees) where the 0 value is placed. Applicable to polar series.Angles increase counterclockwise and zero is to the right. Negative values are acceptable.

C#
public ChartXAxisBuilder<T> StartAngle(double value)
Parameters:valuedouble

The value for StartAngle

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

The title configuration of the scatter chart x axis.

C#
public ChartXAxisBuilder<T> Title(Action<ChartXAxisTitleSettingsBuilder<T>> configurator)
Parameters:configuratorAction<ChartXAxisTitleSettingsBuilder<T>>

The ChartXAxisTitleSettingsBuilder<T> for the title setting.

Returns:

ChartXAxisBuilder<T>

Returns the current instance of ChartXAxisBuilder<T> .

Sets the title of the axis.

C#
public ChartXAxisBuilder<T> Title(string value)
Parameters:valuestring

The value that configures the title.

Returns:

ChartXAxisBuilder<T>

Example:
C#
@(Html.Kendo().Chart()
.Name("chart")
.XAxis(axis =&gt; axis
.Numeric()
.Title(title =&gt; title.Text("Wind Speed [km/h]"))
)
)

The axis type.The supported values are: "numeric" - numeric axis.; "date" - specialized axis for displaying chronological data. or "log" - logarithmic axis..

C#
public ChartXAxisBuilder<T> Type(string value)
Parameters:valuestring

The value for Type

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.

If set to true the chart will display the x axis. By default the x axis is visible.

C#
public ChartXAxisBuilder<T> Visible(bool value)
Parameters:valuebool

The value for Visible

Returns:

ChartXAxisBuilder<T>

Returns the current ChartXAxisBuilder<T> instance.