2D Chart for WinForms | ComponentOne
Chart Fundamentals / Defining the ChartArea Objects / Axes Object
In This Topic
    Axes Object
    In This Topic

    The following graphic illustrates the X and Y axes in C1Chart:



    Most charts have two axes, X and Y. The exceptions are pie charts (which have no axes) and charts with a secondary Y axis (Y2, which have three axes).

    The axes are represented by sub-properties of the ChartArea property: ChartArea.AxisX, ChartArea.AxisY, and AxisY2. Each of these properties returns an Axis object with the following main properties:

    Layout and Style properties

    The following properties below represent the layout and style of the axes in C1Chart:

    Property Description
    Compass Allows you to set the position of the axis. For example, you may want to display the X-axis above the data instead of below. For more information see Axis Position.
    Font Sets the font used to display the values along the axis. For more information see Axis Appearance.
    ForeColor Sets the color used to display the axis, tickmarks, and values. For more information see Axis Appearance.
    Reversed Allows you to reverse the direction of the axis. For example, you can show Y values going down instead of up. For more information see Inverted and Reversed Chart Axes.
    Text Sets a string to display next to the axis (this is typically used to describe the variable and units being depicted by the axis). For more information see Axis Title and Rotation.
    Rotation Sets the orientation of the Text string.

    Annotation properties

    The following properties below represent the format for the annotation of the axes in C1Chart:

    Property Description
    AnnoFormat A set of predefined formats used to format the values displayed next to the axis.
    AnnoFormatString The .NET formatting string used to format the values displayed next to the axis when AnnoFormat is set to "NumericManual" or "DateManual". If the AnnoFormat is set to either NumericManual or DateManual and the AnnoFormatString is empty, then the chart uses an algorithm to find the "best" formatting available.
    AnnoMethod Determines what values are displayed next to the axis. Options are "Values", which displays the actual series values, or "ValueLabels", which displays the elements in the ValueLabels collection.
    ValueLabels A collection of text/value pairs to display next to the axis when AnnoMethod is set to "ValueLabels". This property is useful when you want to display strings along an axis instead of numeric values (for example, you may be charting product prices and want to display the product names along the X-axis). For more information see Value Labels Annotation.
    AnnotationRotation Allows you to rotate the values so they take up less space along the axis. For more information see Axis Annotation Rotation.

    Scaling Tickmark and Gridline properties

    The following properties represent the scaling, tickmarks, and gridline styles and function for the axes in C1Chart:

    Property Description
    AutoMinAutoMax Determine whether the minimum and maximum values for the axis should be calculated automatically. For more information see Axis Bounds.
    MinMax. Set the minimum and maximum values for the axis (when AutoMin and AutoMax are set to False). For more information see Axis Bounds.
    AutoMajorAutoMinor Determine whether the spacing between the major and minor tickmarks should be calculated automatically.

    UnitMajorUnitMinor Set the spacing between the major and minor tickmarks (when the AutoMajor and AutoMinor properties are set to False).
    GridMajorGridMinor Returns a ChartGridStyle object with properties that control the appearance of the grid lines drawn perpendicular to major and minor tickmarks. For more information see Axis Grid Lines.
    AutoOrigin Determines whether the X-axis should be automatically positioned with respect to the Y-axis.
    Origin Sets the position of the X-axis with respect to the Y-axis. The X-axis is usually placed at the bottom of the chart. This property allows you to place it so that it crosses the Y-axis at a given coordinate.
    TickFactorMajor Gets or sets an integral factor for major tick mark length.
    TickFactorMinor Gets or sets an integral factor for minor tick mark length.
    TickGauge Gets or sets the approximate number of intervals delineated by gauge marks between major tick marks.

    For more information about the Axes object, see Axes.

    See Also