GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    ChartAxis Class

    Namespace:
    GemBox.Spreadsheet.Charts
    Assembly:
    GemBox.Spreadsheet.dll

    Represents a base class for all chart axis types.

    • C#
    • VB.NET
    public abstract class ChartAxis
    Public MustInherit Class ChartAxis
    Inheritance:
    System.Object
    ChartAxis
    Derived
    CategoryAxis
    DateAxis
    ValueAxis

    Properties

    AxisType

    Gets the AxisType of this ChartAxis instance.

    • C#
    • VB.NET
    public abstract AxisType AxisType { get; }
    Public MustOverride ReadOnly Property AxisType As AxisType
    Property Value
    AxisType

    The AxisType of this ChartAxis instance.

    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.

    • C#
    • VB.NET
    public double? CrossesAt { get; set; }
    Public Property CrossesAt As Double?
    Property Value
    System.Nullable<System.Double>

    CrossType

    Gets or sets the axis cross configuration.

    • C#
    • VB.NET
    public AxisCrossType CrossType { get; set; }
    Public Property CrossType As AxisCrossType
    Property Value
    AxisCrossType

    The configuration of how this axis should cross the opposite axis.

    Remarks

    If set to Specific, it is necessary to also set CrossesAt.

    Fill

    Gets or sets the fill formatting options.

    • C#
    • VB.NET
    public FillFormat Fill { get; set; }
    Public Property Fill As FillFormat
    Property Value
    FillFormat

    The fill formatting options.

    IsVisible

    Gets or sets a value indicating whether axis is visible.

    • C#
    • VB.NET
    public bool IsVisible { get; set; }
    Public Property IsVisible As Boolean
    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.

    • C#
    • VB.NET
    public AxisLabelsPosition LabelsPosition { get; set; }
    Public Property LabelsPosition As AxisLabelsPosition
    Property Value
    AxisLabelsPosition

    The axis labels position.

    MajorGridlines

    Gets the major gridlines.

    • C#
    • VB.NET
    public AxisGridlines MajorGridlines { get; }
    Public ReadOnly Property MajorGridlines As AxisGridlines
    Property Value
    AxisGridlines

    The major gridlines.

    MajorTickMarkType

    Gets or sets the major tick marks position.

    • C#
    • VB.NET
    public TickMarkType MajorTickMarkType { get; set; }
    Public Property MajorTickMarkType As TickMarkType
    Property Value
    TickMarkType

    The major tick marks position.

    MinorGridlines

    Gets the minor gridlines.

    • C#
    • VB.NET
    public AxisGridlines MinorGridlines { get; }
    Public ReadOnly Property MinorGridlines As AxisGridlines
    Property Value
    AxisGridlines

    The minor gridlines.

    MinorTickMarkType

    Gets or sets the minor tick marks position.

    • C#
    • VB.NET
    public TickMarkType MinorTickMarkType { get; set; }
    Public Property MinorTickMarkType As TickMarkType
    Property Value
    TickMarkType

    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.

    • C#
    • VB.NET
    public string NumberFormat { get; set; }
    Public Property NumberFormat As String
    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    public LineFormat Outline { get; set; }
    Public Property Outline As LineFormat
    Property Value
    LineFormat

    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.

    • C#
    • VB.NET
    public bool ReverseOrder { get; set; }
    Public Property ReverseOrder As Boolean
    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.

    • C#
    • VB.NET
    public TextBoxFormat TextBoxFormat { get; set; }
    Public Property TextBoxFormat As TextBoxFormat
    Property Value
    TextBoxFormat

    The text box formatting.

    TextFormat

    Gets or sets the text formatting options.

    • C#
    • VB.NET
    public TextFormat TextFormat { get; set; }
    Public Property TextFormat As TextFormat
    Property Value
    TextFormat

    The text formatting options.

    Title

    Gets the axis title.

    • C#
    • VB.NET
    public ChartTitle Title { get; }
    Public ReadOnly Property Title As ChartTitle
    Property Value
    ChartTitle

    The axis title.

    Methods

    ChangeAxisType(AxisType)

    Changes the type of the axis.

    • C#
    • VB.NET
    public ChartAxis ChangeAxisType(AxisType axisType)
    Public Function ChangeAxisType(axisType As AxisType) As ChartAxis
    Parameters
    axisType
    AxisType

    New type of the axis.

    Returns
    ChartAxis

    ChartAxis instance with AxisType equal to axisType, if axisType is not equal to AxisType of this instance; otherwise, this instance.

    ChangeAxisType<TChartAxis>()

    Changes the type of the axis.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    public void Delete()
    Public Sub Delete

    ToString()

    Returns a System.String that represents this ChartAxis instance.

    • C#
    • VB.NET
    public sealed override string ToString()
    Public NotOverridable Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this ChartAxis instance.

    Overrides
    System.Object.ToString()
    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).

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.