columbus3 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (199) hide show
  1. checksums.yaml +4 -4
  2. data/README.textile +62 -0
  3. data/bower_components/flot/.bower.json +19 -0
  4. data/bower_components/flot/.gitignore +3 -0
  5. data/bower_components/flot/.travis.yml +3 -0
  6. data/bower_components/flot/API.md +1498 -0
  7. data/bower_components/flot/CONTRIBUTING.md +98 -0
  8. data/bower_components/flot/FAQ.md +75 -0
  9. data/bower_components/flot/LICENSE.txt +22 -0
  10. data/bower_components/flot/Makefile +12 -0
  11. data/bower_components/flot/NEWS.md +1026 -0
  12. data/bower_components/flot/PLUGINS.md +143 -0
  13. data/bower_components/flot/README.md +110 -0
  14. data/bower_components/flot/component.json +8 -0
  15. data/bower_components/flot/examples/ajax/data-eu-gdp-growth-1.json +4 -0
  16. data/bower_components/flot/examples/ajax/data-eu-gdp-growth-2.json +4 -0
  17. data/bower_components/flot/examples/ajax/data-eu-gdp-growth-3.json +4 -0
  18. data/bower_components/flot/examples/ajax/data-eu-gdp-growth-4.json +4 -0
  19. data/bower_components/flot/examples/ajax/data-eu-gdp-growth-5.json +4 -0
  20. data/bower_components/flot/examples/ajax/data-eu-gdp-growth.json +4 -0
  21. data/bower_components/flot/examples/ajax/data-japan-gdp-growth.json +4 -0
  22. data/bower_components/flot/examples/ajax/data-usa-gdp-growth.json +4 -0
  23. data/bower_components/flot/examples/ajax/index.html +173 -0
  24. data/bower_components/flot/examples/annotating/index.html +87 -0
  25. data/bower_components/flot/examples/axes-interacting/index.html +97 -0
  26. data/bower_components/flot/examples/axes-multiple/index.html +77 -0
  27. data/bower_components/flot/examples/axes-time-zones/date.js +893 -0
  28. data/bower_components/flot/examples/axes-time-zones/index.html +114 -0
  29. data/bower_components/flot/examples/axes-time-zones/tz/africa +1181 -0
  30. data/bower_components/flot/examples/axes-time-zones/tz/antarctica +413 -0
  31. data/bower_components/flot/examples/axes-time-zones/tz/asia +2717 -0
  32. data/bower_components/flot/examples/axes-time-zones/tz/australasia +1719 -0
  33. data/bower_components/flot/examples/axes-time-zones/tz/backward +117 -0
  34. data/bower_components/flot/examples/axes-time-zones/tz/etcetera +81 -0
  35. data/bower_components/flot/examples/axes-time-zones/tz/europe +2856 -0
  36. data/bower_components/flot/examples/axes-time-zones/tz/factory +10 -0
  37. data/bower_components/flot/examples/axes-time-zones/tz/iso3166.tab +276 -0
  38. data/bower_components/flot/examples/axes-time-zones/tz/leapseconds +100 -0
  39. data/bower_components/flot/examples/axes-time-zones/tz/northamerica +3235 -0
  40. data/bower_components/flot/examples/axes-time-zones/tz/pacificnew +28 -0
  41. data/bower_components/flot/examples/axes-time-zones/tz/solar87 +390 -0
  42. data/bower_components/flot/examples/axes-time-zones/tz/solar88 +390 -0
  43. data/bower_components/flot/examples/axes-time-zones/tz/solar89 +395 -0
  44. data/bower_components/flot/examples/axes-time-zones/tz/southamerica +1711 -0
  45. data/bower_components/flot/examples/axes-time-zones/tz/systemv +38 -0
  46. data/bower_components/flot/examples/axes-time-zones/tz/yearistype.sh +38 -0
  47. data/bower_components/flot/examples/axes-time-zones/tz/zone.tab +441 -0
  48. data/bower_components/flot/examples/axes-time/index.html +137 -0
  49. data/bower_components/flot/examples/background.png +0 -0
  50. data/bower_components/flot/examples/basic-options/index.html +91 -0
  51. data/bower_components/flot/examples/basic-usage/index.html +57 -0
  52. data/bower_components/flot/examples/canvas/index.html +75 -0
  53. data/bower_components/flot/examples/categories/index.html +64 -0
  54. data/bower_components/flot/examples/examples.css +97 -0
  55. data/bower_components/flot/examples/image/hs-2004-27-a-large-web.jpg +0 -0
  56. data/bower_components/flot/examples/image/index.html +69 -0
  57. data/bower_components/flot/examples/index.html +80 -0
  58. data/bower_components/flot/examples/interacting/index.html +118 -0
  59. data/bower_components/flot/examples/navigate/arrow-down.gif +0 -0
  60. data/bower_components/flot/examples/navigate/arrow-left.gif +0 -0
  61. data/bower_components/flot/examples/navigate/arrow-right.gif +0 -0
  62. data/bower_components/flot/examples/navigate/arrow-up.gif +0 -0
  63. data/bower_components/flot/examples/navigate/index.html +153 -0
  64. data/bower_components/flot/examples/percentiles/index.html +79 -0
  65. data/bower_components/flot/examples/realtime/index.html +122 -0
  66. data/bower_components/flot/examples/resize/index.html +76 -0
  67. data/bower_components/flot/examples/selection/index.html +152 -0
  68. data/bower_components/flot/examples/series-errorbars/index.html +150 -0
  69. data/bower_components/flot/examples/series-pie/index.html +818 -0
  70. data/bower_components/flot/examples/series-toggle/index.html +121 -0
  71. data/bower_components/flot/examples/series-types/index.html +90 -0
  72. data/bower_components/flot/examples/shared/jquery-ui/jquery-ui.min.css +6 -0
  73. data/bower_components/flot/examples/stacking/index.html +107 -0
  74. data/bower_components/flot/examples/symbols/index.html +76 -0
  75. data/bower_components/flot/examples/threshold/index.html +76 -0
  76. data/bower_components/flot/examples/tracking/index.html +135 -0
  77. data/bower_components/flot/examples/visitors/index.html +147 -0
  78. data/bower_components/flot/examples/zooming/index.html +144 -0
  79. data/bower_components/flot/excanvas.js +1428 -0
  80. data/bower_components/flot/excanvas.min.js +1 -0
  81. data/bower_components/flot/flot.jquery.json +27 -0
  82. data/bower_components/flot/jquery.colorhelpers.js +180 -0
  83. data/bower_components/flot/jquery.flot.canvas.js +345 -0
  84. data/bower_components/flot/jquery.flot.categories.js +190 -0
  85. data/bower_components/flot/jquery.flot.crosshair.js +176 -0
  86. data/bower_components/flot/jquery.flot.errorbars.js +353 -0
  87. data/bower_components/flot/jquery.flot.fillbetween.js +226 -0
  88. data/bower_components/flot/jquery.flot.image.js +241 -0
  89. data/bower_components/flot/jquery.flot.js +3168 -0
  90. data/bower_components/flot/jquery.flot.navigate.js +346 -0
  91. data/bower_components/flot/jquery.flot.pie.js +820 -0
  92. data/bower_components/flot/jquery.flot.resize.js +59 -0
  93. data/bower_components/flot/jquery.flot.selection.js +360 -0
  94. data/bower_components/flot/jquery.flot.stack.js +188 -0
  95. data/bower_components/flot/jquery.flot.symbol.js +71 -0
  96. data/bower_components/flot/jquery.flot.threshold.js +142 -0
  97. data/bower_components/flot/jquery.flot.time.js +432 -0
  98. data/bower_components/flot/jquery.js +9472 -0
  99. data/bower_components/flot/package.json +11 -0
  100. data/bower_components/jquery/.bower.json +38 -0
  101. data/bower_components/jquery/MIT-LICENSE.txt +21 -0
  102. data/bower_components/jquery/bower.json +28 -0
  103. data/bower_components/jquery/dist/jquery.js +9210 -0
  104. data/bower_components/jquery/dist/jquery.min.js +5 -0
  105. data/bower_components/jquery/dist/jquery.min.map +1 -0
  106. data/bower_components/jquery/src/ajax.js +786 -0
  107. data/bower_components/jquery/src/ajax/jsonp.js +89 -0
  108. data/bower_components/jquery/src/ajax/load.js +75 -0
  109. data/bower_components/jquery/src/ajax/parseJSON.js +13 -0
  110. data/bower_components/jquery/src/ajax/parseXML.js +28 -0
  111. data/bower_components/jquery/src/ajax/script.js +64 -0
  112. data/bower_components/jquery/src/ajax/var/nonce.js +5 -0
  113. data/bower_components/jquery/src/ajax/var/rquery.js +3 -0
  114. data/bower_components/jquery/src/ajax/xhr.js +136 -0
  115. data/bower_components/jquery/src/attributes.js +11 -0
  116. data/bower_components/jquery/src/attributes/attr.js +141 -0
  117. data/bower_components/jquery/src/attributes/classes.js +158 -0
  118. data/bower_components/jquery/src/attributes/prop.js +94 -0
  119. data/bower_components/jquery/src/attributes/support.js +35 -0
  120. data/bower_components/jquery/src/attributes/val.js +161 -0
  121. data/bower_components/jquery/src/callbacks.js +205 -0
  122. data/bower_components/jquery/src/core.js +502 -0
  123. data/bower_components/jquery/src/core/access.js +60 -0
  124. data/bower_components/jquery/src/core/init.js +123 -0
  125. data/bower_components/jquery/src/core/parseHTML.js +39 -0
  126. data/bower_components/jquery/src/core/ready.js +97 -0
  127. data/bower_components/jquery/src/core/var/rsingleTag.js +4 -0
  128. data/bower_components/jquery/src/css.js +450 -0
  129. data/bower_components/jquery/src/css/addGetHookIf.js +22 -0
  130. data/bower_components/jquery/src/css/curCSS.js +57 -0
  131. data/bower_components/jquery/src/css/defaultDisplay.js +70 -0
  132. data/bower_components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
  133. data/bower_components/jquery/src/css/support.js +96 -0
  134. data/bower_components/jquery/src/css/swap.js +28 -0
  135. data/bower_components/jquery/src/css/var/cssExpand.js +3 -0
  136. data/bower_components/jquery/src/css/var/getStyles.js +12 -0
  137. data/bower_components/jquery/src/css/var/isHidden.js +13 -0
  138. data/bower_components/jquery/src/css/var/rmargin.js +3 -0
  139. data/bower_components/jquery/src/css/var/rnumnonpx.js +5 -0
  140. data/bower_components/jquery/src/data.js +178 -0
  141. data/bower_components/jquery/src/data/Data.js +181 -0
  142. data/bower_components/jquery/src/data/accepts.js +20 -0
  143. data/bower_components/jquery/src/data/var/data_priv.js +5 -0
  144. data/bower_components/jquery/src/data/var/data_user.js +5 -0
  145. data/bower_components/jquery/src/deferred.js +149 -0
  146. data/bower_components/jquery/src/deprecated.js +13 -0
  147. data/bower_components/jquery/src/dimensions.js +50 -0
  148. data/bower_components/jquery/src/effects.js +648 -0
  149. data/bower_components/jquery/src/effects/Tween.js +114 -0
  150. data/bower_components/jquery/src/effects/animatedSelector.js +13 -0
  151. data/bower_components/jquery/src/event.js +868 -0
  152. data/bower_components/jquery/src/event/ajax.js +13 -0
  153. data/bower_components/jquery/src/event/alias.js +39 -0
  154. data/bower_components/jquery/src/event/support.js +9 -0
  155. data/bower_components/jquery/src/exports/amd.js +24 -0
  156. data/bower_components/jquery/src/exports/global.js +32 -0
  157. data/bower_components/jquery/src/intro.js +44 -0
  158. data/bower_components/jquery/src/jquery.js +37 -0
  159. data/bower_components/jquery/src/manipulation.js +580 -0
  160. data/bower_components/jquery/src/manipulation/_evalUrl.js +18 -0
  161. data/bower_components/jquery/src/manipulation/support.js +32 -0
  162. data/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -0
  163. data/bower_components/jquery/src/offset.js +207 -0
  164. data/bower_components/jquery/src/outro.js +1 -0
  165. data/bower_components/jquery/src/queue.js +142 -0
  166. data/bower_components/jquery/src/queue/delay.js +22 -0
  167. data/bower_components/jquery/src/selector-native.js +172 -0
  168. data/bower_components/jquery/src/selector-sizzle.js +14 -0
  169. data/bower_components/jquery/src/selector.js +1 -0
  170. data/bower_components/jquery/src/serialize.js +111 -0
  171. data/bower_components/jquery/src/sizzle/dist/sizzle.js +2067 -0
  172. data/bower_components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
  173. data/bower_components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
  174. data/bower_components/jquery/src/traversing.js +199 -0
  175. data/bower_components/jquery/src/traversing/findFilter.js +100 -0
  176. data/bower_components/jquery/src/traversing/var/rneedsContext.js +6 -0
  177. data/bower_components/jquery/src/var/arr.js +3 -0
  178. data/bower_components/jquery/src/var/class2type.js +4 -0
  179. data/bower_components/jquery/src/var/concat.js +5 -0
  180. data/bower_components/jquery/src/var/hasOwn.js +5 -0
  181. data/bower_components/jquery/src/var/indexOf.js +5 -0
  182. data/bower_components/jquery/src/var/pnum.js +3 -0
  183. data/bower_components/jquery/src/var/push.js +5 -0
  184. data/bower_components/jquery/src/var/rnotwhite.js +3 -0
  185. data/bower_components/jquery/src/var/slice.js +5 -0
  186. data/bower_components/jquery/src/var/strundefined.js +3 -0
  187. data/bower_components/jquery/src/var/support.js +4 -0
  188. data/bower_components/jquery/src/var/toString.js +5 -0
  189. data/bower_components/jquery/src/wrap.js +79 -0
  190. data/columbus3.gemspec +1 -1
  191. data/exe/columbus3 +72 -7
  192. data/lib/columbus3.rb +2 -1
  193. data/lib/columbus3/metadata/sidecar.rb +10 -1
  194. data/lib/columbus3/renderer/flot_renderer.rb +66 -0
  195. data/lib/columbus3/renderer/{renderer.rb → leaflet_renderer.rb} +0 -0
  196. data/lib/columbus3/version.rb +1 -1
  197. data/lib/html/flot.html.erb +106 -0
  198. metadata +194 -5
  199. data/README.md +0 -41
