Skip to content

Instantly share code, notes, and snippets.

@tanyagupta
Created December 30, 2016 00:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanyagupta/bfb2e1da7186164b75cd66ef5d86c2c3 to your computer and use it in GitHub Desktop.
Save tanyagupta/bfb2e1da7186164b75cd66ef5d86c2c3 to your computer and use it in GitHub Desktop.
Using D3 in GAS
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<div class="chart"></div>
</body>
<style>
.chart div {
font: 12px arial-serif;
background-color: black;
text-align: right;
padding: 5px;
margin: 3px;
color: red;
}
</style>
<h1>Sample D3 chart in GAS</h1>
<div class="chart">
<div style="width: 50px;">5</div>
<div style="width: 75px;">7</div>
<div style="width: 152px;">15</div>
<div style="width: 112px;">11</div>
<div style="width: 234px;">23</div>
<div style="width: 567px;">56</div>
</div>
function doGet() {
return HtmlService.createTemplateFromFile('UI').evaluate().setTitle("Test").setSandboxMode(HtmlService.SandboxMode.IFRAME)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment