ChartPoint class
ChartPoint class
Represents a single point in a series in a chart.
The ChartPoint type exposes the following members:
Properties
Property | Description |
---|---|
explosion | The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter. |
shadow | True if the chartpoint has a shadow. |
border | Gets the Line . |
area | Gets the ChartPoint.area . |
marker | Gets the ChartPoint.marker . |
data_labels | Returns a ChartPoint.data_labels object that represents the data label associated with this chart point. |
y_value | Gets or sets the Y value of the chart point. |
y_value_type | Gets Y value type of the chart point. |
x_value | Gets or sets the X value of the chart point. |
x_value_type | Gets X value type of the chart point. |
shape_properties | Gets the ShapePropertyCollection object that holds the visual shape properties of the ChartPoint. |
is_in_secondary_plot | 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 |
shape_x | Gets the x coordinate of the upper left corner in units of 1/4000 of chart’s width after calls Chart.Calculate() method. |
shape_y | Gets the y coordinate of the upper left corner in units of 1/4000 of chart’s height after calls Chart.Calculate() method. |
shape_width | Gets the width in units of 1/4000 of chart’s width after calls Chart.Calculate() method. |
shape_height | Gets the height in units of 1/4000 of chart’s height after calls Chart.Calculate() method. |
shape_x_px | Gets the x coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method. |
shape_y_px | Gets the y coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method. |
shape_width_px | Gets the width in units of pixels after calls Chart.Calculate() method. |
shape_height_px | Gets the height in units of pixels after calls Chart.Calculate() method. |
border_width_px | Gets the width of border in units of pixels after calls Chart.Calculate() method. |
radius_px | Gets the radius of bubble, pie or doughnut in units of pixels after calls Chart.Calculate() method. |
doughnut_inner_radius | Gets the inner radius of doughnut slice in units of pixels after calls Chart.Calculate() method. Applies to Doughnut chart. |
inner_radius_px | Gets the inner radius of doughnut slice in units of pixels after calls Chart.Calculate() method. Applies to Doughnut chart. |
start_angle | 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. |
end_angle | 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. |
arc_start_point_x_px | Gets 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_px | Gets 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_px | Gets 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_px | Gets 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_px | Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart. |
inner_arc_start_point_y_px | Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart. |
inner_arc_end_point_x_px | Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart. |
inner_arc_end_point_y_px | Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart. |
Methods
Method | Description |
---|---|
get_top_point_count | Gets the number of top points after calls Chart.Calculate() method. |
get_top_point_x_px | Gets 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_px | Gets 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_count | Gets the number of bottom points after calls Chart.Calculate() method. |
get_bottom_point_x_px | Gets 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_px | Gets 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_count | Gets the number of the points on category axis after calls Chart.Calculate() method. Only applies to area chart. |
get_on_category_axis_point_x_px | Gets x-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart. |
get_on_category_axis_point_y_px | Gets 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
- module
aspose.cells.charts
- class
Line
- class
ShapePropertyCollection