Google App Scripts: When running script, chart output isn't being generated -
i trying concatenate html files , output them using 1 doget() so:
function doget() { return htmlservice.createtemplatefromfile('index').evaluate() } function include(filename) { return htmlservice.createhtmloutputfromfile(filename).getcontent() } however, charts don't generate. if pass in 1 file via index.html output. it's literally code wrote in editor.
<html> <head> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=tangerine"> <style> body { font-family: 'tangerine', serif; font-size: 35px; } </style> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> // load charts , corechart package. google.charts.load('current', {'packages': ['table']}); google.charts.load('current', {'packages':['corechart']}); google.charts.load('current', {'packages':['bar']}); google.charts.load('current', {'packages':['line']}); //draw table data google.charts.setonloadcallback(drawtable); //draw line chart data google.charts.setonloadcallback(drawlinechart); //draw bar chart data google.charts.setonloadcallback(drawbarchart); // draw pie chart date1 google.charts.setonloadcallback(drawapr1chart); // draw pie chart date2 google.charts.setonloadcallback(drawapr3chart); //draw pie chart date3 google.charts.setonloadcallback(drawapr10chart); //draw pie chart date4 google.charts.setonloadcallback(drawapr24chart); //draw material line chart issues vs date when charts loaded google.charts.setonloadcallback(drawissuesvsdate); function drawtable() not sure why that's case. have managed concatenate html outputs before not sure problem is.
in html file, prior teh tag, place following:
<?!= htmlservice.createhtmloutputfromfile('myfilename').getcontent(); ?> or
<?!= include('myfilename'); ?> where myfilename name of other html file wish include project.
note first option removes need include() function in .gs file while second option allows easy edit if htmlservice calls change or deprecated.
edit comment: did not check include() function 1 have been using. how mine reads:
function include(filename) { // return htmlservice.createhtmloutputfromfile(filename) return htmlservice.createtemplatefromfile(filename).evaluate() .getcontent(); } note addition of .evaluate()
Comments
Post a Comment