X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fextras%2Fshapes.js;fp=src%2Fextras%2Fshapes.js;h=2df07a9b8ecb3001e185e9e8a76cc16c975d5e86;hb=ce31caf22475e3e1fd6d9fea192d61ff4fcd7fac;hp=a4531773db3df56402862657a83ca15a44199f6b;hpb=a4c3ece0a11e4e5c4f1f51a8bc8b7878d34ee052;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]; +} })();