Spline Chart Updating Each Second Tutorial With Examples

Today, We want to share with you Spline Chart Updating Each Second Tutorial With Examples.In this post we will show you Highcharts spline chart with dynamic data update example, hear for Use highcharts to create spline chart updating each second example we will give you demo and example for implement.In this post, we will learn about Dynamic Spline HighChart Example with Multiple Y Axis with an example.

Spline Chart Updating Each Second Tutorial With Examples

There are the Following The simple About Make spline chart which updates every second using highcharts Full Information With Example and source code.

As I will cover this Post with live Working example to develop highcharts add data to series dynamically, so the Highcharts Dynamic Charts-Spline Chart updating each second is used for this example is following below.

Highcharts Spline Chart Updating Each Second Example

index.html

Angular is a platform for building mobile & desktop web Based user friendly and light weight applications.Angular,It’s TypeScript-based open-source Angularjs web application framework.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Highcharts - Spline updating each second Chart - www.pakainfo.com</title>
    <script src="https://www.pakainfo.com/jquery/js/jquery-1.12.4.js"></script>
    <script src="https://www.pakainfo.com/jquery/js/highcharts.js"></script>
    <script type="text/javascript">
        $(function () {
            Highcharts.setOptions({
                global: {
                    useUTC: false
                }
            });
            var graphtype = {
                type: 'spline',
                animation: Highcharts.svg, // don't animate in old IE
                marginRight: 10,
                events: {
                    load: function () {

                        // set up the updating of the chart each second
                        var series = this.series[0];
                        setInterval(function () {
                            var x = (new Date()).getTime(), // current time
                                y = Math.random();
                            series.addPoint([x, y], true, true);
                        }, 1000);
                    }
                }
            }
            var graphTitle = {
                text: 'Live random data'
            }
            var graphxaxis = {
                type: 'datetime',
                tickPixelInterval: 150
            }
            var graphyaxis = {
                title: {
                    text: 'Value'
                },
                plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#808080'
                }]
            }
            var graphtooltip = {
                formatter: function () {
                    return '<b>' + this.series.name + '</b><br/>' +
                        Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
                        Highcharts.numberFormat(this.y, 2);
                }
            }
            var graphlegend = {
                enabled: false
            }
            var chartexporting = {
                enabled: false
            }
            var graphseries = [{
                name: 'Random data',
                data: (function () {
                    // generate an array of random data
                    var data = [],
                        time = (new Date()).getTime(),
                        i;

                    for (i = -19; i <= 0; i += 1) {
                        data.push({
                            x: time + i * 1000,
                            y: Math.random()
                        });
                    }
                    return data;
                }())
            }]
            $('#chart-full-content').highcharts({
                chart: graphtype,
                title: graphTitle,
                xAxis: graphxaxis,
                yAxis: graphyaxis,
                tooltip: graphtooltip,
                legend: graphlegend,
                exporting: chartexporting,
                series: graphseries
            });
        });
    </script>
</head>
<body>
    <div id="chart-full-content" style="min-width: 335px; height: 425px; margin: 0 auto"></div>
</body>
</html>

Web Programming Tutorials Example with Demo

Read :

Also Read This 👉   Pie Chart with Legends Tutorial With Examples

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Highcharts Dynamic Charts.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.