如何摆脱 Google 图表散点图中的线连接点
How to Get Rid of Line Connecting Points in Google Charts Scatter Plot
我创建了一个 Google 图表散点图,但即使我没有指定任何线条,图表也会在我的点之间绘制一条线(在下图中可以看到一条淡蓝色的线) .
我试过将趋势线设置为 0,但它没有任何作用。我怎样才能让这条线消失?
function drawScatterPlot (table_arguments={}) {
var data = new google.visualization.DataTable();
data.addColumn('number', table_arguments["xtitle"]);
data.addColumn('number', table_arguments["ytitle"]); // Required to be a number
data.addRows(table_arguments["data"]);
var options = {
chart: {
title: table_arguments["title"],
subtitle: table_arguments["subtitle"]
},
hAxis: {title: table_arguments["xtitle"]},
vAxis: {title: table_arguments["ytitle"]},
legend: {position: 'none'},
trendlines: { 0: { opacity: 0 }}
};
var chart = new google.visualization.ScatterChart(document.getElementById('scatterchart_material'));
// DRAW CHART
chart.draw(data, options);
}
使用以下配置选项将线宽设置为零...
lineWidth: 0
lineWidth
- Data line width in pixels. Use zero to hide all lines and show only the points.
我创建了一个 Google 图表散点图,但即使我没有指定任何线条,图表也会在我的点之间绘制一条线(在下图中可以看到一条淡蓝色的线) .
我试过将趋势线设置为 0,但它没有任何作用。我怎样才能让这条线消失?
function drawScatterPlot (table_arguments={}) {
var data = new google.visualization.DataTable();
data.addColumn('number', table_arguments["xtitle"]);
data.addColumn('number', table_arguments["ytitle"]); // Required to be a number
data.addRows(table_arguments["data"]);
var options = {
chart: {
title: table_arguments["title"],
subtitle: table_arguments["subtitle"]
},
hAxis: {title: table_arguments["xtitle"]},
vAxis: {title: table_arguments["ytitle"]},
legend: {position: 'none'},
trendlines: { 0: { opacity: 0 }}
};
var chart = new google.visualization.ScatterChart(document.getElementById('scatterchart_material'));
// DRAW CHART
chart.draw(data, options);
}
使用以下配置选项将线宽设置为零...
lineWidth: 0
lineWidth
- Data line width in pixels. Use zero to hide all lines and show only the points.