A "Fan" Line chart

This is an example of the filled range chart being used to create a "Fan" chart. Fan charts are used to illustrate growing uncertainty of future values (eg currency).

[No canvas support]

This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.dynamic.js"></script>
<script src="RGraph.common.tooltips.js"></script>
<script src="RGraph.line.js"></script>
Put this where you want the chart to show up:
<canvas id="cvs" width="600" height="250">
    [No canvas support]
</canvas>
This is the code that generates the chart:
<script>
    var central_line_data = [10,13,15,15,24,19,18,16,17,18,12,11];
    
    var variance1 = [0,0,1,1,2,3,4,4,4,5,5,5];
    var variance2 = [0,0,1,1,3,4,5,5,5,6,6,6];
    var variance3 = [0,0,1,1,3,4,6,6,6,7,7,7];
    
    var d1 = [];
    var d2 = [];
    var d3 = [];
    var d4 = [];
    var d5 = [];
    var d6 = [];
    
    for (var i=0; i<central_line_data.length; ++i) {
        d1.push(central_line_data[i] + variance1[i]);
        d2.push(central_line_data[i] - variance1[i]);
        
        d3.push(central_line_data[i] + variance2[i]);
        d4.push(central_line_data[i] - variance2[i]);
        
        d5.push(central_line_data[i] + variance3[i]);
        d6.push(central_line_data[i] - variance3[i]);
    }

    var line1 = new RGraph.Line({
        id: 'cvs',
        data: [d5, d6],
        options: {
            xaxis: false,
            textSize: 14,
            filled: true,
            filledRange: true,
            filledColors: 'rgba(255,0,0,0.1)',
            colors: ['rgba(0,0,0,0)'],
            linewidth: 0,
            yaxisScaleMax: 30,
            yaxisLabels: false,
            axes: false,
            backgroundGridVlinesCount: 11,
            hmargin: 5,
            tickmarksStyle: null
        }
    }).draw()

    var line2 = new RGraph.Line({
        id: 'cvs',
        data: [d3, d4],
        options: {
            xaxis: false,
            textSize: 14,
            filled: true,
            filledRange: true,
            filledColors: 'rgba(255,0,0,0.2)',
            colors: ['rgba(0,0,0,0)'],
            linewidth: 0,
            yaxisScaleMax: 30,
            yaxisLabels: false,
            axes: false,
            backgroundGridVlinesCount: 11,
            hmargin: 5,
            tickmarksStyle: null
        }
    }).draw()


    var line3 = new RGraph.Line({
        id: 'cvs',
        data: [d1, d2],
        options: {
            xaxis: false,
            textSize: 14,
            filled: true,
            filledRange: true,
            filledColors: 'rgba(255,0,0,0.4)',
            colors: ['rgba(0,0,0,0)'],
            linewidth: 3,
            yaxisScaleMax: 30,
            yaxisLabels: false,
            axes: false,
            backgroundGrid: false,
            hmargin: 5,
            tickmarksStyle: null
        }
    }).draw()

    var line4 = new RGraph.Line({
        id: 'cvs',
        data: central_line_data,
        options: {
            xaxis: false,
            textSize: 14,
            backgroundGrid: false,
            xaxisLabels: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
            tooltips: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
            colors: ['black'],
            linewidth: 3,
            yaxisScaleMax: 30,
            xaxisTickmarksCount: 11,
            tickmarksStyle: null,
            hmargin: 5,
            shadow: false
        }
    }).draw();
</script>