目前无法调整组合图表上的 Z 轴(因此您无法以您正在做的方式做您想做的事情)。
但是,如果您想变得棘手,您可以使用 XY 散点图重新创建相同类型的图表。
示例(复制粘贴到 Google Playground):
<!--
You are free to copy and use this sample in accordance with the terms of the
Apache license (http://www.apache.org/licenses/LICENSE-2.0.html)
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<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="http://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('number', 'X');
data.addColumn('number', 'Sales');
data.addColumn('number', 'Targets');
data.addRows([
[1, 0, null],
[1, 1, null],
[1, null, null],
[2, 0, null],
[2, 3, null],
[2, null, null],
[3, 0, null],
[3, 3, null],
[3, null, null],
[0.5,null,1.5],
[1.5,null,1.5],
[1.5,null,null],
[1.5,null,2.5],
[2.5,null,2.5],
[2.5,null,null],
[2.5,null,3],
[3.5,null,3],
]);
// Create and draw the visualization.
var chart = new google.visualization.ScatterChart(
document.getElementById('visualization'));
chart.draw(data, {
width: 600,
height: 400,
series: {0:{color: 'black', lineWidth: 40, pointSize: 0}, 1:{color: 'red', lineWidth: 10, pointSize: 0}} });
}
google.setOnLoadCallback(drawVisualization);
</script>
</head>
<body style="font-family: Arial;border: 0 none;">
<div id="visualization" style="width: 600px; height: 400px;"></div>
</body>
</html>