A stacked Rose chart using the CSV reader

This chart demonstrates using the CSV reader to read the sample.csv file.

Note: For browser security reasons the AJAX demos don't work offline. You can view the demos on the RGraph website here: https://www.rgraph.net/demos/index.html
[No canvas support]

This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.csv.js"></script>
<script src="RGraph.rose.js"></script>
Put this where you want the chart to show up:
<canvas id="cvs" width="400" height="400">
    [No canvas support]
</canvas>
This is the code that generates the chart:
<script>
    RGraph.CSV('/sample.csv', function (csv)
    {
        var data = [];

        // The first column is the labels
        var labels = csv.getCol(0);

        // This is the number of rows in the CSV file
        var numrows = csv.numrows;
        
        for (var i=0; i<numrows; i+=1) {
            data.push(csv.getRow(i, 1));
        }
        
        new RGraph.Rose({
            id: 'cvs',
            data: data,
            options: {
                labelsAxes: 'n',
                margin: 15,
                colors: ['red', 'green', '#aaf', 'mauve', 'cyan','#fca', 'pink'],
                colorsAlpha: 0.5,
                axes: false,
                backgroundGridRadials: 0
            }
        }).draw();
    });
</script>