An SVG Pie chart using the AJAX functions
This goes in the documents header:
<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>
« Back