Google Script Graph

Google Spreadsheet Graph with Dynamic Data by Eric on February 1, 2020

Recently we started dumping some data from the database into a shared spreadsheet on Google Docs.  With all of this data it would be helpful to visualize it in some way.  After searching the net it seems there isn't really a good way to create a chart that is dynamic with what data is in the spreadsheet.  What I want is to have my graph update every time a new row is added to the sheet without having to edit the graph directly.  The solution was to write a custom Google Apps Script to do just that. To add a Google Apps Script to a document open the document and click Tools -> Script editor...  This opens up a page for editing scripts.  If a prompt appears for what type of script you want to do just select Blank.  Now you just need to paste in this code below.//Runs on document open function onOpen() { createGraph(); }; //Runs on any edit function onEdit() { createGraph(); } /** * This function reads the data in the Totals columns */ function createGraph() { var tabName = ...