ChartAxis Class
Represents the axis options of the chart.
Inheritance Hierarchy
SystemObject
  Aspose.Words.Drawing.ChartsChartAxis

Namespace: Aspose.Words.Drawing.Charts
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.12
Syntax
public class ChartAxis

The ChartAxis type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleAxisBetweenCategories
Gets or sets a flag indicating whether the value axis crosses the category axis between categories.
Public propertyCode exampleBaseTimeUnit
Returns or sets the smallest time unit that is represented on the time category axis.
Public propertyCode exampleCategoryType
Gets or sets type of the category axis.
Public propertyCode exampleCrosses
Specifies how this axis crosses the perpendicular axis.
Public propertyCode exampleCrossesAt
Specifies where on the perpendicular axis the axis crosses.
Public propertyCode exampleDisplayUnit
Specifies the scaling value of the display units for the value axis.
Public propertyDocument
Returns the Document the title holder belongs.
Public propertyCode exampleHidden
Gets or sets a flag indicating whether this axis is hidden or not.
Public propertyCode exampleMajorTickMark
Returns or sets the major tick marks.
Public propertyCode exampleMajorUnit
Returns or sets the distance between major tick marks.
Public propertyCode exampleMajorUnitIsAuto
Gets or sets a flag indicating whether default distance between major tick marks shall be used.
Public propertyCode exampleMajorUnitScale
Returns or sets the scale value for major tick marks on the time category axis.
Public propertyCode exampleMinorTickMark
Returns or sets the minor tick marks for the axis.
Public propertyCode exampleMinorUnit
Returns or sets the distance between minor tick marks.
Public propertyCode exampleMinorUnitIsAuto
Gets or sets a flag indicating whether default distance between minor tick marks shall be used.
Public propertyCode exampleMinorUnitScale
Returns or sets the scale value for minor tick marks on the time category axis.
Public propertyCode exampleNumberFormat
Returns a ChartNumberFormat object that allows defining number formats for the axis.
Public propertyCode exampleReverseOrder
Returns or sets a flag indicating whether values of axis should be displayed in reverse order, i.e. from max to min.
Public propertyCode exampleScaling
Provides access to the scaling options of the axis.
Public propertyCode exampleTickLabelAlignment
Gets or sets text alignment of axis tick labels.
Public propertyCode exampleTickLabelOffset
Gets or sets the distance of labels from the axis.
Public propertyCode exampleTickLabelPosition
Returns or sets the position of the tick labels on the axis.
Public propertyCode exampleTickLabelSpacing
Gets or sets the interval, at which tick labels are drawn.
Public propertyCode exampleTickLabelSpacingIsAuto
Gets or sets a flag indicating whether automatic interval of drawing tick labels shall be used.
Public propertyCode exampleTickMarkSpacing
Gets or sets the interval, at which tick marks are drawn.
Public propertyCode exampleType
Returns type of the axis.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Examples
Shows how to insert chart using the axis options for detailed configuration.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert chart.
Shape shape = builder.InsertChart(ChartType.Column, 432, 252);
Chart chart = shape.Chart;

// Clear demo data.
chart.Series.Clear();
chart.Series.Add("Aspose Test Series",
    new[] { "Word", "PDF", "Excel", "GoogleDocs", "Note" },
    new double[] { 640, 320, 280, 120, 150 });

// Get chart axes
ChartAxis xAxis = chart.AxisX;
ChartAxis yAxis = chart.AxisY;

// For 2D charts like the one we made, the Z axis is null
Assert.Null(chart.AxisZ);

// Set X-axis options
xAxis.CategoryType = AxisCategoryType.Category;
xAxis.Crosses = AxisCrosses.Minimum;
xAxis.ReverseOrder = false;
xAxis.MajorTickMark = AxisTickMark.Inside;
xAxis.MinorTickMark = AxisTickMark.Cross;
xAxis.MajorUnit = 10;
xAxis.MinorUnit = 15;
xAxis.TickLabelOffset = 50;
xAxis.TickLabelPosition = AxisTickLabelPosition.Low;
xAxis.TickLabelSpacingIsAuto = false;
xAxis.TickMarkSpacing = 1;

// Set Y-axis options
yAxis.CategoryType = AxisCategoryType.Automatic;
yAxis.Crosses = AxisCrosses.Maximum;
yAxis.ReverseOrder = true;
yAxis.MajorTickMark = AxisTickMark.Inside;
yAxis.MinorTickMark = AxisTickMark.Cross;
yAxis.MajorUnit = 100;
yAxis.MinorUnit = 20;
yAxis.TickLabelPosition = AxisTickLabelPosition.NextToAxis;
See Also