可视化的下拉菜单

时间:2012-10-09 14:09:33

标签: javascript html

我正在尝试添加一个下拉框菜单,我将在其中进行选择以显示数据。我的可视化工作正常,没有下拉框,但当我把它们放在一起时出错了。在我的代码中,我想在选择selection02时可视化数据。 有谁可以帮助我?

<html>
<head>

 <script type="text/javascript"
 src="//ajax.googleapis.com/ajax/static/modules/gviz/1.0/chart.js"> 


 function allagi()
{
   if (document.getElementById("selection01").selected==true)
   {
      function01();
   }
   else if (document.getElementById("selection02").selected==true)
   {
      f1();
   }
   else if (document.getElementById("selection03").selected==true)
   {
      function03();
   }
   else if (document.getElementById("selection04").selected==true)
   {
      function04();
   }
}

 function f1(){
 {"dataSourceUrl":"//docs.google.com/spreadsheet/tq?key=0AihqKzH-MgAndERnaFVsYk1RLUM3S0pDSmNjcEQ4M1E&transpose=0&headers=0&range=A2%3AB13&gid=0&pub=1","options":{"vAxes":[{"useFormatFromData":true,"viewWindowMode":"pretty","viewWindow":{}},{"useFormatFromData":true,"viewWindowMode":"pretty","viewWindow":{}}],"booleanRole":"certainty","animation":{"duration":0},"useFirstColumnAsDomain":true,"hAxis":{"useFormatFromData":true,"viewWindowMode":"pretty","viewWindow":{}},"isStacked":false,"width":454,"height":285},"state":{},"chartType":"AreaChart","chartName":"\u0393\u03c1\u03ac\u03c6\u03b7\u03bc\u03b1 1"} }</script>

</head>
<body onLoad="loadContent();">

 <div id="logo"><select onchange="allagi()">
  <option id="selection01">Selection01</option>
  <option id="selection02">Selection02</option>
  <option id="selection03">Selection03</option>
  <option id="selection04">Selection04</option>
</select></div> 
<div id="contentArea" style="margin: 20px 0px 10px 10px; border: 1px solid #CCC; width: 780px; height: 250px; float: left;">


</div>



</body>
</html>

0 个答案:

没有答案