New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Axes Configuration

This help article will tell you which properties to set for the axes of the different ASP.NET AJAX Chart series. The axes are child elements of the PlotArea element of the RadHtmlChart. Both the X and Y axes have a common set of properties and inner tags. The major difference is that in most cases, the x-axis requires a set of items while the y-axis requires a numerical value. The exceptions are PieSeries, DonutSeries and FunnelSeries where there are no axes, and ScatterSeries, ScatterLineSeries and BubbleSeries where the x-axis is also numerical.

As of the Q3 2012 release, you can declare multiple y-axes in the AdditionalYAxes tag inside PlotArea. These additional axes have the same configuration options as the main YAxis. Each series offers the AxisName property which corresponds to the Name property of the additional axis used by the series.

Attribute Properties in the [Axis] Tag

You can find samples implementing the below described properties in the following resources:

NameDescription
AxisCrossingValueSets the value of this axis where the other axis will cross it. For a numerical x-axis, i.e., ScatterSeries and ScatterLineSeries and the y-axis, this is the numerical value where the axes cross. For a category axis (e.g., like most cases for the x-axis) this is the item index where the axes cross.
AxisCrossingPointsA collection that holds the AxisCrossingPoint objects. They are used to rearrange the position of the main and the additional y-axes of the chart. This collection is available only in the XAxis inner tag of the PlotArea.
ColorThe color of the axis line. It can take a common color name or a hex value (e.g., "red", "#ff0000") when set in the markup and a value of type System.Drawing.Color when set in the code behind.
BaseUnitControls the scale of the axis (the time intervals through which a label is placed on the date axis). The available options are "auto" , "years" , "months" , "weeks" , "days" , "hours" , "minutes" and "seconds" .
DataLabelsFieldThe field from the data source where the string for the label is stored. This information is used for the DataFormatString property of the labels and tooltips via the {0} placeholder as well as templates via the #=category# field. This property is meaningful for the x-axis only, because the y-axis is always numerical and adjusts its range according to the values the series have. The nearest equivalent is setting the MinValue and MaxValue for the y-axis depending on your data source.
JustifiedApplicable for a categorical x-axis. Defines whether the axis categories and series points will be positioned on major ticks. When set to true, removes the empty space before and after the series. This option is ignored if the series are of type "bar", "column", "boxPlot", "ohlc", "candlestick" or "waterfall". The default value is unset to preserve the default behavior of different series - it defaults to false for most series, but defaults to true for "area", "verticalArea", "rangeArea" and "verticalRangeArea".
MajorTickSizeThe size of the ticks that mark the major grid lines.
MajorTickTypeThe type of the ticks that mark the major grid lines. An enumeration that is either None or Outside .
MaxDateValueThe last date displayed on the category date axis (i.e., area, bar, column, line, etc., series). The default value is the date from the last category.
MaxValueThe maximal numerical value of the axis. The property takes effect only for a numerical axis. Chosen by the control according to the data if not set explicitly.
MinDateValueThe first date displayed on the category date axis (i.e., area, bar, column, line, etc., series). The default value is the date from the first category.
MinorTickSizeThe size of the ticks that mark the minor grid lines.
MinorTickTypeThe type of the ticks that mark the minor grid lines. An enumeration that is either None or Outside .
MinValueThe minimal numerical value of the axis. The property takes effect only for a numerical axis. Chosen by the control according to the data if not set explicitly.
NameThe Name of the y-axis that can be used in the AxisName property of each series to indicate which y-axis will be used by the particular series. Applicable when multiple y-axes are used. Can be left blank for the default y-axis.
NarrowRangeA boolean property that indicates whether the automatic y-axis range snapping to 0 will be prevented.
ReversedDetermines whether the axis will be reversed (i.e., the low values in the place of the high values).
StartAnglePolarAreaSeries , PolarLineSeries and PolarScatterSeries - The angle (degrees) where the 0 value is placed. Angles increase counter clockwise and zero is to the right. Negative values are acceptable. Default value is 90. RadarAreaSeries , RadarColumnSeries and RadarLineSeries - The angle (degrees) of the first category on the axis. Angles increase clockwise and zero is to the left. Negative values are acceptable. Default value is 0.
StepThe step through which major grid lines and axis labels are placed. Chosen by the control according to the data if not set explicitly. Applicable for numeric axes only.
TypeControls the type of the axis. Detailed information on the supported values for the x-axis/y-axis in numeric and category series is available in List 1 and List 2 below.
VisibleWhether to render the axis. True or False .
WidthSets the width of the axis line in pixels.

List 1: YAxis.Type property values.

  • Numeric - Sets a linear scale for the axis. Applicable for numeric and category series.

  • Log - Sets a logarithmic scale for the axis. See Logarithmic Axis help article for details. Applicable for numeric and category series.

List 2: XAxis.Type property values.

  • Auto - Automatically detects the type of the axis. Applicable for numeric and category series.

  • Category - Used for displaying discrete data. See Date Axis help article for details. Applicable for category series.

  • Date - Used for displaying chronological data. See Date Axis help article for details. Applicable for category series.

  • Log - Sets a logarithmic scale for the axis. See Logarithmic Axis help article for details. Applicable for numeric series.

Attribute Properties in [Axis] > LabelsAppearance

You can find samples implementing the below described properties in the following resources:

NameDescription
DataFormatStringThe format string that will form the labels' text. The {0} placeholder is used to denote the value of the tick.
MirrorA boolean property that indicates whether axes labels, ticks and title will be mirrored. Default value is false.
PositionThe position of the axis labels with relation to the current axis and the crossing axis. See List 3 below for possible values and details.
RotationAngleThe angle that is used for rotating the label. The zero mark is vertical and the positive direction is clockwise.
SkipThe number of axes labels to be skipped.
StepThe rendering step for axes labels - render every n-th label.
VisibleSpecifies whether the labels are rendered. True or False .

