document.getElementById("ry1").onclick = function() { regression(1); };
document.getElementById("ry2").onclick = function() { regression(2); };
document.getElementById("clear").onclick = function() { clearLines(); };
document.getElementById("ry1").onclick = function() { regression(1); };
document.getElementById("ry2").onclick = function() { regression(2); };
document.getElementById("clear").onclick = function() { clearLines(); };
// if coeffs = [ null, [1, 2], null ] then we draw a regression for series 1
// only. The regression line is y = 1 + 2 * x.
var coeffs = [ null, null, null ];
// if coeffs = [ null, [1, 2], null ] then we draw a regression for series 1
// only. The regression line is y = 1 + 2 * x.
var coeffs = [ null, null, null ];
function drawLines(ctx, area, layout) {
if (typeof(g) == 'undefined') return; // won't be set on the initial draw.
function drawLines(ctx, area, layout) {
if (typeof(g) == 'undefined') return; // won't be set on the initial draw.