/home/mip/public_html/template/AdminLTE/plugins/RGraph/demos/line-airline-accidents.html
<!DOCTYPE html >
<html>
<head>
    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />
    
    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.common.dynamic.js" ></script>
    <script src="../libraries/RGraph.common.tooltips.js" ></script>
    <script src="../libraries/RGraph.line.js" ></script>
    
    <title>Airline fatalities per year</title>
    
    <meta name="robots" content="noindex,nofollow" />
    <meta name="description" content="Airline fatalities per year" />
     
</head>
<body>

    <h1>Airline fatalities per year</h1>

    <canvas id="cvs" width="800" height="250">[No canvas support]</canvas>
    
    <script>
        years    = [1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996];
        data     = [4,8,6,5,6,5,3,2,3,1,0,1,0,3,2,5,4,5,4,6,5,3,8,7];
        tooltips = [];
        color    = '#D10A11';

        data.forEach(function (v, k, arr)
        {
            tooltips[k] = '{1}<p align="center"><b>Deaths:</b> {2}</p>'.format(
                years[k],
                RGraph.random(300,500)
            );
        });


        new RGraph.Line({
            id: 'cvs',
            data: data,
            options: {
                labels: [
                    'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec',
                    'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'
                ],
                textSize: 10,
                colors: [color],
                noaxes: true,
                gutterLeft: 50,
                backgroundGridColor:  '#ddd',
                backgroundGridVlines: false,
                backgroundGridBorder: false,
                backgroundGridAutofitNumhlines: 3,
                ylabelsCount: 3,
                unitsPost: 'k',
                tickmarks: null,
                shadow: false,
                linewidth: 3,
                textColor: '#888',
                ymax: 12,
                tooltips: function (index)
                {
                    return tooltips[index];
                },
                highlightStyle: 'halo'
            }
        }).draw().on('tooltip', function (obj)
        {
            var tooltip = RGraph.Registry.get('chart.tooltip');

            tooltip.style.borderColor = obj.get('colors')[0];
        });
        
        // Change some of the CSS that gets applied to the tooltips
        RGraph.tooltips.style.padding         = '10px';
        RGraph.tooltips.style.paddingBottom   = '5px';
        RGraph.tooltips.style.backgroundColor = 'white';
        RGraph.tooltips.style.textAlign       = 'left';
        RGraph.tooltips.style.border          = '3px solid black';
    </script>







    <p></p>

    This goes in the documents header:
    <pre class="code">
&lt;script src="../libraries/rgraph.common.core.js" &gt;&lt;/script&gt;
&lt;script src="../libraries/rgraph.common.dynamic.js" &gt;&lt;/script&gt;
&lt;script src="../libraries/rgraph.common.tooltips.js" &gt;&lt;/script&gt;
&lt;script src="../libraries/rgraph.line.js" &gt;&lt;/script&gt;
</pre>
    
    Put this where you want the chart to show up:
    <pre class="code">
&lt;canvas id="cvs" width="800" height="250"&gt;
    [No canvas support]
&lt;/canvas&gt;
</pre>

    This is the code that generates the chart:
    <pre class="code">
&lt;script&gt;
    years    = [1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996];
    data     = [4,8,6,5,6,5,3,2,3,1,0,1,0,3,2,5,4,5,4,6,5,3,8,7];
    tooltips = [];
    color    = '#D10A11';

    data.forEach(function (v, k, arr)
    {
        tooltips[k] = '{1}<p align="center"><b>Deaths:</b> {2}</p>'.format(
            years[k],
            RGraph.random(300,500)
        );
    });


    new RGraph.Line({
        id: 'cvs',
        data: data,
        options: {
            labels: [
                'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec',
                'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'
            ],
            textSize: 10,
            colors: [color],
            noaxes: true,
            gutterLeft: 50,
            backgroundGridColor:  '#ddd',
            backgroundGridVlines: false,
            backgroundGridBorder: false,
            backgroundGridAutofitNumhlines: 3,
            ylabelsCount: 3,
            unitsPost: 'k',
            tickmarks: null,
            shadow: false,
            linewidth: 3,
            textColor: '#888',
            ymax: 12,
            tooltips: function (index)
            {
                return tooltips[index];
            },
            highlightStyle: 'halo'
        }
    }).draw().on('tooltip', function (obj)
    {
        var tooltip = RGraph.Registry.get('chart.tooltip');

        tooltip.style.borderColor = obj.get('colors')[0];
    });
    
    // Change some of the CSS that gets applied to the tooltips
    RGraph.tooltips.style.padding         = '10px';
    RGraph.tooltips.style.paddingBottom   = '5px';
    RGraph.tooltips.style.backgroundColor = 'white';
    RGraph.tooltips.style.textAlign       = 'left';
    RGraph.tooltips.style.border          = '3px solid black';
&lt;/script&gt;
</pre>



    <p>
        <a href="https://www.facebook.com/sharer/sharer.php?u=http://www.rgraph.net" target="_blank" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=http://www.rgraph.net', null, 'top=50,left=50,width=600,height=368'); return false"><img src="../images/facebook-large.png" width="200" height="43" alt="Share on Facebook" border="0" title="Visit the RGraph Facebook page" /></a>
        <a href="https://twitter.com/_rgraph" target="_blank" onclick="window.open('https://twitter.com/_rgraph', null, 'top=50,left=50,width=700,height=400'); return false"><img src="../images/twitter-large.png" width="200" height="43" alt="Share on Twitter" border="0" title="Mention RGraph on Twitter" /></a>
         
    </p>



    <p>
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>