Example:
# Instantiating a Workbook object workbook = Workbook() # Adding a new worksheet to the Excel object sheetIndex = workbook.getWorksheets().add() # Obtaining the reference of the newly added worksheet by passing its sheet index 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 chartIndex = worksheet.getCharts().add(ChartType.COLUMN, 5, 0, 25, 5) # Accessing the instance of the newly added 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().setCrosses(CrossType.MAXIMUM) # Set he number of categories or series between tick-mark labels. chart.getCategoryAxis().setTickLabelSpacing(2) # Saving the Excel file workbook.save("Book1.xlsx")
Property Getters/Setters Summary | ||
---|---|---|
method | getArea() | |
Gets the |
||
method | getAxisBetweenCategories() | |
method | setAxisBetweenCategories(value) | |
Represents if the value axis crosses the category axis between categories. | ||
method | getAxisLabels() | |
Gets the labels of the axis after call Chart.Calculate() methond. | ||
method | getAxisLine() | |
Gets the appearance of an Axis. | ||
method | getBaseUnitScale() | |
method | setBaseUnitScale(value) | |
Represents the base unit scale for the category axis. The value of the property is TimeUnit integer constant. | ||
method | getCategoryType() | |
method | setCategoryType(value) | |
Represents the category axis type. The value of the property is CategoryType integer constant. | ||
method | getCrossAt() | |
method | setCrossAt(value) | |
Represents the point on the value axis where the category axis crosses it. | ||
method | getCrossType() | |
method | setCrossType(value) | |
Represents the |
||
method | getCustUnit() | |
method | setCustUnit(value) | |
Specifies a custom value for the display unit. | ||
method | getDisplayUnit() | |
method | setDisplayUnit(value) | |
Represents the unit label for the specified axis. The value of the property is DisplayUnitType integer constant. | ||
method | getDisplayUnitLabel() | |
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. | ||
method | hasMultiLevelLabels() | |
method | setHasMultiLevelLabels(value) | |
Indicates whether the labels shall be shown as multi level. | ||
method | isAutomaticMajorUnit() | |
method | setAutomaticMajorUnit(value) | |
Indicates whether the major unit of the axis is automatically assigned. | ||
method | isAutomaticMaxValue() | |
method | setAutomaticMaxValue(value) | |
Indicates whether the max value is automatically assigned. | ||
method | isAutomaticMinorUnit() | |
method | setAutomaticMinorUnit(value) | |
Indicates whether the minor unit of the axis is automatically assigned. | ||
method | isAutomaticMinValue() | |
method | setAutomaticMinValue(value) | |
Indicates whether the min value is automatically assigned. | ||
method | isAutoTickLabelSpacing() | |
method | setAutoTickLabelSpacing(value) | |
Indicates whether ticklabel spacing is automatic | ||
method | isBaseUnitAuto() | |
method | setBaseUnitAuto(value) | |
Represents whether the base unit is automatic. | ||
method | isDisplayUnitLabelShown() | |
method | setDisplayUnitLabelShown(value) | |
Represents if the display unit label is shown on the specified axis. | ||
method | isLogarithmic() | |
method | setLogarithmic(value) | |
Represents if the value axis scale type is logarithmic or not. | ||
method | isPlotOrderReversed() | |
method | setPlotOrderReversed(value) | |
Represents if Microsoft Excel plots data points from last to first. | ||
method | isVisible() | |
method | setVisible(value) | |
Represents if the axis is visible. | ||
method | getLogBase() | |
method | setLogBase(value) | |
Represents the logarithmic base. Default value is 10.Only applies for Excel2007. | ||
method | getMajorGridLines() | |
Represents major gridlines on a chart axis. | ||
method | getMajorTickMark() | |
method | setMajorTickMark(value) | |
Represents the type of major tick mark for the specified axis. The value of the property is TickMarkType integer constant. | ||
method | getMajorUnit() | |
method | setMajorUnit(value) | |
Represents the major units for the axis. | ||
method | getMajorUnitScale() | |
method | setMajorUnitScale(value) | |
Represents the major unit scale for the category axis. The value of the property is TimeUnit integer constant. | ||
method | getMaxValue() | |
method | setMaxValue(value) | |
Represents the maximum value on the value axis. | ||
method | getMinorGridLines() | |
Represents minor gridlines on a chart axis. | ||
method | getMinorTickMark() | |
method | setMinorTickMark(value) | |
Represents the type of minor tick mark for the specified axis. The value of the property is TickMarkType integer constant. | ||
method | getMinorUnit() | |
method | setMinorUnit(value) | |
Represents the minor units for the axis. | ||
method | getMinorUnitScale() | |
method | setMinorUnitScale(value) | |
Represents the major unit scale for the category axis. The value of the property is TimeUnit integer constant. | ||
method | getMinValue() | |
method | setMinValue(value) | |
Represents the minimum value on the value axis. | ||
method | getTickLabelPosition() | |
method | setTickLabelPosition(value) | |
Represents the position of tick-mark labels on the specified axis. The value of the property is TickLabelPositionType integer constant. | ||
method | getTickLabels() | |
Returns a |
||
method | getTickLabelSpacing() | |
method | setTickLabelSpacing(value) | |
Represents the number of categories or series between tick-mark labels. Applies only to category and series axes. | ||
method | getTickMarkSpacing() | |
method | setTickMarkSpacing(value) | |
Returns or sets the number of categories or series between tick marks. Applies only to category and series axes. | ||
method | getTitle() | |
Gets the axis' title. |
Method Summary | ||
---|---|---|
method | isAutoCross() | |
Indicates whether Microsoft Workbook automatically sets the axis crossing point. | ||
method | isCrossAtMax() | |
Indicates whether Microsoft Workbook automatically sets the axis crossing point. | ||
method | setAutoCross() | |
Sets the axis crossing point as automatic. | ||
method | setCrossAtMax(isCrossAtMax) | |
Sets whether the axis crosses at the maximum value. |
Property Getters/Setters Detail |
---|
getArea : Area | |
Area getArea() |
isAutomaticMinValue/setAutomaticMinValue : boolean | |
boolean isAutomaticMinValue() / setAutomaticMinValue(value) |
getMinValue/setMinValue : Object | |
Object getMinValue() / setMinValue(value) |
isAutomaticMaxValue/setAutomaticMaxValue : boolean | |
boolean isAutomaticMaxValue() / setAutomaticMaxValue(value) |
getMaxValue/setMaxValue : Object | |
Object getMaxValue() / setMaxValue(value) |
isAutomaticMajorUnit/setAutomaticMajorUnit : boolean | |
boolean isAutomaticMajorUnit() / setAutomaticMajorUnit(value) |
getMajorUnit/setMajorUnit : float | |
float getMajorUnit() / setMajorUnit(value) |
isAutomaticMinorUnit/setAutomaticMinorUnit : boolean | |
boolean isAutomaticMinorUnit() / setAutomaticMinorUnit(value) |
getMinorUnit/setMinorUnit : float | |
float getMinorUnit() / setMinorUnit(value) |
getAxisLine : Line | |
Line getAxisLine() |
getMajorTickMark/setMajorTickMark : int | |
int getMajorTickMark() / setMajorTickMark(value) |
getMinorTickMark/setMinorTickMark : int | |
int getMinorTickMark() / setMinorTickMark(value) |
getTickLabelPosition/setTickLabelPosition : int | |
int getTickLabelPosition() / setTickLabelPosition(value) |
getCrossAt/setCrossAt : float | |
float getCrossAt() / setCrossAt(value) |
getCrossType/setCrossType : int | |
int getCrossType() / setCrossType(value) |
getLogBase/setLogBase : float | |
float getLogBase() / setLogBase(value) |
isLogarithmic/setLogarithmic : boolean | |
boolean isLogarithmic() / setLogarithmic(value) |
isPlotOrderReversed/setPlotOrderReversed : boolean | |
boolean isPlotOrderReversed() / setPlotOrderReversed(value) |
getAxisBetweenCategories/setAxisBetweenCategories : boolean | |
boolean getAxisBetweenCategories() / setAxisBetweenCategories(value) |
getTickLabels : TickLabels | |
TickLabels getTickLabels() |
getTickLabelSpacing/setTickLabelSpacing : int | |
int getTickLabelSpacing() / setTickLabelSpacing(value) |
isAutoTickLabelSpacing/setAutoTickLabelSpacing : boolean | |
boolean isAutoTickLabelSpacing() / setAutoTickLabelSpacing(value) |
getTickMarkSpacing/setTickMarkSpacing : int | |
int getTickMarkSpacing() / setTickMarkSpacing(value) |
getDisplayUnit/setDisplayUnit : int | |
int getDisplayUnit() / setDisplayUnit(value) |
getCustUnit/setCustUnit : int | |
int getCustUnit() / setCustUnit(value) |
getDisplayUnitLabel : DisplayUnitLabel | |
DisplayUnitLabel getDisplayUnitLabel() |
isDisplayUnitLabelShown/setDisplayUnitLabelShown : boolean | |
boolean isDisplayUnitLabelShown() / setDisplayUnitLabelShown(value) |
getTitle : Title | |
Title getTitle() |
getCategoryType/setCategoryType : int | |
int getCategoryType() / setCategoryType(value) |
getBaseUnitScale/setBaseUnitScale : int | |
int getBaseUnitScale() / setBaseUnitScale(value) |
isBaseUnitAuto/setBaseUnitAuto : boolean | |
boolean isBaseUnitAuto() / setBaseUnitAuto(value) |
getMajorUnitScale/setMajorUnitScale : int | |
int getMajorUnitScale() / setMajorUnitScale(value) |
Example:
workbook = Workbook() # Adding a new worksheet to the Excel object sheetIndex = workbook.getWorksheets().add() # Obtaining the reference of the newly added worksheet by passing its sheet index 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 chartIndex = worksheet.getCharts().add(ChartType.COLUMN, 5, 0, 25, 5) # Accessing the instance of the newly added chart chart = worksheet.getCharts().get(chartIndex) chart.getCategoryAxis().setCategoryType(CategoryType.TIME_SCALE) chart.getCategoryAxis().setMajorUnitScale(TimeUnit.MONTHS) chart.getCategoryAxis().setMajorUnit(2)
getMinorUnitScale/setMinorUnitScale : int | |
int getMinorUnitScale() / setMinorUnitScale(value) |
Example:
workbook = Workbook() # Adding a new worksheet to the Excel object sheetIndex = workbook.getWorksheets().add() # Obtaining the reference of the newly added worksheet by passing its sheet index 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 chartIndex = worksheet.getCharts().add(ChartType.COLUMN, 5, 0, 25, 5) # Accessing the instance of the newly added chart chart = worksheet.getCharts().get(chartIndex) chart.getCategoryAxis().setCategoryType(CategoryType.TIME_SCALE) chart.getCategoryAxis().setMinorUnitScale(TimeUnit.MONTHS) chart.getCategoryAxis().setMinorUnit(2)
isVisible/setVisible : boolean | |
boolean isVisible() / setVisible(value) |
getMajorGridLines : Line | |
Line getMajorGridLines() |
Example:
workbook = Workbook() # Adding a new worksheet to the Excel object sheetIndex = workbook.getWorksheets().add() # Obtaining the reference of the newly added worksheet by passing its sheet index 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 chartIndex = worksheet.getCharts().add(ChartType.COLUMN, 5, 0, 25, 5) # Accessing the instance of the newly added chart chart = worksheet.getCharts().get(chartIndex) chart.getValueAxis().getMajorGridLines().setVisible(False) chart.getCategoryAxis().getMajorGridLines().setVisible(True)
getMinorGridLines : Line | |
Line getMinorGridLines() |
hasMultiLevelLabels/setHasMultiLevelLabels : boolean | |
boolean hasMultiLevelLabels() / setHasMultiLevelLabels(value) |
getAxisLabels : ArrayList | |
ArrayList getAxisLabels() |
Method Detail |
---|
isAutoCross | |
boolean isAutoCross() |
isCrossAtMax | |
boolean isCrossAtMax() |
setAutoCross | |
setAutoCross() |
setCrossAtMax | |
setCrossAtMax(isCrossAtMax) |