series gap auto zipping for stock chart - Javascript highcharts

Javascript examples for highcharts:Chart Series

Description

series gap auto zipping for 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   w w  w .j  a va  2  s. c om
  $('#container').highcharts('StockChart', {
    title: {
      text: 'Start at the first of April'
    },
    rangeSelector: {
      selected: 0
    },
    rangeSelector: {
      selected: 5
    },
    xAxis: {
      ordinal: false
    },
    series: [{
      name: 'Temperature',
      data: [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
      pointStart: Date.UTC(2004, 3, 1), // first of April
      pointInterval: 1, // hourly data
      pointIntervalUnit: 'month',
      tooltip: {
        valueDecimals: 1,
        valueSuffix: '?C'
      }
    }, {
      name: 'Ferenhei',
      data: [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
      pointStart: Date.UTC(2009, 3, 1), // first of April
      pointInterval: 1, // hourly data
      pointIntervalUnit: 'month',
      tooltip: {
        valueDecimals: 2,
        valueSuffix: '?F'
      }
    }]
  });
});

      </script> 
   </head> 
   <body> 
      <div id="container" style="height: 400px; min-width: 600px"></div> 
      <script src="https://code.highcharts.com/stock/highstock.js"></script> 
      <script src="https://code.highcharts.com/stock/modules/exporting.js"></script> 
      <script type="text/javascript" src="https://www.highcharts.com/samples/data/large-dataset.js"></script>  
   </body>
</html>

Related Tutorials