# An example of a Line chart with an interactive key

The interactive key has been re-implemented as of June 2013 and added to more chart types.

This goes in the documents header:

    <script src="RGraph.common.core.js"></script>
    <script src="RGraph.common.dynamic.js"></script>
    <script src="RGraph.common.key.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>
        window.onload = function ()
        {
            var line = new RGraph.Line({
                id: 'cvs',
                data: [
                    [4,8,5,5,6,3,5],
                    [1,5,2,3,4,5,5],
                    [4,8,9,6,9,8,7]
                ],
                options: {
                    key: ['Jim','Jack','Joseph'],
                    keyInteractive: true,
                    linewidth: 3,
                    shadow: true,
                    labels: ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'],
                    textAccessible: true
                }
            }).draw();
        };
    </script>