stack values for same category for line chart - Javascript highcharts

Javascript examples for highcharts:Chart Value

Description

stack values for same category for line chart

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript" src="http://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  2s . c o  m
  Highcharts.stockChart('container', {
    title: {
      text: 'Number of viewed mails per hour'
    },
    rangeSelector: {
      enabled: false
    },
    navigator: {
      enabled: false
    },
    scrollbar: {
      enabled: false
    },
    credits: {
      enabled: false
    },
    legend: {
      enabled: true
    },
    xAxis: {
      gridLineWidth: 1
    },
    yAxis: {
      opposite: false,
      showLastLabel: true,
      lineWidth: 1
    },
    plotOptions: {
      series: {
        dataGrouping: {
          enabled: true,
          forced: true,
          approximation: 'sum',
          units: [
            [
              'hour', [1]
            ]
          ]
        },
        marker: {
          enabled: true,
          radius: 5
        }
      }
    },
    series: [{
      data: [
        [1509523800000, 1],
        [1509524700000, 1],
        [1509525540000, 1],
        [1509529800000, 1],
        [1509617400000, 1],
        [1509621900000, 1],
        [1509622740000, 1],
      ]
    }]
  });
});

      </script> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/stock/highstock.js"></script> 
      <div id="container"></div>  
   </body>
</html>

Related Tutorials