Highcharts Stock Demo

author(s): Torstein Hønsi

HTML

<div id="container" style="height: 500px; min-width: 600px"></div>

<script type="text/javascript" src="http://highcharts.com/js/testing-stock.js"></script>
<script type="text/javascript" src="http://highcharts.com/samples/data/usdeur.js"></script>

JavaScript

var groupingUnits = [
    [
    'day',                         // unit name
    [1]                             // allowed multiples
    ], [
    'month',
    [1]
    ]];

$(function() {
    window.chart = new Highcharts.StockChart({
        chart: {
            renderTo:  'container',
            alignTicks: false
           
        },
        /*navigator:{top:200},*/
        
        rangeSelector: {
            selected: 1
        },

        title: {
            text: 'Comp'
        },

        xAxis: {
            maxZoom: 24 * 3600000,
            type: 'datetime'
        },
        yAxis: [{
            
            title: {
                text: 'Price'
            },
            height: 200,
            lineWidth: 2
        }, {
           
            title: {
                text: 'Volume'
            },
            top: 300,
            height: 100,
            offset: 0,
            lineWidth: 2
        }],
          
        series: [{
            type: 'line',
            data: usdeur,
            dataGrouping: {
                units: groupingUnits
            }
        }, {
            type: 'areaspline',
            threshold: null,
            name: 'Volume',
            data: usdeur,
            yAxis: 1,
            dataGrouping: {
                units: groupingUnits
            }
        }]
    });
});