Highcharts Demo

author(s): Torstein Hønsi

HTML

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<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: 400px; min-width: 310px"></div>

JavaScript

Highcharts.stockChart('container', {
  chart: {
    spacingLeft: 200,
  },
  navigator: {
    enabled: false
  },
  scrollbar: {
    enabled: false
  },
  title : {
    text : 'Activity'
  },
  rangeSelector: {
    allButtonsEnabled: true,
    buttons: [{
      type: 'month',
      count: 3,
      text: 'Daily',
      dataGrouping: {
        forced: true,
        units: [['day', [1]]]
      }
    }, {
      type: 'year',
      count: 1,
      text: 'Weekly',
      dataGrouping: {
        forced: true,
        units: [['week', [1]]]
      }
    }, {
      type: 'all',
      text: 'Monthly',
      dataGrouping: {
        forced: true,
        units: [['month', [1]]]
      }
    }],
    buttonTheme: {
      width: 60
    },
    selected: 2
  },
  legend: {
  	enable: true,
    align: 'left',
    verticalAlign: 'top',
    layout: 'vertical',
    x: 0,
    y: 100
  },
  xAxis: {
    type: 'datetime',
    dateTimeLabelFormats: {
      month: '%e. %b',
      year: '%b'
    }
  },
  series: [{
    name: 'Label 1',
    color: "#00aade",
    data: [[1501545600000, 5], [1504224000000,4], [1506816000000, 6],[1509494400000,5]]
  },
  {
    name: 'Label 2',
    color: "#8cc63e",
    data: [[1501545600000, 1], [1504224000000,0], [1506816000000, 2],[1509494400000,0]]
  }]
});