JSFiddle - React, Tailwind, and code Playground

by core972

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>
<script src="https://code.highcharts.com/stock/modules/export-data.js"></script>

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

JavaScript

let firstStamp = 1554076800000,
  data = [];

for (let i = 0; i < 10; i++) {
  var randomValue = Math.floor(Math.random() * Math.floor(100)),
    stamp = [firstStamp + (21600000 * i), randomValue];
  data.push(stamp);
}
// Create the chart
Highcharts.stockChart('container', {


  rangeSelector: {
    selected: 1
  },

  title: {
    text: ''
  },

  series: [{
    name: 'AAPL',
    data: data,
  }],
  xAxis: {
    tickInterval: 21600000
  }
});