ChartPoint
ChartPoint class
Represents a single point in a series in a chart.
class ChartPoint;
Example
const { Workbook, ChartType, Color } = require("aspose.cells.node");
//Instantiating a Workbook object
var workbook = new Workbook();
//Obtaining the reference of the first worksheet
var worksheet = workbook.getWorksheets().get(0);
//Adding a sample value to "A1" cell
worksheet.getCells().get("A1").putValue(50);
//Adding a sample value to "A2" cell
worksheet.getCells().get("A2").putValue(100);
//Adding a sample value to "A3" cell
worksheet.getCells().get("A3").putValue(150);
//Adding a sample value to "B1" cell
worksheet.getCells().get("B1").putValue(60);
//Adding a sample value to "B2" cell
worksheet.getCells().get("B2").putValue(32);
//Adding a sample value to "B3" cell
worksheet.getCells().get("B3").putValue(50);
//Adding a chart to the worksheet
var chartIndex = worksheet.getCharts().add(ChartType.PieExploded, 5, 0, 25, 10);
//Accessing the instance of the newly added chart
var chart = worksheet.getCharts().get(chartIndex);
//Adding NSeries (chart data source) to the chart ranging from "A1" cell to "B3"
chart.getNSeries().add("A1:B3", true);
//Show Data Labels
chart.getNSeries().get(0).getDataLabels().setShowValue(true);
for (var i = 0; i < chart.getNSeries().get(0).getPoints().getCount(); i++)
{
//Get Data Point
var point = chart.getNSeries().get(0).getPoints().get(i);
//Set Pir Explosion
point.setExplosion(15);
//Set Border Color
point.getBorder().setColor(Color.Red);
}
//Saving the Excel file
workbook.save("output/ChartsChartPoint.xls");
Methods
Method | Description |
---|---|
getExplosion() | The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter. |
setExplosion(number) | The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter. |
getShadow() | True if the chartpoint has a shadow. |
setShadow(boolean) | True if the chartpoint has a shadow. |
getBorder() | Gets the |
getArea() | Gets the |
getMarker() | Gets the |
getDataLabels() | Returns a DataLabels object that represents the data label associated with this chart point. |
get_YValue() | Gets or sets the Y value of the chart point. |
setYValue(object) | Gets or sets the Y value of the chart point. |
getYValueType() | Gets Y value type of the chart point. |
getXValue() | Gets or sets the X value of the chart point. |
setXValue(object) | Gets or sets the X value of the chart point. |
getXValueType() | Gets X value type of the chart point. |
getShapeProperties() | Gets the ShapePropertyCollection object that holds the visual shape properties of the ChartPoint. |
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 |
setIsInSecondaryPlot(boolean) | 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 |
getShapeX() | Gets the x coordinate of the upper left corner in units of 1/4000 of chart’s width 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. |
getShapeWidth() | Gets the width in units of 1/4000 of chart’s width after calls Chart.Calculate() method. |
getShapeHeight() | Gets the height in units of 1/4000 of chart’s height after calls Chart.Calculate() method. |
getShapeXPx() | Gets the x coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method. |
getShapeYPx() | Gets the y coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method. |
getShapeWidthPx() | Gets the width in units of pixels after calls Chart.Calculate() method. |
getShapeHeightPx() | Gets the height in units of pixels after calls Chart.Calculate() method. |
getBorderWidthPx() | Gets the width of border in units of pixels after calls Chart.Calculate() method. |
getRadiusPx() | Gets the radius of bubble, pie or doughnut in units of pixels after calls Chart.Calculate() method. |
getDoughnutInnerRadius() | Gets the inner radius of doughnut slice in units of pixels 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. |
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. |
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. |
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. |
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. |
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. |
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. |
getTopPointCount() | Gets the number of top points after calls Chart.Calculate() method. |
getTopPointXPx(number) | 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(number) | Gets y-coordinate of the top point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid and Area3D |
getBottomPointCount() | Gets the number of bottom points after calls Chart.Calculate() method. |
getBottomPointXPx(number) | Gets x-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid |
getBottomPointYPx(number) | Gets y-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid |
getOnCategoryAxisPointCount() | Gets the number of the points on category axis after calls Chart.Calculate() method. Only applies to area chart. |
getOnCategoryAxisPointXPx(number) | Gets x-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart. |
getOnCategoryAxisPointYPx(number) | Gets y-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart. |
isNull() | Checks whether the implementation object is null. |
getExplosion()
The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
getExplosion() : number;
setExplosion(number)
The distance of an open pie slice from the center of the pie chart is expressed as a percentage of the pie diameter.
setExplosion(value: number) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | number | The value to set. |
getShadow()
True if the chartpoint has a shadow.
getShadow() : boolean;
setShadow(boolean)
True if the chartpoint has a shadow.
setShadow(value: boolean) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
getBorder()
Gets the
getBorder() : Line;
Returns
getArea()
Gets the
getArea() : Area;
Returns
getMarker()
Gets the
getMarker() : Marker;
Returns
getDataLabels()
Returns a DataLabels object that represents the data label associated with this chart point.
getDataLabels() : DataLabels;
Returns
get_YValue()
Gets or sets the Y value of the chart point.
get_YValue() : object;
setYValue(object)
Gets or sets the Y value of the chart point.
setYValue(value: object) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | object | The value to set. |
getYValueType()
Gets Y value type of the chart point.
getYValueType() : CellValueType;
Returns
getXValue()
Gets or sets the X value of the chart point.
getXValue() : object;
setXValue(object)
Gets or sets the X value of the chart point.
setXValue(value: object) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | object | The value to set. |
getXValueType()
Gets X value type of the chart point.
getXValueType() : CellValueType;
Returns
getShapeProperties()
Gets the ShapePropertyCollection object that holds the visual shape properties of the ChartPoint.
getShapeProperties() : ShapePropertyCollection;
Returns
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
isInSecondaryPlot() : boolean;
setIsInSecondaryPlot(boolean)
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
setIsInSecondaryPlot(value: boolean) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | The value to set. |
getShapeX()
Gets the x coordinate of the upper left corner in units of 1/4000 of chart’s width after calls Chart.Calculate() method.
getShapeX() : number;
getShapeY()
Gets the y coordinate of the upper left corner in units of 1/4000 of chart’s height after calls Chart.Calculate() method.
getShapeY() : number;
getShapeWidth()
Gets the width in units of 1/4000 of chart’s width after calls Chart.Calculate() method.
getShapeWidth() : number;
getShapeHeight()
Gets the height in units of 1/4000 of chart’s height after calls Chart.Calculate() method.
getShapeHeight() : number;
getShapeXPx()
Gets the x coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method.
getShapeXPx() : number;
getShapeYPx()
Gets the y coordinate of the upper left corner in units of pixels after calls Chart.Calculate() method.
getShapeYPx() : number;
getShapeWidthPx()
Gets the width in units of pixels after calls Chart.Calculate() method.
getShapeWidthPx() : number;
getShapeHeightPx()
Gets the height in units of pixels after calls Chart.Calculate() method.
getShapeHeightPx() : number;
getBorderWidthPx()
Gets the width of border in units of pixels after calls Chart.Calculate() method.
getBorderWidthPx() : number;
getRadiusPx()
Gets the radius of bubble, pie or doughnut in units of pixels after calls Chart.Calculate() method.
getRadiusPx() : number;
getDoughnutInnerRadius()
Gets the inner radius of doughnut slice in units of pixels after calls Chart.Calculate() method. Applies to Doughnut chart.
getDoughnutInnerRadius() : number;
getInnerRadiusPx()
Gets the inner radius of doughnut slice in units of pixels after calls Chart.Calculate() method. Applies to Doughnut chart.
getInnerRadiusPx() : number;
Remarks
NOTE: This property is now obsolete. Instead, please use ChartPoint.DoughnutInnerRadius property. This property will be removed 12 months later since June 2024. Aspose apologizes for any inconvenience you may have experienced.
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.
getStartAngle() : number;
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.
getEndAngle() : number;
getArcStartPointXPx()
Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
getArcStartPointXPx() : number;
getArcStartPointYPx()
Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
getArcStartPointYPx() : number;
getArcEndPointXPx()
Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
getArcEndPointXPx() : number;
getArcEndPointYPx()
Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Pie and Doughnut chart.
getArcEndPointYPx() : number;
getInnerArcStartPointXPx()
Gets the x coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
getInnerArcStartPointXPx() : number;
getInnerArcStartPointYPx()
Gets the y coordinate of starting point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
getInnerArcStartPointYPx() : number;
getInnerArcEndPointXPx()
Gets the x coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
getInnerArcEndPointXPx() : number;
getInnerArcEndPointYPx()
Gets the y coordinate of ending point for the pie section after calls Chart.Calculate() method. Applies to Doughnut chart.
getInnerArcEndPointYPx() : number;
getTopPointCount()
Gets the number of top points after calls Chart.Calculate() method.
getTopPointCount() : number;
getTopPointXPx(number)
Gets x-coordinate of the top point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid and Area3D
getTopPointXPx(index: number) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number |
getTopPointYPx(number)
Gets y-coordinate of the top point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid and Area3D
getTopPointYPx(index: number) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number |
getBottomPointCount()
Gets the number of bottom points after calls Chart.Calculate() method.
getBottomPointCount() : number;
getBottomPointXPx(number)
Gets x-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid
getBottomPointXPx(index: number) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number |
getBottomPointYPx(number)
Gets y-coordinate of the bottom point of shape after calls Chart.Calculate() method. Applies 3D charts: Column3D, Bar3D, Cone, Cylinder, Pyramid
getBottomPointYPx(index: number) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number |
getOnCategoryAxisPointCount()
Gets the number of the points on category axis after calls Chart.Calculate() method. Only applies to area chart.
getOnCategoryAxisPointCount() : number;
Remarks
Area 2D chart return 1 Area 3D chart return 2.
getOnCategoryAxisPointXPx(number)
Gets x-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart.
getOnCategoryAxisPointXPx(index: number) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number |
Remarks
Area 2D chart: index is 0. Area 3D chart: index is 0 or 1.
getOnCategoryAxisPointYPx(number)
Gets y-coordinate of the point on category axis after calls Chart.Calculate() method. Only applies to Area chart.
getOnCategoryAxisPointYPx(index: number) : number;
Parameters:
Parameter | Type | Description |
---|---|---|
index | number |
Remarks
Area 2D chart: index is 0. Area 3D chart: index is 0 or 1.
isNull()
Checks whether the implementation object is null.
isNull() : boolean;