# A dark themed Pie chart

This goes in the documents header:

    <script src="RGraph.common.core.js"></script>
    <script src="RGraph.common.key.js"></script>
    <script src="RGraph.pie.js"></script>

Put this where you want the chart to show up:

    <canvas id="cvs" width="650" height="350">
        [No canvas support]
    </canvas>

This is the code that generates the chart:

    <script>
        window.onload = function ()
        {
            var pie = new RGraph.Pie({
                id: 'cvs',
                data: [4,8,4,6,5,3,2,5],
                options: {
                    textAccessible: true,
                    shadow: false,
                    strokestyle: 'transparent',
                    exploded: 15,
                    title: 'Geographical distribution of DNS root server sites',
                    titleColor: 'white',
                    gutterTop: 50,
                    colors: ['#2A8AB2', '#52A323','#BAB034','#B31C15','#BC941A','#1152B8','#B16498'],
                    key: [
                        'Europe: 34%',
                        'North America: 28%',
                        'Asia: 17%',
                        'South America: 8%',
                        'Oceania: 5%',
                        'Africa: 3%'
                    ],
                    keyColorShape: 'circle',
                    keyPositionGraphBoxed: false,
                    keyTextColor: 'white',
                    keyPositionY: 125,
                    keyPositionX: 450,
                    centerx: 235
                }
            }).draw();
        };
    </script>

« Back