Thursday, February 16, 2012

yogi_Check user mwatanabe's Interactive Chart


Yogi Anand, D.Eng, P.E.                                      Google Spreadsheet                       www.energyefficientbuild.com

here is the code as mwatanbe presented in Google Docs spreadsheets Help forum ... post
https://groups.google.com/a/googleproductforums.com/forum/#!category-topic/docs/spreadsheets/Kvr-IhJkIF8  and this does not display the Chart
here is the script for the interactive chart without the opening angle bracket before script, and without the closing angle bracket after chart.js"
script type="text
/javascript" src="//ajax.googleapis.com/ajax/static/modules/gviz/1.0/chart.js" {"containerId":"chart_1","dataSourceUrl":"//docs.google.com/spreadsheet/tq?key=0At3gqtlT0iJwdDZLVm1MTHBicGpMRjJYM1EwTy1Ib2c&transpose=0&headers=1&range=A1%3AB11&gid=0&pub=1","options":{"series":{"0":{"color":"#ff0000"}},"title":"Rainfall totals (Feb. 15, 2012)","booleanRole":"certainty","height":371,"animation":{"duration":500},"width":600,"vAxis":{"format":""},"useFirstColumnAsDomain":true,"hAxis":{"title":"Rainfall in inches","viewWindowMode":"pretty","format":"","viewWindow":{}},"isStacked":false},"state":{},"view":["{\"columns\":[0,1]}","{\"columns\":[0,1]}","{\"columns\":[0,1]}"],"chartType":"BarChart","chartName":"Chart 1"}
/script
and finally without the opening and closing angle brackets for /script


following is the script as I modified it ... and this one does display the Chart
here is the script for the interactive chart without the opening angle bracket before script, and without the closing angle bracket after javascript"
script src="//ajax.googleapis.com/ajax/static/modules/gviz/1.0/chart.js"
type="text/javascript"
{"dataSourceUrl":"//docs.google.com/spreadsheet/tq?key=0At3gqtlT0iJwdDZLVm1MTHBicGpMRjJYM1EwTy1Ib2c&transpose=0&headers=1&range=A1%3AB11&gid=0&pub=1","options":{"series":{"0":{"color":"#ff0000"}},"title":"Rainfall totals (Feb. 15, 2012)","booleanRole":"certainty","height":371,"animation":{"duration":500},"width":600,"vAxis":{"format":""},"useFirstColumnAsDomain":true,"hAxis":{"title":"Rainfall in inches","viewWindowMode":"pretty","format":"","viewWindow":{}},"isStacked":false},"state":{},"view":["{\"columns\":[0,1]}","{\"columns\":[0,1]}","{\"columns\":[0,1]}"],"chartType":"BarChart","chartName":"Chart 1"}
/script
and finally without the opening and closing angle brackets for /script