# A Line chart using the Google Sheets connector

This goes in the documents header:

    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.common.sheets.js" ></script>
    <script src="../libraries/RGraph.line.js" ></script>

Put this where you want the chart to show up:

    <canvas id="cvs" width="700" height="250">
        [No canvas support]
    </canvas>

This is the code that generates the chart:

    <script>
        new RGraph.Sheets('1ncvARBgXaDjzuca9i7Jyep6JTv9kms-bbIzyAxbaT0E', 2, function (sheet)
        {
            var labels = sheet.get('B1:M1');
            var data   = sheet.get('B2:M2');

            var line = new RGraph.Line({
                id: 'cvs',
                data: data,
                options: {
                    linewidth: 25,
                    tickmarks: null,
                    labels: labels,
                    xlabelsOffset: 10,
                    colors: ['#f66'],
                    shadowOffsetx: 2,
                    shadowOffsety: 2,
                    strokestyle: 'rgba(0,0,0,0)',
                    scaleZerostart: true,
                    noaxes: true,
                    backgroundGridVlines: false,
                    backgroundGridBorder: false,
                    textAccessible: true,
                    textSize: 18,
                    gutterLeft: 35,
                    hmargin: 10
                }
            }).trace2();
    </script>

« Back