asposecells.api

Class ChartPoint

Represents a single point in a series in a chart.

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().setShowValue(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
methodgetArcEndPointXPx()
Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
methodgetArcEndPointYPx()
Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
methodgetArcStartPointXPx()
Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
methodgetArcStartPointYPx()
Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
methodgetArea()
Gets the Area.
methodgetBorder()
Gets the Line.
methodgetBorderWidthPx()
Gets the width of border in units of pixels after calls Chart.Calculate() method.
methodgetDataLabels()
Returns a DataLabels object that represents the data label associated with the point.
methodgetEndAngle()
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.
methodgetExplosion()
method
           The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
methodgetInnerArcEndPointXPx()
Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
methodgetInnerArcEndPointYPx()
Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
methodgetInnerArcStartPointXPx()
Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
methodgetInnerArcStartPointYPx()
Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
methodgetInnerRadiusPx()
Gets the inner radius of doughnut slice in units of pixels after calls Chart.Calculate() method. Applies to Doughnut chart.
methodisInSecondaryPlot()
method
           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
methodgetMarker()
Gets the Marker.
methodgetRadiusPx()
Gets the radius of bubble, pie or doughnut in units of pixels after calls Chart.Calculate() method.
methodgetShadow()
method
setShadow(value)
           True if the chartpoint has a shadow.
methodgetShapeHeight()
Gets the height in units of 1/4000 of chart's height after calls Chart.Calculate() method.
methodgetShapeHeightPx()
Gets the height in units of pixels after calls Chart.Calculate() method.
methodgetShapeProperties()
Gets the ShapePropertyCollection object that holds the visual shape properties of the ChartPoint.
methodgetShapeWidth()
Gets the width in units of 1/4000 of chart's width after calls Chart.Calculate() method.
methodgetShapeWidthPx()
Gets the width in units of pixels after calls Chart.Calculate() method.
methodgetShapeX()
Gets the x coordinate of the upper left corner in units of 1/4000 of chart's width after calls Chart.Calculate() method.
methodgetShapeXPx()
Gets the x coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method.
methodgetShapeY()
Gets the y coordinate of the upper left corner in units of 1/4000 of chart's height after calls Chart.Calculate() method.
methodgetShapeYPx()
Gets the y coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method.
methodgetStartAngle()
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.
methodgetXValue()
method
setXValue(value)
           Gets or sets the X value of the chart point.
methodgetXValueType()
Gets X value type of the chart point. The value of the property is CellValueType integer constant.
methodgetYValue()
method
setYValue(value)
           Gets or sets the Y value of the chart point.
methodgetYValueType()
Gets Y value type of the chart point. The value of the property is CellValueType integer constant.
 
Method Summary
methodgetBottomPointCount()
Gets the number of bottom points after calls Chart.Calculate() method.
methodgetBottomPointXPx(index)
Gets x-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid
methodgetBottomPointYPx(index)
Gets y-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid
methodgetOnCategoryAxisPointCount()
Gets the number of the points on category axis after calls Chart.Calculate() method. Only applies to area chart.
methodgetOnCategoryAxisPointXPx(index)
Gets x-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart.
methodgetOnCategoryAxisPointYPx(index)
Gets y-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart.
methodgetTopPointCount()
Gets the number of top points after calls Chart.Calculate() method.
methodgetTopPointXPx(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
methodgetTopPointYPx(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)
        
        The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
      • getShadow/setShadow : boolean 

        boolean getShadow() / setShadow(value)
        
        True if the chartpoint has a shadow.
      • getArea : Area 

        Area getArea()
        
        Gets the Area.
      • getDataLabels : DataLabels 

        DataLabels getDataLabels()
        
        Returns a DataLabels object that represents the data label associated with the point.
      • getYValue/setYValue : Object 

        Object getYValue() / setYValue(value)
        
        Gets or sets the Y value of the chart point.
      • getYValueType : int 

        int getYValueType()
        
        Gets Y value type of the chart point. The value of the property is CellValueType integer constant.
      • getXValue/setXValue : Object 

        Object getXValue() / setXValue(value)
        
        Gets or sets the X value of the chart point.
      • getXValueType : int 

        int getXValueType()
        
        Gets X value type of the chart point. The value of the property is CellValueType integer constant.
      • isInSecondaryPlot/setInSecondaryPlot : boolean 

        boolean isInSecondaryPlot() / 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
      • getShapeX : int 

        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.
      • getShapeY : int 

        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.
      • getShapeWidth : int 

        int getShapeWidth()
        
        Gets the width in units of 1/4000 of chart's width after calls Chart.Calculate() method.
      • getShapeHeight : int 

        int getShapeHeight()
        
        Gets the height in units of 1/4000 of chart's height after calls Chart.Calculate() method.
      • getShapeXPx : int 

        int getShapeXPx()
        
        Gets the x coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method.
      • getShapeYPx : int 

        int getShapeYPx()
        
        Gets the y coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method.
      • getShapeWidthPx : int 

        int getShapeWidthPx()
        
        Gets the width in units of pixels after calls Chart.Calculate() method.
      • getShapeHeightPx : int 

        int getShapeHeightPx()
        
        Gets the height in units of pixels after calls Chart.Calculate() method.
      • getBorderWidthPx : int 

        int getBorderWidthPx()
        
        Gets the width of border in units of pixels after calls Chart.Calculate() method.
      • getRadiusPx : int 

        int getRadiusPx()
        
        Gets the radius of bubble, pie or doughnut in units of pixels after calls Chart.Calculate() method.
      • getInnerRadiusPx : int 

        int getInnerRadiusPx()
        
        Gets the inner radius of doughnut slice in units of pixels after calls Chart.Calculate() method. Applies to Doughnut chart.
      • getStartAngle : float 

        float 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.
      • getEndAngle : float 

        float 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.
      • getArcStartPointXPx : float 

        float getArcStartPointXPx()
        
        Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
      • getArcStartPointYPx : float 

        float getArcStartPointYPx()
        
        Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
      • getArcEndPointXPx : float 

        float getArcEndPointXPx()
        
        Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
      • getArcEndPointYPx : float 

        float getArcEndPointYPx()
        
        Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
      • getInnerArcStartPointXPx : float 

        float getInnerArcStartPointXPx()
        
        Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
      • getInnerArcStartPointYPx : float 

        float getInnerArcStartPointYPx()
        
        Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
      • getInnerArcEndPointXPx : float 

        float getInnerArcEndPointXPx()
        
        Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
      • getInnerArcEndPointYPx : float 

        float getInnerArcEndPointYPx()
        
        Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
    • Method Detail

      • getTopPointCount

        int getTopPointCount()
        Gets the number of top points after calls Chart.Calculate() method.
      • getTopPointXPx

        float 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
      • getTopPointYPx

        float 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
      • getBottomPointCount

        int getBottomPointCount()
        Gets the number of bottom points after calls Chart.Calculate() method.
      • getBottomPointXPx

        float getBottomPointXPx(index)
        Gets x-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid
      • getBottomPointYPx

        float getBottomPointYPx(index)
        Gets y-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid
      • getOnCategoryAxisPointCount

        int getOnCategoryAxisPointCount()
        Gets the number of the points on category axis after calls Chart.Calculate() method. Only applies to area chart. Area 2D chart return 1 Area 3D chart return 2.
      • getOnCategoryAxisPointXPx

        float getOnCategoryAxisPointXPx(index)
        Gets x-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart. Area 2D chart: index is 0. Area 3D chart: index is 0 or 1.
      • getOnCategoryAxisPointYPx

        float getOnCategoryAxisPointYPx(index)
        Gets y-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart. Area 2D chart: index is 0. Area 3D chart: index is 0 or 1.