Skip to content

Commit 6bb60a5

Browse files
ElizabethSamuel-MSFTgithub-actions
andauthored
Automatically generated docs (#2327)
Co-authored-by: github-actions <[email protected]>
1 parent 8d7d85e commit 6bb60a5

File tree

35 files changed

+4391
-1186
lines changed

35 files changed

+4391
-1186
lines changed

docs/docs-ref-autogen/excel/excel/excel.chartleaderlines.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,36 @@ remarks: >-
88
\[ [API set: ExcelApi
99
1.19](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
1010
11+
12+
#### Examples
13+
14+
15+
```TypeScript
16+
17+
// Link to full sample:
18+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml
19+
20+
21+
// The following code changes the format of leader lines. It adjusts color,
22+
weight, and line style.
23+
24+
await Excel.run(async (context) => {
25+
const sheet = context.workbook.worksheets.getItem(sheetName);
26+
const chart = sheet.charts.getItemAt(0);
27+
const series = chart.series.getItemAt(0);
28+
const dataLabels = series.dataLabels;
29+
const lineFormat = dataLabels.leaderLines.format;
30+
31+
// Set leader line formatting properties.
32+
lineFormat.line.color = "blue";
33+
lineFormat.line.weight = 2;
34+
lineFormat.line.lineStyle = Excel.ChartLineStyle.dot;
35+
36+
await context.sync();
37+
});
38+
39+
```
40+
1141
isPreview: false
1242
isDeprecated: false
1343
type: class

docs/docs-ref-autogen/excel/excel/excel.chartleaderlinesformat.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,36 @@ remarks: >-
88
\[ [API set: ExcelApi
99
1.19](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
1010
11+
12+
#### Examples
13+
14+
15+
```TypeScript
16+
17+
// Link to full sample:
18+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml
19+
20+
21+
// The following code changes the format of leader lines. It adjusts color,
22+
weight, and line style.
23+
24+
await Excel.run(async (context) => {
25+
const sheet = context.workbook.worksheets.getItem(sheetName);
26+
const chart = sheet.charts.getItemAt(0);
27+
const series = chart.series.getItemAt(0);
28+
const dataLabels = series.dataLabels;
29+
const lineFormat = dataLabels.leaderLines.format;
30+
31+
// Set leader line formatting properties.
32+
lineFormat.line.color = "blue";
33+
lineFormat.line.weight = 2;
34+
lineFormat.line.lineStyle = Excel.ChartLineStyle.dot;
35+
36+
await context.sync();
37+
});
38+
39+
```
40+
1141
isPreview: false
1242
isDeprecated: false
1343
type: class

docs/docs-ref-autogen/excel/excel/excel.chartseries.yml

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,49 @@ remarks: >-
88
\[ [API set: ExcelApi
99
1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
1010
11+
12+
#### Examples
13+
14+
15+
```TypeScript
16+
17+
// Link to full sample:
18+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml
19+
20+
21+
// The following code adds data labels to the chart and positions them to
22+
demonstrate leader lines.
23+
24+
await Excel.run(async (context) => {
25+
const sheet = context.workbook.worksheets.getItem(sheetName);
26+
const chart = sheet.charts.getItemAt(0);
27+
const series = chart.series.getItemAt(0);
28+
29+
// Enable data labels for the series. Leader lines are enabled by default.
30+
series.hasDataLabels = true;
31+
series.points.load("items");
32+
await context.sync();
33+
34+
// Load the top position for each data label.
35+
series.points.items.forEach((point) => point.dataLabel.load("top"));
36+
await context.sync();
37+
38+
// Move some data labels to create distance from their chart points.
39+
const point1 = series.points.items[1];
40+
const point2 = series.points.items[2];
41+
point1.dataLabel.top -= 50;
42+
point2.dataLabel.top += 50;
43+
44+
// Format the data labels.
45+
series.dataLabels.geometricShapeType = Excel.GeometricShapeType.rectangle;
46+
series.dataLabels.showCategoryName = true;
47+
series.dataLabels.format.border.weight = 1;
48+
49+
await context.sync();
50+
});
51+
52+
```
53+
1154
isPreview: false
1255
isDeprecated: false
1356
type: class
@@ -449,6 +492,49 @@ properties:
449492
\[ [API set: ExcelApi
450493
1.7](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
451494
495+
496+
#### Examples
497+
498+
499+
```TypeScript
500+
501+
// Link to full sample:
502+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml
503+
504+
505+
// The following code adds data labels to the chart and positions them to
506+
demonstrate leader lines.
507+
508+
await Excel.run(async (context) => {
509+
const sheet = context.workbook.worksheets.getItem(sheetName);
510+
const chart = sheet.charts.getItemAt(0);
511+
const series = chart.series.getItemAt(0);
512+
513+
// Enable data labels for the series. Leader lines are enabled by default.
514+
series.hasDataLabels = true;
515+
series.points.load("items");
516+
await context.sync();
517+
518+
// Load the top position for each data label.
519+
series.points.items.forEach((point) => point.dataLabel.load("top"));
520+
await context.sync();
521+
522+
// Move some data labels to create distance from their chart points.
523+
const point1 = series.points.items[1];
524+
const point2 = series.points.items[2];
525+
point1.dataLabel.top -= 50;
526+
point2.dataLabel.top += 50;
527+
528+
// Format the data labels.
529+
series.dataLabels.geometricShapeType = Excel.GeometricShapeType.rectangle;
530+
series.dataLabels.showCategoryName = true;
531+
series.dataLabels.format.border.weight = 1;
532+
533+
await context.sync();
534+
});
535+
536+
```
537+
452538
isPreview: false
453539
isDeprecated: false
454540
syntax:
@@ -810,6 +896,49 @@ properties:
810896
\[ [API set: ExcelApi
811897
1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
812898
899+
900+
#### Examples
901+
902+
903+
```TypeScript
904+
905+
// Link to full sample:
906+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml
907+
908+
909+
// The following code adds data labels to the chart and positions them to
910+
demonstrate leader lines.
911+
912+
await Excel.run(async (context) => {
913+
const sheet = context.workbook.worksheets.getItem(sheetName);
914+
const chart = sheet.charts.getItemAt(0);
915+
const series = chart.series.getItemAt(0);
916+
917+
// Enable data labels for the series. Leader lines are enabled by default.
918+
series.hasDataLabels = true;
919+
series.points.load("items");
920+
await context.sync();
921+
922+
// Load the top position for each data label.
923+
series.points.items.forEach((point) => point.dataLabel.load("top"));
924+
await context.sync();
925+
926+
// Move some data labels to create distance from their chart points.
927+
const point1 = series.points.items[1];
928+
const point2 = series.points.items[2];
929+
point1.dataLabel.top -= 50;
930+
point2.dataLabel.top += 50;
931+
932+
// Format the data labels.
933+
series.dataLabels.geometricShapeType = Excel.GeometricShapeType.rectangle;
934+
series.dataLabels.showCategoryName = true;
935+
series.dataLabels.format.border.weight = 1;
936+
937+
await context.sync();
938+
});
939+
940+
```
941+
813942
isPreview: false
814943
isDeprecated: false
815944
syntax:
@@ -860,6 +989,32 @@ properties:
860989
\[ [API set: ExcelApi
861990
1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
862991
992+
993+
#### Examples
994+
995+
996+
```TypeScript
997+
998+
// Link to full sample:
999+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml
1000+
1001+
1002+
// The following code disables leader lines for chart data labels.
1003+
1004+
await Excel.run(async (context) => {
1005+
const sheet = context.workbook.worksheets.getItem(sheetName);
1006+
const chart = sheet.charts.getItemAt(0);
1007+
const series = chart.series.getItemAt(0);
1008+
const dataLabels = series.dataLabels;
1009+
1010+
// Disable leader lines.
1011+
dataLabels.showLeaderLines = false;
1012+
1013+
await context.sync();
1014+
});
1015+
1016+
```
1017+
8631018
isPreview: false
8641019
isDeprecated: false
8651020
syntax:

docs/docs-ref-autogen/excel_1_1/excel/excel.chartseries.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,49 @@ remarks: >-
88
\[ [API set: ExcelApi
99
1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
1010
11+
12+
#### Examples
13+
14+
15+
```TypeScript
16+
17+
// Link to full sample:
18+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml
19+
20+
21+
// The following code adds data labels to the chart and positions them to
22+
demonstrate leader lines.
23+
24+
await Excel.run(async (context) => {
25+
const sheet = context.workbook.worksheets.getItem(sheetName);
26+
const chart = sheet.charts.getItemAt(0);
27+
const series = chart.series.getItemAt(0);
28+
29+
// Enable data labels for the series. Leader lines are enabled by default.
30+
series.hasDataLabels = true;
31+
series.points.load("items");
32+
await context.sync();
33+
34+
// Load the top position for each data label.
35+
series.points.items.forEach((point) => point.dataLabel.load("top"));
36+
await context.sync();
37+
38+
// Move some data labels to create distance from their chart points.
39+
const point1 = series.points.items[1];
40+
const point2 = series.points.items[2];
41+
point1.dataLabel.top -= 50;
42+
point2.dataLabel.top += 50;
43+
44+
// Format the data labels.
45+
series.dataLabels.geometricShapeType = Excel.GeometricShapeType.rectangle;
46+
series.dataLabels.showCategoryName = true;
47+
series.dataLabels.format.border.weight = 1;
48+
49+
await context.sync();
50+
});
51+
52+
```
53+
1154
isPreview: false
1255
isDeprecated: false
1356
type: class
@@ -70,6 +113,49 @@ properties:
70113
\[ [API set: ExcelApi
71114
1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]
72115
116+
117+
#### Examples
118+
119+
120+
```TypeScript
121+
122+
// Link to full sample:
123+
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml
124+
125+
126+
// The following code adds data labels to the chart and positions them to
127+
demonstrate leader lines.
128+
129+
await Excel.run(async (context) => {
130+
const sheet = context.workbook.worksheets.getItem(sheetName);
131+
const chart = sheet.charts.getItemAt(0);
132+
const series = chart.series.getItemAt(0);
133+
134+
// Enable data labels for the series. Leader lines are enabled by default.
135+
series.hasDataLabels = true;
136+
series.points.load("items");
137+
await context.sync();
138+
139+
// Load the top position for each data label.
140+
series.points.items.forEach((point) => point.dataLabel.load("top"));
141+
await context.sync();
142+
143+
// Move some data labels to create distance from their chart points.
144+
const point1 = series.points.items[1];
145+
const point2 = series.points.items[2];
146+
point1.dataLabel.top -= 50;
147+
point2.dataLabel.top += 50;
148+
149+
// Format the data labels.
150+
series.dataLabels.geometricShapeType = Excel.GeometricShapeType.rectangle;
151+
series.dataLabels.showCategoryName = true;
152+
series.dataLabels.format.border.weight = 1;
153+
154+
await context.sync();
155+
});
156+
157+
```
158+
73159
isPreview: false
74160
isDeprecated: false
75161
syntax:

0 commit comments

Comments
 (0)