This repository has been archived by the owner on May 6, 2020. It is now read-only.
/
demo.html
152 lines (134 loc) · 4.89 KB
/
demo.html
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8 " lang="en"><![endif]--><!--[if gt IE 8]><!--><html lang="en">
<!--<![endif]-->
<head>
<title>Magna Charta examples</title>
<style>
/* Basic page styles */
* { margin: 0; padding: 0; }
body { font-family: Helvetica, Arial, sans-serif; padding: 25px 100px; }
h1 { margin-bottom: 50px; }
table {
margin-bottom: 50px;
width: 100%;
border-collapse: collapse;
border: 1px solid #ccc;
}
td{
border-top: 1px solid #ccc;
text-align: center;
}
td, th{
padding: 10px;
}
td:first-child,
th:first-child{
text-align: left;
}
caption{
font-size: 16px;
margin: 16px 0;
}
caption a{
display: block;
}
.toggle{
display: block;
font-size: 16px;
width: 220px;
margin: 5px 0;
}
pre { margin: 10px 0; padding: 5px; }
h2, h1, ul { margin: 15px 0; }
p, li { margin 10px 0; line-height: 24px; font-size: 16px;}
code { font-size: 16px; line-height: 25px;}
</style>
<link rel="stylesheet" type="text/css" href="demo/stylesheets/magna-charta.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="src/magna-charta.js"></script>
<script src="demo/demo.js"></script>
</head>
<body>
<a href="https://www.github.com/alphagov/magna-charta"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png" alt="Fork me on GitHub"></a>
<div class="container">
<h1>Magna Charta</h1>
<p>Magna Charter is a jQuery plugin used to create accessible and lovely looking bar charts.</p>
<h1>Magna Charta examples</h1>
<table class="chart mc-outdented" id="fig1">
<caption>Fig. 1: The niceness of types of biscuit (according to Jack)</caption>
<thead>
<tr><th>Biscuit</th><th>Niceness</th></tr>
</thead>
<tbody>
<tr><td>Caramel Digestives</td><td>9</td></tr>
<tr><td>Teacakes</td><td>4</td></tr>
<tr><td>Nice biscuits</td><td>3</td></tr>
<tr><td>Hobnobs</td><td>3</td></tr>
<tr><td>Kitkat</td><td>1.567778910101</td></tr>
<tr><td>Rich Tea</td><td>0</td></tr>
</tbody>
</table>
<table class="chart left-key" id="fig2">
<caption>Fig. 2: Team biscuit preferences (out of 10)</caption>
<thead>
<tr><th>Biscuit</th><th>Tim</th><th>Jack</th><th>Roo</th></tr>
</thead>
<tbody>
<tr><td>Caramel Digestives</td><td>8</td><td>9</td><td>7</td></tr>
<tr><td>Nice biscuits</td><td>7</td><td>3</td><td>5</td></tr>
<tr><td>Teacakes</td><td>4</td><td>4</td><td>7</td></tr>
<tr><td>Hobnobs</td><td>5</td><td>3</td><td>2</td></tr>
</tbody>
</table>
<table class="mc-stacked chart right-key" id="fig3">
<caption>Fig. 3: Combined team biscuit preferences</caption>
<thead>
<tr><th>Biscuit</th><th>Tim</th><th>Jack</th><th>Roo</th><th>Total</th></tr>
</thead>
<tbody>
<tr><td>Caramel Digestives</td><td>8</td><td>9</td><td>7</td><td>24</td></tr>
<tr><td>Nice biscuits</td><td>7</td><td>3</td><td>5</td><td>15</td></tr>
<tr><td>Teacakes</td><td>4</td><td>4</td><td>7</td><td>15</td></tr>
<tr><td>Hobnobs</td><td>5</td><td>3</td><td>2</td><td>10</td></tr>
</tbody>
</table>
<table class="compact chart left-key" id="fig4">
<caption>Fig. 4: Team biscuit preferences (out of 10)</caption>
<thead>
<tr><th>Person</th><th>Caramel Digestives</th><th>Nice biscuits</th><th>Teacakes</th><th>Hobnobs</th></tr>
</thead>
<tbody>
<tr><td>Tim</td><td>8</td><td>7</td><td>4</td><td>5</td></tr>
<tr><td>Jack</td><td>9</td><td>3</td><td>4</td><td>3</td></tr>
<tr><td>Roo</td><td>7</td><td>5</td><td>7</td><td>2</td></tr>
</tbody>
</table>
<table class="chart no-key mc-negative mc-auto-outdent" id="fig5">
<caption>Fig. 5: Negative values test</caption>
<thead>
<tr><th>Biscuit</th><th>Niceness</th></tr>
</thead>
<tbody>
<tr><td>Caramel Digestives</td><td>9</td></tr>
<tr><td>Nice biscuits</td><td>3</td></tr>
<tr><td>Chocolate Hobnobs</td><td>3</td></tr>
<tr><td>Hobnobs</td><td>2.2345678812345</td></tr>
<tr><td>Kitkats</td><td>-1</td></tr>
<tr><td>Penguins</td><td>-1.1233456789</td></tr>
<tr><td>Rich Tea</td><td>-2</td></tr>
</tbody>
</table>
<table id="zerovalues" class="mc-stacked left-key">
<caption>Fig. 6: Stacked with 0 and huge range in values</caption>
<thead>
<tr><th>Some Data</th><th>YES</th><th>NO</th><th>Total</th></tr>
</thead>
<tbody>
<tr><td>Testing One</td><td>0</td><td>1</td><td>1</td></tr>
<tr><td>Testing Two</td><td>2</td><td>2</td><td>4</td></tr>
<tr><td>Testing Three</td><td>4</td><td>0</td><td>4</td></tr>
<tr><td>Testing Four</td><td>4</td><td>48</td><td>52</td></tr>
</tbody>
</table>
</body>
</html>