Aspose::Cells::Charts::ChartPoint class

ChartPoint class

Represents a single point in a series in a chart.

class ChartPoint

Methods

MethodDescription
ChartPoint(ChartPoint_Impl* impl)Constructs from an implementation object.
ChartPoint(const ChartPoint& src)Copy constructor.
GetArcEndPointXPx()Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
GetArcEndPointYPx()Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
GetArcStartPointXPx()Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
GetArcStartPointYPx()Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
GetArea()Gets the area.
GetBorder()Gets the border.
GetBorderWidthPx()Gets the width of border in units of pixels after calls Chart.Calculate() method.
GetBottomPointCount()Gets the number of bottom points after calls Chart.Calculate() method.
GetBottomPointXPx(int32_t index)Gets x-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid.
GetBottomPointYPx(int32_t index)Gets y-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid.
GetDataLabels()Returns a DataLabels object that represents the data label associated with the point.
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.
GetExplosion()The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
GetInnerArcEndPointXPx()Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
GetInnerArcEndPointYPx()Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
GetInnerArcStartPointXPx()Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
GetInnerArcStartPointYPx()Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
GetInnerRadiusPx()Gets the inner radius of doughnut slice in units of pixels after calls Chart.Calculate() method. Applies to Doughnut chart.
GetMarker()Gets the marker.
GetOnCategoryAxisPointCount()Gets the number of the points on category axis after calls Chart.Calculate() method. Only applies to area chart.
GetOnCategoryAxisPointXPx(int32_t index)Gets x-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart.
GetOnCategoryAxisPointYPx(int32_t index)Gets y-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart.
GetRadiusPx()Gets the radius of bubble, pie or doughnut in units of pixels after calls Chart.Calculate() method.
GetShadow()True if the chartpoint has a shadow.
GetShapeHeight()Gets the height in units of 1/4000 of chart’s height after calls Chart.Calculate() method.
GetShapeHeightPx()Gets the height in units of pixels after calls Chart.Calculate() method.
GetShapeProperties()Gets the ShapePropertyCollection object that holds the visual shape properties of the ChartPoint.
GetShapeWidth()Gets the width in units of 1/4000 of chart’s width after calls Chart.Calculate() method.
GetShapeWidthPx()Gets the width in units of pixels after calls Chart.Calculate() 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.
GetShapeXPx()Gets the x coordinate of the upper left corner in units of pixels after calls Chart.Calculate() 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.
GetShapeYPx()Gets the y coordinate of the upper left corner in units of pixels after calls Chart.Calculate() 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.
GetTopPointCount()Gets the number of top points after calls Chart.Calculate() method.
GetTopPointXPx(int32_t 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(int32_t 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.
GetXValueType()Gets X value type of the chart point.
GetYValueType()Gets Y value type of the chart point.
IsInSecondaryPlot()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.
IsNull() constChecks whether the implementation object is nullptr.
explicit operator bool() constoperator bool()
operator=(const ChartPoint& src)operator=
SetExplosion(int32_t value)The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
SetIsInSecondaryPlot(bool 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.
SetShadow(bool value)True if the chartpoint has a shadow.
~ChartPoint()Destructor.

Fields

FieldDescription
_implThe implementation object.

Examples

Aspose::Cells::Startup();
//Instantiating a Workbook object
Workbook workbook;

//Obtaining the reference of the first worksheet
Worksheet worksheet = workbook.GetWorksheets().Get(0);

//Adding a sample value to "A1" cell
worksheet.GetCells().Get(u"A1").PutValue(50);

//Adding a sample value to "A2" cell
worksheet.GetCells().Get(u"A2").PutValue(100);

//Adding a sample value to "A3" cell
worksheet.GetCells().Get(u"A3").PutValue(150);

//Adding a sample value to "B1" cell
worksheet.GetCells().Get(u"B1").PutValue(60);

//Adding a sample value to "B2" cell
worksheet.GetCells().Get(u"B2").PutValue(32);

//Adding a sample value to "B3" cell
worksheet.GetCells().Get(u"B3").PutValue(50);

//Adding a chart to the worksheet
int chartIndex = worksheet.GetCharts().Add(ChartType::PieExploded, 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(u"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(Color{ 0xff, 0xff, 0, 0 });
}

//Saving the Excel file
workbook.Save(u"book1.xls");

Aspose::Cells::Cleanup();

See Also