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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 7 additions & 14 deletions samples/excel/01-basics/basic-api-call-es5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ host: EXCEL
api_set:
ExcelApi: '1.1'
script:
content: |
$("#run").on("click", () => tryCatch(run));
content: |-
document.getElementById("run").addEventListener("click", () => tryCatch(run));

function run() {
return Excel.run(function (context) {
Expand All @@ -33,11 +33,10 @@ script:
}
language: typescript
template:
content: |
content: |-
<section class="ms-Fabric ms-font-m">
<p class="ms-font-m">This sample demonstrates basic Excel API calls.</p>
</section>

<section class="ms-Fabric samples ms-font-m">
<h3>Try it out</h3>
<p class="ms-font-m">Select some cells in the worksheet, then press <b>Highlight selected range</b>.</p>
Expand All @@ -59,15 +58,9 @@ style:
min-width: 80px;
}
language: css
libraries: |
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js

office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css

core-js@2.4.1/client/core.min.js
@types/core-js
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts

jquery@3.1.1
@types/jquery@3.3.1
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
19 changes: 6 additions & 13 deletions samples/excel/01-basics/basic-api-call.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ host: EXCEL
api_set:
ExcelApi: '1.1'
script:
content: |
$("#run").on("click", () => tryCatch(run));
content: |-
document.getElementById("run").addEventListener("click", () => tryCatch(run));

async function run() {
await Excel.run(async (context) => {
Expand Down Expand Up @@ -38,7 +38,6 @@ template:
<section class="ms-Fabric ms-font-m">
<p class="ms-font-m">This sample demonstrates basic Excel API calls.</p>
</section>

<section class="ms-Fabric samples ms-font-m">
<h3>Try it out</h3>
<p class="ms-font-m">Select some cells in the worksheet, then press <b>Highlight selected range</b>.</p>
Expand All @@ -60,15 +59,9 @@ style:
min-width: 80px;
}
language: css
libraries: |
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js

office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css

core-js@2.4.1/client/core.min.js
@types/core-js
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts

jquery@3.1.1
@types/jquery@3.3.1
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
23 changes: 8 additions & 15 deletions samples/excel/01-basics/basic-common-api-call.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ host: EXCEL
api_set:
Selection: 1.1
script:
content: |
$("#run").on("click", run);
content: |-
document.getElementById("run").addEventListener("click", run);

function run() {
Office.context.document.getSelectedDataAsync(
Expand All @@ -24,11 +24,10 @@ script:
}
language: typescript
template:
content: |
content: |-
<section class="ms-Fabric ms-font-m">
<p>This sample uses the Common APIs compatible with Office 2013.</p>
</section>

<section class="ms-Fabric samples ms-font-m">
<h3>Try it out</h3>
<p>Select a cell in the worksheet and press <b>Write to console</b> to see the contents of that cell in the console.</p>
Expand All @@ -39,7 +38,7 @@ template:
</section>
language: html
style:
content: |
content: |-
section.samples {
margin-top: 20px;
}
Expand All @@ -51,15 +50,9 @@ style:
min-width: 80px;
}
language: css
libraries: |
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js

office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css

core-js@2.4.1/client/core.min.js
@types/core-js
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts

jquery@3.1.1
@types/jquery@3.3.1
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
26 changes: 8 additions & 18 deletions samples/excel/10-chart/chart-axis-formatting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ host: EXCEL
api_set:
ExcelApi: '1.8'
script:
content: |
$("#setup").on("click", () => tryCatch(setup));
$("#format-horizontal-axis").on("click", () => tryCatch(formatHorizontalAxis));
$("#format-vertical-axis").on("click", () => tryCatch(formatVerticalAxis));
content: |-
document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
document.getElementById("format-horizontal-axis").addEventListener("click", () => tryCatch(formatHorizontalAxis));
document.getElementById("format-vertical-axis").addEventListener("click", () => tryCatch(formatVerticalAxis));

async function formatHorizontalAxis() {
await Excel.run(async (context) => {
Expand Down Expand Up @@ -118,33 +118,29 @@ script:
language: typescript
template:
content: |-

<section class="ms-Fabric ms-font-m">
<p>This sample shows how to format the vertical and horizontal axis in a chart.</p>
</section>

<section class="ms-Fabric setup ms-font-m">
<h3>Set up</h3>
<button id="setup" class="ms-Button">
<span class="ms-Button-label">Add sample data</span>
</button>
</section>

<section class="ms-Fabric samples ms-font-m">
<h3>Try it out</h3>
<button id="format-horizontal-axis" class="ms-Button">
<span class="ms-Button-label">Format horizontal axis</span>
</button>
</section>

<section class="ms-Fabric samples ms-font-m">
<button id="format-vertical-axis" class="ms-Button">
<span class="ms-Button-label">Format vertical axis</span>
</button>
</section>
language: html
style:
content: |
content: |-
section.samples {
margin-top: 20px;
}
Expand All @@ -158,13 +154,7 @@ style:
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js

office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css

core-js@2.4.1/client/core.min.js
@types/core-js
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts

jquery@3.1.1
@types/jquery@3.3.1
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
34 changes: 11 additions & 23 deletions samples/excel/10-chart/chart-axis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ api_set:
ExcelApi: '1.7'
script:
content: |-
$("#setup").on("click", () => tryCatch(setup));
$("#get-axis-unit").on("click", () => tryCatch(getAxisUnit));
$("#change-axis-unit").on("click", () => tryCatch(changeAxisUnit));
$("#remove-axis-label").on("click", () => tryCatch(removeAxisLabel));
$("#show-axis-label").on("click", () => tryCatch(showAxisLabel));
$("#set-axis-title").on("click", () => tryCatch(setAxisTitle));
document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
document.getElementById("get-axis-unit").addEventListener("click", () => tryCatch(getAxisUnit));
document.getElementById("change-axis-unit").addEventListener("click", () => tryCatch(changeAxisUnit));
document.getElementById("remove-axis-label").addEventListener("click", () => tryCatch(removeAxisLabel));
document.getElementById("show-axis-label").addEventListener("click", () => tryCatch(showAxisLabel));
document.getElementById("set-axis-title").addEventListener("click", () => tryCatch(setAxisTitle));

async function getAxisUnit() {
await Excel.run(async (context) => {
Expand Down Expand Up @@ -173,47 +173,41 @@ template:
<section class="ms-Fabric ms-font-m">
<p>This sample shows how to get, set, and remove axis unit, label and title in a chart.</p>
</section>

<section class="ms-Fabric setup ms-font-m">
<h3>Set up</h3>
<button id="setup" class="ms-Button">
<span class="ms-Button-label">Add sample data</span>
</button>
</section>

<section class="ms-Fabric samples ms-font-m">
<h3>Try it out</h3>
<button id="get-axis-unit" class="ms-Button">
<span class="ms-Button-label">Get axis unit</span>
</button>
</section>

<section class="ms-Fabric samples ms-font-m">
<button id="change-axis-unit" class="ms-Button">
<span class="ms-Button-label">Change axis unit</span>
</button>
</section>

<section class="ms-Fabric samples ms-font-m">
<button id="remove-axis-label" class="ms-Button">
<span class="ms-Button-label">Remove axis label</span>
</button>
</section>

<section class="ms-Fabric samples ms-font-m">
<button id="show-axis-label" class="ms-Button">
<span class="ms-Button-label">Show axis label</span>
</button>
</section>

<section class="ms-Fabric samples ms-font-m">
<button id="set-axis-title" class="ms-Button">
<span class="ms-Button-label">Set axis title</span>
</button>
</section>
language: html
style:
content: |
content: |-
section.samples {
margin-top: 20px;
}
Expand All @@ -225,15 +219,9 @@ style:
min-width: 80px;
}
language: css
libraries: |
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js

office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css

core-js@2.4.1/client/core.min.js
@types/core-js
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts

jquery@3.1.1
@types/jquery@3.3.1
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
28 changes: 11 additions & 17 deletions samples/excel/10-chart/chart-bubble-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ host: EXCEL
api_set:
ExcelApi: '1.12'
script:
content: |
$("#setup").on("click", () => tryCatch(setup));
$("#create-bubble-chart").on("click", () => tryCatch(createBubbleChart));
$("#get-chart-series-dimension-values").on("click", () => tryCatch(getChartSeriesDimensionValues));
content: |-
document.getElementById("setup").addEventListener("click", () => tryCatch(setup));
document.getElementById("create-bubble-chart").addEventListener("click", () => tryCatch(createBubbleChart));
document.getElementById("get-chart-series-dimension-values").addEventListener("click", () => tryCatch(getChartSeriesDimensionValues));

async function createBubbleChart() {
await Excel.run(async (context) => {
/*
Expand Down Expand Up @@ -57,6 +58,7 @@ script:
await context.sync();
});
}

async function getChartSeriesDimensionValues() {
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Sample");
Expand Down Expand Up @@ -120,14 +122,12 @@ template:
<section class="ms-Fabric ms-font-m">
<p>This sample shows how to create a bubble chart, with each chart series (or bubble) representing a single table row.</p>
</section>

<section class="ms-Fabric setup ms-font-m">
<h3>Set up</h3>
<button id="setup" class="ms-Button">
<span class="ms-Button-label">Create table</span>
</button>
</section>

<section class="ms-Fabric samples ms-font-m">
<h3>Try it out</h3>
<button id="create-bubble-chart" class="ms-Button">
Expand All @@ -140,7 +140,7 @@ template:
</section>
language: html
style:
content: |
content: |-
section.samples {
margin-top: 20px;
}
Expand All @@ -152,15 +152,9 @@ style:
min-width: 80px;
}
language: css
libraries: |
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js

office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css

core-js@2.4.1/client/core.min.js
@types/core-js
https://appsforoffice.microsoft.com/lib/1/hosted/office.d.ts

jquery@3.1.1
@types/jquery@3.3.1
https://unpkg.com/office-ui-fabric-core@11.1.0/dist/css/fabric.min.css
https://unpkg.com/office-ui-fabric-js@1.5.0/dist/css/fabric.components.min.css
Loading