Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/docs-ref-autogen/excel/excel/excel.chartleaderlines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,36 @@ remarks: >-
\[ [API set: ExcelApi
1.19](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]


#### Examples


```TypeScript

// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml


// The following code changes the format of leader lines. It adjusts color,
weight, and line style.

await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem(sheetName);
const chart = sheet.charts.getItemAt(0);
const series = chart.series.getItemAt(0);
const dataLabels = series.dataLabels;
const lineFormat = dataLabels.leaderLines.format;

// Set leader line formatting properties.
lineFormat.line.color = "blue";
lineFormat.line.weight = 2;
lineFormat.line.lineStyle = Excel.ChartLineStyle.dot;

await context.sync();
});

```

isPreview: false
isDeprecated: false
type: class
Expand Down
30 changes: 30 additions & 0 deletions docs/docs-ref-autogen/excel/excel/excel.chartleaderlinesformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,36 @@ remarks: >-
\[ [API set: ExcelApi
1.19](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]


#### Examples


```TypeScript

// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml


// The following code changes the format of leader lines. It adjusts color,
weight, and line style.

await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem(sheetName);
const chart = sheet.charts.getItemAt(0);
const series = chart.series.getItemAt(0);
const dataLabels = series.dataLabels;
const lineFormat = dataLabels.leaderLines.format;

// Set leader line formatting properties.
lineFormat.line.color = "blue";
lineFormat.line.weight = 2;
lineFormat.line.lineStyle = Excel.ChartLineStyle.dot;

await context.sync();
});

```

isPreview: false
isDeprecated: false
type: class
Expand Down
155 changes: 155 additions & 0 deletions docs/docs-ref-autogen/excel/excel/excel.chartseries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,49 @@ remarks: >-
\[ [API set: ExcelApi
1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]


#### Examples


```TypeScript

// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml


// The following code adds data labels to the chart and positions them to
demonstrate leader lines.

await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem(sheetName);
const chart = sheet.charts.getItemAt(0);
const series = chart.series.getItemAt(0);

// Enable data labels for the series. Leader lines are enabled by default.
series.hasDataLabels = true;
series.points.load("items");
await context.sync();

// Load the top position for each data label.
series.points.items.forEach((point) => point.dataLabel.load("top"));
await context.sync();

// Move some data labels to create distance from their chart points.
const point1 = series.points.items[1];
const point2 = series.points.items[2];
point1.dataLabel.top -= 50;
point2.dataLabel.top += 50;

// Format the data labels.
series.dataLabels.geometricShapeType = Excel.GeometricShapeType.rectangle;
series.dataLabels.showCategoryName = true;
series.dataLabels.format.border.weight = 1;

await context.sync();
});

```

isPreview: false
isDeprecated: false
type: class
Expand Down Expand Up @@ -449,6 +492,49 @@ properties:
\[ [API set: ExcelApi
1.7](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]


#### Examples


```TypeScript

// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml


// The following code adds data labels to the chart and positions them to
demonstrate leader lines.

await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem(sheetName);
const chart = sheet.charts.getItemAt(0);
const series = chart.series.getItemAt(0);

// Enable data labels for the series. Leader lines are enabled by default.
series.hasDataLabels = true;
series.points.load("items");
await context.sync();

// Load the top position for each data label.
series.points.items.forEach((point) => point.dataLabel.load("top"));
await context.sync();

// Move some data labels to create distance from their chart points.
const point1 = series.points.items[1];
const point2 = series.points.items[2];
point1.dataLabel.top -= 50;
point2.dataLabel.top += 50;

// Format the data labels.
series.dataLabels.geometricShapeType = Excel.GeometricShapeType.rectangle;
series.dataLabels.showCategoryName = true;
series.dataLabels.format.border.weight = 1;

await context.sync();
});

```

isPreview: false
isDeprecated: false
syntax:
Expand Down Expand Up @@ -810,6 +896,49 @@ properties:
\[ [API set: ExcelApi
1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]


#### Examples


```TypeScript

// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml


// The following code adds data labels to the chart and positions them to
demonstrate leader lines.

await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem(sheetName);
const chart = sheet.charts.getItemAt(0);
const series = chart.series.getItemAt(0);

// Enable data labels for the series. Leader lines are enabled by default.
series.hasDataLabels = true;
series.points.load("items");
await context.sync();

// Load the top position for each data label.
series.points.items.forEach((point) => point.dataLabel.load("top"));
await context.sync();

// Move some data labels to create distance from their chart points.
const point1 = series.points.items[1];
const point2 = series.points.items[2];
point1.dataLabel.top -= 50;
point2.dataLabel.top += 50;

// Format the data labels.
series.dataLabels.geometricShapeType = Excel.GeometricShapeType.rectangle;
series.dataLabels.showCategoryName = true;
series.dataLabels.format.border.weight = 1;

await context.sync();
});

```

isPreview: false
isDeprecated: false
syntax:
Expand Down Expand Up @@ -860,6 +989,32 @@ properties:
\[ [API set: ExcelApi
1.9](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]


#### Examples


```TypeScript

// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml


// The following code disables leader lines for chart data labels.

await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem(sheetName);
const chart = sheet.charts.getItemAt(0);
const series = chart.series.getItemAt(0);
const dataLabels = series.dataLabels;

// Disable leader lines.
dataLabels.showLeaderLines = false;

await context.sync();
});

```

isPreview: false
isDeprecated: false
syntax:
Expand Down
86 changes: 86 additions & 0 deletions docs/docs-ref-autogen/excel_1_1/excel/excel.chartseries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,49 @@ remarks: >-
\[ [API set: ExcelApi
1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]


#### Examples


```TypeScript

// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml


// The following code adds data labels to the chart and positions them to
demonstrate leader lines.

await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem(sheetName);
const chart = sheet.charts.getItemAt(0);
const series = chart.series.getItemAt(0);

// Enable data labels for the series. Leader lines are enabled by default.
series.hasDataLabels = true;
series.points.load("items");
await context.sync();

// Load the top position for each data label.
series.points.items.forEach((point) => point.dataLabel.load("top"));
await context.sync();

// Move some data labels to create distance from their chart points.
const point1 = series.points.items[1];
const point2 = series.points.items[2];
point1.dataLabel.top -= 50;
point2.dataLabel.top += 50;

// Format the data labels.
series.dataLabels.geometricShapeType = Excel.GeometricShapeType.rectangle;
series.dataLabels.showCategoryName = true;
series.dataLabels.format.border.weight = 1;

await context.sync();
});

```

isPreview: false
isDeprecated: false
type: class
Expand Down Expand Up @@ -70,6 +113,49 @@ properties:
\[ [API set: ExcelApi
1.1](/javascript/api/requirement-sets/excel/excel-api-requirement-sets) \]


#### Examples


```TypeScript

// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/10-chart/chart-leader-lines.yaml


// The following code adds data labels to the chart and positions them to
demonstrate leader lines.

await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem(sheetName);
const chart = sheet.charts.getItemAt(0);
const series = chart.series.getItemAt(0);

// Enable data labels for the series. Leader lines are enabled by default.
series.hasDataLabels = true;
series.points.load("items");
await context.sync();

// Load the top position for each data label.
series.points.items.forEach((point) => point.dataLabel.load("top"));
await context.sync();

// Move some data labels to create distance from their chart points.
const point1 = series.points.items[1];
const point2 = series.points.items[2];
point1.dataLabel.top -= 50;
point2.dataLabel.top += 50;

// Format the data labels.
series.dataLabels.geometricShapeType = Excel.GeometricShapeType.rectangle;
series.dataLabels.showCategoryName = true;
series.dataLabels.format.border.weight = 1;

await context.sync();
});

```

isPreview: false
isDeprecated: false
syntax:
Expand Down
Loading