An SVG Bar chart using the CSV reader

The CSV reader can be used to get data for your charts from embedded CSV data or via a CSV file that's accessible with AJAX. You can then use the methods on the CSV reader object to get data from the CSV file.

Note: For browser security reasons the AJAX demos don't work offline (this demo is using the CSV reader option that reads data that's embedded in the page itself). You can view the demos on the RGraph website here:

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.common.csv.js"></script>
<script src=""></script>
Put this where you want the chart to show up:
<div id="klkl" style="display: none">

<div style="width: 750px; height: 300px" id="chart-container"></div>
This is the code that generates the chart:
    new RGraph.CSV('id:klkl', function (csv)
    //new RGraph.CSV('/sample.csv', function (csv)
        * Fetch the first row of the CSV file, starting at the second column
        var data = csv.getRow(0, 1);
        * Fetch the first column which becomes the labels
        var labels = csv.getCol(0)

        new RGraph.SVG.Bar({
            id: 'chart-container',
            data: data,
            options: {
                colors: ['Gradient(blue:#66a)'],
                xaxisLabels: labels