Example:
# Instantiating a Workbook object workbook = Workbook() # Obtaining the reference of the first worksheet worksheet = workbook.getWorksheets().get(0) # 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(60) # Adding a sample value to "B2" cell worksheet.getCells().get("B2").putValue(32) # Adding a sample value to "B3" cell worksheet.getCells().get("B3").putValue(50) # Adding a chart to the worksheet chartIndex = worksheet.getCharts().add(ChartType.PIE_EXPLODED, 5, 0, 25, 10) # 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) # Show Data Labels chart.getNSeries().get(0).getDataLabels().setValueShown(True) for i in range(0, chart.getNSeries().get(0).getPoints().getCount()): # Get Data Point point = chart.getNSeries().get(0).getPoints().get(i) # Set Pir Explosion point.setExplosion(15) # Set Border Color point.getBorder().setColor(Color.getRed()) # Saving the Excel file workbook.save("Book1.xls")
Property Getters/Setters Summary | ||
---|---|---|
method | getArcEndPointXPx() | |
Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart. | ||
method | getArcEndPointYPx() | |
Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart. | ||
method | getArcStartPointXPx() | |
Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart. | ||
method | getArcStartPointYPx() | |
Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart. | ||
method | getArea() | |
Gets the |
||
method | getBorder() | |
Gets the |
||
method | getBorderWidthPx() | |
Gets the width of border in units of pixels after calls Chart.Calculate() method. | ||
method | getDataLabels() | |
Returns a DataLabels object that represents the data label associated with the point. | ||
method | getEndAngle() | |
Gets the ending angle for the pie section, measured in degrees clockwise from the x-axis after calls Chart.Calculate() method. Applies to Pie chart. | ||
method | getExplosion() | |
method | setExplosion(value) | |
The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter. | ||
method | getInnerArcEndPointXPx() | |
Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart. | ||
method | getInnerArcEndPointYPx() | |
Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart. | ||
method | getInnerArcStartPointXPx() | |
Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart. | ||
method | getInnerArcStartPointYPx() | |
Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart. | ||
method | getInnerRadiusPx() | |
Gets the inner radius of doughnut slice in units of pixels after calls Chart.Calculate() method. Applies to Doughnut chart. | ||
method | isInSecondaryPlot() | |
method | setInSecondaryPlot(value) | |
Gets or sets a value indicates whether this data points is in the second pie or bar on a pie of pie or bar of pie chart | ||
method | getMarker() | |
Gets the |
||
method | getMarkerBackgroundColor() | |
method | setMarkerBackgroundColor(value) | |
Represents the marker backgournd color in a line chart, scatter chart, or radar chart. | ||
method | getMarkerBackgroundColorSetType() | |
method | setMarkerBackgroundColorSetType(value) | |
Gets or sets the marker background color set type. The value of the property is FormattingType integer constant. | ||
method | getMarkerForegroundColor() | |
method | setMarkerForegroundColor(value) | |
Represents the marker foregournd color in a line chart, scatter chart, or radar chart. | ||
method | getMarkerForegroundColorSetType() | |
method | setMarkerForegroundColorSetType(value) | |
Gets or sets the marker foreground color set type. The value of the property is FormattingType integer constant. | ||
method | getMarkerSize() | |
method | setMarkerSize(value) | |
Represents the marker size in a line chart, scatter chart, or radar chart. | ||
method | getMarkerStyle() | |
method | setMarkerStyle(value) | |
Represents the marker style in a line chart, scatter chart, or radar chart. The value of the property is ChartMarkerType integer constant. | ||
method | getRadiusPx() | |
Gets the radius of bubble, pie or doughnut in units of pixels after calls Chart.Calculate() method. | ||
method | getShadow() | |
method | setShadow(value) | |
True if the chartpoint has a shadow. | ||
method | getShapeHeight() | |
Gets the height in units of 1/4000 of chart's height after calls Chart.Calculate() method. | ||
method | getShapeHeightPx() | |
Gets the height in units of pixels after calls Chart.Calculate() method. | ||
method | getShapeProperties() | |
Gets the object that holds the visual shape properties of the ChartPoint. | ||
method | getShapeWidth() | |
Gets the width in units of 1/4000 of chart's width after calls Chart.Calculate() method. | ||
method | getShapeWidthPx() | |
Gets the width in units of pixels after calls Chart.Calculate() method. | ||
method | getShapeX() | |
Gets the x coordinate of the upper left corner in units of 1/4000 of chart's width after calls Chart.Calculate() method. | ||
method | getShapeXPx() | |
Gets the x coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method. | ||
method | getShapeY() | |
Gets the y coordinate of the upper left corner in units of 1/4000 of chart's height after calls Chart.Calculate() method. | ||
method | getShapeYPx() | |
Gets the y coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method. | ||
method | getStartAngle() | |
Gets the starting angle for the pie section, measured in degrees clockwise from the x-axis after calls Chart.Calculate() method. Applies to Pie chart. | ||
method | getXValue() | |
method | setXValue(value) | |
Gets or sets the X value of the chart point. | ||
method | getXValueType() | |
Gets X value type of the chart point. The value of the property is CellValueType integer constant. | ||
method | getYValue() | |
method | setYValue(value) | |
Gets or sets the Y value of the chart point. | ||
method | getYValueType() | |
Gets Y value type of the chart point. The value of the property is CellValueType integer constant. |
Method Summary | ||
---|---|---|
method | getBottomPointCount() | |
Gets the number of bottom points after calls Chart.Calculate() method. | ||
method | getBottomPointXPx(index) | |
Gets x-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid | ||
method | getBottomPointYPx(index) | |
Gets y-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid | ||
method | getOnCategoryAxisPointCount() | |
Gets the number of the points on category axis after calls Chart.Calculate() method. Only applies to area chart. | ||
method | getOnCategoryAxisPointXPx(index) | |
Gets x-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Aarea chart. | ||
method | getOnCategoryAxisPointYPx(index) | |
Gets y-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart. | ||
method | getTopPointCount() | |
Gets the number of top points after calls Chart.Calculate() method. | ||
method | getTopPointXPx(index) | |
Gets x-coordinate of the top point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid and Area3D | ||
method | getTopPointYPx(index) | |
Gets y-coordinate of the top point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid and Area3D |
Property Getters/Setters Detail |
---|
getExplosion/setExplosion : int | |
int getExplosion() / setExplosion(value) |
getShadow/setShadow : boolean | |
boolean getShadow() / setShadow(value) |
getBorder : Line | |
Line getBorder() |
getArea : Area | |
Area getArea() |
getMarker : Marker | |
Marker getMarker() |
getMarkerStyle/setMarkerStyle : int | |
int getMarkerStyle() / setMarkerStyle(value) |
getMarkerSize/setMarkerSize : int | |
int getMarkerSize() / setMarkerSize(value) |
getMarkerForegroundColor/setMarkerForegroundColor : Color | |
Color getMarkerForegroundColor() / setMarkerForegroundColor(value) |
getMarkerForegroundColorSetType/setMarkerForegroundColorSetType : int | |
int getMarkerForegroundColorSetType() / setMarkerForegroundColorSetType(value) |
getMarkerBackgroundColor/setMarkerBackgroundColor : Color | |
Color getMarkerBackgroundColor() / setMarkerBackgroundColor(value) |
getMarkerBackgroundColorSetType/setMarkerBackgroundColorSetType : int | |
int getMarkerBackgroundColorSetType() / setMarkerBackgroundColorSetType(value) |
getDataLabels : DataLabels | |
DataLabels getDataLabels() |
getYValue/setYValue : Object | |
Object getYValue() / setYValue(value) |
getYValueType : int | |
int getYValueType() |
getXValue/setXValue : Object | |
Object getXValue() / setXValue(value) |
getXValueType : int | |
int getXValueType() |
getShapeProperties : ShapePropertyCollection | |
ShapePropertyCollection getShapeProperties() |
isInSecondaryPlot/setInSecondaryPlot : boolean | |
boolean isInSecondaryPlot() / setInSecondaryPlot(value) |
getShapeX : int | |
int getShapeX() |
getShapeY : int | |
int getShapeY() |
getShapeWidth : int | |
int getShapeWidth() |
getShapeHeight : int | |
int getShapeHeight() |
getShapeXPx : int | |
int getShapeXPx() |
getShapeYPx : int | |
int getShapeYPx() |
getShapeWidthPx : int | |
int getShapeWidthPx() |
getShapeHeightPx : int | |
int getShapeHeightPx() |
getBorderWidthPx : int | |
int getBorderWidthPx() |
getRadiusPx : int | |
int getRadiusPx() |
getInnerRadiusPx : int | |
int getInnerRadiusPx() |
getStartAngle : float | |
float getStartAngle() |
getEndAngle : float | |
float getEndAngle() |
getArcStartPointXPx : float | |
float getArcStartPointXPx() |
getArcStartPointYPx : float | |
float getArcStartPointYPx() |
getArcEndPointXPx : float | |
float getArcEndPointXPx() |
getArcEndPointYPx : float | |
float getArcEndPointYPx() |
getInnerArcStartPointXPx : float | |
float getInnerArcStartPointXPx() |
getInnerArcStartPointYPx : float | |
float getInnerArcStartPointYPx() |
getInnerArcEndPointXPx : float | |
float getInnerArcEndPointXPx() |
getInnerArcEndPointYPx : float | |
float getInnerArcEndPointYPx() |
Method Detail |
---|
getTopPointCount | |
int getTopPointCount() |
getTopPointXPx | |
float getTopPointXPx(index) |
getTopPointYPx | |
float getTopPointYPx(index) |
getBottomPointCount | |
int getBottomPointCount() |
getBottomPointXPx | |
float getBottomPointXPx(index) |
getBottomPointYPx | |
float getBottomPointYPx(index) |
getOnCategoryAxisPointCount | |
int getOnCategoryAxisPointCount() |
getOnCategoryAxisPointXPx | |
float getOnCategoryAxisPointXPx(index) |
getOnCategoryAxisPointYPx | |
float getOnCategoryAxisPointYPx(index) |