java.lang.Object
com.aspose.words.AxisCategoryType
public class AxisCategoryType
- extends java.lang.Object
Utility class containing constants.
Specifies type of a category 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);
doc.save(getArtifactsDir() + "Charts.AxisProperties.docx");
Field Summary |
static final int | AUTOMATIC = 0 | |
Specifies that type of a category axis is determined automatically based on data.
|
static final int | CATEGORY = 1 | |
Specifies an axis of an arbitrary set of categories.
|
static final int | TIME = 2 | |
Specifies a time category axis.
|
AUTOMATIC = 0 | |
public static final int AUTOMATIC |
-
Specifies that type of a category axis is determined automatically based on data.
CATEGORY = 1 | |
public static final int CATEGORY |
-
Specifies an axis of an arbitrary set of categories.
TIME = 2 | |
public static final int TIME |
-
Specifies a time category axis.
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.