updateChart();
}
+ function toHex(rgb) {
+ return 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')';
+ }
+
function updateChart() {
// Generate a new data set with the regression lines.
var new_labels = [];
// Darken the series by 50% to generate its regression.
var label = labels[i] + " Regression";
new_labels.push(label);
- var c = new RGBColorParser(orig_colors[i - 1]);
+ var c = Dygraph.toRGB_(orig_colors[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));
- new_colors.push(c.toHex());
+ new_colors.push(toHex(c));
new_opts[label] = {
drawPoints: false,
strokeWidth: 1.0
drawPoints: true,
strokeWidth: 0.0,
fractions: true,
- errorBars: true
+ errorBars: true,
+ pointSize: 1
}
);
g.updateOptions({});
}
+ function toHex(rgb) {
+ return 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')';
+ }
+
function drawLines(ctx, area, layout) {
if (typeof(g) == 'undefined') return; // won't be set on the initial draw.
var p1 = g.toDomCoords(x1, y1);
var p2 = g.toDomCoords(x2, y2);
- var c = new RGBColorParser(g.getColors()[i - 1]);
+ var c = Dygraph.toRGB_(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();
+ var color = toHex(c);
ctx.save();
ctx.strokeStyle = color;
- ctx.lineWidth = 1.0;
+ ctx.lineWidth = 2.0;
ctx.beginPath();
ctx.moveTo(p1[0], p1[1]);
ctx.lineTo(p2[0], p2[1]);
g.updateOptions({});
}
+ function toHex(rgb) {
+ return 'rgb(' + rgb.r + ',' + rgb.g + ',' + rgb.b + ')';
+ }
+
function drawLines(ctx, area, layout) {
if (typeof(g) == 'undefined') return; // won't be set on the initial draw.
var p1 = g.toDomCoords(x1, y1);
var p2 = g.toDomCoords(x2, y2);
- var c = new RGBColorParser(g.getColors()[i - 1]);
+ var c = Dygraph.toRGB_(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();
+ var color = toHex(c);
ctx.save();
ctx.strokeStyle = color;
ctx.lineWidth = 1.0;