A Radial Scatter chart using the CSV reader

Summary: A Radial Scatter chart using the CSV reader. The RGraph CSV reader reads remote files or an embedded CSV string.


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]

Here's a Radial Scatter chart - a circular Scatter chart. It's a variation on the regular Scatter chart that might suit your data better than the traditional style of Scatter. Radial Scatter charts are only available on canvas - not SVG.

Each point has two values - the angle of the point in degrees and the absolute magnitude. If your values for the angle are initially in a relative format then you would need to convert them first. You could do that with the following example code:

arr = [[10,10],[5,10]];
max = 10;
for (var i=0; i<arr.length; i++) {
    arr[i][0] = arr[i][0] / max * 360;
}
console.log(arr);

All this snippet does is convert the data to proportional values based on the maximum value in the array - so you would get an array of [360, 180] So one point would be placed on the north axis and the other point would be placed on the south axis.

The only other configuration is the labels being changed from being on all four axes to just the 'north' axis.


This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.csv.js"></script>
<script src="RGraph.rscatter.js"></script>
Put this where you want the chart to show up:
<canvas id="cvs" width="500" height="450">
    [No canvas support]
</canvas>
This is the code that generates the chart: