A Line chart using the CSV reader
A Line chart that's serving as a basic example of using the CSV Reader in conjunction with the CSV reader.
The data that's being fetched is done with this line-of-code:
var data = csv.getCol(2);
And what that does is fetch the whole of the third column (counting starts at zero). This column of data is then given to the chart as its data. The X axis labels for the chart are simply hard coded but they could quite easily be fetched from the first column of the CSV like this:
var labels = csv.getCol(0);
This goes in the documents header:
<script src="RGraph.common.core.js"></script> <script src="RGraph.common.csv.js"></script> <script src="RGraph.line.js"></script>Put this where you want the chart to show up: