Reputation: 11
Google provides its Javascript APIs for Google Graphs, but I cannot write any js on page as it is an AMP page
I have following solutions: Make a different non AMP page, integrate google graphs there and add an iframe of the page on my AMP page, but my page is on HTTP and google does not allows HTTP iframe link on AMP Page.
Can anyone think of any other solution?
It would be great if you could help.
Upvotes: 1
Views: 960
Reputation: 4288
amp-iframe is the correct approach in this case. You have two options:
use the srcdoc attribute to directly embed the iframe content into your AMP:
<amp-iframe width="500" height="281" layout="responsive" sandbox="allow-scripts allow-popups" allowfullscreen frameborder="0" srcdoc="<h1>Hello</h1>"> </amp-iframe>
Upvotes: 2