projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clipping rectangles for interaction layer
[dygraphs.git]
/
tests
/
linear-regression.html
diff --git
a/tests/linear-regression.html
b/tests/linear-regression.html
index
e3636c1
..
6a469b8
100644
(file)
--- a/
tests/linear-regression.html
+++ b/
tests/linear-regression.html
@@
-2,7
+2,7
@@
<head>
<title>Linear Regression</title>
<!--[if IE]>
<head>
<title>Linear Regression</title>
<!--[if IE]>
- <script type="text/javascript" src="excanvas.js"></script>
+ <script type="text/javascript" src="
../
excanvas.js"></script>
<![endif]-->
<script type="text/javascript" src="../strftime/strftime-min.js"></script>
<script type="text/javascript" src="../rgbcolor/rgbcolor.js"></script>
<![endif]-->
<script type="text/javascript" src="../strftime/strftime-min.js"></script>
<script type="text/javascript" src="../rgbcolor/rgbcolor.js"></script>
@@
-35,7
+35,8
@@
{
labels: ['X', 'Y1', 'Y2'],
underlayCallback: drawLines,
{
labels: ['X', 'Y1', 'Y2'],
underlayCallback: drawLines,
- drawPoints: true
+ drawPoints: true,
+ strokeWidth: 0.0
}
);
}
);
@@
-66,7
+67,7
@@
var b = (sum_y - a * sum_x) / num;
coeffs[series] = [b, a];
var b = (sum_y - a * sum_x) / num;
coeffs[series] = [b, a];
- if (
console
) {
+ if (
typeof(console) != 'undefined'
) {
console.log("coeffs(" + series + "): [" + b + ", " + a + "]");
}
console.log("coeffs(" + series + "): [" + b + ", " + a + "]");
}
@@
-95,7
+96,11
@@
var p1 = g.toDomCoords(x1, y1);
var p2 = g.toDomCoords(x2, y2);
var p1 = g.toDomCoords(x1, y1);
var p2 = g.toDomCoords(x2, y2);
- var color = g.getColors()[i - 1];
+ var c = new RGBColor(g.getColors()[i - 1]);
+ c.r = Math.floor(255 - 0.5 * (255 - c.r));
+ c.g = Math.floor(255 - 0.5 * (255 - c.g));
+ c.b = Math.floor(255 - 0.5 * (255 - c.b));
+ var color = c.toHex();
ctx.save();
ctx.strokeStyle = color;
ctx.lineWidth = 1.0;
ctx.save();
ctx.strokeStyle = color;
ctx.lineWidth = 1.0;