Trigonometry curves (sine, cosine and tangent)

[No canvas support]

This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.drawing.xaxis.js"></script>
<script src="RGraph.scteter.js"></script>
Put this where you want the chart to show up:
<canvas id="cvs" width="1000" height="200">
    [No canvas support]
</canvas>
This is the code that generates the chart:
<script>
    var data_sin = [],
        data_cos = [],
        data_tan = [];

    for (var i=-360; i<360; i+=1) {
        data_sin.push([i, Math.sin(i / (180 / Math.PI))]).toString();
        data_cos.push([i, Math.cos(i / (180 / Math.PI))]).toString();
        
        var tan_value = Math.tan(i / (180 / Math.PI));
        data_tan.push([i, (tan_value < 1 && tan_value > -1) ? tan_value : null]);
    }

    var xaxis = new RGraph.Drawing.XAxis({
        id: 'cvs',
        y:100,
        options: {
            yaxisPosition: 'center',
            xaxisScaleZerostart: false,
            xaxisLabelsCount: 4,
            xaxisTickmarksCount: 16,
            xaxisScaleMax: 360
        }
    }).draw();


    var scatter = new RGraph.Scatter({
        id: 'cvs',
        data: [
            data_sin,
            data_cos,
            data_tan
        ],
        options: {
            xaxisPosition: 'center',
            xaxisScaleMax: 360,
            xaxis: false,
            yaxisScaleMax: 1,
            yaxisScaleDecimals: 1,
            yaxisScaleZerostart: false,
            marginLeft: 500,
            line: true,
            lineLinewidth: 3,
            tickmarksStyle: null,
            backgroundGrid: false,
            outofbounds: false
        }
    }).trace2();
</script>