Combine both data sets into one DataTable and use a ScatterChart for both series. You can set the series.<series index>.lineWidth option (set to something > 0 to make the line show). Like this:
var data = new google.visualization.DataTable();
data.addColumn('number', 'X');
data.addColumn('number', 'Y (scatter)');data.addColumn('number', 'Y (line)');
for (var i = 0; i < arr1.length; ++i) {
// why use eval's here? data.addRow([eval(arr2[i]), eval(arr1[i]), eval(a + (b * arr2[i]))]);
}
var options = {
title: 'Line of Best Fit(Trend Line)',
hAxis: {
title: 'Independent Variable',
minValue: 0,
maxValue: 15
},
vAxis: {
title: 'Dependent Variable',
minValue: 0,
maxValue: 15
},
legend: 'none', series: { // series 0 is the Scatter 0: { // you can omit this if you choose not to set any options for this series }, // series 1 is the Line 1: { lineWidth: 1, pointSize: 1
}
}
};
var chart = new google.visualization.ScatterChart(document.getElementById('chart_div'));
chart.draw(data, options);