4 <meta http-equiv=
"X-UA-Compatible" content=
"IE=EmulateIE7; IE=EmulateIE9">
5 <title>Custom Circles
</title>
7 <script type=
"text/javascript" src=
"../excanvas.js"></script>
10 For production (minified) code, use:
11 <script type=
"text/javascript" src=
"dygraph-combined.js"></script>
13 <script type=
"text/javascript" src=
"../dygraph-dev.js"></script>
17 <h2>Custom circles and hover circles
</h2>
18 <div id=
"demodiv"></div>
20 <script type=
"text/javascript">
21 var smile = function(g, series, ctx, cx, cy, color, radius) {
22 mouthlessFace(g, series, ctx, cx, cy, color, radius);
24 ctx.fillStyle =
"#000000";
26 ctx.arc(cx, cy, radius -
2,
.3, Math.PI -
.3, false);
30 var frown = function(g, series, ctx, cx, cy, color, radius) {
31 mouthlessFace(g, series, ctx, cx, cy, color, radius);
34 ctx.fillStyle =
"#000000";
36 ctx.arc(cx, cy + radius, radius -
2, Math.PI +
.3, -
.3, false);
40 var mouthlessFace = function(g, series, ctx, cx, cy, color, radius) {
42 ctx.strokeStyle =
"#000000";
43 ctx.fillStyle =
"#FFFF00";
45 ctx.arc(cx, cy, radius, Math.PI *
2, false);
50 ctx.fillStyle =
"#000000";
52 ctx.arc(cx - (radius /
3) , cy - (radius /
4),
1, Math.PI *
2, false);
58 ctx.arc(cx + (radius /
3) , cy - (radius /
4),
1, Math.PI *
2, false);
65 document.getElementById(
"demodiv"),
68 var r =
"xval,default,triangle,square,diamond,pentagon,hexagon,circle,star,plus,ex,custom\n";
69 for (var i=
1; i<=
20; i++) {
71 for (var j =
0; j <
11; j++) {
72 r +=
"," + j + (i /
3);
81 highlightCircleSize :
8,
83 drawPointCallback : Dygraph.Circles.DEFAULT,
84 drawHighlightPointCallback : Dygraph.Circles.DEFAULT
87 drawPointCallback : Dygraph.Circles.TRIANGLE,
88 drawHighlightPointCallback : Dygraph.Circles.TRIANGLE
91 drawPointCallback : Dygraph.Circles.SQUARE,
92 drawHighlightPointCallback : Dygraph.Circles.SQUARE
95 drawPointCallback : Dygraph.Circles.DIAMOND,
96 drawHighlightPointCallback : Dygraph.Circles.DIAMOND
99 drawPointCallback : Dygraph.Circles.PENTAGON,
100 drawHighlightPointCallback : Dygraph.Circles.PENTAGON
103 drawPointCallback : Dygraph.Circles.HEXAGON,
104 drawHighlightPointCallback : Dygraph.Circles.HEXAGON
107 drawPointCallback : Dygraph.Circles.CIRCLE,
108 drawHighlightPointCallback : Dygraph.Circles.CIRCLE
111 drawPointCallback : Dygraph.Circles.STAR,
112 drawHighlightPointCallback : Dygraph.Circles.STAR
115 drawPointCallback : Dygraph.Circles.PLUS,
116 drawHighlightPointCallback : Dygraph.Circles.PLUS
119 drawPointCallback : Dygraph.Circles.EX,
120 drawHighlightPointCallback : Dygraph.Circles.EX
123 drawPointCallback : frown,
124 drawHighlightPointCallback : smile