For an
SQL Server
example, see:
HighCharts databinding in C#[
^]
Here is a pure HTML example:
DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Bar Chart</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://code.jquery.com/jquery-1.9.1.js" type="text/javascript"></script>
<script src="http://code.highcharts.com/highcharts.js" type="text/javascript"></script>
<script src="http://code.highcharts.com/modules/exporting.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'MyFruit database info'
},
xAxis: {
categories: ['Records', 'Fragmentation', 'Users']
},
yAxis: {
title: {
text: 'Values'
}
},
series: [
{
name: 'MyFruit_Sites',
data: [10, 50, 4]
}, {
name: 'MyFruit_Devices',
data: [500, 80, 3]
}
]
});
$('#button').click(function () {
var chart = $('#container').highcharts();
chart.addSeries({
name: 'MyFruit_Users',
data: [30, 60, 4]
});
});
});
</script>
</head>
<body>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
<button id="button" class="autocompare">Add series</button>
</body>
</html>