diff options
| author | Tim Redfern <tim@eclectronics.org> | 2012-01-23 22:22:02 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2012-01-23 22:22:02 +0000 |
| commit | 7523fb951aabc24bf290028c348cbe46bd846f86 (patch) | |
| tree | fc28172683d16b59ecfa1070fa7a8188952803a7 /test/g.raphael/examples/piechart/piechart_rotate.html | |
| parent | 9af0f832607e626d22c4205a3ed21ad105fdc042 (diff) | |
graphing with raphael
Diffstat (limited to 'test/g.raphael/examples/piechart/piechart_rotate.html')
| -rw-r--r-- | test/g.raphael/examples/piechart/piechart_rotate.html | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/g.raphael/examples/piechart/piechart_rotate.html b/test/g.raphael/examples/piechart/piechart_rotate.html new file mode 100644 index 0000000..1ee3a24 --- /dev/null +++ b/test/g.raphael/examples/piechart/piechart_rotate.html @@ -0,0 +1,28 @@ +<html> + <head> + <title>gRaphaël Pie Chart - rotate your piechart</title> + <script type="text/javascript" src="../raphael-min.js"></script> + <script type="text/javascript" src="../../g.raphael-min.js"></script> + <script type="text/javascript" src="../../g.pie-min.js"></script> + <script type="text/javascript"> + window.onload = function() { + // Creates canvas 640 × 480 at 10, 50 + var r = Raphael(10, 50, 640, 480); + // Creates pie chart at with center at 320, 240, + // radius 100 and data: [55, 20, 13, 32, 5, 1, 2] + var pie = r.g.piechart(320, 240, 100, [55, 20, 13, 32, 5, 1, 2]); + var orientation = r.g.line(100, 50, 20).attr({"fill":"#333"}); + // add a click event to the pie chart and rotate pie + // note: after click event is triggered, the pie no longer seems clickable? + pie.click(function() { + pie.each(function(){ + this.sector.animate({"opacity": 0,"rotation": "180 320 240"}, 2000, ">"); + }); + orientation.animate({"stroke-opacity":0.25, "opacity":0.5, "rotation": "180 100 50"}, 2000, ">"); + }); + } + </script> + </head> + <body> + </body> +</html>
\ No newline at end of file |
