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

3 comments:

  1. Hey was just experimenting with this... have you tried using dynamic views with this? From what I can tell this fails totally whilst in a Dynamic View template...
    Any suggestions?

    ReplyDelete
  2. Hi Timothy:

    Thanks for the info --
    I have not tested it with dynamic views ... Sorry!

    ReplyDelete
  3. How long does it take before it shows your chart? I'm still having trouble with my interactive chart...

    ReplyDelete