ctx.lineTo(coords[0], coords[1]);
}
ctx.stroke();
+ ctx.fill();
ctx.closePath();
}
Dygraph.shapeFunction_ = function(sides, rotationRadians, delta) {
return function(g, name, ctx, cx, cy, color, radius) {
- ctx.lineWidth = 1;
ctx.strokeStyle = color;
+ ctx.fillStyle = "white";
Dygraph.regularShape_(ctx, sides, radius, cx, cy, rotationRadians, delta);
};
};
CIRCLE : function(g, name, ctx, cx, cy, color, radius) {
ctx.beginPath();
ctx.strokeStyle = color;
+ ctx.fillStyle = "white";
ctx.arc(cx, cy, radius, 0, 2 * Math.PI, false);
ctx.stroke();
+ ctx.fill();
+ ctx.closePath();
},
STAR : Dygraph.shapeFunction_(5, 0, 4 * Math.PI / 5),
PLUS : function(g, name, ctx, cx, cy, color, radius) {
- ctx.lineWidth = 1;
ctx.strokeStyle = color;
ctx.beginPath();
ctx.moveTo(cx + radius, cy);
ctx.lineTo(cx - radius, cy);
- ctx.closePath();
ctx.stroke();
+ ctx.closePath();
ctx.beginPath();
ctx.moveTo(cx, cy + radius);
ctx.lineTo(cx, cy - radius);
- ctx.closePath();
-
ctx.stroke();
+ ctx.closePath();
},
EX : function(g, name, ctx, cx, cy, color, radius) {
- ctx.lineWidth = 1;
- ctx.strokeStyle = "black";
+ ctx.strokeStyle = color;
ctx.beginPath();
ctx.moveTo(cx + radius, cy + radius);
var circleSize = this.attr_('highlightCircleSize', pt.name);
var callback = this.attr_("drawHighlightPointCallback", pt.name);
+ var color = this.plotter_.colors[pt.name];
if (!callback) {
callback = Dygraph.Circles.DEFAULT;
}
+ ctx.lineWidth = this.attr_('strokeWidth', pt.name);
+ ctx.strokeStyle = color;
+ ctx.fillStyle = color;
callback(this.g, pt.name, ctx, canvasx, pt.canvasy,
- this.plotter_.colors[pt.name], circleSize);
+ color, circleSize);
}
ctx.restore();
var frown = function(g, series, ctx, cx, cy, color, radius) {
mouthlessFace(g, series, ctx, cx, cy, color, radius);
+ ctx.lineWidth = 1;
ctx.fillStyle = "#000000";
ctx.beginPath();
ctx.arc(cx, cy + radius, radius - 2, Math.PI + .3, -.3, false);
};
var mouthlessFace = function(g, series, ctx, cx, cy, color, radius) {
+ ctx.lineWidth = 1;
ctx.strokeStyle = "#000000";
ctx.fillStyle = "#FFFF00";
ctx.beginPath();