Javascript 谷歌组合图的折线图数据点
我正在使用谷歌组合图Javascript 谷歌组合图的折线图数据点,javascript,charts,Javascript,Charts,我正在使用谷歌组合图 <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title> Google Visualization API Sample </title> <script type=
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>
Google Visualization API Sample
</title>
<script type="text/javascript" src="//www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', { packages: ['corechart'] });
</script>
<script type="text/javascript">
function drawVisualization() {
var data = google.visualization.arrayToDataTable([
['Month', 'Madagascar', 'Rwanda', 'Average'],
['2004/05', 165, 938, 614.6],
['2005/06', 135, 1120, 682],
['2006/07', 157, 1167, 623],
['2007/08', 139, 1110, 609.4],
['2008/09', 1026, 366, 569.6]
]);
var ac = new google.visualization.ComboChart(document.getElementById('visualization'));
ac.draw(data, {
title: 'Monthly Coffee Production by Country',
width: 600,
height: 400,
vAxis: { title: "Cups" },
hAxis: { title: "Month" },
seriesType: "bars",
series: { 2: { type: "line", curveType: "function", pointSize: 8 } }
});
}
google.setOnLoadCallback(drawVisualization);
</script>
</head>
<body style="font-family: Arial;border: 0 none;">
<div id="visualization" style="width: 600px; height: 400px;"></div>
</body>
</html>
谷歌可视化API示例
load('visualization','1',{packages:['corechart']});
函数drawVisualization(){
var data=google.visualization.arrayToDataTable([
[‘月份’、‘马达加斯加’、‘卢旺达’、‘平均值’],
['2004/05', 165, 938, 614.6],
['2005/06', 135, 1120, 682],
['2006/07', 157, 1167, 623],
['2007/08', 139, 1110, 609.4],
['2008/09', 1026, 366, 569.6]
]);
var ac=新的google.visualization.ComboChart(document.getElementById('visualization');
ac.draw(数据、{
标题:“各国每月咖啡产量”,
宽度:600,
身高:400,
vAxis:{title:“Cups”},
哈克斯:{标题:“月”},
序列类型:“条”,
系列:{2:{type:“line”,curveType:“function”,pointSize:8}
});
}
setOnLoadCallback(drawVisualization);
现在它正确地创建了谷歌组合图,但我的要求是折线图的每个数据点必须位于每个蓝色条列的中间,而不是位于红色条列的左上角。若要查看此内容,请将上述代码复制并粘贴到html页面中,然后在浏览器中查看此页面