create stock chart - Javascript highcharts

Javascript examples for highcharts:Stock Chart

Description

create stock chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
      <script type="text/javascript">
$(function() {//from ww  w  . j  a v a  2  s. c  o m
   var data = [[1337922000000,1569.50], [1338267600000,1579.50] ,[1338354000000,1540.00],[1338440400000,1558.00],[1338526800000,1606.00],[1338958800000,1635.00],[1339045200000,1606.00],[1339131600000,1576.50],[1339390800000,1584.00],[1339477200000,1603.50],[1339563600000,1619.50],]
        // Create the chart
        window.chart = new Highcharts.StockChart({
            chart : {
                renderTo : 'container'
            },
            title : {
                text : 'AAPL Stock Price'
            },
            series : [{
                name : 'AAPL',
                data : data,
            }]
        });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/stock/highstock.js"></script> 
      <script src="https://code.highcharts.com/stock/modules/exporting.js"></script> 
      <div id="container" style="height: 500px; min-width: 500px"></div>  
   </body>
</html>

Related Tutorials