I am a fairly new Apps Script Programmer, so I apologize in advance for any questions that might seem obvious to advanced users. I looked here to learn how to build a dashboard for a Google Sheet. I was able to use some apps script that I tested in the Script Editor to crate an array. I seemed to follow most of the HTML conventions suggested thus far, but when I got to Step 5 I noticed that the options one could specify when setting up either a ControlWrapper or ChartWrapper. I clicked on the links specified there, but the ControlWrapper page, and the ChartWrapper page didn't really go into the properties; they described the methods that could be called. I don't know why Google wouldn't report these, but I am finding they leave a lot of information out for you to just figure out on your own. Perhaps there is an assumption that one has done some web programming, but I haven't so again please excuse any ignorance on my part. Does anyone know where I can find a list of the options that can be set for these two classes?
Also, I really didn't see anywhere on the page that showed you how to test whether the separate HTML file had worked. I would assume if I am making this as an added dashboard to a Google sheet, I would go to Publish →Deploy as Sheets web add on, but I wasn't sure. Lastly, in the example, they give hand typed/programmed arrays in there, while I used a script to populate an array. I was wondering if I would need to push categorization for all columns to the top of the array? I can share the script I added if this is helpful. I am just a little confused by this write up, as it doesn't really "fill in all of the blanks". Thanks for any help!
<!DOCTYPE html>
<html>
<head>
<!--This is what you will need to do every time you create a data visualization dashboard chart-->
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js">
<script type="text/javascript"
// Load the Visualization API and the controls package.
// Packages for all the other charts you need will be loaded
// automatically by the system.
google.charts.load("current", {'packages' :['corecharts'],['controls']});.
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawDashboard);
function DrawDashboard(){
//here is where you add the apps to get what you need.
//You need to figure out how to call your spreadsheet from here.
var ss = SpreadsheetApp.getActive();
var s = ss.getSheetByName("Stats");
//Not sure we need a comma separator
var datSet = [,];
//Here we would convert the array to a datatable
var ss = SpreadsheetApp.getActive();
var sheets = ss.getSheets();
var s = sheets[1];
var UI = SpreadsheetApp.getUi();
var response = UI.prompt("Please enter the first cell in the category").getResponseText();
var ir = s.getRange(response);
var n= 0;
var stored = [];
//Here is where you create your dashboard.
var dashboard = new google.visualization.Dashboard(document.getElementById('growing-dash'));
//Now you just need to figure out how to do this for a 2D array....we can use this as our script
while (ir.getValue()!= "") {
n = n +1;
ir = ir.offset(1, 0);
}
ir = ir.offset(-n,0)
for(i =0; i<n;i++) {
stored.push([ir.getValue(),ir.offset(n+2,0).getValue()]);
ir = ir.offset(1, 0);
}
var data = google.visualization.AarrayToDataTable(stored[]);
//creating the datachart
var Pie = new google.visualization.ChartWrapper({
'controltype' : 'PieChart',
'container_Id' : 'chart_div',
'options' : {
'width' : 350,
'height' : 325,
'title' : 'Count by salary'
}
}
</script>
<base target="_top">
</head>
<body>
<!--This is what is going to hold the dashboard-->
<div id="growing-dash">
<!--We need div deviders that separate each control and chart-->
<div id="filter1"> </div>
<div id="chart1"> </div>
</div> </body> --
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/1241cb09-f148-4346-9c48-35109e39137e%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/d28cf49c-873a-456a-aeed-1f66a958f6c9%40googlegroups.com.
Apps Scripts limits what you can do intentionally to avoid security issues. They might loosen up the restrictions if security can be assured, but you'll have to write to the Apps Scripts folks to get more info on all that.
On Thu, Jan 12, 2017 at 5:59 PM, Dat Viz <djloq...@gmail.com> wrote:
Thank you for the reference Daniel,
Unfortunately, when I went here and tried to create a pie chart, I found a couple of problems....
first the UiApp is depreciated, so I can't really follow the example (something Google should take the time to update), and I also found that when I tried to create a pre-defined array, the google.visualization.arrayToDataTable function wouldn't seem to accept a pre-defined array. It seemed that you had to create static values in the app itself. It doesn't help if you are trying to make the application flexible to the user so they can select an array they would like to visualize. I might be doing something wrong here, but that seems very limiting. I searched around a bit to see if there was some example somewhere of someone plugging a pre-defined array into the google.visualization.arrayToDataTable() function, but to no avail. Is that not allowed?
On Monday, December 19, 2016 at 10:16:56 PM UTC-8, Dat Viz wrote:I am a fairly new Apps Script Programmer, so I apologize in advance for any questions that might seem obvious to advanced users. I looked here to learn how to build a dashboard for a Google Sheet. I was able to use some apps script that I tested in the Script Editor to crate an array. I seemed to follow most of the HTML conventions suggested thus far, but when I got to Step 5 I noticed that the options one could specify when setting up either a ControlWrapper or ChartWrapper. I clicked on the links specified there, but the ControlWrapper page, and the ChartWrapper page didn't really go into the properties; they described the methods that could be called. I don't know why Google wouldn't report these, but I am finding they leave a lot of information out for you to just figure out on your own. Perhaps there is an assumption that one has done some web programming, but I haven't so again please excuse any ignorance on my part. Does anyone know where I can find a list of the options that can be set for these two classes?
Also, I really didn't see anywhere on the page that showed you how to test whether the separate HTML file had worked. I would assume if I am making this as an added dashboard to a Google sheet, I would go to Publish →Deploy as Sheets web add on, but I wasn't sure. Lastly, in the example, they give hand typed/programmed arrays in there, while I used a script to populate an array. I was wondering if I would need to push categorization for all columns to the top of the array? I can share the script I added if this is helpful. I am just a little confused by this write up, as it doesn't really "fill in all of the blanks". Thanks for any help!
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/d28cf49c-873a-456a-aeed-1f66a958f6c9%40googlegroups.com.
Are you referring to the use of a pre-defined array being limited? I would assume so, but I am having a hard time finding some relevant information in the documentation that will allow me to just get started on a simple dashboard. I appreciate the pointer, and I was going to try to create a chart without the HTML, but due to the UiApp being depreciated, that doesn't sound like an option. I am searching around, but not having much luck. At this point, I am just trying to find some baby steps towards creating a display that works....Maybe just have a static datatable? That just seems so limiting.
On Thursday, January 12, 2017 at 7:28:14 PM UTC-8, Daniel LaLiberte wrote:
Apps Scripts limits what you can do intentionally to avoid security issues. They might loosen up the restrictions if security can be assured, but you'll have to write to the Apps Scripts folks to get more info on all that.
On Thu, Jan 12, 2017 at 5:59 PM, Dat Viz <djloq...@gmail.com> wrote:
Thank you for the reference Daniel,
Unfortunately, when I went here and tried to create a pie chart, I found a couple of problems....
first the UiApp is depreciated, so I can't really follow the example (something Google should take the time to update), and I also found that when I tried to create a pre-defined array, the google.visualization.arrayToDataTable function wouldn't seem to accept a pre-defined array. It seemed that you had to create static values in the app itself. It doesn't help if you are trying to make the application flexible to the user so they can select an array they would like to visualize. I might be doing something wrong here, but that seems very limiting. I searched around a bit to see if there was some example somewhere of someone plugging a pre-defined array into the google.visualization.arrayToDataTable() function, but to no avail. Is that not allowed?
On Monday, December 19, 2016 at 10:16:56 PM UTC-8, Dat Viz wrote:I am a fairly new Apps Script Programmer, so I apologize in advance for any questions that might seem obvious to advanced users. I looked here to learn how to build a dashboard for a Google Sheet. I was able to use some apps script that I tested in the Script Editor to crate an array. I seemed to follow most of the HTML conventions suggested thus far, but when I got to Step 5 I noticed that the options one could specify when setting up either a ControlWrapper or ChartWrapper. I clicked on the links specified there, but the ControlWrapper page, and the ChartWrapper page didn't really go into the properties; they described the methods that could be called. I don't know why Google wouldn't report these, but I am finding they leave a lot of information out for you to just figure out on your own. Perhaps there is an assumption that one has done some web programming, but I haven't so again please excuse any ignorance on my part. Does anyone know where I can find a list of the options that can be set for these two classes?
Also, I really didn't see anywhere on the page that showed you how to test whether the separate HTML file had worked. I would assume if I am making this as an added dashboard to a Google sheet, I would go to Publish →Deploy as Sheets web add on, but I wasn't sure. Lastly, in the example, they give hand typed/programmed arrays in there, while I used a script to populate an array. I was wondering if I would need to push categorization for all columns to the top of the array? I can share the script I added if this is helpful. I am just a little confused by this write up, as it doesn't really "fill in all of the blanks". Thanks for any help!
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/d28cf49c-873a-456a-aeed-1f66a958f6c9%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/63681403-db5c-4c15-b394-5f71f9c96b21%40googlegroups.com.
I don't know exactly what limitations the AppsScripts imposes, but I know they do impose some. I was guessing from what you said that the data provided to arrayToDataTable() might have to be static, though that is surprising nevertheless. If I were you, I would start out with something that you know works, and modify it from there.
On Fri, Jan 13, 2017 at 3:43 PM, Dat Viz <djloq...@gmail.com> wrote:
Are you referring to the use of a pre-defined array being limited? I would assume so, but I am having a hard time finding some relevant information in the documentation that will allow me to just get started on a simple dashboard. I appreciate the pointer, and I was going to try to create a chart without the HTML, but due to the UiApp being depreciated, that doesn't sound like an option. I am searching around, but not having much luck. At this point, I am just trying to find some baby steps towards creating a display that works....Maybe just have a static datatable? That just seems so limiting.
On Thursday, January 12, 2017 at 7:28:14 PM UTC-8, Daniel LaLiberte wrote:
Apps Scripts limits what you can do intentionally to avoid security issues. They might loosen up the restrictions if security can be assured, but you'll have to write to the Apps Scripts folks to get more info on all that.
On Thu, Jan 12, 2017 at 5:59 PM, Dat Viz <djloq...@gmail.com> wrote:
Thank you for the reference Daniel,
Unfortunately, when I went here and tried to create a pie chart, I found a couple of problems....
first the UiApp is depreciated, so I can't really follow the example (something Google should take the time to update), and I also found that when I tried to create a pre-defined array, the google.visualization.arrayToDataTable function wouldn't seem to accept a pre-defined array. It seemed that you had to create static values in the app itself. It doesn't help if you are trying to make the application flexible to the user so they can select an array they would like to visualize. I might be doing something wrong here, but that seems very limiting. I searched around a bit to see if there was some example somewhere of someone plugging a pre-defined array into the google.visualization.arrayToDataTable() function, but to no avail. Is that not allowed?
On Monday, December 19, 2016 at 10:16:56 PM UTC-8, Dat Viz wrote:I am a fairly new Apps Script Programmer, so I apologize in advance for any questions that might seem obvious to advanced users. I looked here to learn how to build a dashboard for a Google Sheet. I was able to use some apps script that I tested in the Script Editor to crate an array. I seemed to follow most of the HTML conventions suggested thus far, but when I got to Step 5 I noticed that the options one could specify when setting up either a ControlWrapper or ChartWrapper. I clicked on the links specified there, but the ControlWrapper page, and the ChartWrapper page didn't really go into the properties; they described the methods that could be called. I don't know why Google wouldn't report these, but I am finding they leave a lot of information out for you to just figure out on your own. Perhaps there is an assumption that one has done some web programming, but I haven't so again please excuse any ignorance on my part. Does anyone know where I can find a list of the options that can be set for these two classes?
Also, I really didn't see anywhere on the page that showed you how to test whether the separate HTML file had worked. I would assume if I am making this as an added dashboard to a Google sheet, I would go to Publish →Deploy as Sheets web add on, but I wasn't sure. Lastly, in the example, they give hand typed/programmed arrays in there, while I used a script to populate an array. I was wondering if I would need to push categorization for all columns to the top of the array? I can share the script I added if this is helpful. I am just a little confused by this write up, as it doesn't really "fill in all of the blanks". Thanks for any help!
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/d28cf49c-873a-456a-aeed-1f66a958f6c9%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/63681403-db5c-4c15-b394-5f71f9c96b21%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/047e07d9-a7ca-42c9-aef6-0f6d20a7f815%40googlegroups.com.