Class ChartPoint

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

objectChartPoint

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

float

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

float

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

float

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

float

Area

Gets the Aspose.Cells.Charts.ChartPoint.Area?text=+area.

public Area Area { get; }

Property Value

Area

Border

Gets the Aspose.Cells.Drawing.Line?text=+border.

public Line Border { get; }

Property Value

Line

BorderWidthPx

Gets the width of border in units of pixels after calls Chart.Calculate() method.

public int BorderWidthPx { get; }

Property Value

int

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

DataLabels

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

int

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

float

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

int

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

float

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

float

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

float

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

float

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

bool

Marker

Gets the Aspose.Cells.Charts.ChartPoint.Marker?text=+marker.

public Marker Marker { get; }

Property Value

Marker

RadiusPx

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

public int RadiusPx { get; }

Property Value

int

Shadow

True if the chartpoint has a shadow.

public bool Shadow { get; set; }

Property Value

bool

ShapeHeight

Gets the height in units of 1/4000 of chart’s height after calls Chart.Calculate() method.

public int ShapeHeight { get; }

Property Value

int

ShapeHeightPx

Gets the height in units of pixels after calls Chart.Calculate() method.

public int ShapeHeightPx { get; }

Property Value

int

ShapeProperties

Gets the Aspose.Cells.Drawing.ShapePropertyCollection object that holds the visual shape properties of the ChartPoint.

public ShapePropertyCollection ShapeProperties { get; }

Property Value

ShapePropertyCollection

ShapeWidth

Gets the width in units of 1/4000 of chart’s width after calls Chart.Calculate() method.

public int ShapeWidth { get; }

Property Value

int

ShapeWidthPx

Gets the width in units of pixels after calls Chart.Calculate() method.

public int ShapeWidthPx { get; }

Property Value

int

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

int

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

int

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

int

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

int

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

float

XValue

Gets or sets the X value of the chart point.

public object XValue { get; set; }

Property Value

object

XValueType

Gets X value type of the chart point.

public CellValueType XValueType { get; }

Property Value

CellValueType

YValue

Gets or sets the Y value of the chart point.

public object YValue { get; set; }

Property Value

object

YValueType

Gets Y value type of the chart point.

public CellValueType YValueType { get; }

Property Value

CellValueType

Methods

GetBottomPointCount()

Gets the number of bottom points after calls Chart.Calculate() method.

public int GetBottomPointCount()

Returns

int

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

float

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

float

GetOnCategoryAxisPointCount()

Gets the number of the points on category axis after calls Chart.Calculate() method. Only applies to area chart.

public int GetOnCategoryAxisPointCount()

Returns

int

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

float

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

float

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

int

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

float

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

Returns

float