X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=src%2Fextras%2Fshapes.js;h=2df07a9b8ecb3001e185e9e8a76cc16c975d5e86;hb=50522d1b2b07c6034be6304b8efc5dd3d154e2db;hp=a4531773db3df56402862657a83ca15a44199f6b;hpb=3123ca57f71d145bb5bcc4a2f754d3dff3225346;p=dygraphs.git diff --git a/src/extras/shapes.js b/src/extras/shapes.js index a453177..2df07a9 100644 --- a/src/extras/shapes.js +++ b/src/extras/shapes.js @@ -68,7 +68,7 @@ var shapeFunction = function(sides, rotationRadians, delta) { }; }; -Dygraph.update(Dygraph.Circles, { +var customCircles = { TRIANGLE : shapeFunction(3), SQUARE : shapeFunction(4, Math.PI / 4), DIAMOND : shapeFunction(4), @@ -113,6 +113,11 @@ Dygraph.update(Dygraph.Circles, { ctx.closePath(); ctx.stroke(); } -}); +}; + +for (var k in customCircles) { + if (!customCircles.hasOwnProperty(k)) continue; + Dygraph.Circles[k] = customCircles[k]; +} })();