Highcharts Demo

author(s): Torstein Hønsi

by Nikhil

HTML

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

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

JavaScript

temp = [
            [null, 'Ola', 'Kari'], // series names
            ['Apples', 1, 5], // category and values
            ['Pears', 4, 4], // category and values
            ['Oranges', 3, 2] // category and values
        ];
  
setInterval(()=>{
	if(temp[0][1][1]==1)
  	temp[0][1][1] = 5;
    else
    temp[0][1][1] = 1;
    console.log(URL.createObjectURL(new Blob(JSON.stringify([temp]), {type: "application/json"})));
    

},2000);

Highcharts.chart('container', {

    chart: {
        type: 'column'
    },

    title: {
        text: 'Data input as row arrays'
    },

    data: {
        rowsUrl: URL.createObjectURL(new Blob([temp], {type: "application/json"})),
        enablePolling:true
    }
});