# A basic SVG vertical progress Bar using the AJAX getNumber function

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: 100px; height: 300px" id="chart-container"></div>
        [No canvas support]
    </div>

This is the code that generates the chart:

    <script>
        RGraph.SVG.AJAX.getNumber('/getdata.html', function (num)
        {
            // This bar chart becomes the background
            new RGraph.SVG.Bar({
                id: 'chart-container',
                data: [100],
                options: {
                    colors: ['#ddd'],
                    backgroundGrid: false,
                    xaxis: false,
                    yaxisNumlabels: 0,
                    yaxis: false,
                    yaxisMax: 100,
                    shadow: true,
                    shadowOpacity: .1
                }
            }).draw();

            var bar = new RGraph.SVG.Bar({
                id: 'chart-container',
                data: [num],
                options: {
                    backgroundGrid: false,
                    xaxis: false,
                    yaxis: false,
                    yaxisMax: 100,
                    hmargin: 8
                }
            }).grow();
        });
    </script>

« Back