A Pie chart making use of the AJAX getJSON function to get data via AJAX. The chart is using the exploded option and has a shadow enabled. It's animated using the roundRobin effect.
<script src="RGraph.svg.common.core.js"></script> <script src="RGraph.svg.common.ajax.js"></script> <script src="RGraph.svg.pie.js"></script>Put this where you want the chart to show up:
<div style="width: 650px; height: 350px" id="chart-container"></div> [No canvas support] </div>This is the code that generates the chart:
<script> RGraph.SVG.AJAX.getJSON('/getdata.html?json', function (json) { var obj = new RGraph.SVG.Pie({ id: 'chart-container', data: json.data, options: { labels: json.labels, exploded: 10, shadow: true } }).roundRobin(); }); </script>