From: Robert Konigsberg Date: Thu, 23 Feb 2012 15:14:38 +0000 (-0500) Subject: Fixed Dygraph.Circles.Circle and custom circles. All working now. X-Git-Tag: v1.0.0~323^2~2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=4ab51f75d72a9e6c98a508b6788367c0198de4d9;p=dygraphs.git Fixed Dygraph.Circles.Circle and custom circles. All working now. --- diff --git a/dygraph-utils.js b/dygraph-utils.js index f9cc85b..06eb666 100644 --- a/dygraph-utils.js +++ b/dygraph-utils.js @@ -884,7 +884,7 @@ Dygraph.Circles = { }, CIRCLE : function(g, name, ctx, cx, cy, color, radius) { ctx.beginPath(); - ctx.lineStyle = color; + ctx.strokeStyle = color; ctx.arc(cx, cy, radius, 0, 2 * Math.PI, false); ctx.stroke(); }, diff --git a/tests/custom-circles.html b/tests/custom-circles.html index 8b1d8bb..6d7caa1 100644 --- a/tests/custom-circles.html +++ b/tests/custom-circles.html @@ -32,7 +32,7 @@ ctx.fillStyle = "#000000"; ctx.beginPath(); - ctx.arc(cx, cy, radius - 2, -.3, Math.PI + .3, false); + ctx.arc(cx, cy + radius, radius - 2, Math.PI + .3, -.3, false); ctx.stroke(); }; @@ -75,18 +75,52 @@ }, { drawPoints : true, - pointSize : 6, - 'default' : { drawPointCallback : Dygraph.Circles.DEFAULT }, - 'triangle' : { drawPointCallback : Dygraph.Circles.TRIANGLE }, - 'square' : { drawPointCallback : Dygraph.Circles.SQUARE }, - 'diamond' : { drawPointCallback : Dygraph.Circles.DIAMOND }, - 'pentagon' : { drawPointCallback : Dygraph.Circles.PENTAGON }, - 'hexagon' : { drawPointCallback : Dygraph.Circles.HEXAGON }, - 'circle' : { drawPointCallback : Dygraph.Circles.CIRCLE }, - 'star' : { drawPointCallback : Dygraph.Circles.STAR }, - 'plus' : { drawPointCallback : Dygraph.Circles.PLUS }, - 'ex' : { drawPointCallback : Dygraph.Circles.EX }, - 'custom' : { drawPointCallback : smile, drawHighlightCallback : frown } + pointSize : 5, + highlightCircleSize : 8, + 'default' : { + drawPointCallback : Dygraph.Circles.DEFAULT, + drawHighlightCallback : Dygraph.Circles.DEFAULT + }, + 'triangle' : { + drawPointCallback : Dygraph.Circles.TRIANGLE, + drawHighlightCallback : Dygraph.Circles.TRIANGLE + }, + 'square' : { + drawPointCallback : Dygraph.Circles.SQUARE, + drawHighlightCallback : Dygraph.Circles.SQUARE + }, + 'diamond' : { + drawPointCallback : Dygraph.Circles.DIAMOND, + drawHighlightCallback : Dygraph.Circles.DIAMOND + }, + 'pentagon' : { + drawPointCallback : Dygraph.Circles.PENTAGON, + drawHighlightCallback : Dygraph.Circles.PENTAGON + }, + 'hexagon' : { + drawPointCallback : Dygraph.Circles.HEXAGON, + drawHighlightCallback : Dygraph.Circles.HEXAGON + }, + 'circle' : { + drawPointCallback : Dygraph.Circles.CIRCLE, + drawHighlightCallback : Dygraph.Circles.CIRCLE + }, + 'star' : { + drawPointCallback : Dygraph.Circles.STAR, + drawHighlightCallback : Dygraph.Circles.STAR + }, + 'plus' : { + drawPointCallback : Dygraph.Circles.PLUS, + drawHighlightCallback : Dygraph.Circles.PLUS + }, + 'ex' : { + drawPointCallback : Dygraph.Circles.EX, + drawHighlightCallback : Dygraph.Circles.EX + }, + 'custom' : { + drawPointCallback : frown, + drawHighlightCallback : smile + }, } );