Encapsulates the object that represents a chart's axis.
Example:
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Adding a new worksheet to the Excel object
int sheetIndex = workbook.getWorksheets().add();
//Obtaining the reference of the newly added worksheet by passing its sheet index
Worksheet worksheet = workbook.getWorksheets().get(sheetIndex);
//Adding a sample value to "A1" cell
worksheet.getCells().get("A1").putValue(50);
//Adding a sample value to "A2" cell
worksheet.getCells().get("A2").putValue(100);
//Adding a sample value to "A3" cell
worksheet.getCells().get("A3").putValue(150);
//Adding a sample value to "B1" cell
worksheet.getCells().get("B1").putValue(4);
//Adding a sample value to "B2" cell
worksheet.getCells().get("B2").putValue(20);
//Adding a sample value to "B3" cell
worksheet.getCells().get("B3").putValue(50);
//Adding a chart to the worksheet
int chartIndex = worksheet.getCharts().add(ChartType.COLUMN, 5, 0, 25, 5);
//Accessing the instance of the newly added chart
Chart chart = worksheet.getCharts().get(chartIndex);
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
chart.getNSeries().add("A1:B3", true);
//Set the max value of value axis
chart.getValueAxis().setMaxValue(200);
//Set the min value of value axis
chart.getValueAxis().setMinValue(0);
//Set the major unit
chart.getValueAxis().setMajorUnit(25);
//Category(X) axis crosses at the maxinum value.
chart.getValueAxis().setCrossType(CrossType.MAXIMUM);
//Set he number of categories or series between tick-mark labels.
chart.getCategoryAxis().setTickLabelSpacing(2);
//do your business
//Saving the Excel file
workbook.save("book1.xlsx");
Represents a unit label on an axis in the specified chart.
Unit labels are useful for charting large values— for example, in the millions or billions.
public int getMajorTickMark() / public void setMajorTickMark(int value)
Represents the type of major tick mark for the specified axis.
The value of the property is TickMarkType integer constant.
getMinorTickMark/setMinorTickMark
public int getMinorTickMark() / public void setMinorTickMark(int value)
Represents the type of minor tick mark for the specified axis.
The value of the property is TickMarkType integer constant.
getTickLabelPosition/setTickLabelPosition
public int getTickLabelPosition() / public void setTickLabelPosition(int value)
Represents the position of tick-mark labels on the specified axis.
The value of the property is TickLabelPositionType integer constant.
getCrossAt/setCrossAt
public double getCrossAt() / public void setCrossAt(double value)
Represents the point on the value axis where the category axis crosses it.
The number should be a integer when it applies to category axis.
And the value must be between 1 and 31999.
getCrossType/setCrossType
public int getCrossType() / public void setCrossType(int value)
Represents the CrossType on the specified axis where the other axis crosses.
The value of the property is CrossType integer constant.
getLogBase/setLogBase
public double getLogBase() / public void setLogBase(double value)
Represents the logarithmic base. Default value is 10.Only applies for Excel2007.
isLogarithmic/setLogarithmic
public boolean isLogarithmic() / public void setLogarithmic(boolean value)
Represents if the value axis scale type is logarithmic or not.
isPlotOrderReversed/setPlotOrderReversed
public boolean isPlotOrderReversed() / public void setPlotOrderReversed(boolean value)
Represents if Microsoft Excel plots data points from last to first.
getAxisBetweenCategories/setAxisBetweenCategories
public boolean getAxisBetweenCategories() / public void setAxisBetweenCategories(boolean value)
Represents if the value axis crosses the category axis between categories.
This property applies only to category axes, and it doesn't apply to 3-D charts.
Returns a TickLabels object that represents the tick-mark labels for the specified axis.
getTickLabelSpacing/setTickLabelSpacing
public int getTickLabelSpacing() / public void setTickLabelSpacing(int value)
Represents the number of categories or series between tick-mark labels. Applies only to category and series axes.
The number must be between 1 and 31999.
isAutoTickLabelSpacing/setAutoTickLabelSpacing
public boolean isAutoTickLabelSpacing() / public void setAutoTickLabelSpacing(boolean value)
Indicates whether the spacing of tick label is automatic
getTickMarkSpacing/setTickMarkSpacing
public int getTickMarkSpacing() / public void setTickMarkSpacing(int value)
Returns or sets the number of categories or series between tick marks. Applies only to category and series axes.
The number must be between 1 and 31999.
getDisplayUnit/setDisplayUnit
public int getDisplayUnit() / public void setDisplayUnit(int value)
Represents the unit label for the specified axis.
The value of the property is DisplayUnitType integer constant.
getCustUnit/setCustUnit
public int getCustUnit() / public void setCustUnit(int value)
Represents a unit label on an axis in the specified chart.
Unit labels are useful for charting large values— for example, in the millions or billions.
isDisplayUnitLabelShown/setDisplayUnitLabelShown
public boolean isDisplayUnitLabelShown() / public void setDisplayUnitLabelShown(boolean value)
Represents if the display unit label is shown on the specified axis.
The default value is True.
public int getCategoryType() / public void setCategoryType(int value)
Represents the category axis type.
The value of the property is CategoryType integer constant.
getBaseUnitScale/setBaseUnitScale
public int getBaseUnitScale() / public void setBaseUnitScale(int value)
Represents the base unit scale for the category axis.
The value of the property is TimeUnit integer constant.Setting this property only takes effect when the CategoryType property is set to TimeScale.
isBaseUnitAuto/setBaseUnitAuto
public boolean isBaseUnitAuto() / public void setBaseUnitAuto(boolean value)
Represents whether the base unit is automatic.
getMajorUnitScale/setMajorUnitScale
public int getMajorUnitScale() / public void setMajorUnitScale(int value)
Represents the major unit scale for the category axis.
The value of the property is TimeUnit integer constant.
Indicates whether Microsoft Workbook automatically sets the axis crossing point.
NOTE: This member is now obsolete. Instead,
please use Aspose.Cells.Charts.Axis.CrossType property.
This property will be removed 12 months later since JANUARY 2012.
Aspose apologizes for any inconvenience you may have experienced.
isCrossAtMax
public boolean isCrossAtMax()
Indicates whether Microsoft Workbook automatically sets the axis crossing point.
NOTE: This member is now obsolete. Instead,
please use Aspose.Cells.Charts.Axis.CrossType property.
This property will be removed 12 months later since JANUARY 2012.
Aspose apologizes for any inconvenience you may have experienced.
setAutoCross
public void setAutoCross()
Sets the axis crossing point as automatic.
NOTE: This member is now obsolete. Instead,
please use Aspose.Cells.Charts.Axis.CrossType property.
This property will be removed 12 months later since JANUARY 2012.
Aspose apologizes for any inconvenience you may have experienced.
setCrossAtMax
public void setCrossAtMax(boolean isCrossAtMax)
Sets whether the axis crosses at the maximum value.
NOTE: This member is now obsolete. Instead,
please use Aspose.Cells.Charts.Axis.CrossType property.
This property will be removed 12 months later since JANUARY 2012.
Aspose apologizes for any inconvenience you may have experienced.