为什么这会加载并运行在Code Playground而不是我的生产Web服务器上的任何想法?应该所有功能都一样正确吗?我是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>
答案 0 :(得分:0)
我明白了。我在说错了元素。