【问题标题】:Trouble Embedding Google Trends Chart in Local HTML File在本地 HTML 文件中嵌入 Google 趋势图时遇到问题
【发布时间】:2021-06-17 03:11:54
【问题描述】:
【问题讨论】:
标签:
html
css
dashboard
google-trends
【解决方案1】:
请在下面找到代码 sn-p,我试图解决您在第一段中遇到的问题,希望此解决方案对您有用
<!DOCTYPE html>
<html>
<head>
<style>
.myDiv {
border: 1px outset lightblue;
background-color: lightgray;
text-align: left;
}
</style>
</head>
<body>
<h1>Data Tracking</h1>
<h2>COVID-19 Data</h2>
<script type="text/javascript" src="https://ssl.gstatic.com/trends_nrtr/2431_RC04/embed_loader.js"></script>
<script type="text/javascript"> trends.embed.renderExploreWidget("TIMESERIES", {"comparisonItem":[{"keyword":"/m/03376x","geo":"GB","time":"today 5-y"}],"category":0,"property":""}, {"exploreQuery":"date=today%205-y&geo=GB&q=%2Fm%2F03376x","guestPath":"https://trends.google.com:443/trends/embed/"});
</script>
<script type="text/javascript">
document.getElementsByTagName("iframe")[0].addEventListener( "load", function(e) {
this.setAttribute('height','450px')
} );
</script>
</body>
</html>