This is a simple demonstration of the RGraph.SVG.AJAX.getJSON AJAX function. To prevent the scale from changing it has been set at 100.
<script src="RGraph.svg.common.core.js"></script> <script src="RGraph.svg.common.ajax.js"></script> <script src="RGraph.svg.line.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:
<script>
RGraph.SVG.AJAX.getJSON('/getdata.html?json', function (json)
{
new RGraph.SVG.Line({
id: 'chart-container',
data: json.data,
options: {
xaxisLabels: json.labels,
gutterLeft: 50,
yaxisMax: 100,
yaxis: false,
linewidth: 3,
shadow: true,
shadowOpacity: 0.25
}
}).trace();
});
</script>