diff options
Diffstat (limited to 'test/g.raphael/examples/barchart/barchart_hover.html')
| -rw-r--r-- | test/g.raphael/examples/barchart/barchart_hover.html | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/g.raphael/examples/barchart/barchart_hover.html b/test/g.raphael/examples/barchart/barchart_hover.html new file mode 100644 index 0000000..4366857 --- /dev/null +++ b/test/g.raphael/examples/barchart/barchart_hover.html @@ -0,0 +1,27 @@ +<html> + <head> + <title>gRaphaël Bar 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.bar-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 a single series barchart at 10, 10 + // width 300, height 220, data: [55, 20, 13, 32, 5, 1, 2, 10] + var barchart = r.g.barchart(10, 10, 300, 220, [[55, 20, 13, 32, 5, 1, 2, 10]]).attr({fill: "#666"}); + + // Add a hover event to the barchart + barchart.hover(function() { + this.bar.attr({fill: "#333"}); + }, function() { + this.bar.attr({fill: "#666"}); + }); + } + </script> + </head> + <body> + </body> +</html>
\ No newline at end of file |
