Represents a collection of all the data labels on a chart point.
Property | Type | Description |
---|---|---|
position | string | DataLabelPosition value that represents the position of the data label. Possible values are: None, Center, InsideEnd, InsideBase, OutsideEnd, Left, Right, Top, Bottom, BestFit, Callout. |
separator | string | String representing the separator used for the data labels on a chart. |
showBubbleSize | bool | Boolean value representing if the data label bubble size is visible or not. |
showCategoryName | bool | Boolean value representing if the data label category name is visible or not. |
showLegendKey | bool | Boolean value representing if the data label legend key is visible or not. |
showPercentage | bool | Boolean value representing if the data label percentage is visible or not. |
showSeriesName | bool | Boolean value representing if the data label series name is visible or not. |
showValue | bool | Boolean value representing if the data label value is visible or not. |
Relationship | Type | Description |
---|---|---|
format | ChartDataLabelFormat | Represents the format of chart data labels, which includes fill and font formatting. Read-only. |
Method | Return Type | Description |
---|---|---|
load(param: object) | void | Fills the proxy object created in JavaScript layer with property and object values specified in the parameter. |
Fills the proxy object created in JavaScript layer with property and object values specified in the parameter.
object.load(param);
Parameter | Type | Description |
---|---|---|
param | object | Optional. Accepts parameter and relationship names as delimited string or an array. Or, provide loadOption object. |
void
Make Series Name shown in Datalabels and set the position
of datalabels to be "top";
var ctx = new Excel.RequestContext();
var chart = ctx.workbook.worksheets.getItem("Sheet1").charts.getItem("Chart1");
chart.datalabels.visible = true;
chart.datalabels.position = "top";
chart.datalabels.ShowSeriesName = true;
ctx.executeAsync().then(function () {
Console.log("Datalabels Shown");
});