0

任何想法为什么它在代码游乐场而不是我的生产网络服务器上加载和运行?它应该都具有相同的功能吗?我是 js 新手。我可能只需要一些指示?

   <script type="text/javascript" src="https://www.google.com/jsapi"></script>
  <script type="text/javascript">
      google.load('visualization', '1', { packages: ['corechart'] });
</script>
 <script type="text/javascript">
     function drawVisualization() {
         // Create and populate the data table.
         var data = new google.visualization.DataTable();
         data.addColumn('string', 'x');
         data.addColumn('number', '% Und Sizer');
         data.addColumn('number', '% Und QC');
         data.addRow(["1-11", 1, 1]);
         data.addRow(["2-9.5", 2, 1]);
         data.addRow(["3-10", 4, 1]);
         data.addRow(["4-11", 8, 10]);
         data.addRow(["5-10.5", 7, 1]);
         data.addRow(["ELM-11.5", 7, 1]);
         data.addRow(["UND-11.5", 8, 1]);
         // Create and draw the visualization.
         new google.visualization.ColumnChart(document.getElementById('visualization')).
  draw(data, { curveType: "function", width: 900, height: 400,
      vAxes: { 0: { logScale: false, maxValue: 30 },
          1: { logScale: false, maxValue: 50 }
      },
      series: {
          0: { targetAxisIndex: 0 },
          1: { targetAxisIndex: 1 }
      }
  }
      );
     }
     google.setOnLoadCallback(drawVisualization);
</script>
4

1 回答 1

0

我想到了。我调用了错误的元素。

于 2013-03-19T22:39:24.983 回答