Class ChartAxisBuilder
Inheritance
System.Object
Syncfusion.EJ2.ControlBuilder
ChartAxisBuilder
Assembly: Syncfusion.EJ2.dll
Syntax
public class ChartAxisBuilder : ControlBuilder
Constructors
ChartAxisBuilder()
Declaration
public ChartAxisBuilder()
ChartAxisBuilder(ChartAxis)
Declaration
public ChartAxisBuilder(ChartAxis model)
Parameters
ChartAxisBuilder(List<ChartAxis>)
Declaration
public ChartAxisBuilder(List<ChartAxis> collection)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<ChartAxis> |
collection |
|
Methods
Add()
Declaration
Border(ChartLabelBorder)
Configures the appearance of the border around multi-level labels, including the color, width, and type of the border.
Declaration
public ChartAxisBuilder Border(ChartLabelBorder border)
Parameters
Returns
Border(Action<ChartLabelBorderBuilder>)
Declaration
public ChartAxisBuilder Border(Action<ChartLabelBorderBuilder> border)
Parameters
Returns
Coefficient(Double)
The coefficient
value adjusts the size of the polar radar chart's radius. A higher value increases the radius size, while a smaller value decreases it.
Declaration
public ChartAxisBuilder Coefficient(double coefficient)
Parameters
Type |
Name |
Description |
System.Double |
coefficient |
|
Returns
ColumnIndex(Double)
Specifies the index of the column where the axis is associated when the chart area is divided into multiple plot areas using columns
.
Declaration
public ChartAxisBuilder ColumnIndex(double columnIndex)
Parameters
Type |
Name |
Description |
System.Double |
columnIndex |
|
Returns
CrossesAt(Object)
Specifies the value at which the axis line intersects with the vertical axis or vice versa.
Declaration
public ChartAxisBuilder CrossesAt(object crossesAt)
Parameters
Type |
Name |
Description |
System.Object |
crossesAt |
|
Returns
CrossesInAxis(String)
Specifies the name of the axis with which the axis line should intersect.
Declaration
public ChartAxisBuilder CrossesInAxis(string crossesInAxis)
Parameters
Type |
Name |
Description |
System.String |
crossesInAxis |
|
Returns
Options to customize the appearance and behavior of the crosshair tooltip that appears when hovering over the chart.
Declaration
public ChartAxisBuilder CrosshairTooltip(ChartCrosshairTooltip crosshairTooltip)
Parameters
Returns
Declaration
public ChartAxisBuilder CrosshairTooltip(Action<ChartCrosshairTooltipBuilder> crosshairTooltip)
Parameters
Returns
Description(String)
A description for the axis that provides additional information about its content for screen readers.
Declaration
public ChartAxisBuilder Description(string description)
Parameters
Type |
Name |
Description |
System.String |
description |
|
Returns
DesiredIntervals(Double)
The desiredIntervals
property allows the axis to calculate intervals that are roughly equal to the specified number, promoting a more readable and evenly spaced axis.
Declaration
public ChartAxisBuilder DesiredIntervals(double desiredIntervals)
Parameters
Type |
Name |
Description |
System.Double |
desiredIntervals |
|
Returns
EdgeLabelPlacement(EdgeLabelPlacement)
The edgeLabelPlacement
property ensures that labels positioned at the edges of the axis do not overlap with the axis boundaries or other chart elements, offering several options to improve chart readability by managing edge labels effectively.
Available options are:
None: No action will be performed on edge labels.
Hide: Edge labels will be hidden to prevent overlap.
Shift: Edge labels will be shifted to fit within the axis bounds without overlapping.
Declaration
public ChartAxisBuilder EdgeLabelPlacement(EdgeLabelPlacement edgeLabelPlacement)
Parameters
Returns
EnableAutoIntervalOnZooming(Boolean)
If set to true, the axis interval will be calculated automatically based on the zoomed range.
Declaration
public ChartAxisBuilder EnableAutoIntervalOnZooming(bool enableAutoIntervalOnZooming)
Parameters
Type |
Name |
Description |
System.Boolean |
enableAutoIntervalOnZooming |
|
Returns
If set to true, a scrollbar will appear while zooming to help navigate through the zoomed content.
Declaration
public ChartAxisBuilder EnableScrollbarOnZooming(bool enableScrollbarOnZooming)
Parameters
Type |
Name |
Description |
System.Boolean |
enableScrollbarOnZooming |
|
Returns
EnableTrim(Boolean)
If set to true, axis labels will be trimmed based on the maximumLabelWidth
.
Declaration
public ChartAxisBuilder EnableTrim(bool enableTrim)
Parameters
Type |
Name |
Description |
System.Boolean |
enableTrim |
|
Returns
Interval(Double)
Specifies the interval for the axis.
Declaration
public ChartAxisBuilder Interval(double interval)
Parameters
Type |
Name |
Description |
System.Double |
interval |
|
Returns
IntervalType(IntervalType)
The intervalType
property defines how the intervals on a date-time axis are calculated and displayed.
Available options are:
Auto: Automatically determines the interval type based on the data and chart settings.
Years: Sets the interval of the axis in years.
Months: Sets the interval of the axis in months.
Days: Sets the interval of the axis in days.
Hours: Sets the interval of the axis in hours.
Minutes: Sets the interval of the axis in minutes.
Declaration
public ChartAxisBuilder IntervalType(IntervalType intervalType)
Parameters
Returns
IsIndexed(Boolean)
If set to true, data points are rendered based on their index.
Declaration
public ChartAxisBuilder IsIndexed(bool isIndexed)
Parameters
Type |
Name |
Description |
System.Boolean |
isIndexed |
|
Returns
IsInversed(Boolean)
If set to true, the axis will be rendered in an inversed manner.
Declaration
public ChartAxisBuilder IsInversed(bool isInversed)
Parameters
Type |
Name |
Description |
System.Boolean |
isInversed |
|
Returns
Used to format the axis label. This property accepts global string formats such as C
, n1
, P
, etc.
It also accepts placeholders like {value}°C
, where {value}
represents the axis label (e.g., 20°C).
Declaration
public ChartAxisBuilder LabelFormat(string labelFormat)
Parameters
Type |
Name |
Description |
System.String |
labelFormat |
|
Returns
LabelIntersectAction(LabelIntersectAction)
Specifies the action to take when axis labels intersect with each other.
The available options are:
None: Shows all labels without any modification.
Hide: Hides the label if it intersects with another label.
Trim: Trims the label text to fit within the available space.
Wrap: Wraps the label text to fit within the available space.
MultipleRows: Displays the label text in multiple rows to avoid intersection.
Rotate45: Rotates the label text by 45 degrees to avoid intersection.
Rotate90: Rotates the label text by 90 degrees to avoid intersection.
Declaration
public ChartAxisBuilder LabelIntersectAction(LabelIntersectAction labelIntersectAction)
Parameters
Returns
LabelPadding(Double)
The labelPadding
property adjusts the distance to ensure a clear space between the axis labels and the axis line.
Declaration
public ChartAxisBuilder LabelPadding(double labelPadding)
Parameters
Type |
Name |
Description |
System.Double |
labelPadding |
|
Returns
LabelPlacement(LabelPlacement)
The labelPlacement
property controls where the category axis labels are rendered in relation to the axis ticks.
Available options are:
BetweenTicks: Renders the label between the axis ticks.
OnTicks: Renders the label directly on the axis ticks.
Declaration
public ChartAxisBuilder LabelPlacement(LabelPlacement labelPlacement)
Parameters
Returns
LabelPosition(AxisPosition)
The labelPosition
property determines where the axis labels are rendered in relation to the axis line.
Available options are:
Inside: Renders the labels inside the axis line.
Outside: Renders the labels outside the axis line.
Declaration
public ChartAxisBuilder LabelPosition(AxisPosition labelPosition)
Parameters
Returns
LabelRotation(Double)
The angle to which the axis label gets rotated.
Declaration
public ChartAxisBuilder LabelRotation(double labelRotation)
Parameters
Type |
Name |
Description |
System.Double |
labelRotation |
|
Returns
LabelStyle(ChartFont)
This property allows defining various font settings to control how the labels are displayed on the axis.
Declaration
public ChartAxisBuilder LabelStyle(ChartFont labelStyle)
Parameters
Returns
LabelStyle(Action<ChartFontBuilder>)
Declaration
public ChartAxisBuilder LabelStyle(Action<ChartFontBuilder> labelStyle)
Parameters
Returns
LineBreakAlignment(TextAlignment)
Determines the alignment of labels when a line break occurs in the axis labels.
Declaration
public ChartAxisBuilder LineBreakAlignment(TextAlignment lineBreakAlignment)
Parameters
Returns
LineStyle(ChartAxisLine)
Options for customizing the axis lines.
Declaration
public ChartAxisBuilder LineStyle(ChartAxisLine lineStyle)
Parameters
Returns
LineStyle(Action<ChartAxisLineBuilder>)
Declaration
public ChartAxisBuilder LineStyle(Action<ChartAxisLineBuilder> lineStyle)
Parameters
Returns
LogBase(Double)
Specifies the base value for a logarithmic axis.
Note that valueType
must be set to Logarithmic
for this feature to work.
Declaration
public ChartAxisBuilder LogBase(double logBase)
Parameters
Type |
Name |
Description |
System.Double |
logBase |
|
Returns
MajorGridLines(ChartMajorGridLines)
Options for customizing major grid lines on the axis.
Declaration
public ChartAxisBuilder MajorGridLines(ChartMajorGridLines majorGridLines)
Parameters
Returns
MajorGridLines(Action<ChartMajorGridLinesBuilder>)
Declaration
public ChartAxisBuilder MajorGridLines(Action<ChartMajorGridLinesBuilder> majorGridLines)
Parameters
Returns
MajorTickLines(ChartMajorTickLines)
Options for customizing major tick lines on the axis.
Declaration
public ChartAxisBuilder MajorTickLines(ChartMajorTickLines majorTickLines)
Parameters
Returns
MajorTickLines(Action<ChartMajorTickLinesBuilder>)
Declaration
public ChartAxisBuilder MajorTickLines(Action<ChartMajorTickLinesBuilder> majorTickLines)
Parameters
Returns
Maximum(Object)
Specifies the maximum value of the axis range, which sets the upper bound of the axis and defines the largest value displayed on the chart, helping to control the visible range of data.
Declaration
public ChartAxisBuilder Maximum(object maximum)
Parameters
Type |
Name |
Description |
System.Object |
maximum |
|
Returns
MaximumLabels(Double)
Specifies the maximum number of labels per 100 pixels relative to the axis length.
Declaration
public ChartAxisBuilder MaximumLabels(double maximumLabels)
Parameters
Type |
Name |
Description |
System.Double |
maximumLabels |
|
Returns
MaximumLabelWidth(Double)
Specifies the maximum width of an axis label.
Declaration
public ChartAxisBuilder MaximumLabelWidth(double maximumLabelWidth)
Parameters
Type |
Name |
Description |
System.Double |
maximumLabelWidth |
|
Returns
Minimum(Object)
Specifies the minimum value of the axis range, which sets the lower bound of the axis and defines the smallest value that will be displayed on the chart to control the visible range of data.
Declaration
public ChartAxisBuilder Minimum(object minimum)
Parameters
Type |
Name |
Description |
System.Object |
minimum |
|
Returns
MinorGridLines(ChartMinorGridLines)
Options for customizing minor grid lines on the axis.
Declaration
public ChartAxisBuilder MinorGridLines(ChartMinorGridLines minorGridLines)
Parameters
Returns
MinorGridLines(Action<ChartMinorGridLinesBuilder>)
Declaration
public ChartAxisBuilder MinorGridLines(Action<ChartMinorGridLinesBuilder> minorGridLines)
Parameters
Returns
MinorTickLines(ChartMinorTickLines)
Options for customizing minor tick lines on the axis.
Declaration
public ChartAxisBuilder MinorTickLines(ChartMinorTickLines minorTickLines)
Parameters
Returns
MinorTickLines(Action<ChartMinorTickLinesBuilder>)
Declaration
public ChartAxisBuilder MinorTickLines(Action<ChartMinorTickLinesBuilder> minorTickLines)
Parameters
Returns
MinorTicksPerInterval(Double)
Specifies the number of minor ticks per interval.
Declaration
public ChartAxisBuilder MinorTicksPerInterval(double minorTicksPerInterval)
Parameters
Type |
Name |
Description |
System.Double |
minorTicksPerInterval |
|
Returns
MultiLevelLabels(Action<ChartMultiLevelLabelBuilder>)
Declaration
public ChartAxisBuilder MultiLevelLabels(Action<ChartMultiLevelLabelBuilder> multiLevelLabels)
Parameters
Returns
MultiLevelLabels(List<ChartMultiLevelLabel>)
Multi-level labels are used to display hierarchical or grouped labels on the axis, allowing for a more detailed and structured data representation.
Declaration
public ChartAxisBuilder MultiLevelLabels(List<ChartMultiLevelLabel> multiLevelLabels)
Parameters
Returns
Name(String)
A unique identifier for an axis. To associate an axis with a series, set this name to the xAxisName
or yAxisName
properties of the series.
Declaration
public ChartAxisBuilder Name(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
OpposedPosition(Boolean)
If set to true, the axis will render on the opposite side of its default position.
Declaration
public ChartAxisBuilder OpposedPosition(bool opposedPosition)
Parameters
Type |
Name |
Description |
System.Boolean |
opposedPosition |
|
Returns
PlaceNextToAxisLine(Boolean)
Specifies whether axis elements, such as axis labels and the axis title, should be crossed by the axis line.
Declaration
public ChartAxisBuilder PlaceNextToAxisLine(bool placeNextToAxisLine)
Parameters
Type |
Name |
Description |
System.Boolean |
placeNextToAxisLine |
|
Returns
PlotOffset(Double)
Specifies the padding on the top, bottom, left and right sides of the chart area, in pixels.
Declaration
public ChartAxisBuilder PlotOffset(double plotOffset)
Parameters
Type |
Name |
Description |
System.Double |
plotOffset |
|
Returns
PlotOffsetBottom(Double)
Specifies the bottom padding for the chart area, in pixels.
Declaration
public ChartAxisBuilder PlotOffsetBottom(double plotOffsetBottom)
Parameters
Type |
Name |
Description |
System.Double |
plotOffsetBottom |
|
Returns
PlotOffsetLeft(Double)
Specifies the left padding for the chart area, in pixels.
Declaration
public ChartAxisBuilder PlotOffsetLeft(double plotOffsetLeft)
Parameters
Type |
Name |
Description |
System.Double |
plotOffsetLeft |
|
Returns
PlotOffsetRight(Double)
Specifies the right padding for the chart area, in pixels.
Declaration
public ChartAxisBuilder PlotOffsetRight(double plotOffsetRight)
Parameters
Type |
Name |
Description |
System.Double |
plotOffsetRight |
|
Returns
PlotOffsetTop(Double)
Specifies the top padding for the chart area, in pixels.
Declaration
public ChartAxisBuilder PlotOffsetTop(double plotOffsetTop)
Parameters
Type |
Name |
Description |
System.Double |
plotOffsetTop |
|
Returns
RangePadding(ChartRangePadding)
The rangePadding
property determines how padding is applied to the axis range, affecting the appearance of the chart by adjusting the minimum and maximum values of the axis.
Available options are:
None: No padding is applied to the axis.
Normal: Padding is applied based on the range calculation.
Additional: The interval of the axis is added as padding to both the minimum and maximum values of the range.
Round: The axis range is rounded to the nearest possible value that is divisible by the interval.
Declaration
public ChartAxisBuilder RangePadding(ChartRangePadding rangePadding)
Parameters
Returns
RowIndex(Double)
Specifies the index of the row where the axis is associated when the chart area is divided into multiple plot areas using rows
.
Declaration
public ChartAxisBuilder RowIndex(double rowIndex)
Parameters
Type |
Name |
Description |
System.Double |
rowIndex |
|
Returns
Configures the scrollbar with options for customization, including appearance, behavior, and lazy loading settings.
Declaration
public ChartAxisBuilder ScrollbarSettings(ChartScrollbarSettings scrollbarSettings)
Parameters
Returns
Declaration
public ChartAxisBuilder ScrollbarSettings(Action<ChartScrollbarSettingsBuilder> scrollbarSettings)
Parameters
Returns
Skeleton(String)
Specifies the skeleton format used for processing date-time values.
Declaration
public ChartAxisBuilder Skeleton(string skeleton)
Parameters
Type |
Name |
Description |
System.String |
skeleton |
|
Returns
SkeletonType(SkeletonType)
Specifies the format type to be used in date-time formatting.
Declaration
public ChartAxisBuilder SkeletonType(SkeletonType skeletonType)
Parameters
Returns
Span(Double)
Specifies the number of columns
or rows
that an axis spans horizontally or vertically.
Declaration
public ChartAxisBuilder Span(double span)
Parameters
Type |
Name |
Description |
System.Double |
span |
|
Returns
StartAngle(Double)
Specifies the start angle for the series in a polar or radar chart, measured in degrees from the horizontal axis, determining the initial angle from which the series begins.
Declaration
public ChartAxisBuilder StartAngle(double startAngle)
Parameters
Type |
Name |
Description |
System.Double |
startAngle |
|
Returns
StartFromZero(Boolean)
If set to true, the axis starts from zero.
If set to false, the axis starts from the minimum value of the data.
Declaration
public ChartAxisBuilder StartFromZero(bool startFromZero)
Parameters
Type |
Name |
Description |
System.Boolean |
startFromZero |
|
Returns
StripLines(Action<ChartStripLineBuilder>)
Declaration
public ChartAxisBuilder StripLines(Action<ChartStripLineBuilder> stripLines)
Parameters
Returns
StripLines(List<ChartStripLine>)
Specifies the collection of strip lines for the axis, which are visual elements used to mark or highlight specific ranges.
Declaration
public ChartAxisBuilder StripLines(List<ChartStripLine> stripLines)
Parameters
Type |
Name |
Description |
System.Collections.Generic.List<ChartStripLine> |
stripLines |
|
Returns
TabIndex(Double)
The tabIndex
value for the axis, determining its position in the tab order.
Declaration
public ChartAxisBuilder TabIndex(double tabIndex)
Parameters
Type |
Name |
Description |
System.Double |
tabIndex |
|
Returns
TickPosition(AxisPosition)
The tickPosition
property determines where the axis ticks are rendered in relation to the axis line.
Available options are:
Inside: Renders the ticks inside the axis line.
Outside: Renders the ticks outside the axis line.
Declaration
public ChartAxisBuilder TickPosition(AxisPosition tickPosition)
Parameters
Returns
Title(String)
Specifies the title of an axis, displayed along the axis to provide context about the represented data.
Declaration
public ChartAxisBuilder Title(string title)
Parameters
Type |
Name |
Description |
System.String |
title |
|
Returns
TitlePadding(Double)
Specifies the padding between the axis title and the axis labels.
Declaration
public ChartAxisBuilder TitlePadding(double titlePadding)
Parameters
Type |
Name |
Description |
System.Double |
titlePadding |
|
Returns
TitleRotation(Double)
Defines an angle for rotating the axis title. By default, the angle is calculated based on the position and orientation of the axis.
Declaration
public ChartAxisBuilder TitleRotation(double titleRotation)
Parameters
Type |
Name |
Description |
System.Double |
titleRotation |
|
Returns
TitleStyle(ChartFont)
Options for customizing the appearance of the axis title, including font family, size, style, weight, and color.
Declaration
public ChartAxisBuilder TitleStyle(ChartFont titleStyle)
Parameters
Returns
TitleStyle(Action<ChartFontBuilder>)
Declaration
public ChartAxisBuilder TitleStyle(Action<ChartFontBuilder> titleStyle)
Parameters
Returns
ValueType(ValueType)
The valueType
property defines the type of data that the axis can manage, ensuring correct rendering based on the data type. This property supports multiple data types, each suited for different kinds of data visualization.
Available options include:
Double: Used for rendering a numeric axis to accommodate numeric data.
DateTime: Utilized for rendering a date-time axis to manage date-time data.
Category: Employed for rendering a category axis to manage categorical data.
Logarithmic: Applied for rendering a logarithmic axis to handle a wide range of values.
DateTimeCategory: Used to render a date-time category axis for managing business days.
Declaration
public ChartAxisBuilder ValueType(ValueType valueType)
Parameters
Returns
Visible(Boolean)
If set to true, axis labels will be visible in the chart. By default, axis labels are enabled.
Declaration
public ChartAxisBuilder Visible(bool visible)
Parameters
Type |
Name |
Description |
System.Boolean |
visible |
|
Returns
ZoomFactor(Double)
The axis is scaled by this factor. When zoomFactor
is 0.5, the chart is scaled by 200% along this axis.
Note the value ranges from 0 to 1.
Declaration
public ChartAxisBuilder ZoomFactor(double zoomFactor)
Parameters
Type |
Name |
Description |
System.Double |
zoomFactor |
|
Returns
ZoomPosition(Double)
Sets the position of the zoomed axis on the chart, with the zoomPosition
property specifying the position within the zoomed range, from 0 (start) to 1 (end).
Declaration
public ChartAxisBuilder ZoomPosition(double zoomPosition)
Parameters
Type |
Name |
Description |
System.Double |
zoomPosition |
|
Returns