[]
        
(Showing Draft Content)

IAxis

Interface IAxis


public interface IAxis
Represents a single axis in a chart.

An IAxis provides access to axis settings such as the axis group, title, scaling, crossing behavior, tick labels, and gridlines for category, value, and series axes.


 worksheet.getRange("A1:B4").setValue(new Object[][] {
     {"Month", "Sales"},
     {"Jan", 100},
     {"Feb", 120},
     {"Mar", 140}
 });
 IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 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.getAxisTitle().setText("Month");
 
  • Method Details

    • getAxisBetweenCategories

      boolean getAxisBetweenCategories()
      Gets whether the value axis crosses the category axis between categories.

      This property applies to a category axis. A value of true indicates that the value axis crosses the category axis between categories instead of at the category marks.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 100},
           {"Feb", 200},
           {"Mar", 150}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 150, 0, 250, 250).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       boolean axisBetweenCategories = axis.getAxisBetweenCategories();
       
      Returns:
      true if the value axis crosses the category axis between categories; otherwise, false.
    • setAxisBetweenCategories

      void setAxisBetweenCategories(boolean value)
      Sets whether the value axis crosses the category axis between categories.

      This property applies to a category axis. A value of true indicates that the value axis crosses the category axis between categories instead of at the category marks.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 100},
           {"Feb", 200},
           {"Mar", 150}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 150, 0, 250, 250).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setAxisBetweenCategories(true);
       
      Parameters:
      value - true if the value axis crosses the category axis between categories; otherwise, false.
    • getAxisGroup

      AxisGroup getAxisGroup()
      Gets the axis group of the axis.

      The returned AxisGroup indicates whether the axis belongs to the primary axis group or the secondary axis group.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       AxisGroup axisGroup = axis.getAxisGroup();
       
      Returns:
      The AxisGroup of the axis.
    • getAxisTitle

      IAxisTitle getAxisTitle()
      Gets the title of the axis.

      Use the returned IAxisTitle object to access and configure the axis title, such as its text and formatting.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setHasTitle(true);
       IAxisTitle title = axis.getAxisTitle();
       title.setText("Sales");
       
      Returns:
      The IAxisTitle object that represents the title of the axis.
    • getBaseUnit

      TimeUnit getBaseUnit()
      Gets the base unit for the specified category axis.

      For a time-scale category axis, the base unit specifies whether the axis is based on days, months, or years.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Date", "Sales"},
           {new GregorianCalendar(2024, Calendar.JANUARY, 1).getTime(), 12},
           {new GregorianCalendar(2024, Calendar.FEBRUARY, 1).getTime(), 18},
           {new GregorianCalendar(2024, Calendar.MARCH, 1).getTime(), 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setBaseUnit(TimeUnit.Months);
       TimeUnit baseUnit = axis.getBaseUnit();
       
      Returns:
      The base unit for the specified category axis.
    • setBaseUnit

      void setBaseUnit(TimeUnit value)
      Sets the base unit for the specified category axis.

      For a time-scale category axis, the base unit determines whether the axis is based on days, months, or years.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Date", "Sales"},
           {new GregorianCalendar(2024, Calendar.JANUARY, 1).getTime(), 12},
           {new GregorianCalendar(2024, Calendar.FEBRUARY, 1).getTime(), 18},
           {new GregorianCalendar(2024, Calendar.MARCH, 1).getTime(), 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setBaseUnit(TimeUnit.Months);
       
      Parameters:
      value - The base unit to use for the category axis.
    • getBaseUnitIsAuto

      boolean getBaseUnitIsAuto()
      Gets whether the base unit is selected automatically for the specified category axis.

      If this property is true, Microsoft Excel chooses an appropriate base unit for the category axis automatically. The default value is true.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Date", "Sales"},
           {45292d, 12},
           {45323d, 18},
           {45352d, 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setBaseUnitIsAuto(false);
       boolean autoBaseUnit = axis.getBaseUnitIsAuto();
       
      Returns:
      true if the base unit is selected automatically; otherwise, false.
    • setBaseUnitIsAuto

      void setBaseUnitIsAuto(boolean value)
      Sets whether the base unit is selected automatically for the specified category axis.

      If this property is true, Microsoft Excel chooses an appropriate base unit for the category axis automatically. The default value is true.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Date", "Sales"},
           {45292d, 12},
           {45323d, 18},
           {45352d, 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setBaseUnitIsAuto(false);
       
      Parameters:
      value - true if the base unit is selected automatically; otherwise, false.
    • getCategoryNames

      String[] getCategoryNames()
      Gets all the category names for the specified axis as a text array.

      Returns the category labels currently used by the axis.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Q1", 120},
           {"Q2", 150},
           {"Q3", 180}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       String[] categoryNames = axis.getCategoryNames();
       
      Returns:
      The category names for the axis as a text array.
    • setCategoryNames

      void setCategoryNames(String[] value)
      Sets all the category names for the specified axis as a text array.

      Sets the category labels currently used by the axis.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Q1", 120},
           {"Q2", 150},
           {"Q3", 180}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setCategoryNames(100);
       
      Parameters:
      value - The category names for the axis as a text array.
    • getCategoryType

      CategoryType getCategoryType()
      Gets the category axis type.

      This method returns the CategoryType configured for the axis. If you need the effective category axis type after automatic resolution, use getActualCategoryType().

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Date", "Sales"},
           {45292d, 12},
           {45323d, 18},
           {45352d, 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       CategoryType type = axis.getCategoryType();
       
      Returns:
      The category axis type configured for the axis.
    • setCategoryType

      void setCategoryType(CategoryType value)
      Sets the category axis type.

      Use this method to control how categories on a category axis are grouped, such as by categories or by a time scale. To get the effective category axis type after automatic resolution, use getActualCategoryType().

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Date", "Sales"},
           {45292d, 12},
           {45323d, 18},
           {45352d, 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setCategoryType(CategoryType.TimeScale);
       
      Parameters:
      value - The category axis type to set.
    • getActualCategoryType

      CategoryType getActualCategoryType()
      Gets the actual category axis type.

      This method returns the effective CategoryType used by the axis. If the category axis type is set to CategoryType.AutomaticScale, the returned value reflects the type resolved from the chart data and chart type.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Date", "Sales"},
           {42374d, 100},
           {42394d, 200},
           {42410d, 150}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 150, 0, 250, 250).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       CategoryType type = axis.getActualCategoryType();
       
      Returns:
      The effective category axis type.
    • getCrosses

      AxisCrosses getCrosses()
      Gets the point on the specified axis where the other axis crosses.

      Returns the current axis crossing mode, such as AxisCrosses.Automatic, AxisCrosses.Custom, AxisCrosses.Maximum, or AxisCrosses.Minimum. If the crossing mode is AxisCrosses.Custom, use getCrossesAt() to get the exact crossing position.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 12},
           {"Feb", 18},
           {"Mar", 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setCrosses(AxisCrosses.Maximum);
       AxisCrosses crosses = axis.getCrosses();
       
      Returns:
      The axis crossing mode.
    • setCrosses

      void setCrosses(AxisCrosses value)
      Sets the point on the specified axis where the other axis crosses.

      Use an AxisCrosses value to control whether the axis crosses automatically or at the minimum or maximum value. To specify an exact crossing position, use setCrossesAt(double).

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 12},
           {"Feb", 18},
           {"Mar", 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setCrosses(AxisCrosses.Maximum);
       
      Parameters:
      value - The axis crossing mode. Use AxisCrosses.Custom with setCrossesAt(double) to specify an exact crossing point.
    • getCrossesAt

      double getCrossesAt()
      Gets the point on the value axis where the category axis crosses it.

      This property applies only to the value axis. To use a custom crossing point, set the axis crosses mode to AxisCrosses.Custom.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setCrosses(AxisCrosses.Custom);
       axis.setCrossesAt(5.0);
       double crossesAt = axis.getCrossesAt();
       
      Returns:
      The point on the value axis where the category axis crosses it.
    • setCrossesAt

      void setCrossesAt(double value)
      Sets the point on the value axis where the category axis crosses it.

      This property applies only to the value axis. To use a custom crossing point, set the axis crosses mode to AxisCrosses.Custom.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setCrosses(AxisCrosses.Custom);
       axis.setCrossesAt(5.0);
       
      Parameters:
      value - The point on the value axis where the category axis crosses it.
    • getDisplayUnit

      DisplayUnit getDisplayUnit()
      Gets the display unit label for the value axis.

      Use this property to determine how values on the value axis are scaled for display, such as thousands or millions.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setDisplayUnit(DisplayUnit.Thousands);
       DisplayUnit displayUnit = axis.getDisplayUnit();
       
      Returns:
      The DisplayUnit applied to the value axis.
    • setDisplayUnit

      void setDisplayUnit(DisplayUnit value)
      Sets the display unit for the value axis.

      Use this method to show axis values in a scaled unit such as thousands or millions. To use a custom display unit value, set this property to DisplayUnit.Custom and then call setDisplayUnitCustom(double).

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setDisplayUnit(DisplayUnit.Thousands);
       
      Parameters:
      value - The display unit for the value axis.
    • getDisplayUnitCustom

      double getDisplayUnitCustom()
      Gets the custom display unit value for the value axis.

      This property returns the displayed unit value when setDisplayUnit(DisplayUnit) is set to DisplayUnit.Custom. The value is from 0 through 10E307.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setDisplayUnit(DisplayUnit.Custom);
       axis.setDisplayUnitCustom(1000d);
       double displayUnitCustom = axis.getDisplayUnitCustom();
       
      Returns:
      The custom display unit value for the value axis.
    • setDisplayUnitCustom

      void setDisplayUnitCustom(double value)
      Sets the custom display unit value for the value axis.

      This property Sets the displayed unit value when setDisplayUnit(DisplayUnit) is set to DisplayUnit.Custom. The value is from 0 through 10E307.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setDisplayUnit(DisplayUnit.Custom);
       axis.setDisplayUnitCustom(1000d);
       
      Parameters:
      value - The custom display unit value for the value axis.
    • getDisplayUnitLabel

      IDisplayUnitLabel getDisplayUnitLabel()
      Gets the IDisplayUnitLabel object for this axis.

      The display unit label shows the unit specified by setDisplayUnit(DisplayUnit) or setDisplayUnitCustom(double) on the axis. Returns null if getHasDisplayUnitLabel() is false.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setDisplayUnit(DisplayUnit.Thousands);
       IDisplayUnitLabel displayUnitLabel = axis.getDisplayUnitLabel();
       
      Returns:
      The IDisplayUnitLabel object for this axis, or null if the display unit label is not shown.
    • getFormat

      IChartFormat getFormat()
      Gets the chart format of the axis.

      Use the returned IChartFormat object to access the fill and line formatting settings of the axis.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       IChartFormat format = axis.getFormat();
       format.getLine().getColor().setRGB(Color.GetBlue());
       
      Returns:
      The IChartFormat object that represents the axis formatting.
    • getHasDisplayUnitLabel

      boolean getHasDisplayUnitLabel()
      Gets whether the display unit label is shown on the specified axis.

      Returns true if the label specified by the getDisplayUnit() or getDisplayUnitCustom() property is displayed on the axis.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setDisplayUnit(DisplayUnit.Thousands);
       boolean hasDisplayUnitLabel = axis.getHasDisplayUnitLabel();
       
      Returns:
      true if the display unit label is displayed on the axis; otherwise, false.
    • setHasDisplayUnitLabel

      void setHasDisplayUnitLabel(boolean value)
      Sets whether the display unit label is shown on the specified axis.

      Set this property to true to display the label specified by the getDisplayUnit() or getDisplayUnitCustom() property, or false to hide it.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setDisplayUnit(DisplayUnit.Thousands);
       axis.setHasDisplayUnitLabel(true);
       
      Parameters:
      value - true if the display unit label is displayed on the axis; otherwise, false.
    • getHasMajorGridlines

      boolean getHasMajorGridlines()
      Gets whether the axis displays major gridlines.

      This property applies only to axes in the primary axis group.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setHasMajorGridlines(true);
       boolean hasMajorGridlines = axis.getHasMajorGridlines();
       
      Returns:
      true if the axis displays major gridlines; otherwise, false.
    • setHasMajorGridlines

      void setHasMajorGridlines(boolean value)
      Sets whether the axis displays major gridlines.

      This property applies only to axes in the primary axis group.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setHasMajorGridlines(true);
       
      Parameters:
      value - true if the axis displays major gridlines; otherwise, false.
    • getHasMinorGridlines

      boolean getHasMinorGridlines()
      Gets whether the axis has minor gridlines.

      This property indicates whether minor gridlines are enabled for the axis. Only axes in the primary axis group can have gridlines.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setHasMinorGridlines(true);
       boolean hasMinorGridlines = axis.getHasMinorGridlines();
       
      Returns:
      true if the axis has minor gridlines; otherwise, false. This property applies only to axes in the primary axis group.
    • setHasMinorGridlines

      void setHasMinorGridlines(boolean value)
      Sets whether the axis has minor gridlines.

      Set this property to true to enable minor gridlines for the axis, or false to disable them. Only axes in the primary axis group can have gridlines.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setHasMinorGridlines(true);
       
      Parameters:
      value - true if the axis has minor gridlines; otherwise, false. This property applies only to axes in the primary axis group.
    • getHasTitle

      boolean getHasTitle()
      Gets whether the axis has a visible title.

      This property indicates whether the axis title is displayed. Use getAxisTitle() to access and configure the title when this property is true.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setHasTitle(true);
       boolean hasTitle = axis.getHasTitle();
       
      Returns:
      true if the axis has a visible title; otherwise, false.
    • setHasTitle

      void setHasTitle(boolean value)
      Sets whether the axis has a visible title.

      Set this property to true to display the axis title, or false to hide it. Use getAxisTitle() to access and configure the title when this property is true.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setHasTitle(true);
       
      Parameters:
      value - true if the axis has a visible title; otherwise, false.
    • getLogBase

      double getLogBase()
      Gets the base of the logarithm used by the axis when log scales are enabled.

      Use this method with getScaleType() to read the logarithmic base of a value axis configured with ScaleType.Logarithmic.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setScaleType(ScaleType.Logarithmic);
       axis.setLogBase(20d);
       double logBase = axis.getLogBase();
       
      Returns:
      The logarithmic base used by the axis.
    • setLogBase

      void setLogBase(double value)
      Sets the base of the logarithm used by the axis when log scales are enabled.

      Use this method with setScaleType(ScaleType) to set the logarithmic base of a value axis configured with ScaleType.Logarithmic.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setScaleType(ScaleType.Logarithmic);
       axis.setLogBase(20d);
       
      Parameters:
      value - The logarithmic base used by the axis.
    • getMajorGridlines

      IGridlines getMajorGridlines()
      Gets the major gridlines for the axis.

      The returned IGridlines object represents the major gridlines on the specified axis. Only axes in the primary axis group can have gridlines.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setHasMajorGridlines(true);
       IGridlines gridlines = axis.getMajorGridlines();
       
      Returns:
      The IGridlines object that represents the major gridlines for the axis.
    • getMajorTickMark

      TickMark getMajorTickMark()
      Gets the type of major tick mark for the specified axis.

      This property determines whether major tick marks are displayed inside the axis, outside the axis, across the axis, or not displayed.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 120},
           {"Feb", 150}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setMajorTickMark(TickMark.Outside);
       TickMark tickMark = axis.getMajorTickMark();
       
      Returns:
      The major tick mark type for the axis.
    • setMajorTickMark

      void setMajorTickMark(TickMark value)
      Sets the type of major tick mark for the specified axis.

      This property determines whether major tick marks are displayed inside the axis, outside the axis, across the axis, or not displayed.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 120},
           {"Feb", 150}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setMajorTickMark(TickMark.Outside);
       
      Parameters:
      value - The major tick mark type to apply to the axis.
    • getMajorUnit

      double getMajorUnit()
      Gets the major unit for the value axis.

      The major unit determines the interval between major tick marks and major gridlines on the value axis.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 10},
           {"Feb", 25}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMajorUnit(5d);
       double majorUnit = axis.getMajorUnit();
       
      Returns:
      The major unit for the value axis.
    • setMajorUnit

      void setMajorUnit(double value)
      Sets the major unit for the value axis.

      The major unit determines the interval between major tick marks and major gridlines on the value axis.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 10},
           {"Feb", 25}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMajorUnit(5d);
       
      Parameters:
      value - The major unit for the value axis.
    • getMajorUnitIsAuto

      boolean getMajorUnitIsAuto()
      Gets whether Excel automatically calculates the major unit for the value axis.

      This method returns true when the major unit is determined automatically by Excel, and false when a custom major unit is used.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 10},
           {"Feb", 25}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMajorUnitIsAuto(true);
       boolean isAuto = axis.getMajorUnitIsAuto();
       
      Returns:
      true if Excel automatically calculates the major unit for the value axis; otherwise, false.
    • setMajorUnitIsAuto

      void setMajorUnitIsAuto(boolean value)
      Sets whether Excel automatically calculates the major unit for the value axis.

      Set value to true to let Excel determine the major unit automatically, or false to use a custom major unit.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 10},
           {"Feb", 25}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMajorUnitIsAuto(true);
       
      Parameters:
      value - true if Excel automatically calculates the major unit for the value axis; otherwise, false.
    • getMajorUnitScale

      TimeUnit getMajorUnitScale()
      Gets the major unit scale for the category axis when getCategoryType() is CategoryType.TimeScale.

      If the major unit is calculated automatically, this method returns the current base unit.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Date", "Sales"},
           {45292d, 12},
           {45323d, 18},
           {45352d, 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setCategoryType(CategoryType.TimeScale);
       axis.setMajorUnitScale(TimeUnit.Months);
       TimeUnit majorUnitScale = axis.getMajorUnitScale();
       
      Returns:
      The major unit scale for the category axis. Returns the current base unit if the major unit is calculated automatically.
    • setMajorUnitScale

      void setMajorUnitScale(TimeUnit value)
      Sets the major unit scale for the category axis when getCategoryType() is CategoryType.TimeScale.

      Use this method to specify the time unit used between major tick marks on a date-based category axis.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Date", "Sales"},
           {45292d, 12},
           {45323d, 18},
           {45352d, 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setCategoryType(CategoryType.TimeScale);
       axis.setMajorUnitScale(TimeUnit.Months);
       
      Parameters:
      value - The major unit scale for the category axis.
    • getMaximumScale

      double getMaximumScale()
      Gets the maximum value on the value axis.

      Use getMaximumScaleIsAuto() to determine whether this value is calculated automatically by Excel or set explicitly with setMaximumScale(double).

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 12},
           {"Feb", 18},
           {"Mar", 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMaximumScale(20);
       double maximumScale = axis.getMaximumScale();
       
      Returns:
      The maximum value on the value axis.
    • setMaximumScale

      void setMaximumScale(double value)
      Sets the maximum value on the value axis.
      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 12},
           {"Feb", 18},
           {"Mar", 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMaximumScale(20);
       
      Parameters:
      value - The maximum value on the value axis.
    • getMaximumScaleIsAuto

      boolean getMaximumScaleIsAuto()
      Gets whether Excel calculates the maximum value for the value axis automatically.

      When this method returns true, the maximum scale is determined by Excel. When it returns false, the maximum scale is set explicitly.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 12},
           {"Feb", 18},
           {"Mar", 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       boolean maximumScaleIsAuto = axis.getMaximumScaleIsAuto();
       
      Returns:
      true if Excel calculates the maximum value for the value axis automatically; otherwise, false.
    • setMaximumScaleIsAuto

      void setMaximumScaleIsAuto(boolean value)
      Sets whether Excel calculates the maximum value for the value axis automatically.

      When value is true, the maximum scale is determined by Excel. When value is false, the maximum scale is set explicitly.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 12},
           {"Feb", 18},
           {"Mar", 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMaximumScaleIsAuto(true);
       
      Parameters:
      value - true if Excel calculates the maximum value for the value axis automatically; otherwise, false.
    • getMinimumScale

      double getMinimumScale()
      Gets the minimum value on the value axis.

      Use getMinimumScaleIsAuto() to determine whether this value is calculated automatically by Excel or set explicitly with setMinimumScale(double).

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 12},
           {"Feb", 18},
           {"Mar", 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       double minimumScale = axis.getMinimumScale();
       
      Returns:
      The minimum value on the value axis.
    • setMinimumScale

      void setMinimumScale(double value)
      Sets the minimum value on the value axis.
      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 12},
           {"Feb", 18},
           {"Mar", 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMinimumScale(100.0);
       
      Parameters:
      value - The minimum value on the value axis.
    • getMinimumScaleIsAuto

      boolean getMinimumScaleIsAuto()
      Gets whether Excel calculates the minimum value for the value axis automatically.

      When this method returns true, the minimum scale is determined by Excel. When it returns false, the minimum scale is set explicitly.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 12},
           {"Feb", 18},
           {"Mar", 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMinimumScaleIsAuto(false);
       boolean minimumScaleIsAuto = axis.getMinimumScaleIsAuto();
       
      Returns:
      true if Excel calculates the minimum value for the value axis automatically; otherwise, false.
    • setMinimumScaleIsAuto

      void setMinimumScaleIsAuto(boolean value)
      Sets whether Excel calculates the minimum value for the value axis automatically.

      When value is true, the minimum scale is determined by Excel. When value is false, the minimum scale is set explicitly.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 12},
           {"Feb", 18},
           {"Mar", 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMinimumScaleIsAuto(false);
       
      Parameters:
      value - true if Excel calculates the minimum value for the value axis automatically; otherwise, false.
    • getMinorGridlines

      IGridlines getMinorGridlines()
      Gets the IGridlines object that represents the minor gridlines for the specified axis.

      Only axes in the primary axis group can have gridlines. You can use the returned object to configure the appearance of minor gridlines after enabling them with setHasMinorGridlines(boolean).

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 10},
           {"Feb", 20}
       });
       IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200);
       shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
       IAxis valueAxis = shape.getChart().getAxes().item(AxisType.Value);
       valueAxis.setHasMinorGridlines(true);
       IGridlines minorGridlines = valueAxis.getMinorGridlines();
       minorGridlines.getFormat().getLine().getColor().setRGB(Color.GetLightGray());
       
      Returns:
      The IGridlines object that represents the minor gridlines for the specified axis.
    • getMinorTickMark

      TickMark getMinorTickMark()
      Gets the minor tick mark type for the axis.

      Use this property to determine whether minor tick marks are displayed inside the axis, outside the axis, across the axis, or not displayed.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 120},
           {"Feb", 150}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMinorTickMark(TickMark.Inside);
       TickMark tickMark = axis.getMinorTickMark();
       
      Returns:
      The minor tick mark type for the axis.
    • setMinorTickMark

      void setMinorTickMark(TickMark value)
      Sets the type of minor tick mark for the specified axis.

      Use this method to control how minor tick marks are displayed on the axis.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMinorTickMark(TickMark.Inside);
       
      Parameters:
      value - The minor tick mark type.
    • getMinorUnit

      double getMinorUnit()
      Gets the minor unit value on the value axis.

      This property returns the interval between minor tick marks on a value axis. If getMinorUnitIsAuto() is true, the returned value is calculated automatically.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Name", "Value"},
           {"A", 10},
           {"B", 30}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMinorUnit(5d);
       double minorUnit = axis.getMinorUnit();
       
      Returns:
      The minor unit value on the value axis.
    • setMinorUnit

      void setMinorUnit(double value)
      Sets the minor unit value on the value axis.

      This property sets the interval between minor tick marks on a value axis. If getMinorUnitIsAuto() is true, Excel calculates the minor unit automatically.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Name", "Value"},
           {"A", 10},
           {"B", 30}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setMinorUnit(5d);
       
      Parameters:
      value - The minor unit value on the value axis.
    • getMinorUnitIsAuto

      boolean getMinorUnitIsAuto()
      Gets whether Microsoft Excel calculates minor units for the value axis.

      Returns true if the minor unit for the value axis is determined automatically by Excel.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Name", "Value"},
           {"A", 10},
           {"B", 20}
       });
       IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, worksheet.getRange("A1:B3"));
       IAxis axis = shape.getChart().getAxes().item(AxisType.Value);
       boolean autoMinorUnit = axis.getMinorUnitIsAuto();
       
      Returns:
      true if Excel calculates the minor units for the value axis; otherwise, false.
    • setMinorUnitIsAuto

      void setMinorUnitIsAuto(boolean value)
      Sets whether Microsoft Excel calculates minor units for the value axis.

      Set value to true to let Excel determine the minor unit for the value axis automatically.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Name", "Value"},
           {"A", 10},
           {"B", 20}
       });
       IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, worksheet.getRange("A1:B3"));
       IAxis axis = shape.getChart().getAxes().item(AxisType.Value);
       axis.setMinorUnitIsAuto(true);
       
      Parameters:
      value - true if Excel calculates the minor units for the value axis; otherwise, false.
    • getMinorUnitScale

      TimeUnit getMinorUnitScale()
      Gets the minor unit scale for the category axis when getCategoryType() is CategoryType.TimeScale.

      If the minor unit is calculated automatically, this method returns the current base unit.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Date", "Sales"},
           {45292d, 12},
           {45323d, 18},
           {45352d, 15}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setCategoryType(CategoryType.TimeScale);
       axis.setMinorUnitScale(TimeUnit.Months);
       TimeUnit minorUnitScale = axis.getMinorUnitScale();
       
      Returns:
      The minor unit scale for the category axis. Returns the current base unit if the minor unit is calculated automatically.
    • setMinorUnitScale

      void setMinorUnitScale(TimeUnit value)
      Sets the minor unit scale for the category axis when the category type is CategoryType.TimeScale.

      Use this method together with setCategoryType(CategoryType) and setMinorUnit(double) to control how minor units are interpreted on a time-scaled category axis.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {null, "Sales"},
           {new GregorianCalendar(2024, 0, 1), 10},
           {new GregorianCalendar(2024, 0, 15), 18},
           {new GregorianCalendar(2024, 1, 1), 25}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setCategoryType(CategoryType.TimeScale);
       axis.setMinorUnitScale(TimeUnit.Days);
       
      Parameters:
      value - The time unit used as the minor unit scale on a time-scaled category axis. Should not be null.
    • getParent

      IAxes getParent()
      Gets the IAxes collection that contains this axis.

      Use this method to access the parent axes collection of the current axis when you need to work with other axes on the same chart.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 100},
           {"Feb", 200}
       });
       IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 230);
       shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B3"), RowCol.Columns, true, true);
       IAxis axis = shape.getChart().getAxes().item(AxisType.Category);
       IAxes axes = axis.getParent();
       
      Returns:
      The parent IAxes collection that contains this axis.
    • getReversePlotOrder

      boolean getReversePlotOrder()
      Gets whether Excel plots data points on the axis from last to first.

      This property returns true when the axis uses reverse plot order. Use setReversePlotOrder(boolean) to change the plot direction.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 120},
           {"Feb", 150},
           {"Mar", 90}
       });
       IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 230);
       shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = shape.getChart().getAxes().item(AxisType.Category);
       axis.setReversePlotOrder(true);
       boolean reversePlotOrder = axis.getReversePlotOrder();
       
      Returns:
      true if Excel plots data points from last to first; otherwise, false.
    • setReversePlotOrder

      void setReversePlotOrder(boolean value)
      Sets whether Excel plots data points on the axis from last to first.
      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 120},
           {"Feb", 150},
           {"Mar", 90}
       });
       IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 230);
       shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B4"), RowCol.Columns, true, true);
       IAxis axis = shape.getChart().getAxes().item(AxisType.Category);
       axis.setReversePlotOrder(true);
       
      Parameters:
      value - true if Excel plots data points from last to first; otherwise, false.
    • getScaleType

      ScaleType getScaleType()
      Gets the scale type of the value axis.

      Use this method to determine whether the value axis uses a linear or logarithmic scale.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Item", "Value"},
           {"A", 10},
           {"B", 100},
           {"C", 1000}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 10, 10, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setScaleType(ScaleType.Logarithmic);
       ScaleType scaleType = axis.getScaleType();
       
      Returns:
      The value axis scale type.
    • setScaleType

      void setScaleType(ScaleType value)
      Sets the scale type of the value axis.

      Use this method to switch the value axis between linear and logarithmic scaling.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setScaleType(ScaleType.Logarithmic);
       
      Parameters:
      value - The scale type to apply to the value axis.
    • getTickLabelPosition

      TickLabelPosition getTickLabelPosition()
      Gets the position of tick-mark labels on the specified axis.

      Use this method to determine whether axis labels are displayed on the low side, high side, next to the axis, or hidden.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 100},
           {"Feb", 120}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, worksheet.getRange("A1:B3")).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       axis.setTickLabelPosition(TickLabelPosition.High);
       TickLabelPosition position = axis.getTickLabelPosition();
       
      Returns:
      The TickLabelPosition value that specifies where tick-mark labels are displayed on the axis.
    • setTickLabelPosition

      void setTickLabelPosition(TickLabelPosition value)
      Sets the position of tick-mark labels on the specified axis.

      Use TickLabelPosition to place tick-mark labels at the low side, high side, next to the axis, or hide them.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setTickLabelPosition(TickLabelPosition.High);
       
      Parameters:
      value - The tick-label position to apply.
    • getTickLabels

      ITickLabels getTickLabels()
      Gets the tick-mark labels for this axis.

      The returned ITickLabels object provides access to label formatting and layout settings for the axis, such as number format, text direction, and label offset.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 1200},
           {"Feb", 1500},
           {"Mar", 1100}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Value, AxisGroup.Primary);
       ITickLabels tickLabels = axis.getTickLabels();
       tickLabels.setNumberFormat("$#,##0");
       
      Returns:
      The ITickLabels object that represents the tick-mark labels for this axis.
    • getTickLabelSpacing

      int getTickLabelSpacing()
      Gets the number of categories or series between tick-mark labels.

      This property applies only to category and series axes. When tick label spacing is automatic, this method returns 1.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 100},
           {"Feb", 120},
           {"Mar", 140}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setTickLabelSpacing(2);
       int spacing = axis.getTickLabelSpacing();
       
      Returns:
      The number of categories or series between tick-mark labels. Returns 1 if tick label spacing is automatic.
    • setTickLabelSpacing

      void setTickLabelSpacing(int value)
      Sets the number of categories or series between tick-mark labels.

      This property applies only to category and series axes. When tick label spacing is automatic, this method Sets 1.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 100},
           {"Feb", 120},
           {"Mar", 140}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setTickLabelSpacing(2);
       
      Parameters:
      value - The number of categories or series between tick-mark labels. Sets 1 if tick label spacing is automatic.
    • getTickLabelSpacingIsAuto

      boolean getTickLabelSpacingIsAuto()
      Gets whether tick label spacing is determined automatically.

      When this property is true, the axis automatically calculates the spacing between tick-mark labels. When it is false, the spacing can be controlled by setTickLabelSpacing(int).

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 120},
           {"Feb", 150}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, worksheet.getRange("A1:B3")).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Category);
       boolean isAuto = axis.getTickLabelSpacingIsAuto();
       
      Returns:
      true if tick label spacing is calculated automatically; otherwise, false.
    • setTickLabelSpacingIsAuto

      void setTickLabelSpacingIsAuto(boolean value)
      Sets whether tick label spacing is determined automatically.

      When this property is true, the axis automatically calculates the spacing between tick-mark labels. When it is false, the spacing can be controlled by setTickLabelSpacing(int).

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 120},
           {"Feb", 150}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, worksheet.getRange("A1:B3")).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Category);
       axis.setTickLabelSpacingIsAuto(true);
       
      Parameters:
      value - true if tick label spacing is calculated automatically; otherwise, false.
    • getTickMarkSpacing

      int getTickMarkSpacing()
      Gets the number of categories or series between tick marks.

      This property applies only to category and series axes.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 100},
           {"Feb", 120},
           {"Mar", 140}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setTickMarkSpacing(2);
       int spacing = axis.getTickMarkSpacing();
       
      Returns:
      The number of categories or series between tick marks.
    • setTickMarkSpacing

      void setTickMarkSpacing(int value)
      Sets the number of categories or series between tick marks.

      This property applies only to category and series axes.

      
       worksheet.getRange("A1:B4").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 100},
           {"Feb", 120},
           {"Mar", 140}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B4"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setTickMarkSpacing(2);
       
      Parameters:
      value - The number of categories or series between tick marks.
    • getType

      AxisType getType()
      Gets the axis type.

      The returned AxisType indicates whether this axis is a category axis, value axis, or series axis.

      
       worksheet.getRange("A1:B3").setValue(new Object[][] {
           {"Month", "Sales"},
           {"Jan", 100},
           {"Feb", 200}
       });
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 360, 220).getChart();
       chart.getSeriesCollection().add(worksheet.getRange("A1:B3"));
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       AxisType type = axis.getType();
       
      Returns:
      The axis type.
    • getVisible

      boolean getVisible()
      Gets whether the axis is visible.

      This property indicates whether the axis is displayed in the chart.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setVisible(false);
       boolean visible = axis.getVisible();
       
      Returns:
      true if the axis is visible; otherwise, false.
    • setVisible

      void setVisible(boolean value)
      Sets whether the axis is visible.

      Set this property to true to display the axis in the chart, or false to hide it.

      
       IChart chart = worksheet.getShapes().addChart(ChartType.ColumnClustered, 20, 20, 300, 200).getChart();
       IAxis axis = chart.getAxes().item(AxisType.Category, AxisGroup.Primary);
       axis.setVisible(false);
       
      Parameters:
      value - true if the axis is visible; otherwise, false.