com.aspose.words

Class AxisCrosses

  • java.lang.Object
    • com.aspose.words.AxisCrosses
public class AxisCrosses 
extends java.lang.Object

Utility class containing constants. Specifies the possible crossing points for an axis.

Example:

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.0, 252.0);
Chart chart = shape.getChart();

// Clear demo data.
chart.getSeries().clear();
chart.getSeries().add("Aspose Test Series",
        new String[]{"Word", "PDF", "Excel", "GoogleDocs", "Note"},
        new double[]{640.0, 320.0, 280.0, 120.0, 150.0});

// Get chart axes
ChartAxis xAxis = chart.getAxisX();
ChartAxis yAxis = chart.getAxisY();

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

// Set X-axis options
xAxis.setCategoryType(AxisCategoryType.CATEGORY);
xAxis.setCrosses(AxisCrosses.MINIMUM);
xAxis.setReverseOrder(false);
xAxis.setMajorTickMark(AxisTickMark.INSIDE);
xAxis.setMinorTickMark(AxisTickMark.CROSS);
xAxis.setMajorUnit(10.0);
xAxis.setMinorUnit(15.0);
xAxis.setTickLabelOffset(50);
xAxis.setTickLabelPosition(AxisTickLabelPosition.LOW);
xAxis.setTickLabelSpacingIsAuto(false);
xAxis.setTickMarkSpacing(1);

// Set Y-axis options
yAxis.setCategoryType(AxisCategoryType.AUTOMATIC);
yAxis.setCrosses(AxisCrosses.MAXIMUM);
yAxis.setReverseOrder(true);
yAxis.setMajorTickMark(AxisTickMark.INSIDE);
yAxis.setMinorTickMark(AxisTickMark.CROSS);
yAxis.setMajorUnit(100.0);
yAxis.setMinorUnit(20.0);
yAxis.setTickLabelPosition(AxisTickLabelPosition.NEXT_TO_AXIS);

Field Summary
static final intAUTOMATIC = 0
The category axis crosses at the zero point of the value axis (if possible), or at the minimum value if the minimum is greater than zero, or at the maximum if the maximum is less than zero.
static final intMAXIMUM = 1
A perpendicular axis crosses at the maximum value of the axis.
static final intMINIMUM = 2
A perpendicular axis crosses at the minimum value of the axis.
static final intCUSTOM = 3
A perpendicular axis crosses at the specified value of the axis.
 

    • Field Detail

      • AUTOMATIC = 0

        public static final int AUTOMATIC
        The category axis crosses at the zero point of the value axis (if possible), or at the minimum value if the minimum is greater than zero, or at the maximum if the maximum is less than zero.
      • MAXIMUM = 1

        public static final int MAXIMUM
        A perpendicular axis crosses at the maximum value of the axis.
      • MINIMUM = 2

        public static final int MINIMUM
        A perpendicular axis crosses at the minimum value of the axis.
      • CUSTOM = 3

        public static final int CUSTOM
        A perpendicular axis crosses at the specified value of the axis.