com.aspose.words

Class AxisTickLabelPosition

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

Utility class containing constants. Specifies the possible positions for tick labels.

Example:

Shows how to insert chart with date/time values
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert chart.
Shape shape = builder.insertChart(ChartType.LINE, 432.0, 252.0);
Chart chart = shape.getChart();

// Clear demo data.
chart.getSeries().clear();

Calendar cal = Calendar.getInstance();

// Fill data.
chart.getSeries().add("Aspose Test Series",
        new Date[]
                {
                        DocumentHelper.createDate(2017, 11, 6), DocumentHelper.createDate(2017, 11, 9), DocumentHelper.createDate(2017, 11, 15),
                        DocumentHelper.createDate(2017, 11, 21), DocumentHelper.createDate(2017, 11, 25), DocumentHelper.createDate(2017, 11, 29)
                },
        new double[]{1.2, 0.3, 2.1, 2.9, 4.2, 5.3});

ChartAxis xAxis = chart.getAxisX();
ChartAxis yAxis = chart.getAxisY();

// Set X axis bounds.
xAxis.getScaling().setMinimum(new AxisBound(DocumentHelper.createDate(2017, 11, 5)));
xAxis.getScaling().setMaximum(new AxisBound(DocumentHelper.createDate(2017, 12, 3)));

// Set major units to a week and minor units to a day.
xAxis.setBaseTimeUnit(AxisTimeUnit.DAYS);
xAxis.setMajorUnit(7.0);
xAxis.setMinorUnit(1.0);
xAxis.setMajorTickMark(AxisTickMark.CROSS);
xAxis.setMinorTickMark(AxisTickMark.OUTSIDE);

// Define Y axis properties.
yAxis.setTickLabelPosition(AxisTickLabelPosition.HIGH);
yAxis.setMajorUnit(100.0);
yAxis.setMinorUnit(50.0);
yAxis.getDisplayUnit().setUnit(AxisBuiltInUnit.HUNDREDS);
yAxis.getScaling().setMinimum(new AxisBound(100.0));
yAxis.getScaling().setMaximum(new AxisBound(700.0));

doc.save(getArtifactsDir() + "Charts.ChartAxisProperties.docx");

Field Summary
static final intHIGH = 0
Specifies the axis labels shall be at the high end of the perpendicular axis.
static final intLOW = 1
Specifies the axis labels shall be at the low end of the perpendicular axis.
static final intNEXT_TO_AXIS = 2
Specifies the axis labels shall be next to the axis.
static final intNONE = 3
Specifies the axis labels are not drawn.
static final intDEFAULT = 2
Specifies default value of tick labels position.
 

    • Field Detail

      • HIGH = 0

        public static final int HIGH
        Specifies the axis labels shall be at the high end of the perpendicular axis.
      • LOW = 1

        public static final int LOW
        Specifies the axis labels shall be at the low end of the perpendicular axis.
      • NEXT_TO_AXIS = 2

        public static final int NEXT_TO_AXIS
        Specifies the axis labels shall be next to the axis.
      • NONE = 3

        public static final int NONE
        Specifies the axis labels are not drawn.
      • DEFAULT = 2

        public static final int DEFAULT
        Specifies default value of tick labels position.