Skip to content

Instantly share code, notes, and snippets.

View MiaofeiWang's full-sized avatar

Miaofei Wang MiaofeiWang

  • Microsoft
View GitHub Profile
@MiaofeiWang
MiaofeiWang / Leaderlines API Samples.EXCEL.yaml
Created March 21, 2024 12:31
This sample shows how to use Excel chart data label leader line APIs.
name: Leaderlines API Samples
description: This sample shows how to use Excel chart data label leader line APIs.
host: EXCEL
api_set: {}
script:
content: |
$("#setup").click(() => tryCatch(setup));
$("#addlabels").click(() => tryCatch(addLabels));
$("#turnonldl").click(() => tryCatch(turnOnLeaderlines));
$("#turnoffldl").click(() => tryCatch(turnOffLeaderlines));
name: Perf_APISetFormula
description: ''
host: EXCEL
api_set: {}
script:
content: |
$("#run").on("click", () => tryCatch(run));
$("#register").on("click", () => tryCatch(registerEvent));
$("#unregister").on("click", () => tryCatch(unregisterEvent));
@MiaofeiWang
MiaofeiWang / PerfTestFunctions.EXCEL.yaml
Last active February 22, 2024 07:17
Functions for perf testing
name: PerfTestFunctions
description: Functions for perf testing
host: EXCEL
api_set: {}
script:
content: >-
/** @CustomFunction
* @description Simulates rolling a 6-sided die.
* @param dependency Only for triggering chained calc.
* @returns A whole number from 1 to 6.
name: Data label APIs from Scratch
description: ''
host: EXCEL
api_set: {}
script:
content: >
$("#prepare-chart").click(() => tryCatch(prepareChart));
const SHEET_NAME = "SampleSheet";
@MiaofeiWang
MiaofeiWang / Get image of shape group.EXCEL.yaml
Last active January 18, 2024 06:29
A demo script to get the image of the shape group in active worksheet.
name: Get image of shape group
description: A demo script to get the image of the shape group in active worksheet.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
name: Multiple Custom functions
description: ''
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
name: BindingDataLabelsWithFormula_20231120
description: ''
host: EXCEL
api_set: {}
script:
content: >
$("#setup").click(() => tryCatch(setup));
$("#import-news").click(() => tryCatch(importNews));
name: Get SVG image of chart
description: ''
host: EXCEL
api_set: {}
script:
content: |
$("#setup").click(() => tryCatch(setup));
$("#run").click(() => tryCatch(run));
const sheetName = "Sample";
name: DataLabelAPIs_Demo_20231012
description: ''
host: EXCEL
api_set: {}
script:
content: >
$("#setup").click(() => tryCatch(setup));
$("#show-data-callout").click(() => tryCatch(addAnnotationToDataPoints));
@MiaofeiWang
MiaofeiWang / MyCFs.EXCEL.yaml
Last active September 13, 2023 08:55
Few custom functions for test
name: MyCFs
description: Few custom functions for test
host: EXCEL
api_set: {}
script:
content: |
/**
* @customfunction
* @return {number} random number between 1-6
*/