summaryrefslogtreecommitdiff
path: root/test/g.raphael/examples/piechart/piechart_hover.html
diff options
context:
space:
mode:
Diffstat (limited to 'test/g.raphael/examples/piechart/piechart_hover.html')
-rw-r--r--test/g.raphael/examples/piechart/piechart_hover.html28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/g.raphael/examples/piechart/piechart_hover.html b/test/g.raphael/examples/piechart/piechart_hover.html
new file mode 100644
index 0000000..f3a62a8
--- /dev/null
+++ b/test/g.raphael/examples/piechart/piechart_hover.html
@@ -0,0 +1,28 @@
+<html>
+ <head>
+ <title>gRaphaël Pie Chart - a .hover() example</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, 200,
+ // 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]).attr({fill:"#666"});
+
+ // add a hover event to the pie chart
+ pie.hover(function() {
+ // when mouse hovers over sector
+ this.sector.attr({fill:"#FAA"});
+ }, function() {
+ // when mouse hovers out
+ this.sector.attr({fill:"#666"});
+ });
+ }
+ </script>
+ </head>
+ <body>
+ </body>
+</html> \ No newline at end of file