-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathchart1.html
More file actions
63 lines (61 loc) · 1.28 KB
/
chart1.html
File metadata and controls
63 lines (61 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Chart</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<div id="container" style="height: 400px;"></div>
<script src="http://code.highcharts.com/highcharts.js"></script>
<script type="text/javascript">
$('#container').highcharts({
chart: {
type: 'column'
},
credits: {
enabled: false
},
title: {
text: 'Results of the 2015 U.K. general election'
},
xAxis: {
categories: ['CON', 'LAB', 'SNP', 'LD', 'OTHER']
},
yAxis: {
title: null,
labels: {
formatter: function(){
if (this.isLast){
return this.value+' seats';
}
return this.value;
}
},
plotLines: [{
value: 323,
color: '#aaa',
dashStyle : 'shortdash',
width: 1,
label : {
text : 'Majority (323 seats)',
align: 'right'
}
}]
},
legend: {
enabled: false
},
colors: ['#03529E', '#9E0400', '#EFF309', '#FDB009', '#999'],
plotOptions: {
series: {
colorByPoint: true
}
},
series: [{
data: [331, 232, 56, 8, 23]
}]
});
</script>
</body>
</html>