A Pie chart that retrieves JSON data via AJAX

Note: For browser security reasons the AJAX demos don't work offline. You can view the demos on the RGraph website here: https://www.rgraph.net/demos/index.html
[No canvas support]

This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.dynamic.js"></script>
<script src="RGraph.common.tooltips.js"></script>
<script src="RGraph.common.effects.js"></script>
<script src="RGraph.pie.js"></script>
Put this where you want the chart to show up:
<canvas id="cvs" width="450" height="350">
    [No canvas support]
</canvas>
This is the code that generates the chart:
<script>
    RGraph.AJAX.getJSON('/getdata.html?json', function (json)
    {
        var pie = new RGraph.Pie({
            id: 'cvs',
            data: json.data,
            options: {
                tooltips: json.labels,
                shadow: false,
                key: json.labels,
                keyPositionGraphBoxed: false,
                colors: ['red','gray','#afa','blue','pink','yellow','black','orange','cyan','purple'],                    
                centerx: 175
            }
        }).draw();
    });
</script>