Class ChartPoint
Namespace: Aspose.Cells.Charts
Assembly: Aspose.Cells.dll (25.2.0)
Represents a single point in a series in a chart.
public class ChartPoint
Inheritance
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Examples
csharp
[C#]
//Instantiating a Workbook object
Workbook workbook = new Workbook();
//Obtaining the reference of the first worksheet
Worksheet worksheet = workbook.Worksheets[0];
//Adding a sample value to "A1" cell
worksheet.Cells["A1"].PutValue(50);
//Adding a sample value to "A2" cell
worksheet.Cells["A2"].PutValue(100);
//Adding a sample value to "A3" cell
worksheet.Cells["A3"].PutValue(150);
//Adding a sample value to "B1" cell
worksheet.Cells["B1"].PutValue(60);
//Adding a sample value to "B2" cell
worksheet.Cells["B2"].PutValue(32);
//Adding a sample value to "B3" cell
worksheet.Cells["B3"].PutValue(50);
//Adding a chart to the worksheet
int chartIndex = worksheet.Charts.Add(ChartType.PieExploded, 5, 0, 25, 10);
//Accessing the instance of the newly added chart
Chart chart = worksheet.Charts[chartIndex];
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
chart.NSeries.Add("A1:B3", true);
//Show Data Labels
chart.NSeries[0].DataLabels.ShowValue = true;
for (int i = 0; i < chart.NSeries[0].Points.Count; i++)
{
//Get Data Point
ChartPoint point = chart.NSeries[0].Points[i];
//Set Pir Explosion
point.Explosion = 15;
//Set Border Color
point.Border.Color = System.Drawing.Color.Red;
}
//Saving the Excel file
workbook.Save("book1.xls");
'Instantiating a Workbook object
Dim workbook As Workbook = New Workbook()
'Obtaining the reference of the first worksheet
Dim worksheet As Worksheet = workbook.Worksheets(0)
'Adding a sample value to "A1" cell
worksheet.Cells("A1").PutValue(50)
'Adding a sample value to "A2" cell
worksheet.Cells("A2").PutValue(100)
'Adding a sample value to "A3" cell
worksheet.Cells("A3").PutValue(150)
'Adding a sample value to "B1" cell
worksheet.Cells("B1").PutValue(60)
'Adding a sample value to "B2" cell
worksheet.Cells("B2").PutValue(32)
'Adding a sample value to "B3" cell
worksheet.Cells("B3").PutValue(50)
'Adding a chart to the worksheet
Dim chartIndex As Integer = worksheet.Charts.Add(ChartType.PieExploded, 5, 0, 25, 10)
'Accessing the instance of the newly added chart
Dim chart As Chart = worksheet.Charts(chartIndex)
'Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
chart.NSeries.Add("A1:B3", True)
'Show Data Labels
chart.NSeries(0).DataLabels.IsValueShown = True
For i As Integer = 0 To chart.NSeries(0).Points.Count - 1
'Get Data Point
Dim point As ChartPoint = chart.NSeries(0).Points(i)
'Set Pir Explosion
point.Explosion = 15
'Set Border Color
point.Border.Color = System.Drawing.Color.Red
Next i
'Saving the Excel file
workbook.Save("book1.xls")
Properties
ArcEndPointXPx
Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
public float ArcEndPointXPx { get; }
Property Value
ArcEndPointYPx
Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
public float ArcEndPointYPx { get; }
Property Value
ArcStartPointXPx
Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
public float ArcStartPointXPx { get; }
Property Value
ArcStartPointYPx
Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
public float ArcStartPointYPx { get; }
Property Value
Area
Gets the Aspose.Cells.Charts.ChartPoint.Area?text=+area.
public Area Area { get; }
Property Value
Border
Gets the Aspose.Cells.Drawing.Line?text=+border.
public Line Border { get; }
Property Value
BorderWidthPx
Gets the width of border in units of pixels after calls Chart.Calculate() method.
public int BorderWidthPx { get; }
Property Value
DataLabels
Returns a Aspose.Cells.Charts.ChartPoint.DataLabels object that represents the data label associated with this chart point.
public DataLabels DataLabels { get; }
Property Value
DoughnutInnerRadius
Gets the inner radius of doughnut slice in units of pixels after calls Chart.Calculate() method. Applies to Doughnut chart.
public int DoughnutInnerRadius { get; }
Property Value
EndAngle
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.
public float EndAngle { get; }
Property Value
Explosion
The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
public int Explosion { get; set; }
Property Value
InnerArcEndPointXPx
Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
public float InnerArcEndPointXPx { get; }
Property Value
InnerArcEndPointYPx
Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
public float InnerArcEndPointYPx { get; }
Property Value
InnerArcStartPointXPx
Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
public float InnerArcStartPointXPx { get; }
Property Value
InnerArcStartPointYPx
Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
public float InnerArcStartPointYPx { get; }
Property Value
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
public bool IsInSecondaryPlot { get; set; }
Property Value
Marker
Gets the Aspose.Cells.Charts.ChartPoint.Marker?text=+marker.
public Marker Marker { get; }
Property Value
RadiusPx
Gets the radius of bubble, pie or doughnut in units of pixels after calls Chart.Calculate() method.
public int RadiusPx { get; }
Property Value
Shadow
True if the chartpoint has a shadow.
public bool Shadow { get; set; }
Property Value
ShapeHeight
Gets the height in units of 1/4000 of chart’s height after calls Chart.Calculate() method.
public int ShapeHeight { get; }
Property Value
ShapeHeightPx
Gets the height in units of pixels after calls Chart.Calculate() method.
public int ShapeHeightPx { get; }
Property Value
ShapeProperties
Gets the Aspose.Cells.Drawing.ShapePropertyCollection object that holds the visual shape properties of the ChartPoint.
public ShapePropertyCollection ShapeProperties { get; }
Property Value
ShapeWidth
Gets the width in units of 1/4000 of chart’s width after calls Chart.Calculate() method.
public int ShapeWidth { get; }
Property Value
ShapeWidthPx
Gets the width in units of pixels after calls Chart.Calculate() method.
public int ShapeWidthPx { get; }
Property Value
ShapeX
Gets the x coordinate of the upper left corner in units of 1/4000 of chart’s width after calls Chart.Calculate() method.
public int ShapeX { get; }
Property Value
ShapeXPx
Gets the x coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method.
public int ShapeXPx { get; }
Property Value
ShapeY
Gets the y coordinate of the upper left corner in units of 1/4000 of chart’s height after calls Chart.Calculate() method.
public int ShapeY { get; }
Property Value
ShapeYPx
Gets the y coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method.
public int ShapeYPx { get; }
Property Value
StartAngle
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.
public float StartAngle { get; }
Property Value
XValue
Gets or sets the X value of the chart point.
public object XValue { get; set; }
Property Value
XValueType
Gets X value type of the chart point.
public CellValueType XValueType { get; }
Property Value
YValue
Gets or sets the Y value of the chart point.
public object YValue { get; set; }
Property Value
YValueType
Gets Y value type of the chart point.
public CellValueType YValueType { get; }
Property Value
Methods
GetBottomPointCount()
Gets the number of bottom points after calls Chart.Calculate() method.
public int GetBottomPointCount()
Returns
GetBottomPointXPx(int)
Gets x-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid
public float GetBottomPointXPx(int index)
Parameters
index
int
Returns
GetBottomPointYPx(int)
Gets y-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid
public float GetBottomPointYPx(int index)
Parameters
index
int
Returns
GetOnCategoryAxisPointCount()
Gets the number of the points on category axis after calls Chart.Calculate() method. Only applies to area chart.
public int GetOnCategoryAxisPointCount()
Returns
Remarks
Area 2D chart return 1 Area 3D chart return 2.
GetOnCategoryAxisPointXPx(int)
Gets x-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart.
public float GetOnCategoryAxisPointXPx(int index)
Parameters
index
int
Returns
Remarks
Area 2D chart: index is 0. Area 3D chart: index is 0 or 1.
GetOnCategoryAxisPointYPx(int)
Gets y-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart.
public float GetOnCategoryAxisPointYPx(int index)
Parameters
index
int
Returns
Remarks
Area 2D chart: index is 0. Area 3D chart: index is 0 or 1.
GetTopPointCount()
Gets the number of top points after calls Chart.Calculate() method.
public int GetTopPointCount()
Returns
GetTopPointXPx(int)
Gets x-coordinate of the top point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid and Area3D
public float GetTopPointXPx(int index)
Parameters
index
int
Returns
GetTopPointYPx(int)
Gets y-coordinate of the top point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid and Area3D
public float GetTopPointYPx(int index)
Parameters
index
int