WordPress.org

Ready to get started?Download WordPress

Forums

Google Docs Charts Embeds are not working in WordPress (3 posts)

  1. OperaManiac
    Member
    Posted 2 years ago #

    <script type="text/javascript" src="//ajax.googleapis.com/ajax/static/modules/gviz/1.0/chart.js"> {"dataSourceUrl":"//docs.google.com/a/hardwarebbq.com/spreadsheet/tq?key=0ApTeq9VLJF0pdGVTeENWV1I1dlV6STNiWkphMTRybmc&transpose=0&headers=1&range=A1%3AF6&gid=0&pub=1","options":{"reverseCategories":false,"pointSize":"7","backgroundColor":"#ff9900","is3D":false,"logScale":false,"wmode":"opaque","title":"Hardware BBQ: Boot Load Time (Lower The Better)","height":371,"pointSizeOther":"7","isStacked":false,"mapType":"hybrid","showTip":true,"displayAnnotations":true,"nonGeoMapColors":["#0b5394","#DC3912","#38761d","#109618","#990099","#0099C6","#DD4477","#66AA00","#B82E2E","#316395"],"titleY":"Time (In Seconds Lower the Better)","dataMode":"markers","maxAlternation":1,"colors":["#0b5394","#DC3912","#38761d","#109618","#990099","#0099C6","#DD4477","#66AA00","#B82E2E","#316395"],"smoothLine":true,"width":600,"lineWidth":"2","labelPosition":"right","hasLabelsColumn":true,"chf":"bg,s,ff9900","legend":"right","allowCollapse":true,"reverseAxis":false},"state":{},"chartType":"LineChart","chartName":"Chart 6"} </script>

    This is a sample code that seems to work fine here: http://htmledit.squarefree.com/

    So, the html works. But putting this code in a blog post does not render anything. Chrome shows an error message. Firefox shows nothing. What could be the reason?

  2. The reason is because you can't insert javascript in a blog post.

    http://codex.wordpress.org/Using_Javascript

    If you only want this code in one post or page, I would create a custom template for it and add it to the php file instead.

    http://codex.wordpress.org/Theme_Development#Custom_Page_Templates

  3. OperaManiac
    Member
    Posted 2 years ago #

    cool thanks. i have managed to embed javascript in posts in the past. i guess this one is a more complicated case. i would look for the alternatives you have suggested!

Topic Closed

This topic has been closed to new replies.

About this Topic