@@ -0,0 +1,122 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Flot Examples: Real-time updates</title>
6
+ <link href="../examples.css" rel="stylesheet" type="text/css">
7
+ <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../excanvas.min.js"></script><![endif]-->
8
+ <script language="javascript" type="text/javascript" src="../../jquery.js"></script>
9
+ <script language="javascript" type="text/javascript" src="../../jquery.flot.js"></script>
10
+ <script type="text/javascript">
11
+
12
+ $(function() {
13
+
14
+ // We use an inline data source in the example, usually data would
15
+ // be fetched from a server
16
+
17
+ var data = [],
18
+ totalPoints = 300;
19
+
20
+ function getRandomData() {
21
+
22
+ if (data.length > 0)
23
+ data = data.slice(1);
24
+
25
+ // Do a random walk
26
+
27
+ while (data.length < totalPoints) {
28
+
29
+ var prev = data.length > 0 ? data[data.length - 1] : 50,
30
+ y = prev + Math.random() * 10 - 5;
31
+
32
+ if (y < 0) {
33
+ y = 0;
34
+ } else if (y > 100) {
35
+ y = 100;
36
+ }
37
+
38
+ data.push(y);
39
+ }
40
+
41
+ // Zip the generated y values with the x values
42
+
43
+ var res = [];
44
+ for (var i = 0; i < data.length; ++i) {
45
+ res.push([i, data[i]])
46
+ }
47
+
48
+ return res;
49
+ }
50
+
51
+ // Set up the control widget
52
+
53
+ var updateInterval = 30;
54
+ $("#updateInterval").val(updateInterval).change(function () {
55
+ var v = $(this).val();
56
+ if (v && !isNaN(+v)) {
57
+ updateInterval = +v;
58
+ if (updateInterval < 1) {
59
+ updateInterval = 1;
60
+ } else if (updateInterval > 2000) {
61
+ updateInterval = 2000;
62
+ }
63
+ $(this).val("" + updateInterval);
64
+ }
65
+ });
66
+
67
+ var plot = $.plot("#placeholder", [ getRandomData() ], {
68
+ series: {
69
+ shadowSize: 0 // Drawing is faster without shadows
70
+ },
71
+ yaxis: {
72
+ min: 0,
73
+ max: 100
74
+ },
75
+ xaxis: {
76
+ show: false
77
+ }
78
+ });
79
+
80
+ function update() {
81
+
82
+ plot.setData([getRandomData()]);
83
+
84
+ // Since the axes don't change, we don't need to call plot.setupGrid()
85
+
86
+ plot.draw();
87
+ setTimeout(update, updateInterval);
88
+ }
89
+
90
+ update();
91
+
92
+ // Add the Flot version string to the footer
93
+
94
+ $("#footer").prepend("Flot " + $.plot.version + " &ndash; ");
95
+ });
96
+
97
+ </script>
98
+ </head>
99
+ <body>
100
+
101
+ <div id="header">
102
+ <h2>Real-time updates</h2>
103
+ </div>
104
+
105
+ <div id="content">
106
+
107
+ <div class="demo-container">
108
+ <div id="placeholder" class="demo-placeholder"></div>
109
+ </div>
110
+
111
+ <p>You can update a chart periodically to get a real-time effect by using a timer to insert the new data in the plot and redraw it.</p>
112
+
113
+ <p>Time between updates: <input id="updateInterval" type="text" value="" style="text-align: right; width:5em"> milliseconds</p>
114
+
115
+ </div>
116
+
117
+ <div id="footer">
118
+ Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
119
+ </div>
120
+
121
+ </body>
122
+ </html>
@@ -0,0 +1,76 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Flot Examples: Resizing</title>
6
+ <link href="../examples.css" rel="stylesheet" type="text/css">
7
+ <link href="../shared/jquery-ui/jquery-ui.min.css" rel="stylesheet" type="text/css">
8
+ <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../excanvas.min.js"></script><![endif]-->
9
+ <script language="javascript" type="text/javascript" src="../../jquery.js"></script>
10
+ <script language="javascript" type="text/javascript" src="../shared/jquery-ui/jquery-ui.min.js"></script>
11
+ <script language="javascript" type="text/javascript" src="../../jquery.flot.js"></script>
12
+ <script language="javascript" type="text/javascript" src="../../jquery.flot.resize.js"></script>
13
+ <script type="text/javascript">
14
+
15
+ $(function() {
16
+
17
+ var d1 = [];
18
+ for (var i = 0; i < 14; i += 0.5) {
19
+ d1.push([i, Math.sin(i)]);
20
+ }
21
+
22
+ var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]];
23
+ var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]];
24
+
25
+ var placeholder = $("#placeholder");
26
+ var plot = $.plot(placeholder, [d1, d2, d3]);
27
+
28
+ // The plugin includes a jQuery plugin for adding resize events to any
29
+ // element. Add a callback so we can display the placeholder size.
30
+
31
+ placeholder.resize(function () {
32
+ $(".message").text("Placeholder is now "
33
+ + $(this).width() + "x" + $(this).height()
34
+ + " pixels");
35
+ });
36
+
37
+ $(".demo-container").resizable({
38
+ maxWidth: 900,
39
+ maxHeight: 500,
40
+ minWidth: 450,
41
+ minHeight: 250
42
+ });
43
+
44
+ // Add the Flot version string to the footer
45
+
46
+ $("#footer").prepend("Flot " + $.plot.version + " &ndash; ");
47
+ });
48
+
49
+ </script>
50
+ </head>
51
+ <body>
52
+
53
+ <div id="header">
54
+ <h2>Resizing</h2>
55
+ </div>
56
+
57
+ <div id="content">
58
+
59
+ <div class="demo-container">
60
+ <div id="placeholder" class="demo-placeholder"></div>
61
+ </div>
62
+
63
+ <p class="message"></p>
64
+
65
+ <p>Sometimes it makes more sense to just let the plot take up the available space. In that case, we need to redraw the plot each time the placeholder changes its size. If you include the resize plugin, this is handled automatically.</p>
66
+
67
+ <p>Drag the bottom and right sides of the plot to resize it.</p>
68
+
69
+ </div>
70
+
71
+ <div id="footer">
72
+ Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
73
+ </div>
74
+
75
+ </body>
76
+ </html>
@@ -0,0 +1,152 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Flot Examples: Selection</title>
6
+ <link href="../examples.css" rel="stylesheet" type="text/css">
7
+ <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../excanvas.min.js"></script><![endif]-->
8
+ <script language="javascript" type="text/javascript" src="../../jquery.js"></script>
9
+ <script language="javascript" type="text/javascript" src="../../jquery.flot.js"></script>
10
+ <script language="javascript" type="text/javascript" src="../../jquery.flot.selection.js"></script>
11
+ <script type="text/javascript">
12
+
13
+ $(function() {
14
+
15
+ // Shim allowing us to get the state of the check-box on jQuery versions
16
+ // prior to 1.6, when prop was added. The reason we don't just use attr
17
+ // is because it doesn't work in jQuery versions 1.9.x and later.
18
+
19
+ // TODO: Remove this once Flot's minimum supported jQuery reaches 1.6.
20
+ if (typeof $.fn.prop != 'function') {
21
+ $.fn.prop = $.fn.attr;
22
+ }
23
+
24
+ var data = [{
25
+ label: "United States",
26
+ data: [[1990, 18.9], [1991, 18.7], [1992, 18.4], [1993, 19.3], [1994, 19.5], [1995, 19.3], [1996, 19.4], [1997, 20.2], [1998, 19.8], [1999, 19.9], [2000, 20.4], [2001, 20.1], [2002, 20.0], [2003, 19.8], [2004, 20.4]]
27
+ }, {
28
+ label: "Russia",
29
+ data: [[1992, 13.4], [1993, 12.2], [1994, 10.6], [1995, 10.2], [1996, 10.1], [1997, 9.7], [1998, 9.5], [1999, 9.7], [2000, 9.9], [2001, 9.9], [2002, 9.9], [2003, 10.3], [2004, 10.5]]
30
+ }, {
31
+ label: "United Kingdom",
32
+ data: [[1990, 10.0], [1991, 11.3], [1992, 9.9], [1993, 9.6], [1994, 9.5], [1995, 9.5], [1996, 9.9], [1997, 9.3], [1998, 9.2], [1999, 9.2], [2000, 9.5], [2001, 9.6], [2002, 9.3], [2003, 9.4], [2004, 9.79]]
33
+ }, {
34
+ label: "Germany",
35
+ data: [[1990, 12.4], [1991, 11.2], [1992, 10.8], [1993, 10.5], [1994, 10.4], [1995, 10.2], [1996, 10.5], [1997, 10.2], [1998, 10.1], [1999, 9.6], [2000, 9.7], [2001, 10.0], [2002, 9.7], [2003, 9.8], [2004, 9.79]]
36
+ }, {
37
+ label: "Denmark",
38
+ data: [[1990, 9.7], [1991, 12.1], [1992, 10.3], [1993, 11.3], [1994, 11.7], [1995, 10.6], [1996, 12.8], [1997, 10.8], [1998, 10.3], [1999, 9.4], [2000, 8.7], [2001, 9.0], [2002, 8.9], [2003, 10.1], [2004, 9.80]]
39
+ }, {
40
+ label: "Sweden",
41
+ data: [[1990, 5.8], [1991, 6.0], [1992, 5.9], [1993, 5.5], [1994, 5.7], [1995, 5.3], [1996, 6.1], [1997, 5.4], [1998, 5.4], [1999, 5.1], [2000, 5.2], [2001, 5.4], [2002, 6.2], [2003, 5.9], [2004, 5.89]]
42
+ }, {
43
+ label: "Norway",
44
+ data: [[1990, 8.3], [1991, 8.3], [1992, 7.8], [1993, 8.3], [1994, 8.4], [1995, 5.9], [1996, 6.4], [1997, 6.7], [1998, 6.9], [1999, 7.6], [2000, 7.4], [2001, 8.1], [2002, 12.5], [2003, 9.9], [2004, 19.0]]
45
+ }];
46
+
47
+ var options = {
48
+ series: {
49
+ lines: {
50
+ show: true
51
+ },
52
+ points: {
53
+ show: true
54
+ }
55
+ },
56
+ legend: {
57
+ noColumns: 2
58
+ },
59
+ xaxis: {
60
+ tickDecimals: 0
61
+ },
62
+ yaxis: {
63
+ min: 0
64
+ },
65
+ selection: {
66
+ mode: "x"
67
+ }
68
+ };
69
+
70
+ var placeholder = $("#placeholder");
71
+
72
+ placeholder.bind("plotselected", function (event, ranges) {
73
+
74
+ $("#selection").text(ranges.xaxis.from.toFixed(1) + " to " + ranges.xaxis.to.toFixed(1));
75
+
76
+ var zoom = $("#zoom").prop("checked");
77
+
78
+ if (zoom) {
79
+ $.each(plot.getXAxes(), function(_, axis) {
80
+ var opts = axis.options;
81
+ opts.min = ranges.xaxis.from;
82
+ opts.max = ranges.xaxis.to;
83
+ });
84
+ plot.setupGrid();
85
+ plot.draw();
86
+ plot.clearSelection();
87
+ }
88
+ });
89
+
90
+ placeholder.bind("plotunselected", function (event) {
91
+ $("#selection").text("");
92
+ });
93
+
94
+ var plot = $.plot(placeholder, data, options);
95
+
96
+ $("#clearSelection").click(function () {
97
+ plot.clearSelection();
98
+ });
99
+
100
+ $("#setSelection").click(function () {
101
+ plot.setSelection({
102
+ xaxis: {
103
+ from: 1994,
104
+ to: 1995
105
+ }
106
+ });
107
+ });
108
+
109
+ // Add the Flot version string to the footer
110
+
111
+ $("#footer").prepend("Flot " + $.plot.version + " &ndash; ");
112
+ });
113
+
114
+ </script>
115
+ </head>
116
+ <body>
117
+
118
+ <div id="header">
119
+ <h2>Selection</h2>
120
+ </div>
121
+
122
+ <div id="content">
123
+
124
+ <div class="demo-container">
125
+ <div id="placeholder" class="demo-placeholder"></div>
126
+ </div>
127
+
128
+ <p>1000 kg. CO<sub>2</sub> emissions per year per capita for various countries (source: <a href="http://en.wikipedia.org/wiki/List_of_countries_by_carbon_dioxide_emissions_per_capita">Wikipedia</a>).</p>
129
+
130
+ <p>Flot supports selections through the selection plugin. You can enable rectangular selection or one-dimensional selection if the user should only be able to select on one axis. Try left-click and drag on the plot above where selection on the x axis is enabled.</p>
131
+
132
+ <p>You selected: <span id="selection"></span></p>
133
+
134
+ <p>The plot command returns a plot object you can use to control the selection. Click the buttons below.</p>
135
+
136
+ <p>
137
+ <button id="clearSelection">Clear selection</button>
138
+ <button id="setSelection">Select year 1994</button>
139
+ </p>
140
+
141
+ <p>Selections are really useful for zooming. Just replot the chart with min and max values for the axes set to the values in the "plotselected" event triggered. Enable the checkbox below and select a region again.</p>
142
+
143
+ <p><label><input id="zoom" type="checkbox"></input>Zoom to selection.</label></p>
144
+
145
+ </div>
146
+
147
+ <div id="footer">
148
+ Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
149
+ </div>
150
+
151
+ </body>
152
+ </html>
@@ -0,0 +1,150 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
+ <title>Flot Examples: Error Bars</title>
6
+ <link href="../examples.css" rel="stylesheet" type="text/css">
7
+ <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../excanvas.min.js"></script><![endif]-->
8
+ <script language="javascript" type="text/javascript" src="../../jquery.js"></script>
9
+ <script language="javascript" type="text/javascript" src="../../jquery.flot.js"></script>
10
+ <script language="javascript" type="text/javascript" src="../../jquery.flot.errorbars.js"></script>
11
+ <script language="javascript" type="text/javascript" src="../../jquery.flot.navigate.js"></script>
12
+ <script type="text/javascript">
13
+
14
+ $(function() {
15
+
16
+ function drawArrow(ctx, x, y, radius){
17
+ ctx.beginPath();
18
+ ctx.moveTo(x + radius, y + radius);
19
+ ctx.lineTo(x, y);
20
+ ctx.lineTo(x - radius, y + radius);
21
+ ctx.stroke();
22
+ }
23
+
24
+ function drawSemiCircle(ctx, x, y, radius){
25
+ ctx.beginPath();
26
+ ctx.arc(x, y, radius, 0, Math.PI, false);
27
+ ctx.moveTo(x - radius, y);
28
+ ctx.lineTo(x + radius, y);
29
+ ctx.stroke();
30
+ }
31
+
32
+ var data1 = [
33
+ [1,1,.5,.1,.3],
34
+ [2,2,.3,.5,.2],
35
+ [3,3,.9,.5,.2],
36
+ [1.5,-.05,.5,.1,.3],
37
+ [3.15,1.,.5,.1,.3],
38
+ [2.5,-1.,.5,.1,.3]
39
+ ];
40
+
41
+ var data1_points = {
42
+ show: true,
43
+ radius: 5,
44
+ fillColor: "blue",
45
+ errorbars: "xy",
46
+ xerr: {show: true, asymmetric: true, upperCap: "-", lowerCap: "-"},
47
+ yerr: {show: true, color: "red", upperCap: "-"}
48
+ };
49
+
50
+ var data2 = [
51
+ [.7,3,.2,.4],
52
+ [1.5,2.2,.3,.4],
53
+ [2.3,1,.5,.2]
54
+ ];
55
+
56
+ var data2_points = {
57
+ show: true,
58
+ radius: 5,
59
+ errorbars: "y",
60
+ yerr: {show:true, asymmetric:true, upperCap: drawArrow, lowerCap: drawSemiCircle}
61
+ };
62
+
63
+ var data3 = [
64
+ [1,2,.4],
65
+ [2,0.5,.3],
66
+ [2.7,2,.5]
67
+ ];
68
+
69
+ var data3_points = {
70
+ //do not show points
71
+ radius: 0,
72
+ errorbars: "y",
73
+ yerr: {show:true, upperCap: "-", lowerCap: "-", radius: 5}
74
+ };
75
+
76
+ var data4 = [
77
+ [1.3, 1],
78
+ [1.75, 2.5],
79
+ [2.5, 0.5]
80
+ ];
81
+
82
+ var data4_errors = [0.1, 0.4, 0.2];
83
+ for (var i = 0; i < data4.length; i++) {
84
+ data4_errors[i] = data4[i].concat(data4_errors[i])
85
+ }
86
+
87
+ var data = [
88
+ {color: "blue", points: data1_points, data: data1, label: "data1"},
89
+ {color: "red", points: data2_points, data: data2, label: "data2"},
90
+ {color: "green", lines: {show: true}, points: data3_points, data: data3, label: "data3"},
91
+ // bars with errors
92
+ {color: "orange", bars: {show: true, align: "center", barWidth: 0.25}, data: data4, label: "data4"},
93
+ {color: "orange", points: data3_points, data: data4_errors}
94
+ ];
95
+
96
+ $.plot($("#placeholder"), data , {
97
+ legend: {
98
+ position: "sw",
99
+ show: true
100
+ },
101
+ series: {
102
+ lines: {
103
+ show: false
104
+ }
105
+ },
106
+ xaxis: {
107
+ min: 0.6,
108
+ max: 3.1
109
+ },
110
+ yaxis: {
111
+ min: 0,
112
+ max: 3.5
113
+ },
114
+ zoom: {
115
+ interactive: true
116
+ },
117
+ pan: {
118
+ interactive: true
119
+ }
120
+ });
121
+
122
+ // Add the Flot version string to the footer
123
+
124
+ $("#footer").prepend("Flot " + $.plot.version + " &ndash; ");
125
+ });
126
+
127
+ </script>
128
+ </head>
129
+ <body>
130
+
131
+ <div id="header">
132
+ <h2>Error Bars</h2>
133
+ </div>
134
+
135
+ <div id="content">
136
+
137
+ <div class="demo-container">
138
+ <div id="placeholder" class="demo-placeholder"></div>
139
+ </div>
140
+
141
+ <p>With the errorbars plugin you can plot error bars to show standard deviation and other useful statistical properties.</p>
142
+
143
+ </div>
144
+
145
+ <div id="footer">
146
+ Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
147
+ </div>
148
+
149
+ </body>
150
+ </html>