ChartPoint class

ChartPoint class

Represents a single point in a series in a chart.

The ChartPoint type exposes the following members:

Properties

PropertyDescription
explosionThe distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
shadowTrue if the chartpoint has a shadow.
borderGets the Line.
areaGets the ChartPoint.area.
markerGets the ChartPoint.marker.
data_labelsReturns a DataLabels object that represents the data label associated with the point.
y_valueGets or sets the Y value of the chart point.
y_value_typeGets Y value type of the chart point.
x_valueGets or sets the X value of the chart point.
x_value_typeGets X value type of the chart point.
shape_propertiesGets the ShapePropertyCollection object that holds the visual shape properties of the ChartPoint.
is_in_secondary_plotGets 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
shape_xGets the x coordinate of the upper left corner in units of 1/4000 of chart’s width after calls Chart.Calculate() method.
shape_yGets the y coordinate of the upper left corner in units of 1/4000 of chart’s height after calls Chart.Calculate() method.
shape_widthGets the width in units of 1/4000 of chart’s width after calls Chart.Calculate() method.
shape_heightGets the height in units of 1/4000 of chart’s height after calls Chart.Calculate() method.
shape_x_pxGets the x coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method.
shape_y_pxGets the y coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method.
shape_width_pxGets the width in units of pixels after calls Chart.Calculate() method.
shape_height_pxGets the height in units of pixels after calls Chart.Calculate() method.
border_width_pxGets the width of border in units of pixels after calls Chart.Calculate() method.
radius_pxGets the radius of bubble, pie or doughnut in units of pixels after calls Chart.Calculate() method.
inner_radius_pxGets the inner radius of doughnut slice in units of pixels after calls Chart.Calculate() method.
Applies to Doughnut chart.
start_angleGets the starting angle for the pie section, measured in degrees clockwise from the x-axis after calls Chart.Calculate() method.
Applies to Pie chart.
end_angleGets the ending angle for the pie section, measured in degrees clockwise from the x-axis after calls Chart.Calculate() method.
Applies to Pie chart.
arc_start_point_x_pxGets the x coordinate of starting point for the pie section after calls Chart.Calculate() method.
Applies to Pie and Doughnut chart.
arc_start_point_y_pxGets the y coordinate of starting point for the pie section after calls Chart.Calculate() method.
Applies to Pie and Doughnut chart.
arc_end_point_x_pxGets the x coordinate of ending point for the pie section after calls Chart.Calculate() method.
Applies to Pie and Doughnut chart.
arc_end_point_y_pxGets the y coordinate of ending point for the pie section after calls Chart.Calculate() method.
Applies to Pie and Doughnut chart.
inner_arc_start_point_x_pxGets the x coordinate of starting point for the pie section after calls Chart.Calculate() method.
Applies to Doughnut chart.
inner_arc_start_point_y_pxGets the y coordinate of starting point for the pie section after calls Chart.Calculate() method.
Applies to Doughnut chart.
inner_arc_end_point_x_pxGets the x coordinate of ending point for the pie section after calls Chart.Calculate() method.
Applies to Doughnut chart.
inner_arc_end_point_y_pxGets the y coordinate of ending point for the pie section after calls Chart.Calculate() method.
Applies to Doughnut chart.

Methods

MethodDescription
get_top_point_countGets the number of top points after calls Chart.Calculate() method.
get_top_point_x_pxGets x-coordinate of the top point of shape after calls Chart.Calculate() method.
Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid and Area3D
get_top_point_y_pxGets y-coordinate of the top point of shape after calls Chart.Calculate() method.
Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid and Area3D
get_bottom_point_countGets the number of bottom points after calls Chart.Calculate() method.
get_bottom_point_x_pxGets x-coordinate of the bottom point of shape after calls Chart.Calculate() method.
Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid
get_bottom_point_y_pxGets y-coordinate of the bottom point of shape after calls Chart.Calculate() method.
Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid
get_on_category_axis_point_countGets the number of the points on category axis after calls Chart.Calculate() method. Only applies to area chart.
get_on_category_axis_point_x_pxGets x-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart.
get_on_category_axis_point_y_pxGets y-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart.

Example

from aspose.cells import Workbook
from aspose.cells.charts import ChartType
from aspose.pydrawing import Color

# Instantiating a Workbook object
workbook = Workbook()
# Obtaining the reference of the first worksheet
worksheet = workbook.worksheets[0]
# Adding a sample value to "A1" cell
worksheet.cells.get("A1").put_value(50)
# Adding a sample value to "A2" cell
worksheet.cells.get("A2").put_value(100)
# Adding a sample value to "A3" cell
worksheet.cells.get("A3").put_value(150)
# Adding a sample value to "B1" cell
worksheet.cells.get("B1").put_value(60)
# Adding a sample value to "B2" cell
worksheet.cells.get("B2").put_value(32)
# Adding a sample value to "B3" cell
worksheet.cells.get("B3").put_value(50)
# Adding a chart to the worksheet
chartIndex = worksheet.charts.add(ChartType.PIE_EXPLODED, 5, 0, 25, 10)
# Accessing the instance of the newly added chart
chart = worksheet.charts[chartIndex]
# Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
chart.n_series.add("A1:B3", True)
# Show Data Labels
chart.n_series[0].data_labels.show_value = True
for i in range(chart.n_series[0].points.count):
    # Get Data Point
    point = chart.n_series[0].points[i]
    # Set Pir Explosion
    point.explosion = 15
    # Set Border Color
    point.border.color = Color.red
# Saving the Excel file
workbook.save("book1.xls")

See Also