HighChart – Update Single Column


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>HighChart Update Animation</title>
</head>

<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 300px"></div>
<button id="update">Update chart</button>

<script>
$(document).ready(function () {
$('#container').highcharts({

chart: {
animation: true
},

xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},

series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]

});

var i = 1;
$('#update').click(function () {
var chart = $('#container').highcharts();
chart.series[0].data[0].update(i % 2 ? 200 : 0);
i += 1;
});
});
</script>
</body>

</html>

http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/chart/animation-none/

http://jsfiddle.net/ebuTs/14609/

 

Published by

G3n1k

just to remember what i had known :)

One thought on “HighChart – Update Single Column”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s