Javascript examples for highcharts:Area Chart
area graph animation on setData for area chart
<html> <head> <title>Highcharts addPoint</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> data = [29.9, 71.5, 106.4, 129.2, 144.0]; var arrayLocation = 5;/*from www .j a v a 2s. c o m*/ var increasingValue = 150; $(function () { var chart = new Highcharts.Chart({ xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, chart: { renderTo: 'container' }, plotOptions: { series: { animation: { duration: 2000 }, stickyTracking: false } }, xAxis: { labels: { style: { fontSize: '13px' } }, min: 0, minRange: 12, }, yAxis: { title: { text: "", enabled: false }, labels: { style: { fontSize: '13px' } } }, series: [{ data: data, type: 'area' }] }); var series = chart.series[0]; var updateChart = function () { series.addPoint({x : arrayLocation, y: increasingValue}); arrayLocation++; increasingValue = increasingValue + 5; console.log(increasingValue); console.log(arrayLocation); }; $('#button').click(updateChart); }); </script> </head> <body> <script src="https://code.highcharts.com/highcharts.js"></script> <div id="container" style="height: 400px"></div> <button id="button">Click</button> </body> </html>