ChartAxis Class
Represents a base class for all chart axis types.
- Inheritance:
- System.ObjectChartAxis
- Derived
Properties
AxisType
public abstract AxisType AxisType { get; }
Public MustOverride ReadOnly Property AxisType As AxisType
Property Value
CrossesAt
Gets or sets the specific value or category on which the opposite axis should be positioned. To be used with CrossType set to Specific.
Property Value
- System.Nullable<System.Double>
CrossType
Gets or sets the axis cross configuration.
Property Value
The configuration of how this axis should cross the opposite axis.
Remarks
Fill
Gets or sets the fill formatting options.
Property Value
The fill formatting options.
IsVisible
Gets or sets a value indicating whether axis is visible.
Property Value
- System.Boolean
true if axis is visible; otherwise, false.
Remarks
Default value of this property is true.
LabelsPosition
Gets or sets the axis labels position.
public AxisLabelsPosition LabelsPosition { get; set; }
Public Property LabelsPosition As AxisLabelsPosition
Property Value
The axis labels position.
MajorGridlines
Gets the major gridlines.
public AxisGridlines MajorGridlines { get; }
Public ReadOnly Property MajorGridlines As AxisGridlines
Property Value
The major gridlines.
MajorTickMarkType
Gets or sets the major tick marks position.
public TickMarkType MajorTickMarkType { get; set; }
Public Property MajorTickMarkType As TickMarkType
Property Value
The major tick marks position.
MinorGridlines
Gets the minor gridlines.
public AxisGridlines MinorGridlines { get; }
Public ReadOnly Property MinorGridlines As AxisGridlines
Property Value
The minor gridlines.
MinorTickMarkType
Gets or sets the minor tick marks position.
public TickMarkType MinorTickMarkType { get; set; }
Public Property MinorTickMarkType As TickMarkType
Property Value
The minor tick marks position.
NumberFormat
Gets or sets the number format used for formatting axis value labels. If NumberFormatLinkedToSource is true, then number format from chart's source data (cells) will be used to format axis value labels as explained in remarks. Setting this property, sets NumberFormatLinkedToSource to false.
Property Value
- System.String
The number format used for formatting axis value labels.
Remarks
If NumberFormatLinkedToSource is true, then number format from chart's source data (cells) will be used to format axis value labels based on the following logic:
- If axis is CategoryAxis or DateAxis, then NumberFormat of the first cell in CategoryLabelsReference will be used.
- If axis is ValueAxis, then NumberFormat of the first cell in ValuesReference of the chart's first series will be used.
Otherwise, if NumberFormat is specified, then it will be used to format axis value labels.
Otherwise, if number format cannot be retrieved by any previously described means, then "General" number format will be used to format axis value labels.
NumberFormatLinkedToSource
Gets or sets a value indicating whether number format from chart's source data (cells) will be used to format axis value labels.
public bool NumberFormatLinkedToSource { get; set; }
Public Property NumberFormatLinkedToSource As Boolean
Property Value
- System.Boolean
true if number format from chart's source data (cells) will be used to format axis value labels; otherwise, false.
Remarks
If NumberFormatLinkedToSource is true, then number format from chart's source data (cells) will be used to format axis value labels based on the following logic:
- If axis is CategoryAxis or DateAxis, then NumberFormat of the first cell in CategoryLabelsReference will be used.
- If axis is ValueAxis, then NumberFormat of the first cell in ValuesReference of the chart's first series will be used.
Otherwise, if NumberFormat is specified, then it will be used to format axis value labels.
Otherwise, if number format cannot be retrieved by any previously described means, then "General" number format will be used to format axis value labels.
Default value of this property is true.
Outline
Gets or sets the outline formatting options.
Property Value
The outline formatting options.
ReverseOrder
Gets or sets a value indicating whether values on the axis shall be reversed so they go from maximum to minimum.
This value is currently not supported when exporting a chart to PDF, XPS, or image formats. This value is always exported as false.
Property Value
- System.Boolean
true if values on the axis shall be reversed so they go from maximum to minimum; otherwise, false.
Remarks
Setting the value also changes position of the axis perpendicular to this one. If value is true, axis perpendicular to this one will be positioned at the top (if horizontal) or at the right (if vertical) of the plot area; otherwise, if value is false, axis perpendicular to this one will be positioned at the bottom (if horizontal) or at the left (if vertical) of the plot area.
TextBoxFormat
Gets or sets the text box formatting.
public TextBoxFormat TextBoxFormat { get; set; }
Public Property TextBoxFormat As TextBoxFormat
Property Value
The text box formatting.
TextFormat
Gets or sets the text formatting options.
Property Value
The text formatting options.
Title
Gets the axis title.
Property Value
The axis title.
Methods
ChangeAxisType(AxisType)
Changes the type of the axis.
public ChartAxis ChangeAxisType(AxisType axisType)
Public Function ChangeAxisType(axisType As AxisType) As ChartAxis
Parameters
axisType
- AxisType
New type of the axis.
Returns
ChangeAxisType<TChartAxis>()
Changes the type of the axis.
public TChartAxis ChangeAxisType<TChartAxis>()
where TChartAxis : ChartAxis
Public Function ChangeAxisType(Of TChartAxis As ChartAxis) As TChartAxis
Returns
- TChartAxis
ChartAxis instance of TChartAxis
type, if this instance is not of TChartAxis
type; otherwise, this instance.
Type Parameters
TChartAxis
New type of the axis.
Delete()
Deletes axis.
ToString()
Returns a System.String that represents this ChartAxis instance.
public sealed override string ToString()
Public NotOverridable Overrides Function ToString As String
Returns
- System.String
A System.String that represents this ChartAxis instance.
Overrides
Remarks
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).