[]
Serializable, Comparable<TimeUnit>, ConstableUse this enum with date-based category axis settings such as IAxis.setBaseUnit(TimeUnit), IAxis.setMajorUnitScale(TimeUnit), and IAxis.setMinorUnitScale(TimeUnit) to control whether the axis is measured in days, months, or years.
worksheet.getRange("A1:B4").setValue(new Object[][] {
{"Date", "Sales"},
{new GregorianCalendar(2024, 0, 1).getTime(), 100},
{new GregorianCalendar(2024, 1, 1).getTime(), 120},
{new GregorianCalendar(2024, 2, 1).getTime(), 140}
});
IShape shape = worksheet.getShapes().addChart(ChartType.Line, 20, 20, 300, 200);
shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
IAxis axis = shape.getChart().getAxes().item(AxisType.Category);
axis.setCategoryType(CategoryType.TimeScale);
axis.setBaseUnit(TimeUnit.Months);
Enum.EnumDesc<E extends Enum<E>>name - the name of the enum constant to be returned.IllegalArgumentException - if this enum class has no constant with the specified nameNullPointerException - if the argument is null