List 3: [Axis].LabelsAppearance.Position property values (Telerik.Web.UI.HtmlChart.AxisLabelPosition enum).

  • OnAxis - the default value, the labels are rendered next to the axis.

  • Start - the labels are rendered at the beginning of the crossing axis. For example, the x-axis labels will be rendered at the bottom (or the left) of the chart, depending on the chart type. Reverses when the crossing axis is Reversed.

  • End - the labels are rendered at the end of the crossing axis. For example, the x-axis labels will be rendered at the top (or the right) of the chart, depending on the chart type. Reverses when the crossing axis is Reversed.

Attribute Properties in [Axis] > LabelsAppearance > TextStyle

You can find samples implementing the below described properties in the following resources:

NameDescription
BoldSpecifies whether the font of the labels' text is bold. True or False .
ColorSpecifies the color of the labels' text. It can take a common color name or a hex value (e.g., "red", "#ff0000") when set in the markup and a value of type System.Drawing.Color when set in the code behind.
FontFamilySpecifies the font family of the labels' text. Takes a string with the font family name.
FontSizeSpecifies the font size of the labels' text. Takes the size in pixels.
ItalicSpecifies whether the font of the labels' text is italic. True or False .
MarginSpecifies the margin of the labels' text. Takes the margin value in pixels.
PaddingSpecifies the padding of the labels' text. Takes the padding value in pixels.

Attribute Properties in [Axis] > LabelsAppearance > DateFormats

You can find samples implementing the below described properties in the following resources:

NameDescription
SecondsFormatThe date format string that will be used for the x-axis labels when the x-axis' BaseUnit property is set to "Seconds".
MinutesFormatThe date format string that will be used for the x-axis labels when the x-axis' BaseUnit property is set to "Minutes".
HoursFormatThe date format string that will be used for the x-axis labels when the x-axis' BaseUnit property is set to "Hours".
DaysFormatThe date format string that will be used for the x-axis labels when the x-axis' BaseUnit property is set to "Days".
WeeksFormatThe date format string that will be used for the x-axis labels when the x-axis' BaseUnit property is set to "Weeks".
MonthsFormatThe date format string that will be used for the x-axis labels when the x-axis' BaseUnit property is set to "Months".
YearsFormatThe date format string that will be used for the x-axis labels when the x-axis' BaseUnit property is set to "Years".

Attribute Properties in [Axis] > MajorGridLines and in [Axis] > MinorGridLines

NameDescription
ColorThe color for the grid lines. It can take a common color name or a hex value (e.g., "red", "#ff0000") when set in the markup and a value of type System.Drawing.Color when set in the code behind.
DashTypeSets the dash type of the grid lines. An enumeration (Telerik.Web.UI.HtmlChart.Enums.DashType) with the following values: Dash , DashDot , Dot , LongDash, LongDashDot, LongDashDotDot, Solid .
VisibleSets whether to render the grid lines. True or False
WidthThe width of the grid line in pixels.
StepDefines every n-th axis grid line will be rendered.
SkipDefines the first n axis grid lines that will not be displayed.

Attribute Properties in [Axis] > PlotBands > PlotBand

You can find samples implementing the below described properties in the following resources:

NameDescription
AlphaGets or Sets the Alpha value of the color filling the PlotBand. Uses values of type byte .
ColorGets or Sets the color filling the PlotBand. It can take a common color name or a hex value (e.g., "red", "#ff0000") when set in the markup and a value of type System.Drawing.Color when set in the code behind.
FromGets or Sets the PlotBand's starting point. Takes a decimal with the value of the starting point.
FromDateGets or Sets the PlotBand's starting date for use with a date axis. Takes a DateTime object and serializes its individual values without converting. Available as of R1 2019.
ToGets or Sets the PlotBand's ending point. Takes a decimal with the value of the ending point.
ToDateGets or Sets the PlotBand's ending date for use with a date axis. Takes a DateTime object and serializes its individual values without converting. Available as of R1 2019.

Attribute Properties in [Axis] > TitleAppearance

You can find samples implementing the below described properties in the following resources:

NameDescription
PositionChooses the position where the title of the axis is shown. An enumeration (Telerik.Web.UI.HtmlChart.AxisTitlePosition) with the following values: Bottom, Center, Left, Right, Top where Top and Bottom are applicable only for the vertical axis while Left and Right are applicable for the horizontal axis only. The Center option is available for both axes.
RotationAngleThe angle that is used for rotating the title of the axis. The zero mark is horizontal for the x-axis and vertical with reading order from bottom to top for the y-axis. The positive direction is clockwise.
TextThe string that is displayed as an axis title.
VisibleSets whether the axis title is rendered. True or False .

Attribute Properties in [Axis] > TitleAppearance > TextStyle

See this article for more information on text styles.

NameDescription
BoldSpecifies whether the font of the axis title's text is bold. True or False .
ColorSpecifies the color of the axis title's text. It can take a common color name or a hex value (e.g., "red", "#ff0000") when set in the markup and a value of type System.Drawing.Color when set in the code behind.
FontFamilySpecifies the font family of the axis title's text. Takes a string with the font family name.
FontSizeSpecifies the font size of the axis title's text. Takes the size in pixels.
ItalicSpecifies whether the font of the axis title's text is italic. True or False .
MarginSpecifies the margin of the axis title's text. Takes the margin value in pixels.
PaddingSpecifies the padding of the axis title's text. Takes the padding value in pixels.

See Also