A basic SVG Bar chart using the AJAX getJSON() function

Like the basic CSV example the getJSON() function is an AJAX function that you can use to fetch data from your server. Unlike CSV data, JSON data can be easier to read and make use of. This example reloads the JSON data every second.

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.bar.js"></script>
Put this where you want the chart to show up:
<div style="width: 750px; height: 300px" id="chart-container"></div>
This is the code that generates the chart: