Highcharts Demo

author(s): Torstein Hønsi

HTML

<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>

<div id="container" style="height: 400px; margin-top: 1em"></div>
<button id='b1'> click </button>
<div style="height: 200vh">
dupa
</div>

JavaScript

var chart = new Highcharts.Chart({
        
        chart: {
            renderTo: 'container'
            
        },
        
        credits: {
            enabled: false
        },
        
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },
        
       series: [
        {
          data: [
            {
              x: 1530288658,
              y: 3,
            },
            {
              x: 1530332869,
              y: 6,
            },
            {
              x: 1530462869,
              y: -6,
            },
            {
              x: 1533141269,
              y: 50,
            },
            {
              x: 1535819669,
              y: -50,
            },
            {
              x: 1538410569,
              y: 25,
            },
          ],
          color: {
            linearGradient: { x1: 0, x2: 0, y1: 1, y2: 0 },
            stops: [[0, "rgb(255, 0, 0)"], [1, "rgb(5, 212, 130)"]],
            background: "rgba(255, 255, 255, 0.8)",
          },
        },
        /* {
          data: [
            {
              x: 1538410669,
              y: 25,
              company: "Tesco",
            },
            {
              x: 1540058353,
              y: 3,
              company: "Aldi",
            },
            {
              x: 1541872753,
              y: 10,
              company: "Liddl",
            },
            {
              x: 1542736753,
              y: 2,
              company: "7/11",
            },
            {
              x: 1543600753,
              y: 7,
              company: "Castorama",
            },
          ],
          color: {
            linearGradient: { x1: 0, x2: 0, y1: 1, y2: 0 },
            stops: [[0, "gray"], [1, "gray"]],
            background: "yellow",
          },
        }, */
      ],
        
        
    });

var data = [29.9, -71.5, 106.4, -129.2, 144.0, -176.0, 135.6, 148.5, 216.4,...