summaryrefslogtreecommitdiff
path: root/test/g.raphael/examples/piechart/piechart_with_legend.html
blob: 721656a007bc6ffb49915b84ce7c5185ae74694f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<html>
    <head>
        <title>gRaphaël Pie Chart - a piechart with legend 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]
                // Add legend to piechart.
                var pie = r.g.piechart(320, 240, 100, [10,20,30,40], {legend:['%% apples', '%% bananas', '%% cherries', '%% durians'], legendmark:"*", legendpos: "south"});
            }
        </script>
    </head>
    <body>   
    </body>
</html>