Created
June 23, 2013 08:23
-
-
Save so-c/5844283 to your computer and use it in GitHub Desktop.
Google DocsのSpreadSheetにエクスポートしたSimpleDietのデータから折れ線グラフを作るための、Container-Bound Script。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Make a line chart with the data exported from iOS App SimppleDiet to Google Docs Spreadsheet. | |
*/ | |
function addLineGraph() { | |
var sheets = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = sheets.getSheets()[0]; | |
var allRange = sheet.getDataRange(); | |
var range = sheet.getRange(1, 1, allRange.getLastRow(), 2); | |
var chart = sheet.newChart().asLineChart() | |
.addRange(range) | |
.setPosition(1, 1, 0, 0) | |
.setOption('legend', {position: 'none'}) | |
.setOption('chartArea', {width: 408, height: 306}) | |
.build(); | |
sheet.insertChart(chart) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment