Skip to content

Instantly share code, notes, and snippets.

@renaudfractale
Created November 12, 2019 12:16
Show Gist options
  • Save renaudfractale/b9d181cc24452b5af5a88dc5d983a2b6 to your computer and use it in GitHub Desktop.
Save renaudfractale/b9d181cc24452b5af5a88dc5d983a2b6 to your computer and use it in GitHub Desktop.
Create a new snippet from a blank template.
name: Blank snippet
description: Create a new snippet from a blank template.
host: EXCEL
api_set: {}
script:
content: ''
language: typescript
template:
content: "<section>\n\t<script type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"></script>\n\t<script type=\"text/javascript\">\n\t\tgoogle.charts.load('current', {'packages':['gantt']});\n google.charts.setOnLoadCallback(drawChart);\n\n function daysToMilliseconds(days) {\n return days * 24 * 60 * 60 * 1000;\n }\n\n function drawChart() {\n\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Task ID');\n data.addColumn('string', 'Task Name');\n data.addColumn('date', 'Start Date');\n data.addColumn('date', 'End Date');\n data.addColumn('number', 'Duration');\n data.addColumn('number', 'Percent Complete');\n data.addColumn('string', 'Dependencies');\n let aa = Exc\n data.addRows([\n ['Research', 'Find sources',\n new Date(2015, 0, 1), new Date(2015, 0, 5), null, 100, null],\n ['Write', 'Write paper',\n null, new Date(2015, 0, 9), daysToMilliseconds(3), 25, 'Research,Outline'],\n ['Cite', 'Create bibliography',\n null, new Date(2015, 0, 7), daysToMilliseconds(1), 20, 'Research'],\n ['Complete', 'Hand in paper',\n null, new Date(2015, 0, 10), daysToMilliseconds(1), 0, 'Cite,Write'],\n ['Outline', 'Outline paper',\n null, new Date(2015, 0, 6), daysToMilliseconds(1), 100, 'Research']\n ]);\n\n var options = {\n height: 275\n };\n\n var chart = new google.visualization.Gantt(document.getElementById('chart_div'));\n\n chart.draw(data, options);\n }\n\t</script>\n\n\t<div id=\"chart_div\"></div>\n</section>"
language: html
style:
content: |-
section.samples {
margin-top: 20px;
}
section.samples .ms-Button, section.setup .ms-Button {
display: block;
margin-bottom: 5px;
margin-left: 20px;
min-width: 80px;
}
language: css
libraries: |-
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js
office-ui-fabric-js@1.4.0/dist/css/fabric.min.css
office-ui-fabric-js@1.4.0/dist/css/fabric.components.min.css
core-js@2.4.1/client/core.min.js
@types/core-js
jquery@3.1.1
@types/jquery@3.3.1
https://www.gstatic.com/charts/loader.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment