public class ChartPoint
extends java.lang.Object
Example
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the first worksheet
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
int chartIndex = worksheet.getCharts().add(ChartType.PIE_EXPLODED, 5, 0, 25, 10);
//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);
//Show Data Labels
chart.getNSeries().get(0).getDataLabels().setShowValue(true);
for (int i = 0; i <chart.getNSeries().get(0).getPoints().getCount(); i++)
{
//Get Data Point
ChartPoint point = chart.getNSeries().get(0).getPoints().get(i);
//Set Pir Explosion
point.setExplosion(15);
//Set Border Color
point.getBorder().setColor(com.aspose.cells.Color.getRed());
}
//Saving the Excel file
workbook.save("book1.xls");
| Modifier and Type | Method and Description |
|---|---|
float |
getArcEndPointXPx()
Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method.
|
float |
getArcEndPointYPx()
Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method.
|
float |
getArcStartPointXPx()
Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method.
|
float |
getArcStartPointYPx()
Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method.
|
Area |
getArea()
Gets the
Area. |
Line |
getBorder()
Gets the
Line. |
int |
getBorderWidthPx()
Gets the width of border in units of pixels after calls Chart.Calculate() method.
|
int |
getBottomPointCount()
Gets the number of bottom points after calls Chart.Calculate() method.
|
float |
getBottomPointXPx(int index)
Gets x-coordinate of the bottom point of shape after calls Chart.Calculate() method.
|
float |
getBottomPointYPx(int index)
Gets y-coordinate of the bottom point of shape after calls Chart.Calculate() method.
|
DataLabels |
getDataLabels()
Returns a
getDataLabels() object that represents the data label associated with this chart point. |
int |
getDoughnutInnerRadius()
Gets the inner radius of doughnut slice in units of pixels after calls Chart.Calculate() method.
|
float |
getEndAngle()
Gets the ending angle for the pie section, measured in degrees clockwise from the x-axis after calls Chart.Calculate() method.
|
int |
getExplosion()
The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
|
float |
getInnerArcEndPointXPx()
Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method.
|
float |
getInnerArcEndPointYPx()
Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method.
|
float |
getInnerArcStartPointXPx()
Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method.
|
float |
getInnerArcStartPointYPx()
Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method.
|
int |
getInnerRadiusPx()
Deprecated.
Use ChartPoint.DoughnutInnerRadius property, instead.
|
Marker |
getMarker()
Gets the
Series.getMarker(). |
int |
getOnCategoryAxisPointCount()
Gets the number of the points on category axis after calls Chart.Calculate() method.
|
float |
getOnCategoryAxisPointXPx(int index)
Gets x-coordinate of the point on category axis after calls Chart.Calculate() method.
|
float |
getOnCategoryAxisPointYPx(int index)
Gets y-coordinate of the point on category axis after calls Chart.Calculate() method.
|
int |
getRadiusPx()
Gets the radius of bubble, pie or doughnut in units of pixels after calls Chart.Calculate() method.
|
boolean |
getShadow()
True if the chartpoint has a shadow.
|
int |
getShapeHeight()
Gets the height in units of 1/4000 of chart's height after calls Chart.Calculate() method.
|
int |
getShapeHeightPx()
Gets the height in units of pixels after calls Chart.Calculate() method.
|
ShapePropertyCollection |
getShapeProperties()
Gets the
ShapePropertyCollection object that holds the visual shape properties of the ChartPoint. |
int |
getShapeWidth()
Gets the width in units of 1/4000 of chart's width after calls Chart.Calculate() method.
|
int |
getShapeWidthPx()
Gets the width in units of pixels after calls Chart.Calculate() method.
|
int |
getShapeX()
Gets the x coordinate of the upper left corner in units of 1/4000 of chart's width after calls Chart.Calculate() method.
|
int |
getShapeXPx()
Gets the x coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method.
|
int |
getShapeY()
Gets the y coordinate of the upper left corner in units of 1/4000 of chart's height after calls Chart.Calculate() method.
|
int |
getShapeYPx()
Gets the y coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method.
|
float |
getStartAngle()
Gets the starting angle for the pie section, measured in degrees clockwise from the x-axis after calls Chart.Calculate() method.
|
int |
getTopPointCount()
Gets the number of top points after calls Chart.Calculate() method.
|
float |
getTopPointXPx(int index)
Gets x-coordinate of the top point of shape after calls Chart.Calculate() method.
|
float |
getTopPointYPx(int index)
Gets y-coordinate of the top point of shape after calls Chart.Calculate() method.
|
java.lang.Object |
getXValue()
Gets the X value of the chart point.
|
int |
getXValueType()
Gets X value type of the chart point.
|
java.lang.Object |
getYValue()
Gets the Y value of the chart point.
|
int |
getYValueType()
Gets Y value type of the chart point.
|
boolean |
isInSecondaryPlot()
Gets a value indicates whether this data points is in the second pie or bar
on a pie of pie or bar of pie chart
|
void |
setExplosion(int value)
The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
|
void |
setInSecondaryPlot(boolean value)
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
|
void |
setShadow(boolean value)
True if the chartpoint has a shadow.
|
void |
setXValue(java.lang.Object value)
Sets the X value of the chart point.
|
void |
setYValue(java.lang.Object value)
Sets the Y value of the chart point.
|
public int getExplosion()
public void setExplosion(int value)
public boolean getShadow()
public void setShadow(boolean value)
public Marker getMarker()
Series.getMarker().public DataLabels getDataLabels()
getDataLabels() object that represents the data label associated with this chart point.public java.lang.Object getYValue()
public void setYValue(java.lang.Object value)
public int getYValueType()
See CellValueType.
public java.lang.Object getXValue()
public void setXValue(java.lang.Object value)
public int getXValueType()
See CellValueType.
public ShapePropertyCollection getShapeProperties()
ShapePropertyCollection object that holds the visual shape properties of the ChartPoint.public boolean isInSecondaryPlot()
public void setInSecondaryPlot(boolean value)
public int getShapeX()
public int getShapeY()
public int getShapeWidth()
public int getShapeHeight()
public int getShapeXPx()
public int getShapeYPx()
public int getShapeWidthPx()
public int getShapeHeightPx()
public int getBorderWidthPx()
public int getRadiusPx()
public int getDoughnutInnerRadius()
public int getInnerRadiusPx()
Remarks
NOTE: This property is now obsolete. Instead, please use ChartPoint.DoughnutInnerRadius property. This property will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.public float getStartAngle()
public float getEndAngle()
public float getArcStartPointXPx()
public float getArcStartPointYPx()
public float getArcEndPointXPx()
public float getArcEndPointYPx()
public float getInnerArcStartPointXPx()
public float getInnerArcStartPointYPx()
public float getInnerArcEndPointXPx()
public float getInnerArcEndPointYPx()
public int getTopPointCount()
public float getTopPointXPx(int index)
public float getTopPointYPx(int index)
public int getBottomPointCount()
public float getBottomPointXPx(int index)
public float getBottomPointYPx(int index)
public int getOnCategoryAxisPointCount()
Remarks
Area 2D chart return 1 Area 3D chart return 2.public float getOnCategoryAxisPointXPx(int index)
Remarks
Area 2D chart: index is 0. Area 3D chart: index is 0 or 1.public float getOnCategoryAxisPointYPx(int index)
Remarks
Area 2D chart: index is 0. Area 3D chart: index is 0 or 1.See Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.