WP Statistics - Version 12.1.0

Version Description

  • Added: Awesome charts! The Chartjs library used in the plugin for show charts.
  • Updated: Missed flags icons. (Curaao, Saint Lucia, Turkmenistan, Kosovo, Saint Martin, Saint Barthlemy and Mayotte)
  • Updated: Countries code.
  • Updated: Settings and Optimization page styles.
  • Fixed: Showing data on the Browsers, Platforms and browsers version charts.
  • Fixed: Postbox container width in Logs page.
  • Removed: WP_STATISTICS_MIN_EXT define for load .min version in css/js.
  • Removed: Additional assets and the assets cleaned up.
Download this release

Release Info

Developer mostafa.s1990
Plugin Icon 128x128 WP Statistics
Version 12.1.0
Comparing to
See all releases

Code changes from version 12.0.12.1 to 12.1.0

Files changed (40) hide show
  1. ajax.php +10 -2
  2. assets/css/admin-old.css +0 -8
  3. assets/css/admin-old.min.css +0 -1
  4. assets/css/admin.css +59 -0
  5. assets/css/admin.min.css +0 -1
  6. assets/css/jquery-ui-1.10.4.custom.css +0 -381
  7. assets/css/jquery-ui-smoothness.css +0 -1908
  8. assets/css/log.css +20 -9
  9. assets/css/log.min.css +0 -1
  10. assets/css/pagination.min.css +0 -1
  11. assets/css/rtl.min.css +0 -1
  12. assets/css/style.min.css +0 -1
  13. assets/images/flags/BL.png +0 -0
  14. assets/images/flags/CW.png +0 -0
  15. assets/images/flags/LC.png +0 -0
  16. assets/images/flags/MF.png +0 -0
  17. assets/images/flags/TM.png +0 -0
  18. assets/images/flags/XK.png +0 -0
  19. assets/images/flags/YT.png +0 -0
  20. assets/jqplot/jquery.jqplot.css +0 -259
  21. assets/jqplot/jquery.jqplot.js +0 -11534
  22. assets/jqplot/jquery.jqplot.min.css +0 -1
  23. assets/jqplot/jquery.jqplot.min.js +0 -8
  24. assets/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js +0 -203
  25. assets/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js +0 -4
  26. assets/jqplot/plugins/jqplot.canvasAxisTickRenderer.js +0 -253
  27. assets/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js +0 -4
  28. assets/jqplot/plugins/jqplot.canvasTextRenderer.js +0 -449
  29. assets/jqplot/plugins/jqplot.canvasTextRenderer.min.js +0 -4
  30. assets/jqplot/plugins/jqplot.dateAxisRenderer.js +0 -741
  31. assets/jqplot/plugins/jqplot.dateAxisRenderer.min.js +0 -4
  32. assets/jqplot/plugins/jqplot.enhancedLegendRenderer.js +0 -305
  33. assets/jqplot/plugins/jqplot.enhancedLegendRenderer.min.js +0 -4
  34. assets/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js +0 -261
  35. assets/jqplot/plugins/jqplot.enhancedPieLegendRenderer.min.js +0 -4
  36. assets/jqplot/plugins/jqplot.highlighter.js +0 -484
  37. assets/jqplot/plugins/jqplot.highlighter.min.js +0 -4
  38. assets/jqplot/plugins/jqplot.pieRenderer.js +0 -946
  39. assets/jqplot/plugins/jqplot.pieRenderer.min.js +0 -4
  40. assets/js/Chart.bundle.min.js +10 -0
ajax.php CHANGED
@@ -213,6 +213,14 @@ function wp_statistics_get_widget_contents_callback() {
213
  'words'
214
  );
215
 
 
 
 
 
 
 
 
 
216
  $view_cap = wp_statistics_validate_capability( $WP_Statistics->get_option( 'read_capability', 'manage_options' ) );
217
 
218
  if ( current_user_can( $view_cap ) ) {
@@ -267,11 +275,11 @@ function wp_statistics_get_widget_contents_callback() {
267
 
268
  break;
269
  case 'hits':
270
- wp_statistics_generate_hits_postbox_content();
271
 
272
  break;
273
  case 'search':
274
- wp_statistics_generate_search_postbox_content( $search_engines );
275
 
276
  break;
277
  case 'words':
213
  'words'
214
  );
215
 
216
+ if ( array_key_exists( 'format', $_POST ) and $_POST['format'] == 'dashboard' ) {
217
+ $size = 300;
218
+ $days = 10;
219
+ } else {
220
+ $size = 110;
221
+ $days = 20;
222
+ }
223
+
224
  $view_cap = wp_statistics_validate_capability( $WP_Statistics->get_option( 'read_capability', 'manage_options' ) );
225
 
226
  if ( current_user_can( $view_cap ) ) {
275
 
276
  break;
277
  case 'hits':
278
+ wp_statistics_generate_hits_postbox_content( $size, $days );
279
 
280
  break;
281
  case 'search':
282
+ wp_statistics_generate_search_postbox_content( $search_engines, $size, $days );
283
 
284
  break;
285
  case 'words':
assets/css/admin-old.css DELETED
@@ -1,8 +0,0 @@
1
-
2
- #adminmenu #toplevel_page_wps_overview_page div.wp-menu-image {
3
- background: url("../images/icon.png") no-repeat scroll center center rgba(0, 0, 0, 0) !important;
4
- }
5
-
6
- #adminmenu #toplevel_page_wps_overview_page div.wp-menu-image:before {
7
- content: "";
8
- }
 
 
 
 
 
 
 
 
assets/css/admin-old.min.css DELETED
@@ -1 +0,0 @@
1
- #adminmenu #toplevel_page_wps_overview_page div.wp-menu-image{background:url("../images/icon.png") no-repeat scroll center center rgba(0,0,0,0) !important}#adminmenu #toplevel_page_wps_overview_page div.wp-menu-image:before{content:""}
 
assets/css/admin.css CHANGED
@@ -56,3 +56,62 @@
56
  font-size: 15px;
57
  color: #589616;
58
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  font-size: 15px;
57
  color: #589616;
58
  }
59
+
60
+ .wp-statistics-sub-fullwidth {
61
+ width: 100%;
62
+ }
63
+
64
+ /** Setting page **/
65
+ .wp-statistics-settings .widefat {
66
+ float: left;
67
+ }
68
+
69
+ .wp-statistics-settings .postbox-container {
70
+ margin-top: 51px;
71
+ }
72
+
73
+ .wp-statistics-settings #tabs {
74
+ margin-top: 18px;
75
+ }
76
+
77
+ .wp-statistics-settings .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
78
+ padding-right: 8px;
79
+ padding-left: 8px;
80
+ }
81
+
82
+ .wp-statistics-settings #tabs .ui-widget-content {
83
+ background-color: white;
84
+ border-left: 1px solid #dadada;
85
+ border-right: 1px solid #dadada;
86
+ border-bottom: 1px solid #dadada;
87
+ }
88
+
89
+ .wp-statistics-settings .ui-tabs .ui-tabs-nav {
90
+ padding: 0;
91
+ }
92
+
93
+ .wp-statistics-settings .ui-tabs .ui-tabs-nav li {
94
+ border-color: #dadada;
95
+ }
96
+
97
+ .wp-statistics-settings .ui-widget-header {
98
+ border-bottom-color: #dadada;
99
+ }
100
+
101
+ .rtl .wp-statistics-settings .widefat {
102
+ float: right;
103
+ }
104
+
105
+ .wp-statistics-settings .ui-widget-content .ui-tabs-panel a {
106
+ color: #0073aa;
107
+ }
108
+
109
+ @media only screen and (max-width: 1482px) {
110
+ .wp-statistics-settings #poststuff #post-body.columns-2 {
111
+ margin: 0;
112
+ }
113
+
114
+ .wp-statistics-settings .postbox-container {
115
+ margin-top: 11px;
116
+ }
117
+ }
assets/css/admin.min.css DELETED
@@ -1 +0,0 @@
1
- #adminmenu #toplevel_page_wps_overview_page .wp-menu-image:before{content:"\f184"}#wp-admin-bar-wp-statistic-menu .ab-icon:before{font-family:"dashicons"!important;content:"\f184"!important}.wps-center{text-align:center}#wps_about_postbox #about_postbox img{max-width:170px;margin:0 0 9px}.column-wp-statistics{width:52px}.button-link.wps-more,.button-link.wps-refresh{text-decoration:none!important}.wp-statistics-plugins .widefat > *{float:left}.wp-statistics-plugins .widefat .plugin-card .desc,.wp-statistics-plugins .widefat .plugin-card .name{margin-right:0}.rtl .wp-statistics-plugins .widefat > *{float:right}.rtl .wp-statistics-plugins .widefat .plugin-card .desc,.rtl .wp-statistics-plugins .widefat .plugin-card .name{margin-right:148px;margin-left:0}.wp-statistics-plugins .widefat .plugin-card-bottom{float:initial}.wp-statistics-plugins .widefat .column-downloaded p{margin:2px 0 0}.wp-statistics-plugins .column-price{display:inline;margin:0 8px;font-size:15px;color:#589616}
 
assets/css/jquery-ui-1.10.4.custom.css DELETED
@@ -1,381 +0,0 @@
1
- /*! jQuery UI - v1.10.4 - 2014-03-06
2
- * http://jqueryui.com
3
- * Includes: jquery.ui.core.css, jquery.ui.progressbar.css, jquery.ui.tabs.css, jquery.ui.theme.css
4
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=0px&bgColorHeader=%2300ffff&bgTextureHeader=highlight_soft&bgImgOpacityHeader=100&borderColorHeader=%23aaaaaa&fcHeader=%23222222&iconColorHeader=%23222222&bgColorContent=%23ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=%23aaaaaa&fcContent=%23222222&iconColorContent=%23222222&bgColorDefault=%23e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=%23d3d3d3&fcDefault=%23555555&iconColorDefault=%23888888&bgColorHover=%23dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=%23999999&fcHover=%23212121&iconColorHover=%23454545&bgColorActive=%23ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=%23aaaaaa&fcActive=%23212121&iconColorActive=%23454545&bgColorHighlight=%23fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=%23fcefa1&fcHighlight=%23363636&iconColorHighlight=%232e83ff&bgColorError=%23fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=%23cd0a0a&fcError=%23cd0a0a&iconColorError=%23cd0a0a&bgColorOverlay=%23aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=%23aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
- * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
6
-
7
- /* Layout helpers
8
- ----------------------------------*/
9
- .ui-helper-hidden {
10
- display: none;
11
- }
12
-
13
- .ui-helper-hidden-accessible {
14
- border: 0;
15
- clip: rect(0 0 0 0);
16
- height: 1px;
17
- margin: -1px;
18
- overflow: hidden;
19
- padding: 0;
20
- position: absolute;
21
- width: 1px;
22
- }
23
-
24
- .ui-helper-reset {
25
- margin: 0;
26
- padding: 0;
27
- border: 0;
28
- outline: 0;
29
- line-height: 1.3;
30
- text-decoration: none;
31
- font-size: 100%;
32
- list-style: none;
33
- }
34
-
35
- .ui-helper-clearfix:before,
36
- .ui-helper-clearfix:after {
37
- content: "";
38
- display: table;
39
- border-collapse: collapse;
40
- }
41
-
42
- .ui-helper-clearfix:after {
43
- clear: both;
44
- }
45
-
46
- .ui-helper-clearfix {
47
- min-height: 0; /* support: IE7 */
48
- }
49
-
50
- .ui-helper-zfix {
51
- width: 100%;
52
- height: 100%;
53
- top: 0;
54
- left: 0;
55
- position: absolute;
56
- opacity: 0;
57
- filter: Alpha(Opacity=0);
58
- }
59
-
60
- .ui-front {
61
- z-index: 100;
62
- }
63
-
64
- /* Interaction Cues
65
- ----------------------------------*/
66
- .ui-state-disabled {
67
- cursor: default !important;
68
- }
69
-
70
- /* Icons
71
- ----------------------------------*/
72
-
73
- /* states and images */
74
- .ui-icon {
75
- display: block;
76
- text-indent: -99999px;
77
- overflow: hidden;
78
- background-repeat: no-repeat;
79
- }
80
-
81
- /* Misc visuals
82
- ----------------------------------*/
83
-
84
- /* Overlays */
85
- .ui-widget-overlay {
86
- position: fixed;
87
- top: 0;
88
- left: 0;
89
- width: 100%;
90
- height: 100%;
91
- }
92
-
93
- .ui-progressbar {
94
- height: 2em;
95
- text-align: left;
96
- overflow: hidden;
97
- }
98
-
99
- .ui-progressbar .ui-progressbar-value {
100
- margin: -1px;
101
- height: 100%;
102
- }
103
-
104
- .ui-progressbar .ui-progressbar-overlay {
105
- background: url("images/animated-overlay.gif");
106
- height: 100%;
107
- filter: alpha(opacity=25);
108
- opacity: 0.25;
109
- }
110
-
111
- .ui-progressbar-indeterminate .ui-progressbar-value {
112
- background-image: none;
113
- }
114
-
115
- #tabs {
116
- border: none;
117
- padding: 0px;
118
- margin: 0px;
119
- }
120
-
121
- .ui-tabs {
122
- position: relative; /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
123
- padding: .2em;
124
- }
125
-
126
- .ui-tabs .ui-tabs-nav {
127
- margin: 0;
128
- padding: .2em .2em 0;
129
- }
130
-
131
- .ui-tabs .ui-tabs-nav li {
132
- list-style: none;
133
- float: left;
134
- position: relative;
135
- top: 0;
136
- margin: 1px .2em 0 0;
137
- margin-right: 10px;
138
- border-bottom-width: 0;
139
- padding: 0;
140
- white-space: nowrap;
141
- }
142
-
143
- .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
144
- float: left;
145
- padding: .5em 1em;
146
- text-decoration: none;
147
- }
148
-
149
- .ui-tabs .ui-tabs-nav li.ui-tabs-active {
150
- margin-bottom: -1px;
151
- padding-bottom: 1px;
152
- margin-right: 10px;
153
- }
154
-
155
- .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
156
- .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
157
- .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
158
- cursor: text;
159
- }
160
-
161
- .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
162
- cursor: pointer;
163
- }
164
-
165
- .ui-tabs .ui-tabs-panel {
166
- display: block;
167
- border-width: 0;
168
- padding: 1em 1.4em;
169
- background: none;
170
- }
171
-
172
- /* Component containers
173
- ----------------------------------*/
174
- .ui-widget {
175
- font-family: Verdana, Arial, sans-serif;
176
- font-size: 1.1em;
177
- }
178
-
179
- .ui-widget .ui-widget {
180
- font-size: 1em;
181
- }
182
-
183
- .ui-widget input,
184
- .ui-widget select,
185
- .ui-widget textarea,
186
- .ui-widget button {
187
- font-family: Verdana, Arial, sans-serif;
188
- font-size: 1em;
189
- }
190
-
191
- .ui-widget-content {
192
- border: 1px solid #aaaaaa;
193
- background: transparent;
194
- color: #222222;
195
- }
196
-
197
- .ui-widget-content a {
198
- color: #222222;
199
- }
200
-
201
- .ui-widget-header {
202
- border-left: none;
203
- border-top: none;
204
- border-right: none;
205
- border-bottom: 1px solid #aaaaaa;
206
- background: transparent;
207
- color: #222222;
208
- font-weight: bold;
209
- }
210
-
211
- .ui-widget-header a {
212
- color: #222222;
213
- }
214
-
215
- /* Interaction states
216
- ----------------------------------*/
217
- .ui-state-default,
218
- .ui-widget-content .ui-state-default,
219
- .ui-widget-header .ui-state-default {
220
- border: 1px solid #d3d3d3;
221
- background: #e6e6e6;
222
- font-weight: normal;
223
- color: #555555;
224
- }
225
-
226
- .ui-state-default a,
227
- .ui-state-default a:link,
228
- .ui-state-default a:visited {
229
- color: #555555;
230
- text-decoration: none;
231
- }
232
-
233
- .ui-state-hover,
234
- .ui-widget-content .ui-state-hover,
235
- .ui-widget-header .ui-state-hover,
236
- .ui-state-focus,
237
- .ui-widget-content .ui-state-focus,
238
- .ui-widget-header .ui-state-focus {
239
- border: 1px solid #999999;
240
- background: #dadada;
241
- font-weight: normal;
242
- color: #212121;
243
- }
244
-
245
- .ui-state-hover a,
246
- .ui-state-hover a:hover,
247
- .ui-state-hover a:link,
248
- .ui-state-hover a:visited,
249
- .ui-state-focus a,
250
- .ui-state-focus a:hover,
251
- .ui-state-focus a:link,
252
- .ui-state-focus a:visited {
253
- color: #212121;
254
- text-decoration: none;
255
- }
256
-
257
- .ui-state-active,
258
- .ui-widget-content .ui-state-active,
259
- .ui-widget-header .ui-state-active {
260
- border: 1px solid #aaaaaa;
261
- background: #ffffff;
262
- font-weight: normal;
263
- color: #212121;
264
- }
265
-
266
- .ui-state-active a,
267
- .ui-state-active a:link,
268
- .ui-state-active a:visited {
269
- color: #212121;
270
- text-decoration: none;
271
- }
272
-
273
- /* Interaction Cues
274
- ----------------------------------*/
275
- .ui-state-highlight,
276
- .ui-widget-content .ui-state-highlight,
277
- .ui-widget-header .ui-state-highlight {
278
- border: 1px solid #fcefa1;
279
- background: #fbf9ee;
280
- color: #363636;
281
- }
282
-
283
- .ui-state-highlight a,
284
- .ui-widget-content .ui-state-highlight a,
285
- .ui-widget-header .ui-state-highlight a {
286
- color: #363636;
287
- }
288
-
289
- .ui-state-error,
290
- .ui-widget-content .ui-state-error,
291
- .ui-widget-header .ui-state-error {
292
- border: 1px solid #cd0a0a;
293
- background: #fef1ec;
294
- color: #cd0a0a;
295
- }
296
-
297
- .ui-state-error a,
298
- .ui-widget-content .ui-state-error a,
299
- .ui-widget-header .ui-state-error a {
300
- color: #cd0a0a;
301
- }
302
-
303
- .ui-state-error-text,
304
- .ui-widget-content .ui-state-error-text,
305
- .ui-widget-header .ui-state-error-text {
306
- color: #cd0a0a;
307
- }
308
-
309
- .ui-priority-primary,
310
- .ui-widget-content .ui-priority-primary,
311
- .ui-widget-header .ui-priority-primary {
312
- font-weight: bold;
313
- }
314
-
315
- .ui-priority-secondary,
316
- .ui-widget-content .ui-priority-secondary,
317
- .ui-widget-header .ui-priority-secondary {
318
- opacity: .7;
319
- filter: Alpha(Opacity=70);
320
- font-weight: normal;
321
- }
322
-
323
- .ui-state-disabled,
324
- .ui-widget-content .ui-state-disabled,
325
- .ui-widget-header .ui-state-disabled {
326
- opacity: .35;
327
- filter: Alpha(Opacity=35);
328
- background-image: none;
329
- }
330
-
331
- .ui-state-disabled .ui-icon {
332
- filter: Alpha(Opacity=35); /* For IE8 - See #6059 */
333
- }
334
-
335
- /* Misc visuals
336
- ----------------------------------*/
337
-
338
- /* Corner radius */
339
- .ui-corner-all,
340
- .ui-corner-top,
341
- .ui-corner-left,
342
- .ui-corner-tl {
343
- border-top-left-radius: 0px;
344
- }
345
-
346
- .ui-corner-all,
347
- .ui-corner-top,
348
- .ui-corner-right,
349
- .ui-corner-tr {
350
- border-top-right-radius: 0px;
351
- }
352
-
353
- .ui-corner-all,
354
- .ui-corner-bottom,
355
- .ui-corner-left,
356
- .ui-corner-bl {
357
- border-bottom-left-radius: 0px;
358
- }
359
-
360
- .ui-corner-all,
361
- .ui-corner-bottom,
362
- .ui-corner-right,
363
- .ui-corner-br {
364
- border-bottom-right-radius: 0px;
365
- }
366
-
367
- /* Overlays */
368
- .ui-widget-overlay {
369
- background: #aaaaaa;
370
- opacity: .3;
371
- filter: Alpha(Opacity=30);
372
- }
373
-
374
- .ui-widget-shadow {
375
- margin: -8px 0 0 -8px;
376
- padding: 8px;
377
- background: #aaaaaa;
378
- opacity: .3;
379
- filter: Alpha(Opacity=30);
380
- border-radius: 8px;
381
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/jquery-ui-smoothness.css DELETED
@@ -1,1908 +0,0 @@
1
- /*! jQuery UI - v1.11.4 - 2015-03-11
2
- * http://jqueryui.com
3
- * Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
4
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
- * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
6
-
7
- /* Layout helpers
8
- ----------------------------------*/
9
- .ui-helper-hidden {
10
- display: none;
11
- }
12
-
13
- .ui-helper-hidden-accessible {
14
- border: 0;
15
- clip: rect(0 0 0 0);
16
- height: 1px;
17
- margin: -1px;
18
- overflow: hidden;
19
- padding: 0;
20
- position: absolute;
21
- width: 1px;
22
- }
23
-
24
- .ui-helper-reset {
25
- margin: 0;
26
- padding: 0;
27
- border: 0;
28
- outline: 0;
29
- line-height: 1.3;
30
- text-decoration: none;
31
- font-size: 100%;
32
- list-style: none;
33
- }
34
-
35
- .ui-helper-clearfix:before,
36
- .ui-helper-clearfix:after {
37
- content: "";
38
- display: table;
39
- border-collapse: collapse;
40
- }
41
-
42
- .ui-helper-clearfix:after {
43
- clear: both;
44
- }
45
-
46
- .ui-helper-clearfix {
47
- min-height: 0; /* support: IE7 */
48
- }
49
-
50
- .ui-helper-zfix {
51
- width: 100%;
52
- height: 100%;
53
- top: 0;
54
- left: 0;
55
- position: absolute;
56
- opacity: 0;
57
- filter: Alpha(Opacity=0); /* support: IE8 */
58
- }
59
-
60
- .ui-front {
61
- z-index: 100;
62
- }
63
-
64
- /* Interaction Cues
65
- ----------------------------------*/
66
- .ui-state-disabled {
67
- cursor: default !important;
68
- }
69
-
70
- /* Icons
71
- ----------------------------------*/
72
-
73
- /* states and images */
74
- .ui-icon {
75
- display: block;
76
- text-indent: -99999px;
77
- overflow: hidden;
78
- background-repeat: no-repeat;
79
- }
80
-
81
- /* Misc visuals
82
- ----------------------------------*/
83
-
84
- /* Overlays */
85
- .ui-widget-overlay {
86
- position: fixed;
87
- top: 0;
88
- left: 0;
89
- width: 100%;
90
- height: 100%;
91
- }
92
-
93
- .ui-accordion .ui-accordion-header {
94
- display: block;
95
- cursor: pointer;
96
- position: relative;
97
- margin: 2px 0 0 0;
98
- padding: .5em .5em .5em .7em;
99
- min-height: 0; /* support: IE7 */
100
- font-size: 100%;
101
- }
102
-
103
- .ui-accordion .ui-accordion-icons {
104
- padding-left: 2.2em;
105
- }
106
-
107
- .ui-accordion .ui-accordion-icons .ui-accordion-icons {
108
- padding-left: 2.2em;
109
- }
110
-
111
- .ui-accordion .ui-accordion-header .ui-accordion-header-icon {
112
- position: absolute;
113
- left: .5em;
114
- top: 50%;
115
- margin-top: -8px;
116
- }
117
-
118
- .ui-accordion .ui-accordion-content {
119
- padding: 1em 2.2em;
120
- border-top: 0;
121
- overflow: auto;
122
- }
123
-
124
- .ui-autocomplete {
125
- position: absolute;
126
- top: 0;
127
- left: 0;
128
- cursor: default;
129
- }
130
-
131
- .ui-button {
132
- display: inline-block;
133
- position: relative;
134
- padding: 0;
135
- line-height: normal;
136
- margin-right: .1em;
137
- cursor: pointer;
138
- vertical-align: middle;
139
- text-align: center;
140
- overflow: visible; /* removes extra width in IE */
141
- }
142
-
143
- .ui-button,
144
- .ui-button:link,
145
- .ui-button:visited,
146
- .ui-button:hover,
147
- .ui-button:active {
148
- text-decoration: none;
149
- }
150
-
151
- /* to make room for the icon, a width needs to be set here */
152
- .ui-button-icon-only {
153
- width: 2.2em;
154
- }
155
-
156
- /* button elements seem to need a little more width */
157
- button.ui-button-icon-only {
158
- width: 2.4em;
159
- }
160
-
161
- .ui-button-icons-only {
162
- width: 3.4em;
163
- }
164
-
165
- button.ui-button-icons-only {
166
- width: 3.7em;
167
- }
168
-
169
- /* button text element */
170
- .ui-button .ui-button-text {
171
- display: block;
172
- line-height: normal;
173
- }
174
-
175
- .ui-button-text-only .ui-button-text {
176
- padding: .4em 1em;
177
- }
178
-
179
- .ui-button-icon-only .ui-button-text,
180
- .ui-button-icons-only .ui-button-text {
181
- padding: .4em;
182
- text-indent: -9999999px;
183
- }
184
-
185
- .ui-button-text-icon-primary .ui-button-text,
186
- .ui-button-text-icons .ui-button-text {
187
- padding: .4em 1em .4em 2.1em;
188
- }
189
-
190
- .ui-button-text-icon-secondary .ui-button-text,
191
- .ui-button-text-icons .ui-button-text {
192
- padding: .4em 2.1em .4em 1em;
193
- }
194
-
195
- .ui-button-text-icons .ui-button-text {
196
- padding-left: 2.1em;
197
- padding-right: 2.1em;
198
- }
199
-
200
- /* no icon support for input elements, provide padding by default */
201
- input.ui-button {
202
- padding: .4em 1em;
203
- }
204
-
205
- /* button icon element(s) */
206
- .ui-button-icon-only .ui-icon,
207
- .ui-button-text-icon-primary .ui-icon,
208
- .ui-button-text-icon-secondary .ui-icon,
209
- .ui-button-text-icons .ui-icon,
210
- .ui-button-icons-only .ui-icon {
211
- position: absolute;
212
- top: 50%;
213
- margin-top: -8px;
214
- }
215
-
216
- .ui-button-icon-only .ui-icon {
217
- left: 50%;
218
- margin-left: -8px;
219
- }
220
-
221
- .ui-button-text-icon-primary .ui-button-icon-primary,
222
- .ui-button-text-icons .ui-button-icon-primary,
223
- .ui-button-icons-only .ui-button-icon-primary {
224
- left: .5em;
225
- }
226
-
227
- .ui-button-text-icon-secondary .ui-button-icon-secondary,
228
- .ui-button-text-icons .ui-button-icon-secondary,
229
- .ui-button-icons-only .ui-button-icon-secondary {
230
- right: .5em;
231
- }
232
-
233
- /* button sets */
234
- .ui-buttonset {
235
- margin-right: 7px;
236
- }
237
-
238
- .ui-buttonset .ui-button {
239
- margin-left: 0;
240
- margin-right: -.3em;
241
- }
242
-
243
- /* workarounds */
244
- /* reset extra padding in Firefox, see h5bp.com/l */
245
- input.ui-button::-moz-focus-inner,
246
- button.ui-button::-moz-focus-inner {
247
- border: 0;
248
- padding: 0;
249
- }
250
-
251
- .ui-datepicker {
252
- width: 17em;
253
- padding: .2em .2em 0;
254
- display: none;
255
- }
256
-
257
- .ui-datepicker .ui-datepicker-header {
258
- position: relative;
259
- padding: .2em 0;
260
- }
261
-
262
- .ui-datepicker .ui-datepicker-prev,
263
- .ui-datepicker .ui-datepicker-next {
264
- position: absolute;
265
- top: 2px;
266
- width: 1.8em;
267
- height: 1.8em;
268
- }
269
-
270
- .ui-datepicker .ui-datepicker-prev-hover,
271
- .ui-datepicker .ui-datepicker-next-hover {
272
- top: 1px;
273
- }
274
-
275
- .ui-datepicker .ui-datepicker-prev {
276
- left: 2px;
277
- }
278
-
279
- .ui-datepicker .ui-datepicker-next {
280
- right: 2px;
281
- }
282
-
283
- .ui-datepicker .ui-datepicker-prev-hover {
284
- left: 1px;
285
- }
286
-
287
- .ui-datepicker .ui-datepicker-next-hover {
288
- right: 1px;
289
- }
290
-
291
- .ui-datepicker .ui-datepicker-prev span,
292
- .ui-datepicker .ui-datepicker-next span {
293
- display: block;
294
- position: absolute;
295
- left: 50%;
296
- margin-left: -8px;
297
- top: 50%;
298
- margin-top: -8px;
299
- }
300
-
301
- .ui-datepicker .ui-datepicker-title {
302
- margin: 0 2.3em;
303
- line-height: 1.8em;
304
- text-align: center;
305
- }
306
-
307
- .ui-datepicker .ui-datepicker-title select {
308
- font-size: 1em;
309
- margin: 1px 0;
310
- }
311
-
312
- .ui-datepicker select.ui-datepicker-month,
313
- .ui-datepicker select.ui-datepicker-year {
314
- width: 45%;
315
- }
316
-
317
- .ui-datepicker table {
318
- width: 100%;
319
- font-size: .9em;
320
- border-collapse: collapse;
321
- margin: 0 0 .4em;
322
- }
323
-
324
- .ui-datepicker th {
325
- padding: .7em .3em;
326
- text-align: center;
327
- font-weight: bold;
328
- border: 0;
329
- }
330
-
331
- .ui-datepicker td {
332
- border: 0;
333
- padding: 1px;
334
- }
335
-
336
- .ui-datepicker td span,
337
- .ui-datepicker td a {
338
- display: block;
339
- padding: .2em;
340
- text-align: right;
341
- text-decoration: none;
342
- }
343
-
344
- .ui-datepicker .ui-datepicker-buttonpane {
345
- background-image: none;
346
- margin: .7em 0 0 0;
347
- padding: 0 .2em;
348
- border-left: 0;
349
- border-right: 0;
350
- border-bottom: 0;
351
- }
352
-
353
- .ui-datepicker .ui-datepicker-buttonpane button {
354
- float: right;
355
- margin: .5em .2em .4em;
356
- cursor: pointer;
357
- padding: .2em .6em .3em .6em;
358
- width: auto;
359
- overflow: visible;
360
- }
361
-
362
- .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
363
- float: left;
364
- }
365
-
366
- /* with multiple calendars */
367
- .ui-datepicker.ui-datepicker-multi {
368
- width: auto;
369
- }
370
-
371
- .ui-datepicker-multi .ui-datepicker-group {
372
- float: left;
373
- }
374
-
375
- .ui-datepicker-multi .ui-datepicker-group table {
376
- width: 95%;
377
- margin: 0 auto .4em;
378
- }
379
-
380
- .ui-datepicker-multi-2 .ui-datepicker-group {
381
- width: 50%;
382
- }
383
-
384
- .ui-datepicker-multi-3 .ui-datepicker-group {
385
- width: 33.3%;
386
- }
387
-
388
- .ui-datepicker-multi-4 .ui-datepicker-group {
389
- width: 25%;
390
- }
391
-
392
- .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
393
- .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
394
- border-left-width: 0;
395
- }
396
-
397
- .ui-datepicker-multi .ui-datepicker-buttonpane {
398
- clear: left;
399
- }
400
-
401
- .ui-datepicker-row-break {
402
- clear: both;
403
- width: 100%;
404
- font-size: 0;
405
- }
406
-
407
- /* RTL support */
408
- .ui-datepicker-rtl {
409
- direction: rtl;
410
- }
411
-
412
- .ui-datepicker-rtl .ui-datepicker-prev {
413
- right: 2px;
414
- left: auto;
415
- }
416
-
417
- .ui-datepicker-rtl .ui-datepicker-next {
418
- left: 2px;
419
- right: auto;
420
- }
421
-
422
- .ui-datepicker-rtl .ui-datepicker-prev:hover {
423
- right: 1px;
424
- left: auto;
425
- }
426
-
427
- .ui-datepicker-rtl .ui-datepicker-next:hover {
428
- left: 1px;
429
- right: auto;
430
- }
431
-
432
- .ui-datepicker-rtl .ui-datepicker-buttonpane {
433
- clear: right;
434
- }
435
-
436
- .ui-datepicker-rtl .ui-datepicker-buttonpane button {
437
- float: left;
438
- }
439
-
440
- .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
441
- .ui-datepicker-rtl .ui-datepicker-group {
442
- float: right;
443
- }
444
-
445
- .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
446
- .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
447
- border-right-width: 0;
448
- border-left-width: 1px;
449
- }
450
-
451
- .ui-dialog {
452
- overflow: hidden;
453
- position: absolute;
454
- top: 0;
455
- left: 0;
456
- padding: .2em;
457
- outline: 0;
458
- }
459
-
460
- .ui-dialog .ui-dialog-titlebar {
461
- padding: .4em 1em;
462
- position: relative;
463
- }
464
-
465
- .ui-dialog .ui-dialog-title {
466
- float: left;
467
- margin: .1em 0;
468
- white-space: nowrap;
469
- width: 90%;
470
- overflow: hidden;
471
- text-overflow: ellipsis;
472
- }
473
-
474
- .ui-dialog .ui-dialog-titlebar-close {
475
- position: absolute;
476
- right: .3em;
477
- top: 50%;
478
- width: 20px;
479
- margin: -10px 0 0 0;
480
- padding: 1px;
481
- height: 20px;
482
- }
483
-
484
- .ui-dialog .ui-dialog-content {
485
- position: relative;
486
- border: 0;
487
- padding: .5em 1em;
488
- background: none;
489
- overflow: auto;
490
- }
491
-
492
- .ui-dialog .ui-dialog-buttonpane {
493
- text-align: left;
494
- border-width: 1px 0 0 0;
495
- background-image: none;
496
- margin-top: .5em;
497
- padding: .3em 1em .5em .4em;
498
- }
499
-
500
- .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
501
- float: right;
502
- }
503
-
504
- .ui-dialog .ui-dialog-buttonpane button {
505
- margin: .5em .4em .5em 0;
506
- cursor: pointer;
507
- }
508
-
509
- .ui-dialog .ui-resizable-se {
510
- width: 12px;
511
- height: 12px;
512
- right: -5px;
513
- bottom: -5px;
514
- background-position: 16px 16px;
515
- }
516
-
517
- .ui-draggable .ui-dialog-titlebar {
518
- cursor: move;
519
- }
520
-
521
- .ui-draggable-handle {
522
- -ms-touch-action: none;
523
- touch-action: none;
524
- }
525
-
526
- .ui-menu {
527
- list-style: none;
528
- padding: 0;
529
- margin: 0;
530
- display: block;
531
- outline: none;
532
- }
533
-
534
- .ui-menu .ui-menu {
535
- position: absolute;
536
- }
537
-
538
- .ui-menu .ui-menu-item {
539
- position: relative;
540
- margin: 0;
541
- padding: 3px 1em 3px .4em;
542
- cursor: pointer;
543
- min-height: 0; /* support: IE7 */
544
- /* support: IE10, see #8844 */
545
- list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
546
- }
547
-
548
- .ui-menu .ui-menu-divider {
549
- margin: 5px 0;
550
- height: 0;
551
- font-size: 0;
552
- line-height: 0;
553
- border-width: 1px 0 0 0;
554
- }
555
-
556
- .ui-menu .ui-state-focus,
557
- .ui-menu .ui-state-active {
558
- margin: -1px;
559
- }
560
-
561
- /* icon support */
562
- .ui-menu-icons {
563
- position: relative;
564
- }
565
-
566
- .ui-menu-icons .ui-menu-item {
567
- padding-left: 2em;
568
- }
569
-
570
- /* left-aligned */
571
- .ui-menu .ui-icon {
572
- position: absolute;
573
- top: 0;
574
- bottom: 0;
575
- left: .2em;
576
- margin: auto 0;
577
- }
578
-
579
- /* right-aligned */
580
- .ui-menu .ui-menu-icon {
581
- left: auto;
582
- right: 0;
583
- }
584
-
585
- .ui-progressbar {
586
- height: 2em;
587
- text-align: left;
588
- overflow: hidden;
589
- }
590
-
591
- .ui-progressbar .ui-progressbar-value {
592
- margin: -1px;
593
- height: 100%;
594
- }
595
-
596
- .ui-progressbar .ui-progressbar-overlay {
597
- background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
598
- height: 100%;
599
- filter: alpha(opacity=25); /* support: IE8 */
600
- opacity: 0.25;
601
- }
602
-
603
- .ui-progressbar-indeterminate .ui-progressbar-value {
604
- background-image: none;
605
- }
606
-
607
- .ui-resizable {
608
- position: relative;
609
- }
610
-
611
- .ui-resizable-handle {
612
- position: absolute;
613
- font-size: 0.1px;
614
- display: block;
615
- -ms-touch-action: none;
616
- touch-action: none;
617
- }
618
-
619
- .ui-resizable-disabled .ui-resizable-handle,
620
- .ui-resizable-autohide .ui-resizable-handle {
621
- display: none;
622
- }
623
-
624
- .ui-resizable-n {
625
- cursor: n-resize;
626
- height: 7px;
627
- width: 100%;
628
- top: -5px;
629
- left: 0;
630
- }
631
-
632
- .ui-resizable-s {
633
- cursor: s-resize;
634
- height: 7px;
635
- width: 100%;
636
- bottom: -5px;
637
- left: 0;
638
- }
639
-
640
- .ui-resizable-e {
641
- cursor: e-resize;
642
- width: 7px;
643
- right: -5px;
644
- top: 0;
645
- height: 100%;
646
- }
647
-
648
- .ui-resizable-w {
649
- cursor: w-resize;
650
- width: 7px;
651
- left: -5px;
652
- top: 0;
653
- height: 100%;
654
- }
655
-
656
- .ui-resizable-se {
657
- cursor: se-resize;
658
- width: 12px;
659
- height: 12px;
660
- right: 1px;
661
- bottom: 1px;
662
- }
663
-
664
- .ui-resizable-sw {
665
- cursor: sw-resize;
666
- width: 9px;
667
- height: 9px;
668
- left: -5px;
669
- bottom: -5px;
670
- }
671
-
672
- .ui-resizable-nw {
673
- cursor: nw-resize;
674
- width: 9px;
675
- height: 9px;
676
- left: -5px;
677
- top: -5px;
678
- }
679
-
680
- .ui-resizable-ne {
681
- cursor: ne-resize;
682
- width: 9px;
683
- height: 9px;
684
- right: -5px;
685
- top: -5px;
686
- }
687
-
688
- .ui-selectable {
689
- -ms-touch-action: none;
690
- touch-action: none;
691
- }
692
-
693
- .ui-selectable-helper {
694
- position: absolute;
695
- z-index: 100;
696
- border: 1px dotted black;
697
- }
698
-
699
- .ui-selectmenu-menu {
700
- padding: 0;
701
- margin: 0;
702
- position: absolute;
703
- top: 0;
704
- left: 0;
705
- display: none;
706
- }
707
-
708
- .ui-selectmenu-menu .ui-menu {
709
- overflow: auto;
710
- /* Support: IE7 */
711
- overflow-x: hidden;
712
- padding-bottom: 1px;
713
- }
714
-
715
- .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
716
- font-size: 1em;
717
- font-weight: bold;
718
- line-height: 1.5;
719
- padding: 2px 0.4em;
720
- margin: 0.5em 0 0 0;
721
- height: auto;
722
- border: 0;
723
- }
724
-
725
- .ui-selectmenu-open {
726
- display: block;
727
- }
728
-
729
- .ui-selectmenu-button {
730
- display: inline-block;
731
- overflow: hidden;
732
- position: relative;
733
- text-decoration: none;
734
- cursor: pointer;
735
- }
736
-
737
- .ui-selectmenu-button span.ui-icon {
738
- right: 0.5em;
739
- left: auto;
740
- margin-top: -8px;
741
- position: absolute;
742
- top: 50%;
743
- }
744
-
745
- .ui-selectmenu-button span.ui-selectmenu-text {
746
- text-align: left;
747
- padding: 0.4em 2.1em 0.4em 1em;
748
- display: block;
749
- line-height: 1.4;
750
- overflow: hidden;
751
- text-overflow: ellipsis;
752
- white-space: nowrap;
753
- }
754
-
755
- .ui-slider {
756
- position: relative;
757
- text-align: left;
758
- }
759
-
760
- .ui-slider .ui-slider-handle {
761
- position: absolute;
762
- z-index: 2;
763
- width: 1.2em;
764
- height: 1.2em;
765
- cursor: default;
766
- -ms-touch-action: none;
767
- touch-action: none;
768
- }
769
-
770
- .ui-slider .ui-slider-range {
771
- position: absolute;
772
- z-index: 1;
773
- font-size: .7em;
774
- display: block;
775
- border: 0;
776
- background-position: 0 0;
777
- }
778
-
779
- /* support: IE8 - See #6727 */
780
- .ui-slider.ui-state-disabled .ui-slider-handle,
781
- .ui-slider.ui-state-disabled .ui-slider-range {
782
- filter: inherit;
783
- }
784
-
785
- .ui-slider-horizontal {
786
- height: .8em;
787
- }
788
-
789
- .ui-slider-horizontal .ui-slider-handle {
790
- top: -.3em;
791
- margin-left: -.6em;
792
- }
793
-
794
- .ui-slider-horizontal .ui-slider-range {
795
- top: 0;
796
- height: 100%;
797
- }
798
-
799
- .ui-slider-horizontal .ui-slider-range-min {
800
- left: 0;
801
- }
802
-
803
- .ui-slider-horizontal .ui-slider-range-max {
804
- right: 0;
805
- }
806
-
807
- .ui-slider-vertical {
808
- width: .8em;
809
- height: 100px;
810
- }
811
-
812
- .ui-slider-vertical .ui-slider-handle {
813
- left: -.3em;
814
- margin-left: 0;
815
- margin-bottom: -.6em;
816
- }
817
-
818
- .ui-slider-vertical .ui-slider-range {
819
- left: 0;
820
- width: 100%;
821
- }
822
-
823
- .ui-slider-vertical .ui-slider-range-min {
824
- bottom: 0;
825
- }
826
-
827
- .ui-slider-vertical .ui-slider-range-max {
828
- top: 0;
829
- }
830
-
831
- .ui-sortable-handle {
832
- -ms-touch-action: none;
833
- touch-action: none;
834
- }
835
-
836
- .ui-spinner {
837
- position: relative;
838
- display: inline-block;
839
- overflow: hidden;
840
- padding: 0;
841
- vertical-align: middle;
842
- }
843
-
844
- .ui-spinner-input {
845
- border: none;
846
- background: none;
847
- color: inherit;
848
- padding: 0;
849
- margin: .2em 0;
850
- vertical-align: middle;
851
- margin-left: .4em;
852
- margin-right: 22px;
853
- }
854
-
855
- .ui-spinner-button {
856
- width: 16px;
857
- height: 50%;
858
- font-size: .5em;
859
- padding: 0;
860
- margin: 0;
861
- text-align: center;
862
- position: absolute;
863
- cursor: default;
864
- display: block;
865
- overflow: hidden;
866
- right: 0;
867
- }
868
-
869
- /* more specificity required here to override default borders */
870
- .ui-spinner a.ui-spinner-button {
871
- border-top: none;
872
- border-bottom: none;
873
- border-right: none;
874
- }
875
-
876
- /* vertically center icon */
877
- .ui-spinner .ui-icon {
878
- position: absolute;
879
- margin-top: -8px;
880
- top: 50%;
881
- left: 0;
882
- }
883
-
884
- .ui-spinner-up {
885
- top: 0;
886
- }
887
-
888
- .ui-spinner-down {
889
- bottom: 0;
890
- }
891
-
892
- /* TR overrides */
893
- .ui-spinner .ui-icon-triangle-1-s {
894
- /* need to fix icons sprite */
895
- background-position: -65px -16px;
896
- }
897
-
898
- .ui-tabs {
899
- position: relative; /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
900
- padding: .2em;
901
- }
902
-
903
- .ui-tabs .ui-tabs-nav {
904
- margin: 0;
905
- padding: .2em .2em 0;
906
- }
907
-
908
- .ui-tabs .ui-tabs-nav li {
909
- list-style: none;
910
- float: left;
911
- position: relative;
912
- top: 0;
913
- margin: 1px .2em 0 0;
914
- border-bottom-width: 0;
915
- padding: 0;
916
- white-space: nowrap;
917
- }
918
-
919
- .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
920
- float: left;
921
- padding: .5em 1em;
922
- text-decoration: none;
923
- }
924
-
925
- .ui-tabs .ui-tabs-nav li.ui-tabs-active {
926
- margin-bottom: -1px;
927
- padding-bottom: 1px;
928
- }
929
-
930
- .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
931
- .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
932
- .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
933
- cursor: text;
934
- }
935
-
936
- .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
937
- cursor: pointer;
938
- }
939
-
940
- .ui-tabs .ui-tabs-panel {
941
- display: block;
942
- border-width: 0;
943
- padding: 1em 1.4em;
944
- background: none;
945
- }
946
-
947
- .ui-tooltip {
948
- padding: 8px;
949
- position: absolute;
950
- z-index: 9999;
951
- max-width: 300px;
952
- -webkit-box-shadow: 0 0 5px #aaa;
953
- box-shadow: 0 0 5px #aaa;
954
- }
955
-
956
- body .ui-tooltip {
957
- border-width: 2px;
958
- }
959
-
960
- /* Component containers
961
- ----------------------------------*/
962
- .ui-widget {
963
- font-family: Verdana, Arial, sans-serif;
964
- font-size: 1.1em;
965
- }
966
-
967
- .ui-widget .ui-widget {
968
- font-size: 1em;
969
- }
970
-
971
- .ui-widget input,
972
- .ui-widget select,
973
- .ui-widget textarea,
974
- .ui-widget button {
975
- font-family: Verdana, Arial, sans-serif;
976
- font-size: 1em;
977
- }
978
-
979
- .ui-widget-content {
980
- border: 1px solid #aaaaaa;
981
- background: #ffffff url("../images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;
982
- color: #222222;
983
- }
984
-
985
- .ui-widget-content a {
986
- color: #222222;
987
- }
988
-
989
- .ui-widget-header {
990
- border: 1px solid #aaaaaa;
991
- background: #cccccc url("../images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
992
- color: #222222;
993
- font-weight: bold;
994
- }
995
-
996
- .ui-widget-header a {
997
- color: #222222;
998
- }
999
-
1000
- /* Interaction states
1001
- ----------------------------------*/
1002
- .ui-state-default,
1003
- .ui-widget-content .ui-state-default,
1004
- .ui-widget-header .ui-state-default {
1005
- border: 1px solid #d3d3d3;
1006
- background: #e6e6e6 url("../images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
1007
- font-weight: normal;
1008
- color: #555555;
1009
- }
1010
-
1011
- .ui-state-default a,
1012
- .ui-state-default a:link,
1013
- .ui-state-default a:visited {
1014
- color: #555555;
1015
- text-decoration: none;
1016
- }
1017
-
1018
- .ui-state-hover,
1019
- .ui-widget-content .ui-state-hover,
1020
- .ui-widget-header .ui-state-hover,
1021
- .ui-state-focus,
1022
- .ui-widget-content .ui-state-focus,
1023
- .ui-widget-header .ui-state-focus {
1024
- border: 1px solid #999999;
1025
- background: #dadada url("../images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
1026
- font-weight: normal;
1027
- color: #212121;
1028
- }
1029
-
1030
- .ui-state-hover a,
1031
- .ui-state-hover a:hover,
1032
- .ui-state-hover a:link,
1033
- .ui-state-hover a:visited,
1034
- .ui-state-focus a,
1035
- .ui-state-focus a:hover,
1036
- .ui-state-focus a:link,
1037
- .ui-state-focus a:visited {
1038
- color: #212121;
1039
- text-decoration: none;
1040
- }
1041
-
1042
- .ui-state-active,
1043
- .ui-widget-content .ui-state-active,
1044
- .ui-widget-header .ui-state-active {
1045
- border: 1px solid #aaaaaa;
1046
- background: #ffffff url("../images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
1047
- font-weight: normal;
1048
- color: #212121;
1049
- }
1050
-
1051
- .ui-state-active a,
1052
- .ui-state-active a:link,
1053
- .ui-state-active a:visited {
1054
- color: #212121;
1055
- text-decoration: none;
1056
- }
1057
-
1058
- /* Interaction Cues
1059
- ----------------------------------*/
1060
- .ui-state-highlight,
1061
- .ui-widget-content .ui-state-highlight,
1062
- .ui-widget-header .ui-state-highlight {
1063
- border: 1px solid #fcefa1;
1064
- background: #fbf9ee url("../images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
1065
- color: #363636;
1066
- }
1067
-
1068
- .ui-state-highlight a,
1069
- .ui-widget-content .ui-state-highlight a,
1070
- .ui-widget-header .ui-state-highlight a {
1071
- color: #363636;
1072
- }
1073
-
1074
- .ui-state-error,
1075
- .ui-widget-content .ui-state-error,
1076
- .ui-widget-header .ui-state-error {
1077
- border: 1px solid #cd0a0a;
1078
- background: #fef1ec url("../images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
1079
- color: #cd0a0a;
1080
- }
1081
-
1082
- .ui-state-error a,
1083
- .ui-widget-content .ui-state-error a,
1084
- .ui-widget-header .ui-state-error a {
1085
- color: #cd0a0a;
1086
- }
1087
-
1088
- .ui-state-error-text,
1089
- .ui-widget-content .ui-state-error-text,
1090
- .ui-widget-header .ui-state-error-text {
1091
- color: #cd0a0a;
1092
- }
1093
-
1094
- .ui-priority-primary,
1095
- .ui-widget-content .ui-priority-primary,
1096
- .ui-widget-header .ui-priority-primary {
1097
- font-weight: bold;
1098
- }
1099
-
1100
- .ui-priority-secondary,
1101
- .ui-widget-content .ui-priority-secondary,
1102
- .ui-widget-header .ui-priority-secondary {
1103
- opacity: .7;
1104
- filter: Alpha(Opacity=70); /* support: IE8 */
1105
- font-weight: normal;
1106
- }
1107
-
1108
- .ui-state-disabled,
1109
- .ui-widget-content .ui-state-disabled,
1110
- .ui-widget-header .ui-state-disabled {
1111
- opacity: .35;
1112
- filter: Alpha(Opacity=35); /* support: IE8 */
1113
- background-image: none;
1114
- }
1115
-
1116
- .ui-state-disabled .ui-icon {
1117
- filter: Alpha(Opacity=35); /* support: IE8 - See #6059 */
1118
- }
1119
-
1120
- /* Icons
1121
- ----------------------------------*/
1122
-
1123
- /* states and images */
1124
- .ui-icon {
1125
- width: 16px;
1126
- height: 16px;
1127
- }
1128
-
1129
- .ui-icon,
1130
- .ui-widget-content .ui-icon {
1131
- background-image: url("../images/ui-icons_222222_256x240.png");
1132
- }
1133
-
1134
- .ui-widget-header .ui-icon {
1135
- background-image: url("../images/ui-icons_222222_256x240.png");
1136
- }
1137
-
1138
- .ui-state-default .ui-icon {
1139
- background-image: url("../images/ui-icons_888888_256x240.png");
1140
- }
1141
-
1142
- .ui-state-hover .ui-icon,
1143
- .ui-state-focus .ui-icon {
1144
- background-image: url("../images/ui-icons_454545_256x240.png");
1145
- }
1146
-
1147
- .ui-state-active .ui-icon {
1148
- background-image: url("../images/ui-icons_454545_256x240.png");
1149
- }
1150
-
1151
- .ui-state-highlight .ui-icon {
1152
- background-image: url("../images/ui-icons_2e83ff_256x240.png");
1153
- }
1154
-
1155
- .ui-state-error .ui-icon,
1156
- .ui-state-error-text .ui-icon {
1157
- background-image: url("../images/ui-icons_cd0a0a_256x240.png");
1158
- }
1159
-
1160
- /* positioning */
1161
- .ui-icon-blank {
1162
- background-position: 16px 16px;
1163
- }
1164
-
1165
- .ui-icon-carat-1-n {
1166
- background-position: 0 0;
1167
- }
1168
-
1169
- .ui-icon-carat-1-ne {
1170
- background-position: -16px 0;
1171
- }
1172
-
1173
- .ui-icon-carat-1-e {
1174
- background-position: -32px 0;
1175
- }
1176
-
1177
- .ui-icon-carat-1-se {
1178
- background-position: -48px 0;
1179
- }
1180
-
1181
- .ui-icon-carat-1-s {
1182
- background-position: -64px 0;
1183
- }
1184
-
1185
- .ui-icon-carat-1-sw {
1186
- background-position: -80px 0;
1187
- }
1188
-
1189
- .ui-icon-carat-1-w {
1190
- background-position: -96px 0;
1191
- }
1192
-
1193
- .ui-icon-carat-1-nw {
1194
- background-position: -112px 0;
1195
- }
1196
-
1197
- .ui-icon-carat-2-n-s {
1198
- background-position: -128px 0;
1199
- }
1200
-
1201
- .ui-icon-carat-2-e-w {
1202
- background-position: -144px 0;
1203
- }
1204
-
1205
- .ui-icon-triangle-1-n {
1206
- background-position: 0 -16px;
1207
- }
1208
-
1209
- .ui-icon-triangle-1-ne {
1210
- background-position: -16px -16px;
1211
- }
1212
-
1213
- .ui-icon-triangle-1-e {
1214
- background-position: -32px -16px;
1215
- }
1216
-
1217
- .ui-icon-triangle-1-se {
1218
- background-position: -48px -16px;
1219
- }
1220
-
1221
- .ui-icon-triangle-1-s {
1222
- background-position: -64px -16px;
1223
- }
1224
-
1225
- .ui-icon-triangle-1-sw {
1226
- background-position: -80px -16px;
1227
- }
1228
-
1229
- .ui-icon-triangle-1-w {
1230
- background-position: -96px -16px;
1231
- }
1232
-
1233
- .ui-icon-triangle-1-nw {
1234
- background-position: -112px -16px;
1235
- }
1236
-
1237
- .ui-icon-triangle-2-n-s {
1238
- background-position: -128px -16px;
1239
- }
1240
-
1241
- .ui-icon-triangle-2-e-w {
1242
- background-position: -144px -16px;
1243
- }
1244
-
1245
- .ui-icon-arrow-1-n {
1246
- background-position: 0 -32px;
1247
- }
1248
-
1249
- .ui-icon-arrow-1-ne {
1250
- background-position: -16px -32px;
1251
- }
1252
-
1253
- .ui-icon-arrow-1-e {
1254
- background-position: -32px -32px;
1255
- }
1256
-
1257
- .ui-icon-arrow-1-se {
1258
- background-position: -48px -32px;
1259
- }
1260
-
1261
- .ui-icon-arrow-1-s {
1262
- background-position: -64px -32px;
1263
- }
1264
-
1265
- .ui-icon-arrow-1-sw {
1266
- background-position: -80px -32px;
1267
- }
1268
-
1269
- .ui-icon-arrow-1-w {
1270
- background-position: -96px -32px;
1271
- }
1272
-
1273
- .ui-icon-arrow-1-nw {
1274
- background-position: -112px -32px;
1275
- }
1276
-
1277
- .ui-icon-arrow-2-n-s {
1278
- background-position: -128px -32px;
1279
- }
1280
-
1281
- .ui-icon-arrow-2-ne-sw {
1282
- background-position: -144px -32px;
1283
- }
1284
-
1285
- .ui-icon-arrow-2-e-w {
1286
- background-position: -160px -32px;
1287
- }
1288
-
1289
- .ui-icon-arrow-2-se-nw {
1290
- background-position: -176px -32px;
1291
- }
1292
-
1293
- .ui-icon-arrowstop-1-n {
1294
- background-position: -192px -32px;
1295
- }
1296
-
1297
- .ui-icon-arrowstop-1-e {
1298
- background-position: -208px -32px;
1299
- }
1300
-
1301
- .ui-icon-arrowstop-1-s {
1302
- background-position: -224px -32px;
1303
- }
1304
-
1305
- .ui-icon-arrowstop-1-w {
1306
- background-position: -240px -32px;
1307
- }
1308
-
1309
- .ui-icon-arrowthick-1-n {
1310
- background-position: 0 -48px;
1311
- }
1312
-
1313
- .ui-icon-arrowthick-1-ne {
1314
- background-position: -16px -48px;
1315
- }
1316
-
1317
- .ui-icon-arrowthick-1-e {
1318
- background-position: -32px -48px;
1319
- }
1320
-
1321
- .ui-icon-arrowthick-1-se {
1322
- background-position: -48px -48px;
1323
- }
1324
-
1325
- .ui-icon-arrowthick-1-s {
1326
- background-position: -64px -48px;
1327
- }
1328
-
1329
- .ui-icon-arrowthick-1-sw {
1330
- background-position: -80px -48px;
1331
- }
1332
-
1333
- .ui-icon-arrowthick-1-w {
1334
- background-position: -96px -48px;
1335
- }
1336
-
1337
- .ui-icon-arrowthick-1-nw {
1338
- background-position: -112px -48px;
1339
- }
1340
-
1341
- .ui-icon-arrowthick-2-n-s {
1342
- background-position: -128px -48px;
1343
- }
1344
-
1345
- .ui-icon-arrowthick-2-ne-sw {
1346
- background-position: -144px -48px;
1347
- }
1348
-
1349
- .ui-icon-arrowthick-2-e-w {
1350
- background-position: -160px -48px;
1351
- }
1352
-
1353
- .ui-icon-arrowthick-2-se-nw {
1354
- background-position: -176px -48px;
1355
- }
1356
-
1357
- .ui-icon-arrowthickstop-1-n {
1358
- background-position: -192px -48px;
1359
- }
1360
-
1361
- .ui-icon-arrowthickstop-1-e {
1362
- background-position: -208px -48px;
1363
- }
1364
-
1365
- .ui-icon-arrowthickstop-1-s {
1366
- background-position: -224px -48px;
1367
- }
1368
-
1369
- .ui-icon-arrowthickstop-1-w {
1370
- background-position: -240px -48px;
1371
- }
1372
-
1373
- .ui-icon-arrowreturnthick-1-w {
1374
- background-position: 0 -64px;
1375
- }
1376
-
1377
- .ui-icon-arrowreturnthick-1-n {
1378
- background-position: -16px -64px;
1379
- }
1380
-
1381
- .ui-icon-arrowreturnthick-1-e {
1382
- background-position: -32px -64px;
1383
- }
1384
-
1385
- .ui-icon-arrowreturnthick-1-s {
1386
- background-position: -48px -64px;
1387
- }
1388
-
1389
- .ui-icon-arrowreturn-1-w {
1390
- background-position: -64px -64px;
1391
- }
1392
-
1393
- .ui-icon-arrowreturn-1-n {
1394
- background-position: -80px -64px;
1395
- }
1396
-
1397
- .ui-icon-arrowreturn-1-e {
1398
- background-position: -96px -64px;
1399
- }
1400
-
1401
- .ui-icon-arrowreturn-1-s {
1402
- background-position: -112px -64px;
1403
- }
1404
-
1405
- .ui-icon-arrowrefresh-1-w {
1406
- background-position: -128px -64px;
1407
- }
1408
-
1409
- .ui-icon-arrowrefresh-1-n {
1410
- background-position: -144px -64px;
1411
- }
1412
-
1413
- .ui-icon-arrowrefresh-1-e {
1414
- background-position: -160px -64px;
1415
- }
1416
-
1417
- .ui-icon-arrowrefresh-1-s {
1418
- background-position: -176px -64px;
1419
- }
1420
-
1421
- .ui-icon-arrow-4 {
1422
- background-position: 0 -80px;
1423
- }
1424
-
1425
- .ui-icon-arrow-4-diag {
1426
- background-position: -16px -80px;
1427
- }
1428
-
1429
- .ui-icon-extlink {
1430
- background-position: -32px -80px;
1431
- }
1432
-
1433
- .ui-icon-newwin {
1434
- background-position: -48px -80px;
1435
- }
1436
-
1437
- .ui-icon-refresh {
1438
- background-position: -64px -80px;
1439
- }
1440
-
1441
- .ui-icon-shuffle {
1442
- background-position: -80px -80px;
1443
- }
1444
-
1445
- .ui-icon-transfer-e-w {
1446
- background-position: -96px -80px;
1447
- }
1448
-
1449
- .ui-icon-transferthick-e-w {
1450
- background-position: -112px -80px;
1451
- }
1452
-
1453
- .ui-icon-folder-collapsed {
1454
- background-position: 0 -96px;
1455
- }
1456
-
1457
- .ui-icon-folder-open {
1458
- background-position: -16px -96px;
1459
- }
1460
-
1461
- .ui-icon-document {
1462
- background-position: -32px -96px;
1463
- }
1464
-
1465
- .ui-icon-document-b {
1466
- background-position: -48px -96px;
1467
- }
1468
-
1469
- .ui-icon-note {
1470
- background-position: -64px -96px;
1471
- }
1472
-
1473
- .ui-icon-mail-closed {
1474
- background-position: -80px -96px;
1475
- }
1476
-
1477
- .ui-icon-mail-open {
1478
- background-position: -96px -96px;
1479
- }
1480
-
1481
- .ui-icon-suitcase {
1482
- background-position: -112px -96px;
1483
- }
1484
-
1485
- .ui-icon-comment {
1486
- background-position: -128px -96px;
1487
- }
1488
-
1489
- .ui-icon-person {
1490
- background-position: -144px -96px;
1491
- }
1492
-
1493
- .ui-icon-print {
1494
- background-position: -160px -96px;
1495
- }
1496
-
1497
- .ui-icon-trash {
1498
- background-position: -176px -96px;
1499
- }
1500
-
1501
- .ui-icon-locked {
1502
- background-position: -192px -96px;
1503
- }
1504
-
1505
- .ui-icon-unlocked {
1506
- background-position: -208px -96px;
1507
- }
1508
-
1509
- .ui-icon-bookmark {
1510
- background-position: -224px -96px;
1511
- }
1512
-
1513
- .ui-icon-tag {
1514
- background-position: -240px -96px;
1515
- }
1516
-
1517
- .ui-icon-home {
1518
- background-position: 0 -112px;
1519
- }
1520
-
1521
- .ui-icon-flag {
1522
- background-position: -16px -112px;
1523
- }
1524
-
1525
- .ui-icon-calendar {
1526
- background-position: -32px -112px;
1527
- }
1528
-
1529
- .ui-icon-cart {
1530
- background-position: -48px -112px;
1531
- }
1532
-
1533
- .ui-icon-pencil {
1534
- background-position: -64px -112px;
1535
- }
1536
-
1537
- .ui-icon-clock {
1538
- background-position: -80px -112px;
1539
- }
1540
-
1541
- .ui-icon-disk {
1542
- background-position: -96px -112px;
1543
- }
1544
-
1545
- .ui-icon-calculator {
1546
- background-position: -112px -112px;
1547
- }
1548
-
1549
- .ui-icon-zoomin {
1550
- background-position: -128px -112px;
1551
- }
1552
-
1553
- .ui-icon-zoomout {
1554
- background-position: -144px -112px;
1555
- }
1556
-
1557
- .ui-icon-search {
1558
- background-position: -160px -112px;
1559
- }
1560
-
1561
- .ui-icon-wrench {
1562
- background-position: -176px -112px;
1563
- }
1564
-
1565
- .ui-icon-gear {
1566
- background-position: -192px -112px;
1567
- }
1568
-
1569
- .ui-icon-heart {
1570
- background-position: -208px -112px;
1571
- }
1572
-
1573
- .ui-icon-star {
1574
- background-position: -224px -112px;
1575
- }
1576
-
1577
- .ui-icon-link {
1578
- background-position: -240px -112px;
1579
- }
1580
-
1581
- .ui-icon-cancel {
1582
- background-position: 0 -128px;
1583
- }
1584
-
1585
- .ui-icon-plus {
1586
- background-position: -16px -128px;
1587
- }
1588
-
1589
- .ui-icon-plusthick {
1590
- background-position: -32px -128px;
1591
- }
1592
-
1593
- .ui-icon-minus {
1594
- background-position: -48px -128px;
1595
- }
1596
-
1597
- .ui-icon-minusthick {
1598
- background-position: -64px -128px;
1599
- }
1600
-
1601
- .ui-icon-close {
1602
- background-position: -80px -128px;
1603
- }
1604
-
1605
- .ui-icon-closethick {
1606
- background-position: -96px -128px;
1607
- }
1608
-
1609
- .ui-icon-key {
1610
- background-position: -112px -128px;
1611
- }
1612
-
1613
- .ui-icon-lightbulb {
1614
- background-position: -128px -128px;
1615
- }
1616
-
1617
- .ui-icon-scissors {
1618
- background-position: -144px -128px;
1619
- }
1620
-
1621
- .ui-icon-clipboard {
1622
- background-position: -160px -128px;
1623
- }
1624
-
1625
- .ui-icon-copy {
1626
- background-position: -176px -128px;
1627
- }
1628
-
1629
- .ui-icon-contact {
1630
- background-position: -192px -128px;
1631
- }
1632
-
1633
- .ui-icon-image {
1634
- background-position: -208px -128px;
1635
- }
1636
-
1637
- .ui-icon-video {
1638
- background-position: -224px -128px;
1639
- }
1640
-
1641
- .ui-icon-script {
1642
- background-position: -240px -128px;
1643
- }
1644
-
1645
- .ui-icon-alert {
1646
- background-position: 0 -144px;
1647
- }
1648
-
1649
- .ui-icon-info {
1650
- background-position: -16px -144px;
1651
- }
1652
-
1653
- .ui-icon-notice {
1654
- background-position: -32px -144px;
1655
- }
1656
-
1657
- .ui-icon-help {
1658
- background-position: -48px -144px;
1659
- }
1660
-
1661
- .ui-icon-check {
1662
- background-position: -64px -144px;
1663
- }
1664
-
1665
- .ui-icon-bullet {
1666
- background-position: -80px -144px;
1667
- }
1668
-
1669
- .ui-icon-radio-on {
1670
- background-position: -96px -144px;
1671
- }
1672
-
1673
- .ui-icon-radio-off {
1674
- background-position: -112px -144px;
1675
- }
1676
-
1677
- .ui-icon-pin-w {
1678
- background-position: -128px -144px;
1679
- }
1680
-
1681
- .ui-icon-pin-s {
1682
- background-position: -144px -144px;
1683
- }
1684
-
1685
- .ui-icon-play {
1686
- background-position: 0 -160px;
1687
- }
1688
-
1689
- .ui-icon-pause {
1690
- background-position: -16px -160px;
1691
- }
1692
-
1693
- .ui-icon-seek-next {
1694
- background-position: -32px -160px;
1695
- }
1696
-
1697
- .ui-icon-seek-prev {
1698
- background-position: -48px -160px;
1699
- }
1700
-
1701
- .ui-icon-seek-end {
1702
- background-position: -64px -160px;
1703
- }
1704
-
1705
- .ui-icon-seek-start {
1706
- background-position: -80px -160px;
1707
- }
1708
-
1709
- /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
1710
- .ui-icon-seek-first {
1711
- background-position: -80px -160px;
1712
- }
1713
-
1714
- .ui-icon-stop {
1715
- background-position: -96px -160px;
1716
- }
1717
-
1718
- .ui-icon-eject {
1719
- background-position: -112px -160px;
1720
- }
1721
-
1722
- .ui-icon-volume-off {
1723
- background-position: -128px -160px;
1724
- }
1725
-
1726
- .ui-icon-volume-on {
1727
- background-position: -144px -160px;
1728
- }
1729
-
1730
- .ui-icon-power {
1731
- background-position: 0 -176px;
1732
- }
1733
-
1734
- .ui-icon-signal-diag {
1735
- background-position: -16px -176px;
1736
- }
1737
-
1738
- .ui-icon-signal {
1739
- background-position: -32px -176px;
1740
- }
1741
-
1742
- .ui-icon-battery-0 {
1743
- background-position: -48px -176px;
1744
- }
1745
-
1746
- .ui-icon-battery-1 {
1747
- background-position: -64px -176px;
1748
- }
1749
-
1750
- .ui-icon-battery-2 {
1751
- background-position: -80px -176px;
1752
- }
1753
-
1754
- .ui-icon-battery-3 {
1755
- background-position: -96px -176px;
1756
- }
1757
-
1758
- .ui-icon-circle-plus {
1759
- background-position: 0 -192px;
1760
- }
1761
-
1762
- .ui-icon-circle-minus {
1763
- background-position: -16px -192px;
1764
- }
1765
-
1766
- .ui-icon-circle-close {
1767
- background-position: -32px -192px;
1768
- }
1769
-
1770
- .ui-icon-circle-triangle-e {
1771
- background-position: -48px -192px;
1772
- }
1773
-
1774
- .ui-icon-circle-triangle-s {
1775
- background-position: -64px -192px;
1776
- }
1777
-
1778
- .ui-icon-circle-triangle-w {
1779
- background-position: -80px -192px;
1780
- }
1781
-
1782
- .ui-icon-circle-triangle-n {
1783
- background-position: -96px -192px;
1784
- }
1785
-
1786
- .ui-icon-circle-arrow-e {
1787
- background-position: -112px -192px;
1788
- }
1789
-
1790
- .ui-icon-circle-arrow-s {
1791
- background-position: -128px -192px;
1792
- }
1793
-
1794
- .ui-icon-circle-arrow-w {
1795
- background-position: -144px -192px;
1796
- }
1797
-
1798
- .ui-icon-circle-arrow-n {
1799
- background-position: -160px -192px;
1800
- }
1801
-
1802
- .ui-icon-circle-zoomin {
1803
- background-position: -176px -192px;
1804
- }
1805
-
1806
- .ui-icon-circle-zoomout {
1807
- background-position: -192px -192px;
1808
- }
1809
-
1810
- .ui-icon-circle-check {
1811
- background-position: -208px -192px;
1812
- }
1813
-
1814
- .ui-icon-circlesmall-plus {
1815
- background-position: 0 -208px;
1816
- }
1817
-
1818
- .ui-icon-circlesmall-minus {
1819
- background-position: -16px -208px;
1820
- }
1821
-
1822
- .ui-icon-circlesmall-close {
1823
- background-position: -32px -208px;
1824
- }
1825
-
1826
- .ui-icon-squaresmall-plus {
1827
- background-position: -48px -208px;
1828
- }
1829
-
1830
- .ui-icon-squaresmall-minus {
1831
- background-position: -64px -208px;
1832
- }
1833
-
1834
- .ui-icon-squaresmall-close {
1835
- background-position: -80px -208px;
1836
- }
1837
-
1838
- .ui-icon-grip-dotted-vertical {
1839
- background-position: 0 -224px;
1840
- }
1841
-
1842
- .ui-icon-grip-dotted-horizontal {
1843
- background-position: -16px -224px;
1844
- }
1845
-
1846
- .ui-icon-grip-solid-vertical {
1847
- background-position: -32px -224px;
1848
- }
1849
-
1850
- .ui-icon-grip-solid-horizontal {
1851
- background-position: -48px -224px;
1852
- }
1853
-
1854
- .ui-icon-gripsmall-diagonal-se {
1855
- background-position: -64px -224px;
1856
- }
1857
-
1858
- .ui-icon-grip-diagonal-se {
1859
- background-position: -80px -224px;
1860
- }
1861
-
1862
- /* Misc visuals
1863
- ----------------------------------*/
1864
-
1865
- /* Corner radius */
1866
- .ui-corner-all,
1867
- .ui-corner-top,
1868
- .ui-corner-left,
1869
- .ui-corner-tl {
1870
- border-top-left-radius: 4px;
1871
- }
1872
-
1873
- .ui-corner-all,
1874
- .ui-corner-top,
1875
- .ui-corner-right,
1876
- .ui-corner-tr {
1877
- border-top-right-radius: 4px;
1878
- }
1879
-
1880
- .ui-corner-all,
1881
- .ui-corner-bottom,
1882
- .ui-corner-left,
1883
- .ui-corner-bl {
1884
- border-bottom-left-radius: 4px;
1885
- }
1886
-
1887
- .ui-corner-all,
1888
- .ui-corner-bottom,
1889
- .ui-corner-right,
1890
- .ui-corner-br {
1891
- border-bottom-right-radius: 4px;
1892
- }
1893
-
1894
- /* Overlays */
1895
- .ui-widget-overlay {
1896
- background: #aaaaaa url("../images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
1897
- opacity: .3;
1898
- filter: Alpha(Opacity=30); /* support: IE8 */
1899
- }
1900
-
1901
- .ui-widget-shadow {
1902
- margin: -8px 0 0 -8px;
1903
- padding: 8px;
1904
- background: #aaaaaa url("../images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;
1905
- opacity: .3;
1906
- filter: Alpha(Opacity=30); /* support: IE8 */
1907
- border-radius: 8px;
1908
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/log.css CHANGED
@@ -166,14 +166,14 @@
166
  }
167
 
168
  .log-item {
169
- border-bottom: 1px solid #D3CDCD;
170
  border-top: 1px solid #FFFFFF;
171
  min-height: 46px;
172
  padding: 3px 7px;
173
  }
174
 
175
  .log-item:hover {
176
- background: none repeat scroll 0 0 #EEEEEE;
177
  }
178
 
179
  .show-map {
@@ -271,13 +271,6 @@
271
  direction: ltr;
272
  }
273
 
274
- #browsers-log {
275
- direction: ltr;
276
- height: 330px;
277
- margin: 0 auto;
278
- width: 100%;
279
- }
280
-
281
  #platform-log {
282
  direction: ltr;
283
  }
@@ -334,4 +327,22 @@
334
 
335
  .ui-sortable {
336
  min-height: 100px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  }
166
  }
167
 
168
  .log-item {
169
+ border-bottom: 1px solid #efeeee;
170
  border-top: 1px solid #FFFFFF;
171
  min-height: 46px;
172
  padding: 3px 7px;
173
  }
174
 
175
  .log-item:hover {
176
+ background: none repeat scroll 0 0 #f7f7f7;
177
  }
178
 
179
  .show-map {
271
  direction: ltr;
272
  }
273
 
 
 
 
 
 
 
 
274
  #platform-log {
275
  direction: ltr;
276
  }
327
 
328
  .ui-sortable {
329
  min-height: 100px;
330
+ }
331
+
332
+ .table-stats tr, .table-stats td {
333
+ border-bottom: 1px solid #efeeee;
334
+ background-color: white;
335
+ }
336
+
337
+ .table-stats tr:first-child td {
338
+ border: 0px none;
339
+ text-align: left;
340
+ }
341
+
342
+ .rtl .table-stats tr, .rtl .table-stats td {
343
+ text-align: right !important;
344
+ }
345
+
346
+ .table-stats {
347
+ border: 0px none !important;
348
  }
assets/css/log.min.css DELETED
@@ -1 +0,0 @@
1
- @media print{#wpadminbar,#adminmenuback,#adminmenuwrap,#show-settings-link{display:none}#wpcontent,#wpfooter{margin-left:0}}#wps-postbox-container-1{width:30%;float:left}#wps-postbox-container-2{margin:0 0 0 1%;width:68%;float:right}@media screen and (max-width:960px){#wps-postbox-container-1{width:35%}#wps-postbox-container-2{margin:0 0 0 1%;width:63%}}@media screen and (max-width:758px){#wps-postbox-container-1{width:100%}#wps-postbox-container-2{margin:0 0 0 1%;width:100%}}@media screen and (max-width:524px){#wps-postbox-container-1{width:100%}#wps-postbox-container-2{margin:0 0 0 1%;width:100%}}#last-log{width:100%;direction:ltr}#wps-postbox-container-1 a,#wps-postbox-container-2 a,#last-log a{text-decoration:none}#summary-stats{background:none repeat scroll 0 0 rgba(0,0,0,0);border:1px none;margin:0 0 10px}#summary-stats tr:first-child th{border-top:0 none}#summary-stats span{color:#21759b !important;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:21px}#post-stats{border:0}#th-colspan{text-align:center}#th-colspan span{color:#459605 !important;font-size:30px}#last-visitor tr{text-align:center}#last-visitor tr:first-child{background:none repeat scroll 0 0 #eee;font-weight:bold;text-align:center}#last-search tr{text-align:center}#last-search tr:first-child{background:none repeat scroll 0 0 #eee;font-weight:bold;text-align:center}#last-referrer tr{text-align:left}#last-referrer tr:first-child{background:none repeat scroll 0 0 #eee;font-weight:bold;text-align:center}.th-center{text-align:center !important}.td-align{text-align:left}.td-url{color:#009936 !important;direction:ltr;font-size:10px !important;text-align:left;white-space:nowrap}#map_canvas{direction:ltr;height:380px;width:100%}.map-html-marker{max-height:170px;width:200px}.map-html-marker p{border-bottom:1px dashed #efefef;font-size:10px;margin:2px 0;padding:3px 0;text-align:left}.map-html-marker p:last-child{border-bottom:0 none}.log-item{border-bottom:1px solid #d3cdcd;border-top:1px solid #fff;min-height:46px;padding:3px 7px}.log-item:hover{background:none repeat scroll 0 0 #eee}.show-map{float:left}.log-referred{float:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:auto}.log-page-title{float:left;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:100%}.log-ip{direction:ltr;float:right;font-size:10px;margin-bottom:5px;white-space:pre;overflow:hidden;text-overflow:ellipsis;text-align:right}.log-tools{float:left;margin:0 2px}.log-agent{float:left}.log-url{direction:ltr;float:left;font-size:10px;margin:0 0 0 2px;white-space:nowrap;width:100%;overflow:hidden;text-overflow:ellipsis}#wp_statistics_editor_meta_box,#wp-statistics-browsers-widget,#wp-statistics-countries-widget,#wp-statistics-hitsmap-widget,#wp-statistics-hits-widget,#wp-statistics-pages-widget,#wp-statistics-recent-widget,#wp-statistics-referring-widget,#wp-statistics-search-widget,#wp-statistics-summary-widget,#wp-statistics-words-widget,#wp-statistics-top-visitors-widget,#wps_hits_postbox,#wps_top_visitors_postbox,#wps_search_postbox,#wps_words_postbox,#wps_recent_postbox,#wps_map_postbox,#wps_pages_postbox,#wps_summary_postbox,#wps_browsers_postbox,#wps_referring_postbox,#wps_countries_postbox{overflow:hidden}#time_zone a{font-size:11px;text-decoration:none}#visits-log{direction:ltr;height:290px;width:100%}#search-engine-log{direction:ltr}#browsers-log{direction:ltr;height:330px;margin:0 auto;width:100%}#platform-log{direction:ltr}#visits-stats{direction:ltr}#exclusion-stats{direction:ltr}#search-stats{direction:ltr}#page-stats{direction:ltr}#about-links{margin:0 0 10px}#about-links p{display:inline;font-size:11px;margin:0 2px}.left-div{float:left}.right-div{float:right}#donate-text{float:left}#donate-button{float:right;margin:12px 0 0}.jqvmap-label{z-index:10000}.ui-sortable{min-height:100px}
 
assets/css/pagination.min.css DELETED
@@ -1 +0,0 @@
1
- .pagination-log{border-top:1px solid #f2f2f2;direction:ltr;padding:14px 0 0;text-align:center}.pageOn{background:none repeat scroll 0 0 #4dcdff;border:1px solid #60a8ff;border-radius:4px;box-shadow:0 1px 0 #c8e8ff inset;color:#fff4f4;margin:2px;padding:5px 10px}.pageOff{background:none repeat scroll 0 0 #fff;border:1px solid #dadada;border-radius:4px;color:#aaa;margin:2px;padding:5px 9px;text-shadow:1px 1px #fff}.pageOff a{box-shadow:0 1px 0 #fff inset;color:#aaa;padding:5px 8px}.paginationSelect{background:none repeat scroll 0 0 #eee}.paginationErrors{background:none repeat scroll 0 0 #fd9;border:2px dashed #d90;clear:both;color:#a40;margin:40px auto;padding:10px;text-align:left;width:70%}#result-log{color:#148e00;direction:rtl;font-weight:bold}
 
assets/css/rtl.min.css DELETED
@@ -1 +0,0 @@
1
- #left-log{margin:0 1% 0 0}.td-align{text-align:right}.log-referred{float:right}.log-ip{float:left}#last-log{direction:rtl}.ui-widget,.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:tahoma}.ui-tabs .ui-tabs-nav li{float:right}.jqvmap-label{direction:ltr}.jqplot-table-legend,.jqplot-highlighter-tooltip{direction:rtl;font-family:tahoma}#donate-text{float:right}#donate-button{float:left}.left-div{float:right}.right-div{float:left}
 
assets/css/style.min.css DELETED
@@ -1 +0,0 @@
1
- .note{color:red;font-size:11px !important;font-weight:bold}.data{border-top:1px solid #cfcdcd;font-size:11px !important;padding:5px 0 0}.data code{border-radius:2px 2px 2px 2px}
 
assets/images/flags/BL.png ADDED
Binary file
assets/images/flags/CW.png ADDED
Binary file
assets/images/flags/LC.png ADDED
Binary file
assets/images/flags/MF.png ADDED
Binary file
assets/images/flags/TM.png ADDED
Binary file
assets/images/flags/XK.png ADDED
Binary file
assets/images/flags/YT.png ADDED
Binary file
assets/jqplot/jquery.jqplot.css DELETED
@@ -1,259 +0,0 @@
1
- /*rules for the plot target div. These will be cascaded down to all plot elements according to css rules*/
2
- .jqplot-target {
3
- position: relative;
4
- color: #666666;
5
- font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
6
- font-size: 1em;
7
- /* height: 300px;
8
- width: 400px;*/
9
- }
10
-
11
- /*rules applied to all axes*/
12
- .jqplot-axis {
13
- font-size: 0.75em;
14
- }
15
-
16
- .jqplot-xaxis {
17
- margin-top: 10px;
18
- }
19
-
20
- .jqplot-x2axis {
21
- margin-bottom: 10px;
22
- }
23
-
24
- .jqplot-yaxis {
25
- margin-right: 10px;
26
- }
27
-
28
- .jqplot-y2axis, .jqplot-y3axis, .jqplot-y4axis, .jqplot-y5axis, .jqplot-y6axis, .jqplot-y7axis, .jqplot-y8axis, .jqplot-y9axis, .jqplot-yMidAxis {
29
- margin-left: 10px;
30
- margin-right: 10px;
31
- }
32
-
33
- /*rules applied to all axis tick divs*/
34
- .jqplot-axis-tick, .jqplot-xaxis-tick, .jqplot-yaxis-tick, .jqplot-x2axis-tick, .jqplot-y2axis-tick, .jqplot-y3axis-tick, .jqplot-y4axis-tick, .jqplot-y5axis-tick, .jqplot-y6axis-tick, .jqplot-y7axis-tick, .jqplot-y8axis-tick, .jqplot-y9axis-tick, .jqplot-yMidAxis-tick {
35
- position: absolute;
36
- white-space: pre;
37
- }
38
-
39
-
40
- .jqplot-xaxis-tick {
41
- top: 0px;
42
- /* initial position untill tick is drawn in proper place */
43
- left: 15px;
44
- /* padding-top: 10px;*/
45
- vertical-align: top;
46
- }
47
-
48
- .jqplot-x2axis-tick {
49
- bottom: 0px;
50
- /* initial position untill tick is drawn in proper place */
51
- left: 15px;
52
- /* padding-bottom: 10px;*/
53
- vertical-align: bottom;
54
- }
55
-
56
- .jqplot-yaxis-tick {
57
- right: 0px;
58
- /* initial position untill tick is drawn in proper place */
59
- top: 15px;
60
- /* padding-right: 10px;*/
61
- text-align: right;
62
- }
63
-
64
- .jqplot-yaxis-tick.jqplot-breakTick {
65
- right: -20px;
66
- margin-right: 0px;
67
- padding:1px 5px 1px 5px;
68
- /*background-color: white;*/
69
- z-index: 2;
70
- font-size: 1.5em;
71
- }
72
-
73
- .jqplot-y2axis-tick, .jqplot-y3axis-tick, .jqplot-y4axis-tick, .jqplot-y5axis-tick, .jqplot-y6axis-tick, .jqplot-y7axis-tick, .jqplot-y8axis-tick, .jqplot-y9axis-tick {
74
- left: 0px;
75
- /* initial position untill tick is drawn in proper place */
76
- top: 15px;
77
- /* padding-left: 10px;*/
78
- /* padding-right: 15px;*/
79
- text-align: left;
80
- }
81
-
82
- .jqplot-yMidAxis-tick {
83
- text-align: center;
84
- white-space: nowrap;
85
- }
86
-
87
- .jqplot-xaxis-label {
88
- margin-top: 10px;
89
- font-size: 11pt;
90
- position: absolute;
91
- }
92
-
93
- .jqplot-x2axis-label {
94
- margin-bottom: 10px;
95
- font-size: 11pt;
96
- position: absolute;
97
- }
98
-
99
- .jqplot-yaxis-label {
100
- margin-right: 10px;
101
- /* text-align: center;*/
102
- font-size: 11pt;
103
- position: absolute;
104
- }
105
-
106
- .jqplot-yMidAxis-label {
107
- font-size: 11pt;
108
- position: absolute;
109
- }
110
-
111
- .jqplot-y2axis-label, .jqplot-y3axis-label, .jqplot-y4axis-label, .jqplot-y5axis-label, .jqplot-y6axis-label, .jqplot-y7axis-label, .jqplot-y8axis-label, .jqplot-y9axis-label {
112
- /* text-align: center;*/
113
- font-size: 11pt;
114
- margin-left: 10px;
115
- position: absolute;
116
- }
117
-
118
- .jqplot-meterGauge-tick {
119
- font-size: 0.75em;
120
- color: #999999;
121
- }
122
-
123
- .jqplot-meterGauge-label {
124
- font-size: 1em;
125
- color: #999999;
126
- }
127
-
128
- table.jqplot-table-legend {
129
- margin-top: 12px;
130
- margin-bottom: 12px;
131
- margin-left: 12px;
132
- margin-right: 12px;
133
- }
134
-
135
- table.jqplot-table-legend, table.jqplot-cursor-legend {
136
- background-color: rgba(255,255,255,0.6);
137
- border: 1px solid #cccccc;
138
- position: absolute;
139
- font-size: 0.75em;
140
- }
141
-
142
- td.jqplot-table-legend {
143
- vertical-align:middle;
144
- }
145
-
146
- /*
147
- These rules could be used instead of assigning
148
- element styles and relying on js object properties.
149
- */
150
-
151
- /*
152
- td.jqplot-table-legend-swatch {
153
- padding-top: 0.5em;
154
- text-align: center;
155
- }
156
-
157
- tr.jqplot-table-legend:first td.jqplot-table-legend-swatch {
158
- padding-top: 0px;
159
- }
160
- */
161
-
162
- td.jqplot-seriesToggle:hover, td.jqplot-seriesToggle:active {
163
- cursor: pointer;
164
- }
165
-
166
- .jqplot-table-legend .jqplot-series-hidden {
167
- text-decoration: line-through;
168
- }
169
-
170
- div.jqplot-table-legend-swatch-outline {
171
- border: 1px solid #cccccc;
172
- padding:1px;
173
- }
174
-
175
- div.jqplot-table-legend-swatch {
176
- width:0px;
177
- height:0px;
178
- border-top-width: 5px;
179
- border-bottom-width: 5px;
180
- border-left-width: 6px;
181
- border-right-width: 6px;
182
- border-top-style: solid;
183
- border-bottom-style: solid;
184
- border-left-style: solid;
185
- border-right-style: solid;
186
- }
187
-
188
- .jqplot-title {
189
- top: 0px;
190
- left: 0px;
191
- padding-bottom: 0.5em;
192
- font-size: 1.2em;
193
- }
194
-
195
- table.jqplot-cursor-tooltip {
196
- border: 1px solid #cccccc;
197
- font-size: 0.75em;
198
- }
199
-
200
-
201
- .jqplot-cursor-tooltip {
202
- border: 1px solid #cccccc;
203
- font-size: 0.75em;
204
- white-space: nowrap;
205
- background: rgba(208,208,208,0.5);
206
- padding: 1px;
207
- }
208
-
209
- .jqplot-highlighter-tooltip, .jqplot-canvasOverlay-tooltip {
210
- border: 1px solid #cccccc;
211
- font-size: 0.75em;
212
- white-space: nowrap;
213
- background: rgba(208,208,208,0.5);
214
- padding: 1px;
215
- }
216
-
217
- .jqplot-point-label {
218
- font-size: 0.75em;
219
- z-index: 2;
220
- }
221
-
222
- td.jqplot-cursor-legend-swatch {
223
- vertical-align: middle;
224
- text-align: center;
225
- }
226
-
227
- div.jqplot-cursor-legend-swatch {
228
- width: 1.2em;
229
- height: 0.7em;
230
- }
231
-
232
- .jqplot-error {
233
- /* Styles added to the plot target container when there is an error go here.*/
234
- text-align: center;
235
- }
236
-
237
- .jqplot-error-message {
238
- /* Styling of the custom error message div goes here.*/
239
- position: relative;
240
- top: 46%;
241
- display: inline-block;
242
- }
243
-
244
- div.jqplot-bubble-label {
245
- font-size: 0.8em;
246
- /* background: rgba(90%, 90%, 90%, 0.15);*/
247
- padding-left: 2px;
248
- padding-right: 2px;
249
- color: rgb(20%, 20%, 20%);
250
- }
251
-
252
- div.jqplot-bubble-label.jqplot-bubble-label-highlight {
253
- background: rgba(90%, 90%, 90%, 0.7);
254
- }
255
-
256
- div.jqplot-noData-container {
257
- text-align: center;
258
- background-color: rgba(96%, 96%, 96%, 0.3);
259
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/jqplot/jquery.jqplot.js DELETED
@@ -1,11534 +0,0 @@
1
- /**
2
- * Title: jqPlot Charts
3
- *
4
- * Pure JavaScript plotting plugin for jQuery.
5
- *
6
- * About: Version
7
- *
8
- * version: 1.0.9
9
- * revision: c465c44
10
- *
11
- * About: Copyright & License
12
- *
13
- * Copyright (c) 2009-2016 Chris Leonello
14
- * jqPlot is currently available for use in all personal or commercial projects
15
- * under both the MIT and GPL version 2.0 licenses. This means that you can
16
- * choose the license that best suits your project and use it accordingly.
17
- *
18
- * See <GPL Version 2> and <MIT License> contained within this distribution for further information.
19
- *
20
- * The author would appreciate an email letting him know of any substantial
21
- * use of jqPlot. You can reach the author at: chris at jqplot dot com
22
- * or see http://www.jqplot.com/info.php. This is, of course, not required.
23
- *
24
- * If you are feeling kind and generous, consider supporting the project by
25
- * making a donation at: http://www.jqplot.com/donate.php.
26
- *
27
- * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
28
- *
29
- * version 2007.04.27
30
- * author Ash Searle
31
- * http://hexmen.com/blog/2007/03/printf-sprintf/
32
- * http://hexmen.com/js/sprintf.js
33
- * The author (Ash Searle) has placed this code in the public domain:
34
- * "This code is unrestricted: you are free to use it however you like."
35
- *
36
- *
37
- * About: Introduction
38
- *
39
- * jqPlot requires jQuery (1.4+ required for certain features). jQuery 1.4.2 is included in the distribution.
40
- * To use jqPlot include jQuery, the jqPlot jQuery plugin, the jqPlot css file and optionally
41
- * the excanvas script for IE support in your web page:
42
- *
43
- * > <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="excanvas.js"></script><![endif]-->
44
- * > <script language="javascript" type="text/javascript" src="jquery-1.4.4.min.js"></script>
45
- * > <script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script>
46
- * > <link rel="stylesheet" type="text/css" href="jquery.jqplot.css" />
47
- *
48
- * jqPlot can be customized by overriding the defaults of any of the objects which make
49
- * up the plot. The general usage of jqplot is:
50
- *
51
- * > chart = $.jqplot('targetElemId', [dataArray,...], {optionsObject});
52
- *
53
- * The options available to jqplot are detailed in <jqPlot Options> in the jqPlotOptions.txt file.
54
- *
55
- * An actual call to $.jqplot() may look like the
56
- * examples below:
57
- *
58
- * > chart = $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]);
59
- *
60
- * or
61
- *
62
- * > dataArray = [34,12,43,55,77];
63
- * > chart = $.jqplot('targetElemId', [dataArray, ...], {title:'My Plot', axes:{yaxis:{min:20, max:100}}});
64
- *
65
- * For more inforrmation, see <jqPlot Usage>.
66
- *
67
- * About: Usage
68
- *
69
- * See <jqPlot Usage>
70
- *
71
- * About: Available Options
72
- *
73
- * See <jqPlot Options> for a list of options available thorugh the options object (not complete yet!)
74
- *
75
- * About: Options Usage
76
- *
77
- * See <Options Tutorial>
78
- *
79
- * About: Changes
80
- *
81
- * See <Change Log>
82
- *
83
- */
84
-
85
- (function($) {
86
- // make sure undefined is undefined
87
- var undefined;
88
-
89
- $.fn.emptyForce = function() {
90
- for ( var i = 0, elem; (elem = $(this)[i]) != null; i++ ) {
91
- // Remove element nodes and prevent memory leaks
92
- if ( elem.nodeType === 1 ) {
93
- $.cleanData( elem.getElementsByTagName("*") );
94
- }
95
-
96
- // Remove any remaining nodes
97
- if ($.jqplot.use_excanvas) {
98
- elem.outerHTML = "";
99
- }
100
- else {
101
- while ( elem.firstChild ) {
102
- elem.removeChild( elem.firstChild );
103
- }
104
- }
105
-
106
- elem = null;
107
- }
108
-
109
- return $(this);
110
- };
111
-
112
- $.fn.removeChildForce = function(parent) {
113
- while ( parent.firstChild ) {
114
- this.removeChildForce( parent.firstChild );
115
- parent.removeChild( parent.firstChild );
116
- }
117
- };
118
-
119
- $.fn.jqplot = function() {
120
- var datas = [];
121
- var options = [];
122
- // see how many data arrays we have
123
- for (var i=0, l=arguments.length; i<l; i++) {
124
- if ($.isArray(arguments[i])) {
125
- datas.push(arguments[i]);
126
- }
127
- else if ($.isPlainObject(arguments[i])) {
128
- options.push(arguments[i]);
129
- }
130
- }
131
-
132
- return this.each(function(index) {
133
- var tid,
134
- plot,
135
- $this = $(this),
136
- dl = datas.length,
137
- ol = options.length,
138
- data,
139
- opts;
140
-
141
- if (index < dl) {
142
- data = datas[index];
143
- }
144
- else {
145
- data = dl ? datas[dl-1] : null;
146
- }
147
-
148
- if (index < ol) {
149
- opts = options[index];
150
- }
151
- else {
152
- opts = ol ? options[ol-1] : null;
153
- }
154
-
155
- // does el have an id?
156
- // if not assign it one.
157
- tid = $this.attr('id');
158
- if (tid === undefined) {
159
- tid = 'jqplot_target_' + $.jqplot.targetCounter++;
160
- $this.attr('id', tid);
161
- }
162
-
163
- plot = $.jqplot(tid, data, opts);
164
-
165
- $this.data('jqplot', plot);
166
- });
167
- };
168
-
169
-
170
- /**
171
- * Namespace: $.jqplot
172
- * jQuery function called by the user to create a plot.
173
- *
174
- * Parameters:
175
- * target - ID of target element to render the plot into.
176
- * data - an array of data series.
177
- * options - user defined options object. See the individual classes for available options.
178
- *
179
- * Properties:
180
- * config - object to hold configuration information for jqPlot plot object.
181
- *
182
- * attributes:
183
- * enablePlugins - False to disable plugins by default. Plugins must then be explicitly
184
- * enabled in the individual plot options. Default: false.
185
- * This property sets the "show" property of certain plugins to true or false.
186
- * Only plugins that can be immediately active upon loading are affected. This includes
187
- * non-renderer plugins like cursor, dragable, highlighter, and trendline.
188
- * defaultHeight - Default height for plots where no css height specification exists. This
189
- * is a jqplot wide default.
190
- * defaultWidth - Default height for plots where no css height specification exists. This
191
- * is a jqplot wide default.
192
- */
193
-
194
- $.jqplot = function(target, data, options) {
195
- var _data = null, _options = null;
196
-
197
- if (arguments.length === 3) {
198
- _data = data;
199
- _options = options;
200
- }
201
-
202
- else if (arguments.length === 2) {
203
- if ($.isArray(data)) {
204
- _data = data;
205
- }
206
-
207
- else if ($.isPlainObject(data)) {
208
- _options = data;
209
- }
210
- }
211
-
212
- if (_data === null && _options !== null && _options.data) {
213
- _data = _options.data;
214
- }
215
-
216
- var plot = new jqPlot();
217
- // remove any error class that may be stuck on target.
218
- $('#'+target).removeClass('jqplot-error');
219
-
220
- if ($.jqplot.config.catchErrors) {
221
- try {
222
- plot.init(target, _data, _options);
223
- plot.draw();
224
- plot.themeEngine.init.call(plot);
225
- return plot;
226
- }
227
- catch(e) {
228
- var msg = $.jqplot.config.errorMessage || e.message;
229
- $('#'+target).append('<div class="jqplot-error-message">'+msg+'</div>');
230
- $('#'+target).addClass('jqplot-error');
231
- document.getElementById(target).style.background = $.jqplot.config.errorBackground;
232
- document.getElementById(target).style.border = $.jqplot.config.errorBorder;
233
- document.getElementById(target).style.fontFamily = $.jqplot.config.errorFontFamily;
234
- document.getElementById(target).style.fontSize = $.jqplot.config.errorFontSize;
235
- document.getElementById(target).style.fontStyle = $.jqplot.config.errorFontStyle;
236
- document.getElementById(target).style.fontWeight = $.jqplot.config.errorFontWeight;
237
- }
238
- }
239
- else {
240
- plot.init(target, _data, _options);
241
- plot.draw();
242
- plot.themeEngine.init.call(plot);
243
- return plot;
244
- }
245
- };
246
-
247
- $.jqplot.version = "1.0.9";
248
- $.jqplot.revision = "c465c44";
249
-
250
- $.jqplot.targetCounter = 1;
251
-
252
- // canvas manager to reuse canvases on the plot.
253
- // Should help solve problem of canvases not being freed and
254
- // problem of waiting forever for firefox to decide to free memory.
255
- $.jqplot.CanvasManager = function() {
256
- // canvases are managed globally so that they can be reused
257
- // across plots after they have been freed
258
- if (typeof $.jqplot.CanvasManager.canvases == 'undefined') {
259
- $.jqplot.CanvasManager.canvases = [];
260
- $.jqplot.CanvasManager.free = [];
261
- }
262
-
263
- var myCanvases = [];
264
-
265
- this.getCanvas = function() {
266
- var canvas;
267
- var makeNew = true;
268
-
269
- if (!$.jqplot.use_excanvas) {
270
- for (var i = 0, l = $.jqplot.CanvasManager.canvases.length; i < l; i++) {
271
- if ($.jqplot.CanvasManager.free[i] === true) {
272
- makeNew = false;
273
- canvas = $.jqplot.CanvasManager.canvases[i];
274
- // $(canvas).removeClass('jqplot-canvasManager-free').addClass('jqplot-canvasManager-inuse');
275
- $.jqplot.CanvasManager.free[i] = false;
276
- myCanvases.push(i);
277
- break;
278
- }
279
- }
280
- }
281
-
282
- if (makeNew) {
283
- canvas = document.createElement('canvas');
284
- myCanvases.push($.jqplot.CanvasManager.canvases.length);
285
- $.jqplot.CanvasManager.canvases.push(canvas);
286
- $.jqplot.CanvasManager.free.push(false);
287
- }
288
-
289
- return canvas;
290
- };
291
-
292
- // this method has to be used after settings the dimesions
293
- // on the element returned by getCanvas()
294
- this.initCanvas = function(canvas) {
295
- if ($.jqplot.use_excanvas) {
296
- return window.G_vmlCanvasManager.initElement(canvas);
297
- }
298
-
299
- var cctx = canvas.getContext('2d');
300
-
301
- var canvasBackingScale = 1;
302
- if (window.devicePixelRatio > 1 && (cctx.webkitBackingStorePixelRatio === undefined ||
303
- cctx.webkitBackingStorePixelRatio < 2)) {
304
- canvasBackingScale = window.devicePixelRatio;
305
- }
306
- var oldWidth = canvas.width;
307
- var oldHeight = canvas.height;
308
-
309
- canvas.width = canvasBackingScale * canvas.width;
310
- canvas.height = canvasBackingScale * canvas.height;
311
- canvas.style.width = oldWidth + 'px';
312
- canvas.style.height = oldHeight + 'px';
313
- cctx.save();
314
-
315
- cctx.scale(canvasBackingScale, canvasBackingScale);
316
-
317
- return canvas;
318
- };
319
-
320
- this.freeAllCanvases = function() {
321
- for (var i = 0, l=myCanvases.length; i < l; i++) {
322
- this.freeCanvas(myCanvases[i]);
323
- }
324
- myCanvases = [];
325
- };
326
-
327
- this.freeCanvas = function(idx) {
328
- if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
329
- // excanvas can't be reused, but properly unset
330
- window.G_vmlCanvasManager.uninitElement($.jqplot.CanvasManager.canvases[idx]);
331
- $.jqplot.CanvasManager.canvases[idx] = null;
332
- }
333
- else {
334
- var canvas = $.jqplot.CanvasManager.canvases[idx];
335
- canvas.getContext('2d').clearRect(0, 0, canvas.width, canvas.height);
336
- $(canvas).unbind().removeAttr('class').removeAttr('style');
337
- // Style attributes seemed to be still hanging around. wierd. Some ticks
338
- // still retained a left: 0px attribute after reusing a canvas.
339
- $(canvas).css({left: '', top: '', position: ''});
340
- // setting size to 0 may save memory of unused canvases?
341
- canvas.width = 0;
342
- canvas.height = 0;
343
- $.jqplot.CanvasManager.free[idx] = true;
344
- }
345
- };
346
-
347
- };
348
-
349
-
350
- // Convienence function that won't hang IE or FF without FireBug.
351
- $.jqplot.log = function() {
352
- if (window.console) {
353
- window.console.log.apply(window.console, arguments);
354
- }
355
- };
356
-
357
- $.jqplot.config = {
358
- addDomReference: false,
359
- enablePlugins:false,
360
- defaultHeight:300,
361
- defaultWidth:400,
362
- UTCAdjust:false,
363
- timezoneOffset: new Date(new Date().getTimezoneOffset() * 60000),
364
- errorMessage: '',
365
- errorBackground: '',
366
- errorBorder: '',
367
- errorFontFamily: '',
368
- errorFontSize: '',
369
- errorFontStyle: '',
370
- errorFontWeight: '',
371
- catchErrors: false,
372
- defaultTickFormatString: "%.1f",
373
- defaultColors: [ "#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"],
374
- defaultNegativeColors: [ "#498991", "#C08840", "#9F9274", "#546D61", "#646C4A", "#6F6621", "#6E3F5F", "#4F64B0", "#A89050", "#C45923", "#187399", "#945381", "#959E5C", "#C7AF7B", "#478396", "#907294"],
375
- dashLength: 4,
376
- gapLength: 4,
377
- dotGapLength: 2.5,
378
- srcLocation: 'jqplot/src/',
379
- pluginLocation: 'jqplot/src/plugins/'
380
- };
381
-
382
-
383
- $.jqplot.arrayMax = function( array ){
384
- return Math.max.apply( Math, array );
385
- };
386
-
387
- $.jqplot.arrayMin = function( array ){
388
- return Math.min.apply( Math, array );
389
- };
390
-
391
- $.jqplot.enablePlugins = $.jqplot.config.enablePlugins;
392
-
393
- // canvas related tests taken from modernizer:
394
- // Copyright (c) 2009 - 2010 Faruk Ates.
395
- // http://www.modernizr.com
396
-
397
- $.jqplot.support_canvas = function() {
398
- if (typeof $.jqplot.support_canvas.result == 'undefined') {
399
- $.jqplot.support_canvas.result = !!document.createElement('canvas').getContext;
400
- }
401
- return $.jqplot.support_canvas.result;
402
- };
403
-
404
- $.jqplot.support_canvas_text = function() {
405
- if (typeof $.jqplot.support_canvas_text.result == 'undefined') {
406
- if (window.G_vmlCanvasManager !== undefined && window.G_vmlCanvasManager._version > 887) {
407
- $.jqplot.support_canvas_text.result = true;
408
- }
409
- else {
410
- $.jqplot.support_canvas_text.result = !!(document.createElement('canvas').getContext && typeof document.createElement('canvas').getContext('2d').fillText == 'function');
411
- }
412
-
413
- }
414
- return $.jqplot.support_canvas_text.result;
415
- };
416
-
417
- $.jqplot.use_excanvas = ((!$.support.boxModel || !$.support.objectAll || !$support.leadingWhitespace) && !$.jqplot.support_canvas()) ? true : false;
418
-
419
- /**
420
- *
421
- * Hooks: jqPlot Pugin Hooks
422
- *
423
- * $.jqplot.preInitHooks - called before initialization.
424
- * $.jqplot.postInitHooks - called after initialization.
425
- * $.jqplot.preParseOptionsHooks - called before user options are parsed.
426
- * $.jqplot.postParseOptionsHooks - called after user options are parsed.
427
- * $.jqplot.preDrawHooks - called before plot draw.
428
- * $.jqplot.postDrawHooks - called after plot draw.
429
- * $.jqplot.preDrawSeriesHooks - called before each series is drawn.
430
- * $.jqplot.postDrawSeriesHooks - called after each series is drawn.
431
- * $.jqplot.preDrawLegendHooks - called before the legend is drawn.
432
- * $.jqplot.addLegendRowHooks - called at the end of legend draw, so plugins
433
- * can add rows to the legend table.
434
- * $.jqplot.preSeriesInitHooks - called before series is initialized.
435
- * $.jqplot.postSeriesInitHooks - called after series is initialized.
436
- * $.jqplot.preParseSeriesOptionsHooks - called before series related options
437
- * are parsed.
438
- * $.jqplot.postParseSeriesOptionsHooks - called after series related options
439
- * are parsed.
440
- * $.jqplot.eventListenerHooks - called at the end of plot drawing, binds
441
- * listeners to the event canvas which lays on top of the grid area.
442
- * $.jqplot.preDrawSeriesShadowHooks - called before series shadows are drawn.
443
- * $.jqplot.postDrawSeriesShadowHooks - called after series shadows are drawn.
444
- *
445
- */
446
-
447
- $.jqplot.preInitHooks = [];
448
- $.jqplot.postInitHooks = [];
449
- $.jqplot.preParseOptionsHooks = [];
450
- $.jqplot.postParseOptionsHooks = [];
451
- $.jqplot.preDrawHooks = [];
452
- $.jqplot.postDrawHooks = [];
453
- $.jqplot.preDrawSeriesHooks = [];
454
- $.jqplot.postDrawSeriesHooks = [];
455
- $.jqplot.preDrawLegendHooks = [];
456
- $.jqplot.addLegendRowHooks = [];
457
- $.jqplot.preSeriesInitHooks = [];
458
- $.jqplot.postSeriesInitHooks = [];
459
- $.jqplot.preParseSeriesOptionsHooks = [];
460
- $.jqplot.postParseSeriesOptionsHooks = [];
461
- $.jqplot.eventListenerHooks = [];
462
- $.jqplot.preDrawSeriesShadowHooks = [];
463
- $.jqplot.postDrawSeriesShadowHooks = [];
464
-
465
- // A superclass holding some common properties and methods.
466
- $.jqplot.ElemContainer = function() {
467
- this._elem;
468
- this._plotWidth;
469
- this._plotHeight;
470
- this._plotDimensions = {height:null, width:null};
471
- };
472
-
473
- $.jqplot.ElemContainer.prototype.createElement = function(el, offsets, clss, cssopts, attrib) {
474
- this._offsets = offsets;
475
- var klass = clss || 'jqplot';
476
- var elem = document.createElement(el);
477
- this._elem = $(elem);
478
- this._elem.addClass(klass);
479
- this._elem.css(cssopts);
480
- this._elem.attr(attrib);
481
- // avoid memory leak;
482
- elem = null;
483
- return this._elem;
484
- };
485
-
486
- $.jqplot.ElemContainer.prototype.getWidth = function() {
487
- if (this._elem) {
488
- return this._elem.outerWidth(true);
489
- }
490
- else {
491
- return null;
492
- }
493
- };
494
-
495
- $.jqplot.ElemContainer.prototype.getHeight = function() {
496
- if (this._elem) {
497
- return this._elem.outerHeight(true);
498
- }
499
- else {
500
- return null;
501
- }
502
- };
503
-
504
- $.jqplot.ElemContainer.prototype.getPosition = function() {
505
- if (this._elem) {
506
- return this._elem.position();
507
- }
508
- else {
509
- return {top:null, left:null, bottom:null, right:null};
510
- }
511
- };
512
-
513
- $.jqplot.ElemContainer.prototype.getTop = function() {
514
- return this.getPosition().top;
515
- };
516
-
517
- $.jqplot.ElemContainer.prototype.getLeft = function() {
518
- return this.getPosition().left;
519
- };
520
-
521
- $.jqplot.ElemContainer.prototype.getBottom = function() {
522
- return this._elem.css('bottom');
523
- };
524
-
525
- $.jqplot.ElemContainer.prototype.getRight = function() {
526
- return this._elem.css('right');
527
- };
528
-
529
-
530
- /**
531
- * Class: Axis
532
- * An individual axis object. Cannot be instantiated directly, but created
533
- * by the Plot object. Axis properties can be set or overridden by the
534
- * options passed in from the user.
535
- *
536
- */
537
- function Axis(name) {
538
- $.jqplot.ElemContainer.call(this);
539
- // Group: Properties
540
- //
541
- // Axes options are specified within an axes object at the top level of the
542
- // plot options like so:
543
- // > {
544
- // > axes: {
545
- // > xaxis: {min: 5},
546
- // > yaxis: {min: 2, max: 8, numberTicks:4},
547
- // > x2axis: {pad: 1.5},
548
- // > y2axis: {ticks:[22, 44, 66, 88]}
549
- // > }
550
- // > }
551
- // There are 2 x axes, 'xaxis' and 'x2axis', and
552
- // 9 yaxes, 'yaxis', 'y2axis'. 'y3axis', ... Any or all of which may be specified.
553
- this.name = name;
554
- this._series = [];
555
- // prop: show
556
- // Wether to display the axis on the graph.
557
- this.show = false;
558
- // prop: tickRenderer
559
- // A class of a rendering engine for creating the ticks labels displayed on the plot,
560
- // See <$.jqplot.AxisTickRenderer>.
561
- this.tickRenderer = $.jqplot.AxisTickRenderer;
562
- // prop: tickOptions
563
- // Options that will be passed to the tickRenderer, see <$.jqplot.AxisTickRenderer> options.
564
- this.tickOptions = {};
565
- // prop: labelRenderer
566
- // A class of a rendering engine for creating an axis label.
567
- this.labelRenderer = $.jqplot.AxisLabelRenderer;
568
- // prop: labelOptions
569
- // Options passed to the label renderer.
570
- this.labelOptions = {};
571
- // prop: label
572
- // Label for the axis
573
- this.label = null;
574
- // prop: showLabel
575
- // true to show the axis label.
576
- this.showLabel = true;
577
- // prop: min
578
- // minimum value of the axis (in data units, not pixels).
579
- this.min = null;
580
- // prop: max
581
- // maximum value of the axis (in data units, not pixels).
582
- this.max = null;
583
- // prop: autoscale
584
- // DEPRECATED
585
- // the default scaling algorithm produces superior results.
586
- this.autoscale = false;
587
- // prop: pad
588
- // Padding to extend the range above and below the data bounds.
589
- // The data range is multiplied by this factor to determine minimum and maximum axis bounds.
590
- // A value of 0 will be interpreted to mean no padding, and pad will be set to 1.0.
591
- this.pad = 1.2;
592
- // prop: padMax
593
- // Padding to extend the range above data bounds.
594
- // The top of the data range is multiplied by this factor to determine maximum axis bounds.
595
- // A value of 0 will be interpreted to mean no padding, and padMax will be set to 1.0.
596
- this.padMax = null;
597
- // prop: padMin
598
- // Padding to extend the range below data bounds.
599
- // The bottom of the data range is multiplied by this factor to determine minimum axis bounds.
600
- // A value of 0 will be interpreted to mean no padding, and padMin will be set to 1.0.
601
- this.padMin = null;
602
- // prop: ticks
603
- // 1D [val, val, ...] or 2D [[val, label], [val, label], ...] array of ticks for the axis.
604
- // If no label is specified, the value is formatted into an appropriate label.
605
- this.ticks = [];
606
- // prop: numberTicks
607
- // Desired number of ticks. Default is to compute automatically.
608
- this.numberTicks;
609
- // prop: tickInterval
610
- // number of units between ticks. Mutually exclusive with numberTicks.
611
- this.tickInterval;
612
- // prop: renderer
613
- // A class of a rendering engine that handles tick generation,
614
- // scaling input data to pixel grid units and drawing the axis element.
615
- this.renderer = $.jqplot.LinearAxisRenderer;
616
- // prop: rendererOptions
617
- // renderer specific options. See <$.jqplot.LinearAxisRenderer> for options.
618
- this.rendererOptions = {};
619
- // prop: showTicks
620
- // Wether to show the ticks (both marks and labels) or not.
621
- // Will not override showMark and showLabel options if specified on the ticks themselves.
622
- this.showTicks = true;
623
- // prop: showTickMarks
624
- // Wether to show the tick marks (line crossing grid) or not.
625
- // Overridden by showTicks and showMark option of tick itself.
626
- this.showTickMarks = true;
627
- // prop: showMinorTicks
628
- // Wether or not to show minor ticks. This is renderer dependent.
629
- this.showMinorTicks = true;
630
- // prop: drawMajorGridlines
631
- // True to draw gridlines for major axis ticks.
632
- this.drawMajorGridlines = true;
633
- // prop: drawMinorGridlines
634
- // True to draw gridlines for minor ticks.
635
- this.drawMinorGridlines = false;
636
- // prop: drawMajorTickMarks
637
- // True to draw tick marks for major axis ticks.
638
- this.drawMajorTickMarks = true;
639
- // prop: drawMinorTickMarks
640
- // True to draw tick marks for minor ticks. This is renderer dependent.
641
- this.drawMinorTickMarks = true;
642
- // prop: useSeriesColor
643
- // Use the color of the first series associated with this axis for the
644
- // tick marks and line bordering this axis.
645
- this.useSeriesColor = false;
646
- // prop: borderWidth
647
- // width of line stroked at the border of the axis. Defaults
648
- // to the width of the grid boarder.
649
- this.borderWidth = null;
650
- // prop: borderColor
651
- // color of the border adjacent to the axis. Defaults to grid border color.
652
- this.borderColor = null;
653
- // prop: scaleToHiddenSeries
654
- // True to include hidden series when computing axes bounds and scaling.
655
- this.scaleToHiddenSeries = false;
656
- // minimum and maximum values on the axis.
657
- this._dataBounds = {min:null, max:null};
658
- // statistics (min, max, mean) as well as actual data intervals for each series attached to axis.
659
- // holds collection of {intervals:[], min:, max:, mean: } objects for each series on axis.
660
- this._intervalStats = [];
661
- // pixel position from the top left of the min value and max value on the axis.
662
- this._offsets = {min:null, max:null};
663
- this._ticks=[];
664
- this._label = null;
665
- // prop: syncTicks
666
- // true to try and synchronize tick spacing across multiple axes so that ticks and
667
- // grid lines line up. This has an impact on autoscaling algorithm, however.
668
- // In general, autoscaling an individual axis will work better if it does not
669
- // have to sync ticks.
670
- this.syncTicks = null;
671
- // prop: tickSpacing
672
- // Approximate pixel spacing between ticks on graph. Used during autoscaling.
673
- // This number will be an upper bound, actual spacing will be less.
674
- this.tickSpacing = 75;
675
- // Properties to hold the original values for min, max, ticks, tickInterval and numberTicks
676
- // so they can be restored if altered by plugins.
677
- this._min = null;
678
- this._max = null;
679
- this._tickInterval = null;
680
- this._numberTicks = null;
681
- this.__ticks = null;
682
- // hold original user options.
683
- this._options = {};
684
- }
685
-
686
- Axis.prototype = new $.jqplot.ElemContainer();
687
- Axis.prototype.constructor = Axis;
688
-
689
- Axis.prototype.init = function() {
690
- if ($.isFunction(this.renderer)) {
691
- this.renderer = new this.renderer();
692
- }
693
- // set the axis name
694
- this.tickOptions.axis = this.name;
695
- // if showMark or showLabel tick options not specified, use value of axis option.
696
- // showTicks overrides showTickMarks.
697
- if (this.tickOptions.showMark == null) {
698
- this.tickOptions.showMark = this.showTicks;
699
- }
700
- if (this.tickOptions.showMark == null) {
701
- this.tickOptions.showMark = this.showTickMarks;
702
- }
703
- if (this.tickOptions.showLabel == null) {
704
- this.tickOptions.showLabel = this.showTicks;
705
- }
706
-
707
- if (this.label == null || this.label == '') {
708
- this.showLabel = false;
709
- }
710
- else {
711
- this.labelOptions.label = this.label;
712
- }
713
- if (this.showLabel == false) {
714
- this.labelOptions.show = false;
715
- }
716
- // set the default padMax, padMin if not specified
717
- // special check, if no padding desired, padding
718
- // should be set to 1.0
719
- if (this.pad == 0) {
720
- this.pad = 1.0;
721
- }
722
- if (this.padMax == 0) {
723
- this.padMax = 1.0;
724
- }
725
- if (this.padMin == 0) {
726
- this.padMin = 1.0;
727
- }
728
- if (this.padMax == null) {
729
- this.padMax = (this.pad-1)/2 + 1;
730
- }
731
- if (this.padMin == null) {
732
- this.padMin = (this.pad-1)/2 + 1;
733
- }
734
- // now that padMin and padMax are correctly set, reset pad in case user has supplied
735
- // padMin and/or padMax
736
- this.pad = this.padMax + this.padMin - 1;
737
- if (this.min != null || this.max != null) {
738
- this.autoscale = false;
739
- }
740
- // if not set, sync ticks for y axes but not x by default.
741
- if (this.syncTicks == null && this.name.indexOf('y') > -1) {
742
- this.syncTicks = true;
743
- }
744
- else if (this.syncTicks == null){
745
- this.syncTicks = false;
746
- }
747
- this.renderer.init.call(this, this.rendererOptions);
748
-
749
- };
750
-
751
- Axis.prototype.draw = function(ctx, plot) {
752
- // Memory Leaks patch
753
- if (this.__ticks) {
754
- this.__ticks = null;
755
- }
756
-
757
- return this.renderer.draw.call(this, ctx, plot);
758
-
759
- };
760
-
761
- Axis.prototype.set = function() {
762
- this.renderer.set.call(this);
763
- };
764
-
765
- Axis.prototype.pack = function(pos, offsets) {
766
- if (this.show) {
767
- this.renderer.pack.call(this, pos, offsets);
768
- }
769
- // these properties should all be available now.
770
- if (this._min == null) {
771
- this._min = this.min;
772
- this._max = this.max;
773
- this._tickInterval = this.tickInterval;
774
- this._numberTicks = this.numberTicks;
775
- this.__ticks = this._ticks;
776
- }
777
- };
778
-
779
- // reset the axis back to original values if it has been scaled, zoomed, etc.
780
- Axis.prototype.reset = function() {
781
- this.renderer.reset.call(this);
782
- };
783
-
784
- Axis.prototype.resetScale = function(opts) {
785
- $.extend(true, this, {min: null, max: null, numberTicks: null, tickInterval: null, _ticks: [], ticks: []}, opts);
786
- this.resetDataBounds();
787
- };
788
-
789
- Axis.prototype.resetDataBounds = function() {
790
- // Go through all the series attached to this axis and find
791
- // the min/max bounds for this axis.
792
- var db = this._dataBounds;
793
- db.min = null;
794
- db.max = null;
795
- var l, s, d;
796
- // check for when to force min 0 on bar series plots.
797
- var doforce = (this.show) ? true : false;
798
- for (var i=0; i<this._series.length; i++) {
799
- s = this._series[i];
800
- if (s.show || this.scaleToHiddenSeries) {
801
- d = s._plotData;
802
- if (s._type === 'line' && s.renderer.bands.show && this.name.charAt(0) !== 'x') {
803
- d = [[0, s.renderer.bands._min], [1, s.renderer.bands._max]];
804
- }
805
-
806
- var minyidx = 1, maxyidx = 1;
807
-
808
- if (s._type != null && s._type == 'ohlc') {
809
- minyidx = 3;
810
- maxyidx = 2;
811
- }
812
-
813
- for (var j=0, l=d.length; j<l; j++) {
814
- if (this.name == 'xaxis' || this.name == 'x2axis') {
815
- if ((d[j][0] != null && d[j][0] < db.min) || db.min == null) {
816
- db.min = d[j][0];
817
- }
818
- if ((d[j][0] != null && d[j][0] > db.max) || db.max == null) {
819
- db.max = d[j][0];
820
- }
821
- }
822
- else {
823
- if ((d[j][minyidx] != null && d[j][minyidx] < db.min) || db.min == null) {
824
- db.min = d[j][minyidx];
825
- }
826
- if ((d[j][maxyidx] != null && d[j][maxyidx] > db.max) || db.max == null) {
827
- db.max = d[j][maxyidx];
828
- }
829
- }
830
- }
831
-
832
- // Hack to not pad out bottom of bar plots unless user has specified a padding.
833
- // every series will have a chance to set doforce to false. once it is set to
834
- // false, it cannot be reset to true.
835
- // If any series attached to axis is not a bar, wont force 0.
836
- if (doforce && s.renderer.constructor !== $.jqplot.BarRenderer) {
837
- doforce = false;
838
- }
839
-
840
- else if (doforce && this._options.hasOwnProperty('forceTickAt0') && this._options.forceTickAt0 == false) {
841
- doforce = false;
842
- }
843
-
844
- else if (doforce && s.renderer.constructor === $.jqplot.BarRenderer) {
845
- if (s.barDirection == 'vertical' && this.name != 'xaxis' && this.name != 'x2axis') {
846
- if (this._options.pad != null || this._options.padMin != null) {
847
- doforce = false;
848
- }
849
- }
850
-
851
- else if (s.barDirection == 'horizontal' && (this.name == 'xaxis' || this.name == 'x2axis')) {
852
- if (this._options.pad != null || this._options.padMin != null) {
853
- doforce = false;
854
- }
855
- }
856
-
857
- }
858
- }
859
- }
860
-
861
- if (doforce && this.renderer.constructor === $.jqplot.LinearAxisRenderer && db.min >= 0) {
862
- this.padMin = 1.0;
863
- this.forceTickAt0 = true;
864
- }
865
- };
866
-
867
- /**
868
- * Class: Legend
869
- * Legend object. Cannot be instantiated directly, but created
870
- * by the Plot object. Legend properties can be set or overridden by the
871
- * options passed in from the user.
872
- */
873
- function Legend(options) {
874
- $.jqplot.ElemContainer.call(this);
875
- // Group: Properties
876
-
877
- // prop: show
878
- // Wether to display the legend on the graph.
879
- this.show = false;
880
- // prop: location
881
- // Placement of the legend. one of the compass directions: nw, n, ne, e, se, s, sw, w
882
- this.location = 'ne';
883
- // prop: labels
884
- // Array of labels to use. By default the renderer will look for labels on the series.
885
- // Labels specified in this array will override labels specified on the series.
886
- this.labels = [];
887
- // prop: showLabels
888
- // true to show the label text on the legend.
889
- this.showLabels = true;
890
- // prop: showSwatch
891
- // true to show the color swatches on the legend.
892
- this.showSwatches = true;
893
- // prop: placement
894
- // "insideGrid" places legend inside the grid area of the plot.
895
- // "outsideGrid" places the legend outside the grid but inside the plot container,
896
- // shrinking the grid to accommodate the legend.
897
- // "inside" synonym for "insideGrid",
898
- // "outside" places the legend ouside the grid area, but does not shrink the grid which
899
- // can cause the legend to overflow the plot container.
900
- this.placement = "insideGrid";
901
- // prop: xoffset
902
- // DEPRECATED. Set the margins on the legend using the marginTop, marginLeft, etc.
903
- // properties or via CSS margin styling of the .jqplot-table-legend class.
904
- this.xoffset = 0;
905
- // prop: yoffset
906
- // DEPRECATED. Set the margins on the legend using the marginTop, marginLeft, etc.
907
- // properties or via CSS margin styling of the .jqplot-table-legend class.
908
- this.yoffset = 0;
909
- // prop: border
910
- // css spec for the border around the legend box.
911
- this.border;
912
- // prop: background
913
- // css spec for the background of the legend box.
914
- this.background;
915
- // prop: textColor
916
- // css color spec for the legend text.
917
- this.textColor;
918
- // prop: fontFamily
919
- // css font-family spec for the legend text.
920
- this.fontFamily;
921
- // prop: fontSize
922
- // css font-size spec for the legend text.
923
- this.fontSize ;
924
- // prop: rowSpacing
925
- // css padding-top spec for the rows in the legend.
926
- this.rowSpacing = '0.5em';
927
- // renderer
928
- // A class that will create a DOM object for the legend,
929
- // see <$.jqplot.TableLegendRenderer>.
930
- this.renderer = $.jqplot.TableLegendRenderer;
931
- // prop: rendererOptions
932
- // renderer specific options passed to the renderer.
933
- this.rendererOptions = {};
934
- // prop: predraw
935
- // Wether to draw the legend before the series or not.
936
- // Used with series specific legend renderers for pie, donut, mekko charts, etc.
937
- this.preDraw = false;
938
- // prop: marginTop
939
- // CSS margin for the legend DOM element. This will set an element
940
- // CSS style for the margin which will override any style sheet setting.
941
- // The default will be taken from the stylesheet.
942
- this.marginTop = null;
943
- // prop: marginRight
944
- // CSS margin for the legend DOM element. This will set an element
945
- // CSS style for the margin which will override any style sheet setting.
946
- // The default will be taken from the stylesheet.
947
- this.marginRight = null;
948
- // prop: marginBottom
949
- // CSS margin for the legend DOM element. This will set an element
950
- // CSS style for the margin which will override any style sheet setting.
951
- // The default will be taken from the stylesheet.
952
- this.marginBottom = null;
953
- // prop: marginLeft
954
- // CSS margin for the legend DOM element. This will set an element
955
- // CSS style for the margin which will override any style sheet setting.
956
- // The default will be taken from the stylesheet.
957
- this.marginLeft = null;
958
- // prop: escapeHtml
959
- // True to escape special characters with their html entity equivalents
960
- // in legend text. "<" becomes &lt; and so on, so html tags are not rendered.
961
- this.escapeHtml = false;
962
- this._series = [];
963
-
964
- $.extend(true, this, options);
965
- }
966
-
967
- Legend.prototype = new $.jqplot.ElemContainer();
968
- Legend.prototype.constructor = Legend;
969
-
970
- Legend.prototype.setOptions = function(options) {
971
- $.extend(true, this, options);
972
-
973
- // Try to emulate deprecated behaviour
974
- // if user has specified xoffset or yoffset, copy these to
975
- // the margin properties.
976
-
977
- if (this.placement == 'inside') {
978
- this.placement = 'insideGrid';
979
- }
980
-
981
- if (this.xoffset >0) {
982
- if (this.placement == 'insideGrid') {
983
- switch (this.location) {
984
- case 'nw':
985
- case 'w':
986
- case 'sw':
987
- if (this.marginLeft == null) {
988
- this.marginLeft = this.xoffset + 'px';
989
- }
990
- this.marginRight = '0px';
991
- break;
992
- case 'ne':
993
- case 'e':
994
- case 'se':
995
- default:
996
- if (this.marginRight == null) {
997
- this.marginRight = this.xoffset + 'px';
998
- }
999
- this.marginLeft = '0px';
1000
- break;
1001
- }
1002
- }
1003
- else if (this.placement == 'outside') {
1004
- switch (this.location) {
1005
- case 'nw':
1006
- case 'w':
1007
- case 'sw':
1008
- if (this.marginRight == null) {
1009
- this.marginRight = this.xoffset + 'px';
1010
- }
1011
- this.marginLeft = '0px';
1012
- break;
1013
- case 'ne':
1014
- case 'e':
1015
- case 'se':
1016
- default:
1017
- if (this.marginLeft == null) {
1018
- this.marginLeft = this.xoffset + 'px';
1019
- }
1020
- this.marginRight = '0px';
1021
- break;
1022
- }
1023
- }
1024
- this.xoffset = 0;
1025
- }
1026
-
1027
- if (this.yoffset >0) {
1028
- if (this.placement == 'outside') {
1029
- switch (this.location) {
1030
- case 'sw':
1031
- case 's':
1032
- case 'se':
1033
- if (this.marginTop == null) {
1034
- this.marginTop = this.yoffset + 'px';
1035
- }
1036
- this.marginBottom = '0px';
1037
- break;
1038
- case 'ne':
1039
- case 'n':
1040
- case 'nw':
1041
- default:
1042
- if (this.marginBottom == null) {
1043
- this.marginBottom = this.yoffset + 'px';
1044
- }
1045
- this.marginTop = '0px';
1046
- break;
1047
- }
1048
- }
1049
- else if (this.placement == 'insideGrid') {
1050
- switch (this.location) {
1051
- case 'sw':
1052
- case 's':
1053
- case 'se':
1054
- if (this.marginBottom == null) {
1055
- this.marginBottom = this.yoffset + 'px';
1056
- }
1057
- this.marginTop = '0px';
1058
- break;
1059
- case 'ne':
1060
- case 'n':
1061
- case 'nw':
1062
- default:
1063
- if (this.marginTop == null) {
1064
- this.marginTop = this.yoffset + 'px';
1065
- }
1066
- this.marginBottom = '0px';
1067
- break;
1068
- }
1069
- }
1070
- this.yoffset = 0;
1071
- }
1072
-
1073
- // TO-DO:
1074
- // Handle case where offsets are < 0.
1075
- //
1076
- };
1077
-
1078
- Legend.prototype.init = function() {
1079
- if ($.isFunction(this.renderer)) {
1080
- this.renderer = new this.renderer();
1081
- }
1082
- this.renderer.init.call(this, this.rendererOptions);
1083
- };
1084
-
1085
- Legend.prototype.draw = function(offsets, plot) {
1086
- for (var i=0; i<$.jqplot.preDrawLegendHooks.length; i++){
1087
- $.jqplot.preDrawLegendHooks[i].call(this, offsets);
1088
- }
1089
- return this.renderer.draw.call(this, offsets, plot);
1090
- };
1091
-
1092
- Legend.prototype.pack = function(offsets) {
1093
- this.renderer.pack.call(this, offsets);
1094
- };
1095
-
1096
- /**
1097
- * Class: Title
1098
- * Plot Title object. Cannot be instantiated directly, but created
1099
- * by the Plot object. Title properties can be set or overridden by the
1100
- * options passed in from the user.
1101
- *
1102
- * Parameters:
1103
- * text - text of the title.
1104
- */
1105
- function Title(text) {
1106
- $.jqplot.ElemContainer.call(this);
1107
- // Group: Properties
1108
-
1109
- // prop: text
1110
- // text of the title;
1111
- this.text = text;
1112
- // prop: show
1113
- // whether or not to show the title
1114
- this.show = true;
1115
- // prop: fontFamily
1116
- // css font-family spec for the text.
1117
- this.fontFamily;
1118
- // prop: fontSize
1119
- // css font-size spec for the text.
1120
- this.fontSize ;
1121
- // prop: textAlign
1122
- // css text-align spec for the text.
1123
- this.textAlign;
1124
- // prop: textColor
1125
- // css color spec for the text.
1126
- this.textColor;
1127
- // prop: renderer
1128
- // A class for creating a DOM element for the title,
1129
- // see <$.jqplot.DivTitleRenderer>.
1130
- this.renderer = $.jqplot.DivTitleRenderer;
1131
- // prop: rendererOptions
1132
- // renderer specific options passed to the renderer.
1133
- this.rendererOptions = {};
1134
- // prop: escapeHtml
1135
- // True to escape special characters with their html entity equivalents
1136
- // in title text. "<" becomes &lt; and so on, so html tags are not rendered.
1137
- this.escapeHtml = false;
1138
- }
1139
-
1140
- Title.prototype = new $.jqplot.ElemContainer();
1141
- Title.prototype.constructor = Title;
1142
-
1143
- Title.prototype.init = function() {
1144
- if ($.isFunction(this.renderer)) {
1145
- this.renderer = new this.renderer();
1146
- }
1147
- this.renderer.init.call(this, this.rendererOptions);
1148
- };
1149
-
1150
- Title.prototype.draw = function(width) {
1151
- return this.renderer.draw.call(this, width);
1152
- };
1153
-
1154
- Title.prototype.pack = function() {
1155
- this.renderer.pack.call(this);
1156
- };
1157
-
1158
-
1159
- /**
1160
- * Class: Series
1161
- * An individual data series object. Cannot be instantiated directly, but created
1162
- * by the Plot object. Series properties can be set or overridden by the
1163
- * options passed in from the user.
1164
- */
1165
- function Series(options) {
1166
- options = options || {};
1167
- $.jqplot.ElemContainer.call(this);
1168
- // Group: Properties
1169
- // Properties will be assigned from a series array at the top level of the
1170
- // options. If you had two series and wanted to change the color and line
1171
- // width of the first and set the second to use the secondary y axis with
1172
- // no shadow and supply custom labels for each:
1173
- // > {
1174
- // > series:[
1175
- // > {color: '#ff4466', lineWidth: 5, label:'good line'},
1176
- // > {yaxis: 'y2axis', shadow: false, label:'bad line'}
1177
- // > ]
1178
- // > }
1179
-
1180
- // prop: show
1181
- // whether or not to draw the series.
1182
- this.show = true;
1183
- // prop: xaxis
1184
- // which x axis to use with this series, either 'xaxis' or 'x2axis'.
1185
- this.xaxis = 'xaxis';
1186
- this._xaxis;
1187
- // prop: yaxis
1188
- // which y axis to use with this series, either 'yaxis' or 'y2axis'.
1189
- this.yaxis = 'yaxis';
1190
- this._yaxis;
1191
- this.gridBorderWidth = 2.0;
1192
- // prop: renderer
1193
- // A class of a renderer which will draw the series,
1194
- // see <$.jqplot.LineRenderer>.
1195
- this.renderer = $.jqplot.LineRenderer;
1196
- // prop: rendererOptions
1197
- // Options to pass on to the renderer.
1198
- this.rendererOptions = {};
1199
- this.data = [];
1200
- this.gridData = [];
1201
- // prop: label
1202
- // Line label to use in the legend.
1203
- this.label = '';
1204
- // prop: showLabel
1205
- // true to show label for this series in the legend.
1206
- this.showLabel = true;
1207
- // prop: color
1208
- // css color spec for the series
1209
- this.color;
1210
- // prop: negativeColor
1211
- // css color spec used for filled (area) plots that are filled to zero and
1212
- // the "useNegativeColors" option is true.
1213
- this.negativeColor;
1214
- // prop: lineWidth
1215
- // width of the line in pixels. May have different meanings depending on renderer.
1216
- this.lineWidth = 2.5;
1217
- // prop: lineJoin
1218
- // Canvas lineJoin style between segments of series.
1219
- this.lineJoin = 'round';
1220
- // prop: lineCap
1221
- // Canvas lineCap style at ends of line.
1222
- this.lineCap = 'round';
1223
- // prop: linePattern
1224
- // line pattern 'dashed', 'dotted', 'solid', some combination
1225
- // of '-' and '.' characters such as '.-.' or a numerical array like
1226
- // [draw, skip, draw, skip, ...] such as [1, 10] to draw a dotted line,
1227
- // [1, 10, 20, 10] to draw a dot-dash line, and so on.
1228
- this.linePattern = 'solid';
1229
- this.shadow = true;
1230
- // prop: shadowAngle
1231
- // Shadow angle in degrees
1232
- this.shadowAngle = 45;
1233
- // prop: shadowOffset
1234
- // Shadow offset from line in pixels
1235
- this.shadowOffset = 1.25;
1236
- // prop: shadowDepth
1237
- // Number of times shadow is stroked, each stroke offset shadowOffset from the last.
1238
- this.shadowDepth = 3;
1239
- // prop: shadowAlpha
1240
- // Alpha channel transparency of shadow. 0 = transparent.
1241
- this.shadowAlpha = '0.1';
1242
- // prop: breakOnNull
1243
- // Wether line segments should be be broken at null value.
1244
- // False will join point on either side of line.
1245
- this.breakOnNull = false;
1246
- // prop: markerRenderer
1247
- // A class of a renderer which will draw marker (e.g. circle, square, ...) at the data points,
1248
- // see <$.jqplot.MarkerRenderer>.
1249
- this.markerRenderer = $.jqplot.MarkerRenderer;
1250
- // prop: markerOptions
1251
- // renderer specific options to pass to the markerRenderer,
1252
- // see <$.jqplot.MarkerRenderer>.
1253
- this.markerOptions = {};
1254
- // prop: showLine
1255
- // whether to actually draw the line or not. Series will still be renderered, even if no line is drawn.
1256
- this.showLine = true;
1257
- // prop: showMarker
1258
- // whether or not to show the markers at the data points.
1259
- this.showMarker = true;
1260
- // prop: index
1261
- // 0 based index of this series in the plot series array.
1262
- this.index;
1263
- // prop: fill
1264
- // true or false, whether to fill under lines or in bars.
1265
- // May not be implemented in all renderers.
1266
- this.fill = false;
1267
- // prop: fillColor
1268
- // CSS color spec to use for fill under line. Defaults to line color.
1269
- this.fillColor;
1270
- // prop: fillAlpha
1271
- // Alpha transparency to apply to the fill under the line.
1272
- // Use this to adjust alpha separate from fill color.
1273
- this.fillAlpha;
1274
- // prop: fillAndStroke
1275
- // If true will stroke the line (with color this.color) as well as fill under it.
1276
- // Applies only when fill is true.
1277
- this.fillAndStroke = false;
1278
- // prop: disableStack
1279
- // true to not stack this series with other series in the plot.
1280
- // To render properly, non-stacked series must come after any stacked series
1281
- // in the plot's data series array. So, the plot's data series array would look like:
1282
- // > [stackedSeries1, stackedSeries2, ..., nonStackedSeries1, nonStackedSeries2, ...]
1283
- // disableStack will put a gap in the stacking order of series, and subsequent
1284
- // stacked series will not fill down through the non-stacked series and will
1285
- // most likely not stack properly on top of the non-stacked series.
1286
- this.disableStack = false;
1287
- // _stack is set by the Plot if the plot is a stacked chart.
1288
- // will stack lines or bars on top of one another to build a "mountain" style chart.
1289
- // May not be implemented in all renderers.
1290
- this._stack = false;
1291
- // prop: neighborThreshold
1292
- // how close or far (in pixels) the cursor must be from a point marker to detect the point.
1293
- this.neighborThreshold = 4;
1294
- // prop: fillToZero
1295
- // true will force bar and filled series to fill toward zero on the fill Axis.
1296
- this.fillToZero = false;
1297
- // prop: fillToValue
1298
- // fill a filled series to this value on the fill axis.
1299
- // Works in conjunction with fillToZero, so that must be true.
1300
- this.fillToValue = 0;
1301
- // prop: fillAxis
1302
- // Either 'x' or 'y'. Which axis to fill the line toward if fillToZero is true.
1303
- // 'y' means fill up/down to 0 on the y axis for this series.
1304
- this.fillAxis = 'y';
1305
- // prop: useNegativeColors
1306
- // true to color negative values differently in filled and bar charts.
1307
- this.useNegativeColors = true;
1308
- this._stackData = [];
1309
- // _plotData accounts for stacking. If plots not stacked, _plotData and data are same. If
1310
- // stacked, _plotData is accumulation of stacking data.
1311
- this._plotData = [];
1312
- // _plotValues hold the individual x and y values that will be plotted for this series.
1313
- this._plotValues = {x:[], y:[]};
1314
- // statistics about the intervals between data points. Used for auto scaling.
1315
- this._intervals = {x:{}, y:{}};
1316
- // data from the previous series, for stacked charts.
1317
- this._prevPlotData = [];
1318
- this._prevGridData = [];
1319
- this._stackAxis = 'y';
1320
- this._primaryAxis = '_xaxis';
1321
- // give each series a canvas to draw on. This should allow for redrawing speedups.
1322
- this.canvas = new $.jqplot.GenericCanvas();
1323
- this.shadowCanvas = new $.jqplot.GenericCanvas();
1324
- this.plugins = {};
1325
- // sum of y values in this series.
1326
- this._sumy = 0;
1327
- this._sumx = 0;
1328
- this._type = '';
1329
- this.step = false;
1330
- }
1331
-
1332
- Series.prototype = new $.jqplot.ElemContainer();
1333
- Series.prototype.constructor = Series;
1334
-
1335
- Series.prototype.init = function(index, gridbw, plot) {
1336
- // weed out any null values in the data.
1337
- this.index = index;
1338
- this.gridBorderWidth = gridbw;
1339
- var d = this.data;
1340
- var temp = [], i, l;
1341
- for (i=0, l=d.length; i<l; i++) {
1342
- if (! this.breakOnNull) {
1343
- if (d[i] == null || d[i][0] == null || d[i][1] == null) {
1344
- continue;
1345
- }
1346
- else {
1347
- temp.push(d[i]);
1348
- }
1349
- }
1350
- else {
1351
- // TODO: figure out what to do with null values
1352
- // probably involve keeping nulls in data array
1353
- // and then updating renderers to break line
1354
- // when it hits null value.
1355
- // For now, just keep value.
1356
- temp.push(d[i]);
1357
- }
1358
- }
1359
- this.data = temp;
1360
-
1361
- // parse the renderer options and apply default colors if not provided
1362
- // Set color even if not shown, so series don't change colors when other
1363
- // series on plot shown/hidden.
1364
- if (!this.color) {
1365
- this.color = plot.colorGenerator.get(this.index);
1366
- }
1367
- if (!this.negativeColor) {
1368
- this.negativeColor = plot.negativeColorGenerator.get(this.index);
1369
- }
1370
-
1371
-
1372
- if (!this.fillColor) {
1373
- this.fillColor = this.color;
1374
- }
1375
- if (this.fillAlpha) {
1376
- var comp = $.jqplot.normalize2rgb(this.fillColor);
1377
- var comp = $.jqplot.getColorComponents(comp);
1378
- this.fillColor = 'rgba('+comp[0]+','+comp[1]+','+comp[2]+','+this.fillAlpha+')';
1379
- }
1380
- if ($.isFunction(this.renderer)) {
1381
- this.renderer = new this.renderer();
1382
- }
1383
- this.renderer.init.call(this, this.rendererOptions, plot);
1384
- this.markerRenderer = new this.markerRenderer();
1385
- if (!this.markerOptions.color) {
1386
- this.markerOptions.color = this.color;
1387
- }
1388
- if (this.markerOptions.show == null) {
1389
- this.markerOptions.show = this.showMarker;
1390
- }
1391
- this.showMarker = this.markerOptions.show;
1392
- // the markerRenderer is called within its own scope, don't want to overwrite series options!!
1393
- this.markerRenderer.init(this.markerOptions);
1394
- };
1395
-
1396
- // data - optional data point array to draw using this series renderer
1397
- // gridData - optional grid data point array to draw using this series renderer
1398
- // stackData - array of cumulative data for stacked plots.
1399
- Series.prototype.draw = function(sctx, opts, plot) {
1400
- var options = (opts == undefined) ? {} : opts;
1401
- sctx = (sctx == undefined) ? this.canvas._ctx : sctx;
1402
-
1403
- var j, data, gridData;
1404
-
1405
- // hooks get called even if series not shown
1406
- // we don't clear canvas here, it would wipe out all other series as well.
1407
- for (j=0; j<$.jqplot.preDrawSeriesHooks.length; j++) {
1408
- $.jqplot.preDrawSeriesHooks[j].call(this, sctx, options);
1409
- }
1410
- if (this.show) {
1411
- this.renderer.setGridData.call(this, plot);
1412
- if (!options.preventJqPlotSeriesDrawTrigger) {
1413
- $(sctx.canvas).trigger('jqplotSeriesDraw', [this.data, this.gridData]);
1414
- }
1415
- data = [];
1416
- if (options.data) {
1417
- data = options.data;
1418
- }
1419
- else if (!this._stack) {
1420
- data = this.data;
1421
- }
1422
- else {
1423
- data = this._plotData;
1424
- }
1425
- gridData = options.gridData || this.renderer.makeGridData.call(this, data, plot);
1426
-
1427
- if (this._type === 'line' && this.renderer.smooth && this.renderer._smoothedData.length) {
1428
- gridData = this.renderer._smoothedData;
1429
- }
1430
-
1431
- this.renderer.draw.call(this, sctx, gridData, options, plot);
1432
- }
1433
-
1434
- for (j=0; j<$.jqplot.postDrawSeriesHooks.length; j++) {
1435
- $.jqplot.postDrawSeriesHooks[j].call(this, sctx, options, plot);
1436
- }
1437
-
1438
- sctx = opts = plot = j = data = gridData = null;
1439
- };
1440
-
1441
- Series.prototype.drawShadow = function(sctx, opts, plot) {
1442
- var options = (opts == undefined) ? {} : opts;
1443
- sctx = (sctx == undefined) ? this.shadowCanvas._ctx : sctx;
1444
-
1445
- var j, data, gridData;
1446
-
1447
- // hooks get called even if series not shown
1448
- // we don't clear canvas here, it would wipe out all other series as well.
1449
- for (j=0; j<$.jqplot.preDrawSeriesShadowHooks.length; j++) {
1450
- $.jqplot.preDrawSeriesShadowHooks[j].call(this, sctx, options);
1451
- }
1452
- if (this.shadow) {
1453
- this.renderer.setGridData.call(this, plot);
1454
-
1455
- data = [];
1456
- if (options.data) {
1457
- data = options.data;
1458
- }
1459
- else if (!this._stack) {
1460
- data = this.data;
1461
- }
1462
- else {
1463
- data = this._plotData;
1464
- }
1465
- gridData = options.gridData || this.renderer.makeGridData.call(this, data, plot);
1466
-
1467
- this.renderer.drawShadow.call(this, sctx, gridData, options, plot);
1468
- }
1469
-
1470
- for (j=0; j<$.jqplot.postDrawSeriesShadowHooks.length; j++) {
1471
- $.jqplot.postDrawSeriesShadowHooks[j].call(this, sctx, options);
1472
- }
1473
-
1474
- sctx = opts = plot = j = data = gridData = null;
1475
-
1476
- };
1477
-
1478
- // toggles series display on plot, e.g. show/hide series
1479
- Series.prototype.toggleDisplay = function(ev, callback) {
1480
- var s, speed;
1481
- if (ev.data.series) {
1482
- s = ev.data.series;
1483
- }
1484
- else {
1485
- s = this;
1486
- }
1487
-
1488
- if (ev.data.speed) {
1489
- speed = ev.data.speed;
1490
- }
1491
- if (speed) {
1492
- // this can be tricky because series may not have a canvas element if replotting.
1493
- if (s.canvas._elem.is(':hidden') || !s.show) {
1494
- s.show = true;
1495
-
1496
- s.canvas._elem.removeClass('jqplot-series-hidden');
1497
- if (s.shadowCanvas._elem) {
1498
- s.shadowCanvas._elem.fadeIn(speed);
1499
- }
1500
- s.canvas._elem.fadeIn(speed, callback);
1501
- s.canvas._elem.nextAll('.jqplot-point-label.jqplot-series-'+s.index).fadeIn(speed);
1502
- }
1503
- else {
1504
- s.show = false;
1505
-
1506
- s.canvas._elem.addClass('jqplot-series-hidden');
1507
- if (s.shadowCanvas._elem) {
1508
- s.shadowCanvas._elem.fadeOut(speed);
1509
- }
1510
- s.canvas._elem.fadeOut(speed, callback);
1511
- s.canvas._elem.nextAll('.jqplot-point-label.jqplot-series-'+s.index).fadeOut(speed);
1512
- }
1513
- }
1514
- else {
1515
- // this can be tricky because series may not have a canvas element if replotting.
1516
- if (s.canvas._elem.is(':hidden') || !s.show) {
1517
- s.show = true;
1518
-
1519
- s.canvas._elem.removeClass('jqplot-series-hidden');
1520
- if (s.shadowCanvas._elem) {
1521
- s.shadowCanvas._elem.show();
1522
- }
1523
- s.canvas._elem.show(0, callback);
1524
- s.canvas._elem.nextAll('.jqplot-point-label.jqplot-series-'+s.index).show();
1525
- }
1526
- else {
1527
- s.show = false;
1528
-
1529
- s.canvas._elem.addClass('jqplot-series-hidden');
1530
- if (s.shadowCanvas._elem) {
1531
- s.shadowCanvas._elem.hide();
1532
- }
1533
- s.canvas._elem.hide(0, callback);
1534
- s.canvas._elem.nextAll('.jqplot-point-label.jqplot-series-'+s.index).hide();
1535
- }
1536
- }
1537
- };
1538
-
1539
-
1540
-
1541
- /**
1542
- * Class: Grid
1543
- *
1544
- * Object representing the grid on which the plot is drawn. The grid in this
1545
- * context is the area bounded by the axes, the area which will contain the series.
1546
- * Note, the series are drawn on their own canvas.
1547
- * The Grid object cannot be instantiated directly, but is created by the Plot object.
1548
- * Grid properties can be set or overridden by the options passed in from the user.
1549
- */
1550
- function Grid() {
1551
- $.jqplot.ElemContainer.call(this);
1552
- // Group: Properties
1553
-
1554
- // prop: drawGridlines
1555
- // whether to draw the gridlines on the plot.
1556
- this.drawGridlines = true;
1557
- // prop: gridLineColor
1558
- // color of the grid lines.
1559
- this.gridLineColor = '#cccccc';
1560
- // prop: gridLineWidth
1561
- // width of the grid lines.
1562
- this.gridLineWidth = 1.0;
1563
- // prop: background
1564
- // css spec for the background color.
1565
- this.background = '#fffdf6';
1566
- // prop: borderColor
1567
- // css spec for the color of the grid border.
1568
- this.borderColor = '#999999';
1569
- // prop: borderWidth
1570
- // width of the border in pixels.
1571
- this.borderWidth = 2.0;
1572
- // prop: drawBorder
1573
- // True to draw border around grid.
1574
- this.drawBorder = true;
1575
- // prop: shadow
1576
- // whether to show a shadow behind the grid.
1577
- this.shadow = true;
1578
- // prop: shadowAngle
1579
- // shadow angle in degrees
1580
- this.shadowAngle = 45;
1581
- // prop: shadowOffset
1582
- // Offset of each shadow stroke from the border in pixels
1583
- this.shadowOffset = 1.5;
1584
- // prop: shadowWidth
1585
- // width of the stoke for the shadow
1586
- this.shadowWidth = 3;
1587
- // prop: shadowDepth
1588
- // Number of times shadow is stroked, each stroke offset shadowOffset from the last.
1589
- this.shadowDepth = 3;
1590
- // prop: shadowColor
1591
- // an optional css color spec for the shadow in 'rgba(n, n, n, n)' form
1592
- this.shadowColor = null;
1593
- // prop: shadowAlpha
1594
- // Alpha channel transparency of shadow. 0 = transparent.
1595
- this.shadowAlpha = '0.07';
1596
- this._left;
1597
- this._top;
1598
- this._right;
1599
- this._bottom;
1600
- this._width;
1601
- this._height;
1602
- this._axes = [];
1603
- // prop: renderer
1604
- // Instance of a renderer which will actually render the grid,
1605
- // see <$.jqplot.CanvasGridRenderer>.
1606
- this.renderer = $.jqplot.CanvasGridRenderer;
1607
- // prop: rendererOptions
1608
- // Options to pass on to the renderer,
1609
- // see <$.jqplot.CanvasGridRenderer>.
1610
- this.rendererOptions = {};
1611
- this._offsets = {top:null, bottom:null, left:null, right:null};
1612
- }
1613
-
1614
- Grid.prototype = new $.jqplot.ElemContainer();
1615
- Grid.prototype.constructor = Grid;
1616
-
1617
- Grid.prototype.init = function() {
1618
- if ($.isFunction(this.renderer)) {
1619
- this.renderer = new this.renderer();
1620
- }
1621
- this.renderer.init.call(this, this.rendererOptions);
1622
- };
1623
-
1624
- Grid.prototype.createElement = function(offsets,plot) {
1625
- this._offsets = offsets;
1626
- return this.renderer.createElement.call(this, plot);
1627
- };
1628
-
1629
- Grid.prototype.draw = function() {
1630
- this.renderer.draw.call(this);
1631
- };
1632
-
1633
- $.jqplot.GenericCanvas = function() {
1634
- $.jqplot.ElemContainer.call(this);
1635
- this._ctx;
1636
- };
1637
-
1638
- $.jqplot.GenericCanvas.prototype = new $.jqplot.ElemContainer();
1639
- $.jqplot.GenericCanvas.prototype.constructor = $.jqplot.GenericCanvas;
1640
-
1641
- $.jqplot.GenericCanvas.prototype.createElement = function(offsets, clss, plotDimensions, plot) {
1642
- this._offsets = offsets;
1643
- var klass = 'jqplot';
1644
- if (clss != undefined) {
1645
- klass = clss;
1646
- }
1647
- var elem;
1648
-
1649
- elem = plot.canvasManager.getCanvas();
1650
-
1651
- // if new plotDimensions supplied, use them.
1652
- if (plotDimensions != null) {
1653
- this._plotDimensions = plotDimensions;
1654
- }
1655
-
1656
- elem.width = this._plotDimensions.width - this._offsets.left - this._offsets.right;
1657
- elem.height = this._plotDimensions.height - this._offsets.top - this._offsets.bottom;
1658
- this._elem = $(elem);
1659
- this._elem.css({ position: 'absolute', left: this._offsets.left, top: this._offsets.top });
1660
-
1661
- this._elem.addClass(klass);
1662
-
1663
- elem = plot.canvasManager.initCanvas(elem);
1664
-
1665
- elem = null;
1666
- return this._elem;
1667
- };
1668
-
1669
- $.jqplot.GenericCanvas.prototype.setContext = function() {
1670
- this._ctx = this._elem.get(0).getContext("2d");
1671
- return this._ctx;
1672
- };
1673
-
1674
- // Memory Leaks patch
1675
- $.jqplot.GenericCanvas.prototype.resetCanvas = function() {
1676
- if (this._elem) {
1677
- if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
1678
- window.G_vmlCanvasManager.uninitElement(this._elem.get(0));
1679
- }
1680
-
1681
- //this._elem.remove();
1682
- this._elem.emptyForce();
1683
- }
1684
-
1685
- this._ctx = null;
1686
- };
1687
-
1688
- $.jqplot.HooksManager = function () {
1689
- this.hooks =[];
1690
- this.args = [];
1691
- };
1692
-
1693
- $.jqplot.HooksManager.prototype.addOnce = function(fn, args) {
1694
- args = args || [];
1695
- var havehook = false;
1696
- for (var i=0, l=this.hooks.length; i<l; i++) {
1697
- if (this.hooks[i] == fn) {
1698
- havehook = true;
1699
- }
1700
- }
1701
- if (!havehook) {
1702
- this.hooks.push(fn);
1703
- this.args.push(args);
1704
- }
1705
- };
1706
-
1707
- $.jqplot.HooksManager.prototype.add = function(fn, args) {
1708
- args = args || [];
1709
- this.hooks.push(fn);
1710
- this.args.push(args);
1711
- };
1712
-
1713
- $.jqplot.EventListenerManager = function () {
1714
- this.hooks =[];
1715
- };
1716
-
1717
- $.jqplot.EventListenerManager.prototype.addOnce = function(ev, fn) {
1718
- var havehook = false, h, i;
1719
- for (var i=0, l=this.hooks.length; i<l; i++) {
1720
- h = this.hooks[i];
1721
- if (h[0] == ev && h[1] == fn) {
1722
- havehook = true;
1723
- }
1724
- }
1725
- if (!havehook) {
1726
- this.hooks.push([ev, fn]);
1727
- }
1728
- };
1729
-
1730
- $.jqplot.EventListenerManager.prototype.add = function(ev, fn) {
1731
- this.hooks.push([ev, fn]);
1732
- };
1733
-
1734
-
1735
- var _axisNames = ['yMidAxis', 'xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis'];
1736
-
1737
- /**
1738
- * Class: jqPlot
1739
- * Plot object returned by call to $.jqplot. Handles parsing user options,
1740
- * creating sub objects (Axes, legend, title, series) and rendering the plot.
1741
- */
1742
- function jqPlot() {
1743
- // Group: Properties
1744
- // These properties are specified at the top of the options object
1745
- // like so:
1746
- // > {
1747
- // > axesDefaults:{min:0},
1748
- // > series:[{color:'#6633dd'}],
1749
- // > title: 'A Plot'
1750
- // > }
1751
- //
1752
-
1753
- // prop: animate
1754
- // True to animate the series on initial plot draw (renderer dependent).
1755
- // Actual animation functionality must be supported in the renderer.
1756
- this.animate = false;
1757
- // prop: animateReplot
1758
- // True to animate series after a call to the replot() method.
1759
- // Use with caution! Replots can happen very frequently under
1760
- // certain circumstances (e.g. resizing, dragging points) and
1761
- // animation in these situations can cause problems.
1762
- this.animateReplot = false;
1763
- // prop: axes
1764
- // up to 4 axes are supported, each with its own options,
1765
- // See <Axis> for axis specific options.
1766
- this.axes = {xaxis: new Axis('xaxis'), yaxis: new Axis('yaxis'), x2axis: new Axis('x2axis'), y2axis: new Axis('y2axis'), y3axis: new Axis('y3axis'), y4axis: new Axis('y4axis'), y5axis: new Axis('y5axis'), y6axis: new Axis('y6axis'), y7axis: new Axis('y7axis'), y8axis: new Axis('y8axis'), y9axis: new Axis('y9axis'), yMidAxis: new Axis('yMidAxis')};
1767
- this.baseCanvas = new $.jqplot.GenericCanvas();
1768
- // true to intercept right click events and fire a 'jqplotRightClick' event.
1769
- // this will also block the context menu.
1770
- this.captureRightClick = false;
1771
- // prop: data
1772
- // user's data. Data should *NOT* be specified in the options object,
1773
- // but be passed in as the second argument to the $.jqplot() function.
1774
- // The data property is described here soley for reference.
1775
- // The data should be in the form of an array of 2D or 1D arrays like
1776
- // > [ [[x1, y1], [x2, y2],...], [y1, y2, ...] ].
1777
- this.data = [];
1778
- // prop: dataRenderer
1779
- // A callable which can be used to preprocess data passed into the plot.
1780
- // Will be called with 3 arguments: the plot data, a reference to the plot,
1781
- // and the value of dataRendererOptions.
1782
- this.dataRenderer;
1783
- // prop: dataRendererOptions
1784
- // Options that will be passed to the dataRenderer.
1785
- // Can be of any type.
1786
- this.dataRendererOptions;
1787
- this.defaults = {
1788
- // prop: axesDefaults
1789
- // default options that will be applied to all axes.
1790
- // see <Axis> for axes options.
1791
- axesDefaults: {},
1792
- axes: {xaxis:{}, yaxis:{}, x2axis:{}, y2axis:{}, y3axis:{}, y4axis:{}, y5axis:{}, y6axis:{}, y7axis:{}, y8axis:{}, y9axis:{}, yMidAxis:{}},
1793
- // prop: seriesDefaults
1794
- // default options that will be applied to all series.
1795
- // see <Series> for series options.
1796
- seriesDefaults: {},
1797
- series:[]
1798
- };
1799
- // prop: defaultAxisStart
1800
- // 1-D data series are internally converted into 2-D [x,y] data point arrays
1801
- // by jqPlot. This is the default starting value for the missing x or y value.
1802
- // The added data will be a monotonically increasing series (e.g. [1, 2, 3, ...])
1803
- // starting at this value.
1804
- this.defaultAxisStart = 1;
1805
- // this.doCustomEventBinding = true;
1806
- // prop: drawIfHidden
1807
- // True to execute the draw method even if the plot target is hidden.
1808
- // Generally, this should be false. Most plot elements will not be sized/
1809
- // positioned correclty if renderered into a hidden container. To render into
1810
- // a hidden container, call the replot method when the container is shown.
1811
- this.drawIfHidden = false;
1812
- this.eventCanvas = new $.jqplot.GenericCanvas();
1813
- // prop: fillBetween
1814
- // Fill between 2 line series in a plot.
1815
- // Options object:
1816
- // {
1817
- // series1: first index (0 based) of series in fill
1818
- // series2: second index (0 based) of series in fill
1819
- // color: color of fill [default fillColor of series1]
1820
- // baseSeries: fill will be drawn below this series (0 based index)
1821
- // fill: false to turn off fill [default true].
1822
- // }
1823
- this.fillBetween = {
1824
- series1: null,
1825
- series2: null,
1826
- color: null,
1827
- baseSeries: 0,
1828
- fill: true
1829
- };
1830
- // prop; fontFamily
1831
- // css spec for the font-family attribute. Default for the entire plot.
1832
- this.fontFamily;
1833
- // prop: fontSize
1834
- // css spec for the font-size attribute. Default for the entire plot.
1835
- this.fontSize;
1836
- // prop: grid
1837
- // See <Grid> for grid specific options.
1838
- this.grid = new Grid();
1839
- // prop: legend
1840
- // see <$.jqplot.TableLegendRenderer>
1841
- this.legend = new Legend();
1842
- // prop: noDataIndicator
1843
- // Options to set up a mock plot with a data loading indicator if no data is specified.
1844
- this.noDataIndicator = {
1845
- show: false,
1846
- indicator: 'Loading Data...',
1847
- axes: {
1848
- xaxis: {
1849
- min: 0,
1850
- max: 10,
1851
- tickInterval: 2,
1852
- show: true
1853
- },
1854
- yaxis: {
1855
- min: 0,
1856
- max: 12,
1857
- tickInterval: 3,
1858
- show: true
1859
- }
1860
- }
1861
- };
1862
- // prop: negativeSeriesColors
1863
- // colors to use for portions of the line below zero.
1864
- this.negativeSeriesColors = $.jqplot.config.defaultNegativeColors;
1865
- // container to hold all of the merged options. Convienence for plugins.
1866
- this.options = {};
1867
- this.previousSeriesStack = [];
1868
- // Namespace to hold plugins. Generally non-renderer plugins add themselves to here.
1869
- this.plugins = {};
1870
- // prop: series
1871
- // Array of series object options.
1872
- // see <Series> for series specific options.
1873
- this.series = [];
1874
- // array of series indices. Keep track of order
1875
- // which series canvases are displayed, lowest
1876
- // to highest, back to front.
1877
- this.seriesStack = [];
1878
- // prop: seriesColors
1879
- // Ann array of CSS color specifications that will be applied, in order,
1880
- // to the series in the plot. Colors will wrap around so, if their
1881
- // are more series than colors, colors will be reused starting at the
1882
- // beginning. For pie charts, this specifies the colors of the slices.
1883
- this.seriesColors = $.jqplot.config.defaultColors;
1884
- // prop: sortData
1885
- // false to not sort the data passed in by the user.
1886
- // Many bar, stacked and other graphs as well as many plugins depend on
1887
- // having sorted data.
1888
- this.sortData = true;
1889
- // prop: stackSeries
1890
- // true or false, creates a stack or "mountain" plot.
1891
- // Not all series renderers may implement this option.
1892
- this.stackSeries = false;
1893
- // a shortcut for axis syncTicks options. Not implemented yet.
1894
- this.syncXTicks = true;
1895
- // a shortcut for axis syncTicks options. Not implemented yet.
1896
- this.syncYTicks = true;
1897
- // the jquery object for the dom target.
1898
- this.target = null;
1899
- // The id of the dom element to render the plot into
1900
- this.targetId = null;
1901
- // prop textColor
1902
- // css spec for the css color attribute. Default for the entire plot.
1903
- this.textColor;
1904
- // prop: title
1905
- // Title object. See <Title> for specific options. As a shortcut, you
1906
- // can specify the title option as just a string like: title: 'My Plot'
1907
- // and this will create a new title object with the specified text.
1908
- this.title = new Title();
1909
- // Count how many times the draw method has been called while the plot is visible.
1910
- // Mostly used to test if plot has never been dran (=0), has been successfully drawn
1911
- // into a visible container once (=1) or draw more than once into a visible container.
1912
- // Can use this in tests to see if plot has been visibly drawn at least one time.
1913
- // After plot has been visibly drawn once, it generally doesn't need redrawing if its
1914
- // container is hidden and shown.
1915
- this._drawCount = 0;
1916
- // sum of y values for all series in plot.
1917
- // used in mekko chart.
1918
- this._sumy = 0;
1919
- this._sumx = 0;
1920
- // array to hold the cumulative stacked series data.
1921
- // used to ajust the individual series data, which won't have access to other
1922
- // series data.
1923
- this._stackData = [];
1924
- // array that holds the data to be plotted. This will be the series data
1925
- // merged with the the appropriate data from _stackData according to the stackAxis.
1926
- this._plotData = [];
1927
- this._width = null;
1928
- this._height = null;
1929
- this._plotDimensions = {height:null, width:null};
1930
- this._gridPadding = {top:null, right:null, bottom:null, left:null};
1931
- this._defaultGridPadding = {top:10, right:10, bottom:23, left:10};
1932
-
1933
- this._addDomReference = $.jqplot.config.addDomReference;
1934
-
1935
- this.preInitHooks = new $.jqplot.HooksManager();
1936
- this.postInitHooks = new $.jqplot.HooksManager();
1937
- this.preParseOptionsHooks = new $.jqplot.HooksManager();
1938
- this.postParseOptionsHooks = new $.jqplot.HooksManager();
1939
- this.preDrawHooks = new $.jqplot.HooksManager();
1940
- this.postDrawHooks = new $.jqplot.HooksManager();
1941
- this.preDrawSeriesHooks = new $.jqplot.HooksManager();
1942
- this.postDrawSeriesHooks = new $.jqplot.HooksManager();
1943
- this.preDrawLegendHooks = new $.jqplot.HooksManager();
1944
- this.addLegendRowHooks = new $.jqplot.HooksManager();
1945
- this.preSeriesInitHooks = new $.jqplot.HooksManager();
1946
- this.postSeriesInitHooks = new $.jqplot.HooksManager();
1947
- this.preParseSeriesOptionsHooks = new $.jqplot.HooksManager();
1948
- this.postParseSeriesOptionsHooks = new $.jqplot.HooksManager();
1949
- this.eventListenerHooks = new $.jqplot.EventListenerManager();
1950
- this.preDrawSeriesShadowHooks = new $.jqplot.HooksManager();
1951
- this.postDrawSeriesShadowHooks = new $.jqplot.HooksManager();
1952
-
1953
- this.colorGenerator = new $.jqplot.ColorGenerator();
1954
- this.negativeColorGenerator = new $.jqplot.ColorGenerator();
1955
-
1956
- this.canvasManager = new $.jqplot.CanvasManager();
1957
-
1958
- this.themeEngine = new $.jqplot.ThemeEngine();
1959
-
1960
- var seriesColorsIndex = 0;
1961
-
1962
- // Group: methods
1963
- //
1964
- // method: init
1965
- // sets the plot target, checks data and applies user
1966
- // options to plot.
1967
- this.init = function(target, data, options) {
1968
- options = options || {};
1969
- for (var i=0; i<$.jqplot.preInitHooks.length; i++) {
1970
- $.jqplot.preInitHooks[i].call(this, target, data, options);
1971
- }
1972
-
1973
- for (var i=0; i<this.preInitHooks.hooks.length; i++) {
1974
- this.preInitHooks.hooks[i].call(this, target, data, options);
1975
- }
1976
-
1977
- this.targetId = '#'+target;
1978
- this.target = $('#'+target);
1979
-
1980
- //////
1981
- // Add a reference to plot
1982
- //////
1983
- if (this._addDomReference) {
1984
- this.target.data('jqplot', this);
1985
- }
1986
- // remove any error class that may be stuck on target.
1987
- this.target.removeClass('jqplot-error');
1988
- if (!this.target.get(0)) {
1989
- throw new Error("No plot target specified");
1990
- }
1991
-
1992
- // make sure the target is positioned by some means and set css
1993
- if (this.target.css('position') == 'static') {
1994
- this.target.css('position', 'relative');
1995
- }
1996
- if (!this.target.hasClass('jqplot-target')) {
1997
- this.target.addClass('jqplot-target');
1998
- }
1999
-
2000
- // if no height or width specified, use a default.
2001
- if (!this.target.height()) {
2002
- var h;
2003
- if (options && options.height) {
2004
- h = parseInt(options.height, 10);
2005
- }
2006
- else if (this.target.attr('data-height')) {
2007
- h = parseInt(this.target.attr('data-height'), 10);
2008
- }
2009
- else {
2010
- h = parseInt($.jqplot.config.defaultHeight, 10);
2011
- }
2012
- this._height = h;
2013
- this.target.css('height', h+'px');
2014
- }
2015
- else {
2016
- this._height = h = this.target.height();
2017
- }
2018
- if (!this.target.width()) {
2019
- var w;
2020
- if (options && options.width) {
2021
- w = parseInt(options.width, 10);
2022
- }
2023
- else if (this.target.attr('data-width')) {
2024
- w = parseInt(this.target.attr('data-width'), 10);
2025
- }
2026
- else {
2027
- w = parseInt($.jqplot.config.defaultWidth, 10);
2028
- }
2029
- this._width = w;
2030
- this.target.css('width', w+'px');
2031
- }
2032
- else {
2033
- this._width = w = this.target.width();
2034
- }
2035
-
2036
- for (var i=0, l=_axisNames.length; i<l; i++) {
2037
- this.axes[_axisNames[i]] = new Axis(_axisNames[i]);
2038
- }
2039
-
2040
- this._plotDimensions.height = this._height;
2041
- this._plotDimensions.width = this._width;
2042
- this.grid._plotDimensions = this._plotDimensions;
2043
- this.title._plotDimensions = this._plotDimensions;
2044
- this.baseCanvas._plotDimensions = this._plotDimensions;
2045
- this.eventCanvas._plotDimensions = this._plotDimensions;
2046
- this.legend._plotDimensions = this._plotDimensions;
2047
- if (this._height <=0 || this._width <=0 || !this._height || !this._width) {
2048
- throw new Error("Canvas dimension not set");
2049
- }
2050
-
2051
- if (options.dataRenderer && $.isFunction(options.dataRenderer)) {
2052
- if (options.dataRendererOptions) {
2053
- this.dataRendererOptions = options.dataRendererOptions;
2054
- }
2055
- this.dataRenderer = options.dataRenderer;
2056
- data = this.dataRenderer(data, this, this.dataRendererOptions);
2057
- }
2058
-
2059
- if (options.noDataIndicator && $.isPlainObject(options.noDataIndicator)) {
2060
- $.extend(true, this.noDataIndicator, options.noDataIndicator);
2061
- }
2062
-
2063
- if (data == null || $.isArray(data) == false || data.length == 0 || $.isArray(data[0]) == false || data[0].length == 0) {
2064
-
2065
- if (this.noDataIndicator.show == false) {
2066
- throw new Error("No data specified");
2067
- }
2068
-
2069
- else {
2070
- // have to be descructive here in order for plot to not try and render series.
2071
- // This means that $.jqplot() will have to be called again when there is data.
2072
- //delete options.series;
2073
-
2074
- for (var ax in this.noDataIndicator.axes) {
2075
- for (var prop in this.noDataIndicator.axes[ax]) {
2076
- this.axes[ax][prop] = this.noDataIndicator.axes[ax][prop];
2077
- }
2078
- }
2079
-
2080
- this.postDrawHooks.add(function() {
2081
- var eh = this.eventCanvas.getHeight();
2082
- var ew = this.eventCanvas.getWidth();
2083
- var temp = $('<div class="jqplot-noData-container" style="position:absolute;"></div>');
2084
- this.target.append(temp);
2085
- temp.height(eh);
2086
- temp.width(ew);
2087
- temp.css('top', this.eventCanvas._offsets.top);
2088
- temp.css('left', this.eventCanvas._offsets.left);
2089
-
2090
- var temp2 = $('<div class="jqplot-noData-contents" style="text-align:center; position:relative; margin-left:auto; margin-right:auto;"></div>');
2091
- temp.append(temp2);
2092
- temp2.html(this.noDataIndicator.indicator);
2093
- var th = temp2.height();
2094
- var tw = temp2.width();
2095
- temp2.height(th);
2096
- temp2.width(tw);
2097
- temp2.css('top', (eh - th)/2 + 'px');
2098
- });
2099
-
2100
- }
2101
- }
2102
-
2103
- // make a copy of the data
2104
- this.data = $.extend(true, [], data);
2105
-
2106
- this.parseOptions(options);
2107
-
2108
- if (this.textColor) {
2109
- this.target.css('color', this.textColor);
2110
- }
2111
- if (this.fontFamily) {
2112
- this.target.css('font-family', this.fontFamily);
2113
- }
2114
- if (this.fontSize) {
2115
- this.target.css('font-size', this.fontSize);
2116
- }
2117
-
2118
- this.title.init();
2119
- this.legend.init();
2120
- this._sumy = 0;
2121
- this._sumx = 0;
2122
- this.computePlotData();
2123
- for (var i=0; i<this.series.length; i++) {
2124
- // set default stacking order for series canvases
2125
- this.seriesStack.push(i);
2126
- this.previousSeriesStack.push(i);
2127
- this.series[i].shadowCanvas._plotDimensions = this._plotDimensions;
2128
- this.series[i].canvas._plotDimensions = this._plotDimensions;
2129
- for (var j=0; j<$.jqplot.preSeriesInitHooks.length; j++) {
2130
- $.jqplot.preSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
2131
- }
2132
- for (var j=0; j<this.preSeriesInitHooks.hooks.length; j++) {
2133
- this.preSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
2134
- }
2135
- // this.populatePlotData(this.series[i], i);
2136
- this.series[i]._plotDimensions = this._plotDimensions;
2137
- this.series[i].init(i, this.grid.borderWidth, this);
2138
- for (var j=0; j<$.jqplot.postSeriesInitHooks.length; j++) {
2139
- $.jqplot.postSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
2140
- }
2141
- for (var j=0; j<this.postSeriesInitHooks.hooks.length; j++) {
2142
- this.postSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
2143
- }
2144
- this._sumy += this.series[i]._sumy;
2145
- this._sumx += this.series[i]._sumx;
2146
- }
2147
-
2148
- var name,
2149
- axis;
2150
- for (var i=0, l=_axisNames.length; i<l; i++) {
2151
- name = _axisNames[i];
2152
- axis = this.axes[name];
2153
- axis._plotDimensions = this._plotDimensions;
2154
- axis.init();
2155
- if (this.axes[name].borderColor == null) {
2156
- if (name.charAt(0) !== 'x' && axis.useSeriesColor === true && axis.show) {
2157
- axis.borderColor = axis._series[0].color;
2158
- }
2159
- else {
2160
- axis.borderColor = this.grid.borderColor;
2161
- }
2162
- }
2163
- }
2164
-
2165
- if (this.sortData) {
2166
- sortData(this.series);
2167
- }
2168
- this.grid.init();
2169
- this.grid._axes = this.axes;
2170
-
2171
- this.legend._series = this.series;
2172
-
2173
- for (var i=0; i<$.jqplot.postInitHooks.length; i++) {
2174
- $.jqplot.postInitHooks[i].call(this, target, this.data, options);
2175
- }
2176
-
2177
- for (var i=0; i<this.postInitHooks.hooks.length; i++) {
2178
- this.postInitHooks.hooks[i].call(this, target, this.data, options);
2179
- }
2180
- };
2181
-
2182
- // method: resetAxesScale
2183
- // Reset the specified axes min, max, numberTicks and tickInterval properties to null
2184
- // or reset these properties on all axes if no list of axes is provided.
2185
- //
2186
- // Parameters:
2187
- // axes - Boolean to reset or not reset all axes or an array or object of axis names to reset.
2188
- this.resetAxesScale = function(axes, options) {
2189
- var opts = options || {};
2190
- var ax = axes || this.axes;
2191
- if (ax === true) {
2192
- ax = this.axes;
2193
- }
2194
- if ($.isArray(ax)) {
2195
- for (var i = 0; i < ax.length; i++) {
2196
- this.axes[ax[i]].resetScale(opts[ax[i]]);
2197
- }
2198
- }
2199
- else if (typeof(ax) === 'object') {
2200
- for (var name in ax) {
2201
- this.axes[name].resetScale(opts[name]);
2202
- }
2203
- }
2204
- };
2205
- // method: reInitialize
2206
- // reinitialize plot for replotting.
2207
- // not called directly.
2208
- this.reInitialize = function (data, opts) {
2209
- // Plot should be visible and have a height and width.
2210
- // If plot doesn't have height and width for some
2211
- // reason, set it by other means. Plot must not have
2212
- // a display:none attribute, however.
2213
-
2214
- var options = $.extend(true, {}, this.options, opts);
2215
-
2216
- var target = this.targetId.substr(1);
2217
- var tdata = (data == null) ? this.data : data;
2218
-
2219
- for (var i=0; i<$.jqplot.preInitHooks.length; i++) {
2220
- $.jqplot.preInitHooks[i].call(this, target, tdata, options);
2221
- }
2222
-
2223
- for (var i=0; i<this.preInitHooks.hooks.length; i++) {
2224
- this.preInitHooks.hooks[i].call(this, target, tdata, options);
2225
- }
2226
-
2227
- this._height = this.target.height();
2228
- this._width = this.target.width();
2229
-
2230
- if (this._height <=0 || this._width <=0 || !this._height || !this._width) {
2231
- throw new Error("Target dimension not set");
2232
- }
2233
-
2234
- this._plotDimensions.height = this._height;
2235
- this._plotDimensions.width = this._width;
2236
- this.grid._plotDimensions = this._plotDimensions;
2237
- this.title._plotDimensions = this._plotDimensions;
2238
- this.baseCanvas._plotDimensions = this._plotDimensions;
2239
- this.eventCanvas._plotDimensions = this._plotDimensions;
2240
- this.legend._plotDimensions = this._plotDimensions;
2241
-
2242
- var name,
2243
- t,
2244
- j,
2245
- axis;
2246
-
2247
- for (var i=0, l=_axisNames.length; i<l; i++) {
2248
- name = _axisNames[i];
2249
- axis = this.axes[name];
2250
-
2251
- // Memory Leaks patch : clear ticks elements
2252
- t = axis._ticks;
2253
- for (var j = 0, tlen = t.length; j < tlen; j++) {
2254
- var el = t[j]._elem;
2255
- if (el) {
2256
- // if canvas renderer
2257
- if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
2258
- window.G_vmlCanvasManager.uninitElement(el.get(0));
2259
- }
2260
- el.emptyForce();
2261
- el = null;
2262
- t._elem = null;
2263
- }
2264
- }
2265
- t = null;
2266
-
2267
- delete axis.ticks;
2268
- delete axis._ticks;
2269
- this.axes[name] = new Axis(name);
2270
- this.axes[name]._plotWidth = this._width;
2271
- this.axes[name]._plotHeight = this._height;
2272
- }
2273
-
2274
- if (data) {
2275
- if (options.dataRenderer && $.isFunction(options.dataRenderer)) {
2276
- if (options.dataRendererOptions) {
2277
- this.dataRendererOptions = options.dataRendererOptions;
2278
- }
2279
- this.dataRenderer = options.dataRenderer;
2280
- data = this.dataRenderer(data, this, this.dataRendererOptions);
2281
- }
2282
-
2283
- // make a copy of the data
2284
- this.data = $.extend(true, [], data);
2285
- }
2286
-
2287
- if (opts) {
2288
- this.parseOptions(options);
2289
- }
2290
-
2291
- this.title._plotWidth = this._width;
2292
-
2293
- if (this.textColor) {
2294
- this.target.css('color', this.textColor);
2295
- }
2296
- if (this.fontFamily) {
2297
- this.target.css('font-family', this.fontFamily);
2298
- }
2299
- if (this.fontSize) {
2300
- this.target.css('font-size', this.fontSize);
2301
- }
2302
-
2303
- this.title.init();
2304
- this.legend.init();
2305
- this._sumy = 0;
2306
- this._sumx = 0;
2307
-
2308
- this.seriesStack = [];
2309
- this.previousSeriesStack = [];
2310
-
2311
- this.computePlotData();
2312
- for (var i=0, l=this.series.length; i<l; i++) {
2313
- // set default stacking order for series canvases
2314
- this.seriesStack.push(i);
2315
- this.previousSeriesStack.push(i);
2316
- this.series[i].shadowCanvas._plotDimensions = this._plotDimensions;
2317
- this.series[i].canvas._plotDimensions = this._plotDimensions;
2318
- for (var j=0; j<$.jqplot.preSeriesInitHooks.length; j++) {
2319
- $.jqplot.preSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
2320
- }
2321
- for (var j=0; j<this.preSeriesInitHooks.hooks.length; j++) {
2322
- this.preSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
2323
- }
2324
- // this.populatePlotData(this.series[i], i);
2325
- this.series[i]._plotDimensions = this._plotDimensions;
2326
- this.series[i].init(i, this.grid.borderWidth, this);
2327
- for (var j=0; j<$.jqplot.postSeriesInitHooks.length; j++) {
2328
- $.jqplot.postSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
2329
- }
2330
- for (var j=0; j<this.postSeriesInitHooks.hooks.length; j++) {
2331
- this.postSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this);
2332
- }
2333
- this._sumy += this.series[i]._sumy;
2334
- this._sumx += this.series[i]._sumx;
2335
- }
2336
-
2337
- for (var i=0, l=_axisNames.length; i<l; i++) {
2338
- name = _axisNames[i];
2339
- axis = this.axes[name];
2340
-
2341
- axis._plotDimensions = this._plotDimensions;
2342
- axis.init();
2343
- if (axis.borderColor == null) {
2344
- if (name.charAt(0) !== 'x' && axis.useSeriesColor === true && axis.show) {
2345
- axis.borderColor = axis._series[0].color;
2346
- }
2347
- else {
2348
- axis.borderColor = this.grid.borderColor;
2349
- }
2350
- }
2351
- }
2352
-
2353
- if (this.sortData) {
2354
- sortData(this.series);
2355
- }
2356
- this.grid.init();
2357
- this.grid._axes = this.axes;
2358
-
2359
- this.legend._series = this.series;
2360
-
2361
- for (var i=0, l=$.jqplot.postInitHooks.length; i<l; i++) {
2362
- $.jqplot.postInitHooks[i].call(this, target, this.data, options);
2363
- }
2364
-
2365
- for (var i=0, l=this.postInitHooks.hooks.length; i<l; i++) {
2366
- this.postInitHooks.hooks[i].call(this, target, this.data, options);
2367
- }
2368
- };
2369
-
2370
-
2371
-
2372
- // method: quickInit
2373
- //
2374
- // Quick reinitialization plot for replotting.
2375
- // Does not parse options ore recreate axes and series.
2376
- // not called directly.
2377
- this.quickInit = function () {
2378
- // Plot should be visible and have a height and width.
2379
- // If plot doesn't have height and width for some
2380
- // reason, set it by other means. Plot must not have
2381
- // a display:none attribute, however.
2382
-
2383
- this._height = this.target.height();
2384
- this._width = this.target.width();
2385
-
2386
- if (this._height <=0 || this._width <=0 || !this._height || !this._width) {
2387
- throw new Error("Target dimension not set");
2388
- }
2389
-
2390
- this._plotDimensions.height = this._height;
2391
- this._plotDimensions.width = this._width;
2392
- this.grid._plotDimensions = this._plotDimensions;
2393
- this.title._plotDimensions = this._plotDimensions;
2394
- this.baseCanvas._plotDimensions = this._plotDimensions;
2395
- this.eventCanvas._plotDimensions = this._plotDimensions;
2396
- this.legend._plotDimensions = this._plotDimensions;
2397
-
2398
- for (var n in this.axes) {
2399
- this.axes[n]._plotWidth = this._width;
2400
- this.axes[n]._plotHeight = this._height;
2401
- }
2402
-
2403
- this.title._plotWidth = this._width;
2404
-
2405
- if (this.textColor) {
2406
- this.target.css('color', this.textColor);
2407
- }
2408
- if (this.fontFamily) {
2409
- this.target.css('font-family', this.fontFamily);
2410
- }
2411
- if (this.fontSize) {
2412
- this.target.css('font-size', this.fontSize);
2413
- }
2414
-
2415
- this._sumy = 0;
2416
- this._sumx = 0;
2417
- this.computePlotData();
2418
- for (var i=0; i<this.series.length; i++) {
2419
- // this.populatePlotData(this.series[i], i);
2420
- if (this.series[i]._type === 'line' && this.series[i].renderer.bands.show) {
2421
- this.series[i].renderer.initBands.call(this.series[i], this.series[i].renderer.options, this);
2422
- }
2423
- this.series[i]._plotDimensions = this._plotDimensions;
2424
- this.series[i].canvas._plotDimensions = this._plotDimensions;
2425
- //this.series[i].init(i, this.grid.borderWidth);
2426
- this._sumy += this.series[i]._sumy;
2427
- this._sumx += this.series[i]._sumx;
2428
- }
2429
-
2430
- var name;
2431
-
2432
- for (var j=0; j<12; j++) {
2433
- name = _axisNames[j];
2434
- // Memory Leaks patch : clear ticks elements
2435
- var t = this.axes[name]._ticks;
2436
- for (var i = 0; i < t.length; i++) {
2437
- var el = t[i]._elem;
2438
- if (el) {
2439
- // if canvas renderer
2440
- if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
2441
- window.G_vmlCanvasManager.uninitElement(el.get(0));
2442
- }
2443
- el.emptyForce();
2444
- el = null;
2445
- t._elem = null;
2446
- }
2447
- }
2448
- t = null;
2449
-
2450
- this.axes[name]._plotDimensions = this._plotDimensions;
2451
- this.axes[name]._ticks = [];
2452
- // this.axes[name].renderer.init.call(this.axes[name], {});
2453
- }
2454
-
2455
- if (this.sortData) {
2456
- sortData(this.series);
2457
- }
2458
-
2459
- this.grid._axes = this.axes;
2460
-
2461
- this.legend._series = this.series;
2462
- };
2463
-
2464
- // sort the series data in increasing order.
2465
- function sortData(series) {
2466
- var d, sd, pd, ppd, ret;
2467
- for (var i=0; i<series.length; i++) {
2468
- var check;
2469
- var bat = [series[i].data, series[i]._stackData, series[i]._plotData, series[i]._prevPlotData];
2470
- for (var n=0; n<4; n++) {
2471
- check = true;
2472
- d = bat[n];
2473
- if (series[i]._stackAxis == 'x') {
2474
- for (var j = 0; j < d.length; j++) {
2475
- if (typeof(d[j][1]) != "number") {
2476
- check = false;
2477
- break;
2478
- }
2479
- }
2480
- if (check) {
2481
- d.sort(function(a,b) { return a[1] - b[1]; });
2482
- }
2483
- }
2484
- else {
2485
- for (var j = 0; j < d.length; j++) {
2486
- if (typeof(d[j][0]) != "number") {
2487
- check = false;
2488
- break;
2489
- }
2490
- }
2491
- if (check) {
2492
- d.sort(function(a,b) { return a[0] - b[0]; });
2493
- }
2494
- }
2495
- }
2496
-
2497
- }
2498
- }
2499
-
2500
- this.computePlotData = function() {
2501
- this._plotData = [];
2502
- this._stackData = [];
2503
- var series,
2504
- index,
2505
- l;
2506
-
2507
-
2508
- for (index=0, l=this.series.length; index<l; index++) {
2509
- series = this.series[index];
2510
- this._plotData.push([]);
2511
- this._stackData.push([]);
2512
- var cd = series.data;
2513
- this._plotData[index] = $.extend(true, [], cd);
2514
- this._stackData[index] = $.extend(true, [], cd);
2515
- series._plotData = this._plotData[index];
2516
- series._stackData = this._stackData[index];
2517
- var plotValues = {x:[], y:[]};
2518
-
2519
- if (this.stackSeries && !series.disableStack) {
2520
- series._stack = true;
2521
- ///////////////////////////
2522
- // have to check for nulls
2523
- ///////////////////////////
2524
- var sidx = (series._stackAxis === 'x') ? 0 : 1;
2525
-
2526
- for (var k=0, cdl=cd.length; k<cdl; k++) {
2527
- var temp = cd[k][sidx];
2528
- if (temp == null) {
2529
- temp = 0;
2530
- }
2531
- this._plotData[index][k][sidx] = temp;
2532
- this._stackData[index][k][sidx] = temp;
2533
-
2534
- if (index > 0) {
2535
- for (var j=index; j--;) {
2536
- var prevval = this._plotData[j][k][sidx];
2537
- // only need to sum up the stack axis column of data
2538
- // and only sum if it is of same sign.
2539
- // if previous series isn't same sign, keep looking
2540
- // at earlier series untill we find one of same sign.
2541
- if (temp * prevval >= 0) {
2542
- this._plotData[index][k][sidx] += prevval;
2543
- this._stackData[index][k][sidx] += prevval;
2544
- break;
2545
- }
2546
- }
2547
- }
2548
- }
2549
-
2550
- }
2551
- else {
2552
- for (var i=0; i<series.data.length; i++) {
2553
- plotValues.x.push(series.data[i][0]);
2554
- plotValues.y.push(series.data[i][1]);
2555
- }
2556
- this._stackData.push(series.data);
2557
- this.series[index]._stackData = series.data;
2558
- this._plotData.push(series.data);
2559
- series._plotData = series.data;
2560
- series._plotValues = plotValues;
2561
- }
2562
- if (index>0) {
2563
- series._prevPlotData = this.series[index-1]._plotData;
2564
- }
2565
- series._sumy = 0;
2566
- series._sumx = 0;
2567
- for (i=series.data.length-1; i>-1; i--) {
2568
- series._sumy += series.data[i][1];
2569
- series._sumx += series.data[i][0];
2570
- }
2571
- }
2572
-
2573
- };
2574
-
2575
- // populate the _stackData and _plotData arrays for the plot and the series.
2576
- this.populatePlotData = function(series, index) {
2577
- // if a stacked chart, compute the stacked data
2578
- this._plotData = [];
2579
- this._stackData = [];
2580
- series._stackData = [];
2581
- series._plotData = [];
2582
- var plotValues = {x:[], y:[]};
2583
- if (this.stackSeries && !series.disableStack) {
2584
- series._stack = true;
2585
- var sidx = (series._stackAxis === 'x') ? 0 : 1;
2586
- // var idx = sidx ? 0 : 1;
2587
- // push the current data into stackData
2588
- //this._stackData.push(this.series[i].data);
2589
- var temp = $.extend(true, [], series.data);
2590
- // create the data that will be plotted for this series
2591
- var plotdata = $.extend(true, [], series.data);
2592
- var tempx, tempy, dval, stackval, comparator;
2593
- // for first series, nothing to add to stackData.
2594
- for (var j=0; j<index; j++) {
2595
- var cd = this.series[j].data;
2596
- for (var k=0; k<cd.length; k++) {
2597
- dval = cd[k];
2598
- tempx = (dval[0] != null) ? dval[0] : 0;
2599
- tempy = (dval[1] != null) ? dval[1] : 0;
2600
- temp[k][0] += tempx;
2601
- temp[k][1] += tempy;
2602
- stackval = (sidx) ? tempy : tempx;
2603
- // only need to sum up the stack axis column of data
2604
- // and only sum if it is of same sign.
2605
- if (series.data[k][sidx] * stackval >= 0) {
2606
- plotdata[k][sidx] += stackval;
2607
- }
2608
- }
2609
- }
2610
- for (var i=0; i<plotdata.length; i++) {
2611
- plotValues.x.push(plotdata[i][0]);
2612
- plotValues.y.push(plotdata[i][1]);
2613
- }
2614
- this._plotData.push(plotdata);
2615
- this._stackData.push(temp);
2616
- series._stackData = temp;
2617
- series._plotData = plotdata;
2618
- series._plotValues = plotValues;
2619
- }
2620
- else {
2621
- for (var i=0; i<series.data.length; i++) {
2622
- plotValues.x.push(series.data[i][0]);
2623
- plotValues.y.push(series.data[i][1]);
2624
- }
2625
- this._stackData.push(series.data);
2626
- this.series[index]._stackData = series.data;
2627
- this._plotData.push(series.data);
2628
- series._plotData = series.data;
2629
- series._plotValues = plotValues;
2630
- }
2631
- if (index>0) {
2632
- series._prevPlotData = this.series[index-1]._plotData;
2633
- }
2634
- series._sumy = 0;
2635
- series._sumx = 0;
2636
- for (i=series.data.length-1; i>-1; i--) {
2637
- series._sumy += series.data[i][1];
2638
- series._sumx += series.data[i][0];
2639
- }
2640
- };
2641
-
2642
- // function to safely return colors from the color array and wrap around at the end.
2643
- this.getNextSeriesColor = (function(t) {
2644
- var idx = 0;
2645
- var sc = t.seriesColors;
2646
-
2647
- return function () {
2648
- if (idx < sc.length) {
2649
- return sc[idx++];
2650
- }
2651
- else {
2652
- idx = 0;
2653
- return sc[idx++];
2654
- }
2655
- };
2656
- })(this);
2657
-
2658
- this.parseOptions = function(options){
2659
- for (var i=0; i<this.preParseOptionsHooks.hooks.length; i++) {
2660
- this.preParseOptionsHooks.hooks[i].call(this, options);
2661
- }
2662
- for (var i=0; i<$.jqplot.preParseOptionsHooks.length; i++) {
2663
- $.jqplot.preParseOptionsHooks[i].call(this, options);
2664
- }
2665
- this.options = $.extend(true, {}, this.defaults, options);
2666
- var opts = this.options;
2667
- this.animate = opts.animate;
2668
- this.animateReplot = opts.animateReplot;
2669
- this.stackSeries = opts.stackSeries;
2670
- if ($.isPlainObject(opts.fillBetween)) {
2671
-
2672
- var temp = ['series1', 'series2', 'color', 'baseSeries', 'fill'],
2673
- tempi;
2674
-
2675
- for (var i=0, l=temp.length; i<l; i++) {
2676
- tempi = temp[i];
2677
- if (opts.fillBetween[tempi] != null) {
2678
- this.fillBetween[tempi] = opts.fillBetween[tempi];
2679
- }
2680
- }
2681
- }
2682
-
2683
- if (opts.seriesColors) {
2684
- this.seriesColors = opts.seriesColors;
2685
- }
2686
- if (opts.negativeSeriesColors) {
2687
- this.negativeSeriesColors = opts.negativeSeriesColors;
2688
- }
2689
- if (opts.captureRightClick) {
2690
- this.captureRightClick = opts.captureRightClick;
2691
- }
2692
- this.defaultAxisStart = (options && options.defaultAxisStart != null) ? options.defaultAxisStart : this.defaultAxisStart;
2693
- this.colorGenerator.setColors(this.seriesColors);
2694
- this.negativeColorGenerator.setColors(this.negativeSeriesColors);
2695
- // var cg = new this.colorGenerator(this.seriesColors);
2696
- // var ncg = new this.colorGenerator(this.negativeSeriesColors);
2697
- // this._gridPadding = this.options.gridPadding;
2698
- $.extend(true, this._gridPadding, opts.gridPadding);
2699
- this.sortData = (opts.sortData != null) ? opts.sortData : this.sortData;
2700
- for (var i=0; i<12; i++) {
2701
- var n = _axisNames[i];
2702
- var axis = this.axes[n];
2703
- axis._options = $.extend(true, {}, opts.axesDefaults, opts.axes[n]);
2704
- $.extend(true, axis, opts.axesDefaults, opts.axes[n]);
2705
- axis._plotWidth = this._width;
2706
- axis._plotHeight = this._height;
2707
- }
2708
- // if (this.data.length == 0) {
2709
- // this.data = [];
2710
- // for (var i=0; i<this.options.series.length; i++) {
2711
- // this.data.push(this.options.series.data);
2712
- // }
2713
- // }
2714
-
2715
- var normalizeData = function(data, dir, start) {
2716
- // return data as an array of point arrays,
2717
- // in form [[x1,y1...], [x2,y2...], ...]
2718
- var temp = [];
2719
- var i, l;
2720
- dir = dir || 'vertical';
2721
- if (!$.isArray(data[0])) {
2722
- // we have a series of scalars. One line with just y values.
2723
- // turn the scalar list of data into a data array of form:
2724
- // [[1, data[0]], [2, data[1]], ...]
2725
- for (i=0, l=data.length; i<l; i++) {
2726
- if (dir == 'vertical') {
2727
- temp.push([start + i, data[i]]);
2728
- }
2729
- else {
2730
- temp.push([data[i], start+i]);
2731
- }
2732
- }
2733
- }
2734
- else {
2735
- // we have a properly formatted data series, copy it.
2736
- $.extend(true, temp, data);
2737
- }
2738
- return temp;
2739
- };
2740
-
2741
- var colorIndex = 0;
2742
- this.series = [];
2743
- for (var i=0; i<this.data.length; i++) {
2744
- var sopts = $.extend(true, {index: i}, {seriesColors:this.seriesColors, negativeSeriesColors:this.negativeSeriesColors}, this.options.seriesDefaults, this.options.series[i], {rendererOptions:{animation:{show: this.animate}}});
2745
- // pass in options in case something needs set prior to initialization.
2746
- var temp = new Series(sopts);
2747
- for (var j=0; j<$.jqplot.preParseSeriesOptionsHooks.length; j++) {
2748
- $.jqplot.preParseSeriesOptionsHooks[j].call(temp, this.options.seriesDefaults, this.options.series[i]);
2749
- }
2750
- for (var j=0; j<this.preParseSeriesOptionsHooks.hooks.length; j++) {
2751
- this.preParseSeriesOptionsHooks.hooks[j].call(temp, this.options.seriesDefaults, this.options.series[i]);
2752
- }
2753
- // Now go back and apply the options to the series. Really should just do this during initializaiton, but don't want to
2754
- // mess up preParseSeriesOptionsHooks at this point.
2755
- $.extend(true, temp, sopts);
2756
- var dir = 'vertical';
2757
- if (temp.renderer === $.jqplot.BarRenderer && temp.rendererOptions && temp.rendererOptions.barDirection == 'horizontal') {
2758
- dir = 'horizontal';
2759
- temp._stackAxis = 'x';
2760
- temp._primaryAxis = '_yaxis';
2761
- }
2762
- temp.data = normalizeData(this.data[i], dir, this.defaultAxisStart);
2763
- switch (temp.xaxis) {
2764
- case 'xaxis':
2765
- temp._xaxis = this.axes.xaxis;
2766
- break;
2767
- case 'x2axis':
2768
- temp._xaxis = this.axes.x2axis;
2769
- break;
2770
- default:
2771
- break;
2772
- }
2773
- temp._yaxis = this.axes[temp.yaxis];
2774
- temp._xaxis._series.push(temp);
2775
- temp._yaxis._series.push(temp);
2776
- if (temp.show) {
2777
- temp._xaxis.show = true;
2778
- temp._yaxis.show = true;
2779
- }
2780
- else {
2781
- if (temp._xaxis.scaleToHiddenSeries) {
2782
- temp._xaxis.show = true;
2783
- }
2784
- if (temp._yaxis.scaleToHiddenSeries) {
2785
- temp._yaxis.show = true;
2786
- }
2787
- }
2788
-
2789
- // // parse the renderer options and apply default colors if not provided
2790
- // if (!temp.color && temp.show != false) {
2791
- // temp.color = cg.next();
2792
- // colorIndex = cg.getIndex() - 1;;
2793
- // }
2794
- // if (!temp.negativeColor && temp.show != false) {
2795
- // temp.negativeColor = ncg.get(colorIndex);
2796
- // ncg.setIndex(colorIndex);
2797
- // }
2798
- if (!temp.label) {
2799
- temp.label = 'Series '+ (i+1).toString();
2800
- }
2801
- // temp.rendererOptions.show = temp.show;
2802
- // $.extend(true, temp.renderer, {color:this.seriesColors[i]}, this.rendererOptions);
2803
- this.series.push(temp);
2804
- for (var j=0; j<$.jqplot.postParseSeriesOptionsHooks.length; j++) {
2805
- $.jqplot.postParseSeriesOptionsHooks[j].call(this.series[i], this.options.seriesDefaults, this.options.series[i]);
2806
- }
2807
- for (var j=0; j<this.postParseSeriesOptionsHooks.hooks.length; j++) {
2808
- this.postParseSeriesOptionsHooks.hooks[j].call(this.series[i], this.options.seriesDefaults, this.options.series[i]);
2809
- }
2810
- }
2811
-
2812
- // copy the grid and title options into this object.
2813
- $.extend(true, this.grid, this.options.grid);
2814
- // if axis border properties aren't set, set default.
2815
- for (var i=0, l=_axisNames.length; i<l; i++) {
2816
- var n = _axisNames[i];
2817
- var axis = this.axes[n];
2818
- if (axis.borderWidth == null) {
2819
- axis.borderWidth =this.grid.borderWidth;
2820
- }
2821
- }
2822
-
2823
- if (typeof this.options.title == 'string') {
2824
- this.title.text = this.options.title;
2825
- }
2826
- else if (typeof this.options.title == 'object') {
2827
- $.extend(true, this.title, this.options.title);
2828
- }
2829
- this.title._plotWidth = this._width;
2830
- this.legend.setOptions(this.options.legend);
2831
-
2832
- for (var i=0; i<$.jqplot.postParseOptionsHooks.length; i++) {
2833
- $.jqplot.postParseOptionsHooks[i].call(this, options);
2834
- }
2835
- for (var i=0; i<this.postParseOptionsHooks.hooks.length; i++) {
2836
- this.postParseOptionsHooks.hooks[i].call(this, options);
2837
- }
2838
- };
2839
-
2840
- // method: destroy
2841
- // Releases all resources occupied by the plot
2842
- this.destroy = function() {
2843
- this.canvasManager.freeAllCanvases();
2844
- if (this.eventCanvas && this.eventCanvas._elem) {
2845
- this.eventCanvas._elem.unbind();
2846
- }
2847
- // Couple of posts on Stack Overflow indicate that empty() doesn't
2848
- // always cear up the dom and release memory. Sometimes setting
2849
- // innerHTML property to null is needed. Particularly on IE, may
2850
- // have to directly set it to null, bypassing $.
2851
- this.target.empty();
2852
-
2853
- this.target[0].innerHTML = '';
2854
- };
2855
-
2856
- // method: replot
2857
- // Does a reinitialization of the plot followed by
2858
- // a redraw. Method could be used to interactively
2859
- // change plot characteristics and then replot.
2860
- //
2861
- // Parameters:
2862
- // options - Options used for replotting.
2863
- //
2864
- // Properties:
2865
- // clear - false to not clear (empty) the plot container before replotting (default: true).
2866
- // resetAxes - true to reset all axes min, max, numberTicks and tickInterval setting so axes will rescale themselves.
2867
- // optionally pass in list of axes to reset (e.g. ['xaxis', 'y2axis']) (default: false).
2868
- this.replot = function(options) {
2869
- var opts = options || {};
2870
- var data = opts.data || null;
2871
- var clear = (opts.clear === false) ? false : true;
2872
- var resetAxes = opts.resetAxes || false;
2873
- delete opts.data;
2874
- delete opts.clear;
2875
- delete opts.resetAxes;
2876
-
2877
- this.target.trigger('jqplotPreReplot');
2878
-
2879
- if (clear) {
2880
- this.destroy();
2881
- }
2882
- // if have data or other options, full reinit.
2883
- // otherwise, quickinit.
2884
- if (data || !$.isEmptyObject(opts)) {
2885
- this.reInitialize(data, opts);
2886
- }
2887
- else {
2888
- this.quickInit();
2889
- }
2890
-
2891
- if (resetAxes) {
2892
- this.resetAxesScale(resetAxes, opts.axes);
2893
- }
2894
- this.draw();
2895
- this.target.trigger('jqplotPostReplot');
2896
- };
2897
-
2898
- // method: redraw
2899
- // Empties the plot target div and redraws the plot.
2900
- // This enables plot data and properties to be changed
2901
- // and then to comletely clear the plot and redraw.
2902
- // redraw *will not* reinitialize any plot elements.
2903
- // That is, axes will not be autoscaled and defaults
2904
- // will not be reapplied to any plot elements. redraw
2905
- // is used primarily with zooming.
2906
- //
2907
- // Parameters:
2908
- // clear - false to not clear (empty) the plot container before redrawing (default: true).
2909
- this.redraw = function(clear) {
2910
- clear = (clear != null) ? clear : true;
2911
- this.target.trigger('jqplotPreRedraw');
2912
- if (clear) {
2913
- this.canvasManager.freeAllCanvases();
2914
- this.eventCanvas._elem.unbind();
2915
- // Dont think I bind any events to the target, this shouldn't be necessary.
2916
- // It will remove user's events.
2917
- // this.target.unbind();
2918
- this.target.empty();
2919
- }
2920
- for (var ax in this.axes) {
2921
- this.axes[ax]._ticks = [];
2922
- }
2923
- this.computePlotData();
2924
- // for (var i=0; i<this.series.length; i++) {
2925
- // this.populatePlotData(this.series[i], i);
2926
- // }
2927
- this._sumy = 0;
2928
- this._sumx = 0;
2929
- for (var i=0, tsl = this.series.length; i<tsl; i++) {
2930
- this._sumy += this.series[i]._sumy;
2931
- this._sumx += this.series[i]._sumx;
2932
- }
2933
- this.draw();
2934
- this.target.trigger('jqplotPostRedraw');
2935
- };
2936
-
2937
- // method: draw
2938
- // Draws all elements of the plot into the container.
2939
- // Does not clear the container before drawing.
2940
- this.draw = function(){
2941
- if (this.drawIfHidden || this.target.is(':visible')) {
2942
- this.target.trigger('jqplotPreDraw');
2943
- var i,
2944
- j,
2945
- l,
2946
- tempseries;
2947
- for (i=0, l=$.jqplot.preDrawHooks.length; i<l; i++) {
2948
- $.jqplot.preDrawHooks[i].call(this);
2949
- }
2950
- for (i=0, l=this.preDrawHooks.hooks.length; i<l; i++) {
2951
- this.preDrawHooks.hooks[i].apply(this, this.preDrawSeriesHooks.args[i]);
2952
- }
2953
- // create an underlying canvas to be used for special features.
2954
- this.target.append(this.baseCanvas.createElement({left:0, right:0, top:0, bottom:0}, 'jqplot-base-canvas', null, this));
2955
- this.baseCanvas.setContext();
2956
- this.target.append(this.title.draw());
2957
- this.title.pack({top:0, left:0});
2958
-
2959
- // make room for the legend between the grid and the edge.
2960
- // pass a dummy offsets object and a reference to the plot.
2961
- var legendElem = this.legend.draw({}, this);
2962
-
2963
- var gridPadding = {top:0, left:0, bottom:0, right:0};
2964
-
2965
- if (this.legend.placement == "outsideGrid") {
2966
- // temporarily append the legend to get dimensions
2967
- this.target.append(legendElem);
2968
- switch (this.legend.location) {
2969
- case 'n':
2970
- gridPadding.top += this.legend.getHeight();
2971
- break;
2972
- case 's':
2973
- gridPadding.bottom += this.legend.getHeight();
2974
- break;
2975
- case 'ne':
2976
- case 'e':
2977
- case 'se':
2978
- gridPadding.right += this.legend.getWidth();
2979
- break;
2980
- case 'nw':
2981
- case 'w':
2982
- case 'sw':
2983
- gridPadding.left += this.legend.getWidth();
2984
- break;
2985
- default: // same as 'ne'
2986
- gridPadding.right += this.legend.getWidth();
2987
- break;
2988
- }
2989
- legendElem = legendElem.detach();
2990
- }
2991
-
2992
- var ax = this.axes;
2993
- var name;
2994
- // draw the yMidAxis first, so xaxis of pyramid chart can adjust itself if needed.
2995
- for (i=0; i<12; i++) {
2996
- name = _axisNames[i];
2997
- this.target.append(ax[name].draw(this.baseCanvas._ctx, this));
2998
- ax[name].set();
2999
- }
3000
- if (ax.yaxis.show) {
3001
- gridPadding.left += ax.yaxis.getWidth();
3002
- }
3003
- var ra = ['y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis'];
3004
- var rapad = [0, 0, 0, 0, 0, 0, 0, 0];
3005
- var gpr = 0;
3006
- var n;
3007
- for (n=0; n<8; n++) {
3008
- if (ax[ra[n]].show) {
3009
- gpr += ax[ra[n]].getWidth();
3010
- rapad[n] = gpr;
3011
- }
3012
- }
3013
- gridPadding.right += gpr;
3014
- if (ax.x2axis.show) {
3015
- gridPadding.top += ax.x2axis.getHeight();
3016
- }
3017
- if (this.title.show) {
3018
- gridPadding.top += this.title.getHeight();
3019
- }
3020
- if (ax.xaxis.show) {
3021
- gridPadding.bottom += ax.xaxis.getHeight();
3022
- }
3023
-
3024
- // end of gridPadding adjustments.
3025
-
3026
- // if user passed in gridDimensions option, check against calculated gridPadding
3027
- if (this.options.gridDimensions && $.isPlainObject(this.options.gridDimensions)) {
3028
- var gdw = parseInt(this.options.gridDimensions.width, 10) || 0;
3029
- var gdh = parseInt(this.options.gridDimensions.height, 10) || 0;
3030
- var widthAdj = (this._width - gridPadding.left - gridPadding.right - gdw)/2;
3031
- var heightAdj = (this._height - gridPadding.top - gridPadding.bottom - gdh)/2;
3032
-
3033
- if (heightAdj >= 0 && widthAdj >= 0) {
3034
- gridPadding.top += heightAdj;
3035
- gridPadding.bottom += heightAdj;
3036
- gridPadding.left += widthAdj;
3037
- gridPadding.right += widthAdj;
3038
- }
3039
- }
3040
- var arr = ['top', 'bottom', 'left', 'right'];
3041
- for (var n in arr) {
3042
- if (this._gridPadding[arr[n]] == null && gridPadding[arr[n]] > 0) {
3043
- this._gridPadding[arr[n]] = gridPadding[arr[n]];
3044
- }
3045
- else if (this._gridPadding[arr[n]] == null) {
3046
- this._gridPadding[arr[n]] = this._defaultGridPadding[arr[n]];
3047
- }
3048
- }
3049
-
3050
- var legendPadding = this._gridPadding;
3051
-
3052
- if (this.legend.placement === 'outsideGrid') {
3053
- legendPadding = {top:this.title.getHeight(), left: 0, right: 0, bottom: 0};
3054
- }
3055
-
3056
- ax.xaxis.pack({position:'absolute', bottom:this._gridPadding.bottom - ax.xaxis.getHeight(), left:0, width:this._width}, {min:this._gridPadding.left, max:this._width - this._gridPadding.right});
3057
- ax.yaxis.pack({position:'absolute', top:0, left:this._gridPadding.left - ax.yaxis.getWidth(), height:this._height}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});
3058
- ax.x2axis.pack({position:'absolute', top:this._gridPadding.top - ax.x2axis.getHeight(), left:0, width:this._width}, {min:this._gridPadding.left, max:this._width - this._gridPadding.right});
3059
- for (i=8; i>0; i--) {
3060
- ax[ra[i-1]].pack({position:'absolute', top:0, right:this._gridPadding.right - rapad[i-1]}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});
3061
- }
3062
- var ltemp = (this._width - this._gridPadding.left - this._gridPadding.right)/2.0 + this._gridPadding.left - ax.yMidAxis.getWidth()/2.0;
3063
- ax.yMidAxis.pack({position:'absolute', top:0, left:ltemp, zIndex:9, textAlign: 'center'}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});
3064
-
3065
- this.target.append(this.grid.createElement(this._gridPadding, this));
3066
- this.grid.draw();
3067
-
3068
- var series = this.series;
3069
- var seriesLength = series.length;
3070
- // put the shadow canvases behind the series canvases so shadows don't overlap on stacked bars.
3071
- for (i=0, l=seriesLength; i<l; i++) {
3072
- // draw series in order of stacking. This affects only
3073
- // order in which canvases are added to dom.
3074
- j = this.seriesStack[i];
3075
- this.target.append(series[j].shadowCanvas.createElement(this._gridPadding, 'jqplot-series-shadowCanvas', null, this));
3076
- series[j].shadowCanvas.setContext();
3077
- series[j].shadowCanvas._elem.data('seriesIndex', j);
3078
- }
3079
-
3080
- for (i=0, l=seriesLength; i<l; i++) {
3081
- // draw series in order of stacking. This affects only
3082
- // order in which canvases are added to dom.
3083
- j = this.seriesStack[i];
3084
- this.target.append(series[j].canvas.createElement(this._gridPadding, 'jqplot-series-canvas', null, this));
3085
- series[j].canvas.setContext();
3086
- series[j].canvas._elem.data('seriesIndex', j);
3087
- }
3088
- // Need to use filled canvas to capture events in IE.
3089
- // Also, canvas seems to block selection of other elements in document on FF.
3090
- this.target.append(this.eventCanvas.createElement(this._gridPadding, 'jqplot-event-canvas', null, this));
3091
- this.eventCanvas.setContext();
3092
- this.eventCanvas._ctx.fillStyle = 'rgba(0,0,0,0)';
3093
- this.eventCanvas._ctx.fillRect(0,0,this.eventCanvas._ctx.canvas.width, this.eventCanvas._ctx.canvas.height);
3094
-
3095
- // bind custom event handlers to regular events.
3096
- this.bindCustomEvents();
3097
-
3098
- // draw legend before series if the series needs to know the legend dimensions.
3099
- if (this.legend.preDraw) {
3100
- this.eventCanvas._elem.before(legendElem);
3101
- this.legend.pack(legendPadding);
3102
- if (this.legend._elem) {
3103
- this.drawSeries({legendInfo:{location:this.legend.location, placement:this.legend.placement, width:this.legend.getWidth(), height:this.legend.getHeight(), xoffset:this.legend.xoffset, yoffset:this.legend.yoffset}});
3104
- }
3105
- else {
3106
- this.drawSeries();
3107
- }
3108
- }
3109
- else { // draw series before legend
3110
- this.drawSeries();
3111
- if (seriesLength) {
3112
- $(series[seriesLength-1].canvas._elem).after(legendElem);
3113
- }
3114
- this.legend.pack(legendPadding);
3115
- }
3116
-
3117
- // register event listeners on the overlay canvas
3118
- for (var i=0, l=$.jqplot.eventListenerHooks.length; i<l; i++) {
3119
- // in the handler, this will refer to the eventCanvas dom element.
3120
- // make sure there are references back into plot objects.
3121
- this.eventCanvas._elem.bind($.jqplot.eventListenerHooks[i][0], {plot:this}, $.jqplot.eventListenerHooks[i][1]);
3122
- }
3123
-
3124
- // register event listeners on the overlay canvas
3125
- for (var i=0, l=this.eventListenerHooks.hooks.length; i<l; i++) {
3126
- // in the handler, this will refer to the eventCanvas dom element.
3127
- // make sure there are references back into plot objects.
3128
- this.eventCanvas._elem.bind(this.eventListenerHooks.hooks[i][0], {plot:this}, this.eventListenerHooks.hooks[i][1]);
3129
- }
3130
-
3131
- var fb = this.fillBetween;
3132
- if(typeof fb.series1 == 'number'){
3133
- if(fb.fill&&fb.series1!==fb.series2&&fb.series1<seriesLength&&fb.series2<seriesLength&&series[fb.series1]._type==="line"&&series[fb.series2]._type==="line")
3134
- this.doFillBetweenLines();
3135
- }
3136
- else{
3137
- if(fb.series1 != null && fb.series2 != null){
3138
- var doFb = false;
3139
- if(fb.series1.length === fb.series2.length){
3140
- var tempSeries1 = 0;
3141
- var tempSeries2 = 0;
3142
-
3143
- for(var cnt = 0; cnt < fb.series1.length; cnt++){
3144
- tempSeries1 = fb.series1[cnt];
3145
- tempSeries2 = fb.series2[cnt];
3146
- if(tempSeries1!==tempSeries2&&tempSeries1<seriesLength&&tempSeries2<seriesLength&&series[tempSeries1]._type==="line"&&series[tempSeries2]._type==="line"){
3147
- doFb = true;
3148
- }
3149
- else{
3150
- doFb = false;
3151
- break;
3152
- }
3153
- }
3154
- }
3155
- if(fb.fill && doFb){
3156
- this.doFillBetweenLines();
3157
- }
3158
- }
3159
- }
3160
-
3161
- for (var i=0, l=$.jqplot.postDrawHooks.length; i<l; i++) {
3162
- $.jqplot.postDrawHooks[i].call(this);
3163
- }
3164
-
3165
- for (var i=0, l=this.postDrawHooks.hooks.length; i<l; i++) {
3166
- this.postDrawHooks.hooks[i].apply(this, this.postDrawHooks.args[i]);
3167
- }
3168
-
3169
- if (this.target.is(':visible')) {
3170
- this._drawCount += 1;
3171
- }
3172
-
3173
- var temps,
3174
- tempr,
3175
- sel,
3176
- _els;
3177
- // ughh. ideally would hide all series then show them.
3178
- for (i=0, l=seriesLength; i<l; i++) {
3179
- temps = series[i];
3180
- tempr = temps.renderer;
3181
- sel = '.jqplot-point-label.jqplot-series-'+i;
3182
- if (tempr.animation && tempr.animation._supported && tempr.animation.show && (this._drawCount < 2 || this.animateReplot)) {
3183
- _els = this.target.find(sel);
3184
- _els.stop(true, true).hide();
3185
- temps.canvas._elem.stop(true, true).hide();
3186
- temps.shadowCanvas._elem.stop(true, true).hide();
3187
- temps.canvas._elem.jqplotEffect('blind', {mode: 'show', direction: tempr.animation.direction}, tempr.animation.speed);
3188
- temps.shadowCanvas._elem.jqplotEffect('blind', {mode: 'show', direction: tempr.animation.direction}, tempr.animation.speed);
3189
- _els.fadeIn(tempr.animation.speed*0.8);
3190
- }
3191
- }
3192
- _els = null;
3193
-
3194
- this.target.trigger('jqplotPostDraw', [this]);
3195
- }
3196
- };
3197
-
3198
- jqPlot.prototype.doFillBetweenLines = function () {
3199
- var fb = this.fillBetween;
3200
- var series = this.series;
3201
- var sid1 = fb.series1;
3202
- var sid2 = fb.series2;
3203
- var id1 = 0, id2 = 0;
3204
-
3205
- function fill(id1, id2){
3206
- var series1 = series[id1];
3207
- var series2 = series[id2];
3208
- if (series2.renderer.smooth)
3209
- var tempgd = series2.renderer._smoothedData.slice(0).reverse();
3210
- else
3211
- var tempgd = series2.gridData.slice(0).reverse();
3212
- if (series1.renderer.smooth)
3213
- var gd = series1.renderer._smoothedData.concat(tempgd);
3214
- else
3215
- var gd = series1.gridData.concat(tempgd);
3216
- var color = fb.color !== null ? fb.color : series[id1].fillColor;
3217
- var baseSeries = fb.baseSeries !== null ? fb.baseSeries : id1;
3218
- var sr =
3219
- series[baseSeries].renderer.shapeRenderer;
3220
- var opts =
3221
- {
3222
- fillStyle : color,
3223
- fill : true,
3224
- closePath : true
3225
- };
3226
- sr.draw(series1.shadowCanvas._ctx, gd, opts)
3227
- }
3228
-
3229
- if(typeof sid1 == 'number' && typeof sid2 == 'number'){
3230
- id1 = sid1 < sid2 ? sid1 : sid2;
3231
- id2 = sid2 > sid1 ? sid2 : sid1;
3232
- fill(id1, id2);
3233
- }
3234
- else{
3235
- for(var cnt = 0; cnt < sid1.length ; cnt++){
3236
- id1 = sid1[cnt] < sid2[cnt] ? sid1[cnt] : sid2[cnt];
3237
- id2 = sid2[cnt] > sid1[cnt] ? sid2[cnt] : sid1[cnt];
3238
- fill(id1, id2);
3239
- }
3240
- }
3241
- };
3242
-
3243
- this.bindCustomEvents = function() {
3244
- this.eventCanvas._elem.bind('click', {plot:this}, this.onClick);
3245
- this.eventCanvas._elem.bind('dblclick', {plot:this}, this.onDblClick);
3246
- this.eventCanvas._elem.bind('mousedown', {plot:this}, this.onMouseDown);
3247
- this.eventCanvas._elem.bind('mousemove', {plot:this}, this.onMouseMove);
3248
- this.eventCanvas._elem.bind('mouseenter', {plot:this}, this.onMouseEnter);
3249
- this.eventCanvas._elem.bind('mouseleave', {plot:this}, this.onMouseLeave);
3250
- if (this.captureRightClick) {
3251
- this.eventCanvas._elem.bind('mouseup', {plot:this}, this.onRightClick);
3252
- this.eventCanvas._elem.get(0).oncontextmenu = function() {
3253
- return false;
3254
- };
3255
- }
3256
- else {
3257
- this.eventCanvas._elem.bind('mouseup', {plot:this}, this.onMouseUp);
3258
- }
3259
- };
3260
-
3261
- function getEventPosition(ev) {
3262
- var plot = ev.data.plot;
3263
- var go = plot.eventCanvas._elem.offset();
3264
- var gridPos = {x:ev.pageX - go.left, y:ev.pageY - go.top};
3265
- var dataPos = {xaxis:null, yaxis:null, x2axis:null, y2axis:null, y3axis:null, y4axis:null, y5axis:null, y6axis:null, y7axis:null, y8axis:null, y9axis:null, yMidAxis:null};
3266
- var an = ['xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis', 'yMidAxis'];
3267
- var ax = plot.axes;
3268
- var n, axis;
3269
- for (n=11; n>0; n--) {
3270
- axis = an[n-1];
3271
- if (ax[axis].show) {
3272
- dataPos[axis] = ax[axis].series_p2u(gridPos[axis.charAt(0)]);
3273
- }
3274
- }
3275
-
3276
- return {offsets:go, gridPos:gridPos, dataPos:dataPos};
3277
- }
3278
-
3279
-
3280
- // function to check if event location is over a area area
3281
- function checkIntersection(gridpos, plot) {
3282
- var series = plot.series;
3283
- var i, j, k, s, r, x, y, theta, sm, sa, minang, maxang;
3284
- var d0, d, p, pp, points, bw, hp;
3285
- var threshold, t;
3286
- for (k=plot.seriesStack.length-1; k>=0; k--) {
3287
- i = plot.seriesStack[k];
3288
- s = series[i];
3289
- hp = s._highlightThreshold;
3290
- switch (s.renderer.constructor) {
3291
- case $.jqplot.BarRenderer:
3292
- x = gridpos.x;
3293
- y = gridpos.y;
3294
- for (j=0; j<s._barPoints.length; j++) {
3295
- points = s._barPoints[j];
3296
- p = s.gridData[j];
3297
- if (x>points[0][0] && x<points[2][0] && (y>points[2][1] && y<points[0][1] || y<points[2][1] && y>points[0][1])) {
3298
- return {seriesIndex:s.index, pointIndex:j, gridData:p, data:s.data[j], points:s._barPoints[j]};
3299
- }
3300
- }
3301
- break;
3302
- case $.jqplot.PyramidRenderer:
3303
- x = gridpos.x;
3304
- y = gridpos.y;
3305
- for (j=0; j<s._barPoints.length; j++) {
3306
- points = s._barPoints[j];
3307
- p = s.gridData[j];
3308
- if (x > points[0][0] + hp[0][0] && x < points[2][0] + hp[2][0] && y > points[2][1] && y < points[0][1]) {
3309
- return {seriesIndex:s.index, pointIndex:j, gridData:p, data:s.data[j], points:s._barPoints[j]};
3310
- }
3311
- }
3312
- break;
3313
-
3314
- case $.jqplot.DonutRenderer:
3315
- sa = s.startAngle/180*Math.PI;
3316
- x = gridpos.x - s._center[0];
3317
- y = gridpos.y - s._center[1];
3318
- r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
3319
- if (x > 0 && -y >= 0) {
3320
- theta = 2*Math.PI - Math.atan(-y/x);
3321
- }
3322
- else if (x > 0 && -y < 0) {
3323
- theta = -Math.atan(-y/x);
3324
- }
3325
- else if (x < 0) {
3326
- theta = Math.PI - Math.atan(-y/x);
3327
- }
3328
- else if (x == 0 && -y > 0) {
3329
- theta = 3*Math.PI/2;
3330
- }
3331
- else if (x == 0 && -y < 0) {
3332
- theta = Math.PI/2;
3333
- }
3334
- else if (x == 0 && y == 0) {
3335
- theta = 0;
3336
- }
3337
- if (sa) {
3338
- theta -= sa;
3339
- if (theta < 0) {
3340
- theta += 2*Math.PI;
3341
- }
3342
- else if (theta > 2*Math.PI) {
3343
- theta -= 2*Math.PI;
3344
- }
3345
- }
3346
-
3347
- sm = s.sliceMargin/180*Math.PI;
3348
- if (r < s._radius && r > s._innerRadius) {
3349
- for (j=0; j<s.gridData.length; j++) {
3350
- minang = (j>0) ? s.gridData[j-1][1]+sm : sm;
3351
- maxang = s.gridData[j][1];
3352
- if (theta > minang && theta < maxang) {
3353
- return {seriesIndex:s.index, pointIndex:j, gridData:[gridpos.x,gridpos.y], data:s.data[j]};
3354
- }
3355
- }
3356
- }
3357
- break;
3358
-
3359
- case $.jqplot.PieRenderer:
3360
- sa = s.startAngle/180*Math.PI;
3361
- x = gridpos.x - s._center[0];
3362
- y = gridpos.y - s._center[1];
3363
- r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
3364
- if (x > 0 && -y >= 0) {
3365
- theta = 2*Math.PI - Math.atan(-y/x);
3366
- }
3367
- else if (x > 0 && -y < 0) {
3368
- theta = -Math.atan(-y/x);
3369
- }
3370
- else if (x < 0) {
3371
- theta = Math.PI - Math.atan(-y/x);
3372
- }
3373
- else if (x == 0 && -y > 0) {
3374
- theta = 3*Math.PI/2;
3375
- }
3376
- else if (x == 0 && -y < 0) {
3377
- theta = Math.PI/2;
3378
- }
3379
- else if (x == 0 && y == 0) {
3380
- theta = 0;
3381
- }
3382
- if (sa) {
3383
- theta -= sa;
3384
- if (theta < 0) {
3385
- theta += 2*Math.PI;
3386
- }
3387
- else if (theta > 2*Math.PI) {
3388
- theta -= 2*Math.PI;
3389
- }
3390
- }
3391
-
3392
- sm = s.sliceMargin/180*Math.PI;
3393
- if (r < s._radius) {
3394
- for (j=0; j<s.gridData.length; j++) {
3395
- minang = (j>0) ? s.gridData[j-1][1]+sm : sm;
3396
- maxang = s.gridData[j][1];
3397
- if (theta > minang && theta < maxang) {
3398
- return {seriesIndex:s.index, pointIndex:j, gridData:[gridpos.x,gridpos.y], data:s.data[j]};
3399
- }
3400
- }
3401
- }
3402
- break;
3403
-
3404
- case $.jqplot.BubbleRenderer:
3405
- x = gridpos.x;
3406
- y = gridpos.y;
3407
- var ret = null;
3408
-
3409
- if (s.show) {
3410
- for (var j=0; j<s.gridData.length; j++) {
3411
- p = s.gridData[j];
3412
- d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );
3413
- if (d <= p[2] && (d <= d0 || d0 == null)) {
3414
- d0 = d;
3415
- ret = {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3416
- }
3417
- }
3418
- if (ret != null) {
3419
- return ret;
3420
- }
3421
- }
3422
- break;
3423
-
3424
- case $.jqplot.FunnelRenderer:
3425
- x = gridpos.x;
3426
- y = gridpos.y;
3427
- var v = s._vertices,
3428
- vfirst = v[0],
3429
- vlast = v[v.length-1],
3430
- lex,
3431
- rex,
3432
- cv;
3433
-
3434
- // equations of right and left sides, returns x, y values given height of section (y value and 2 points)
3435
-
3436
- function findedge (l, p1 , p2) {
3437
- var m = (p1[1] - p2[1])/(p1[0] - p2[0]);
3438
- var b = p1[1] - m*p1[0];
3439
- var y = l + p1[1];
3440
-
3441
- return [(y - b)/m, y];
3442
- }
3443
-
3444
- // check each section
3445
- lex = findedge(y, vfirst[0], vlast[3]);
3446
- rex = findedge(y, vfirst[1], vlast[2]);
3447
- for (j=0; j<v.length; j++) {
3448
- cv = v[j];
3449
- if (y >= cv[0][1] && y <= cv[3][1] && x >= lex[0] && x <= rex[0]) {
3450
- return {seriesIndex:s.index, pointIndex:j, gridData:null, data:s.data[j]};
3451
- }
3452
- }
3453
- break;
3454
-
3455
- case $.jqplot.LineRenderer:
3456
- x = gridpos.x;
3457
- y = gridpos.y;
3458
- r = s.renderer;
3459
- if (s.show) {
3460
- if ((s.fill || (s.renderer.bands.show && s.renderer.bands.fill)) && (!plot.plugins.highlighter || !plot.plugins.highlighter.show)) {
3461
- // first check if it is in bounding box
3462
- var inside = false;
3463
- if (x>s._boundingBox[0][0] && x<s._boundingBox[1][0] && y>s._boundingBox[1][1] && y<s._boundingBox[0][1]) {
3464
- // now check the crossing number
3465
-
3466
- var numPoints = s._areaPoints.length;
3467
- var ii;
3468
- var j = numPoints-1;
3469
-
3470
- for(var ii=0; ii < numPoints; ii++) {
3471
- var vertex1 = [s._areaPoints[ii][0], s._areaPoints[ii][1]];
3472
- var vertex2 = [s._areaPoints[j][0], s._areaPoints[j][1]];
3473
-
3474
- if (vertex1[1] < y && vertex2[1] >= y || vertex2[1] < y && vertex1[1] >= y) {
3475
- if (vertex1[0] + (y - vertex1[1]) / (vertex2[1] - vertex1[1]) * (vertex2[0] - vertex1[0]) < x) {
3476
- inside = !inside;
3477
- }
3478
- }
3479
-
3480
- j = ii;
3481
- }
3482
- }
3483
- if (inside) {
3484
- return {seriesIndex:i, pointIndex:null, gridData:s.gridData, data:s.data, points:s._areaPoints};
3485
- }
3486
- break;
3487
-
3488
- }
3489
-
3490
- else {
3491
- t = s.markerRenderer.size/2+s.neighborThreshold;
3492
- threshold = (t > 0) ? t : 0;
3493
- for (var j=0; j<s.gridData.length; j++) {
3494
- p = s.gridData[j];
3495
- // neighbor looks different to OHLC chart.
3496
- if (r.constructor == $.jqplot.OHLCRenderer) {
3497
- if (r.candleStick) {
3498
- var yp = s._yaxis.series_u2p;
3499
- if (x >= p[0]-r._bodyWidth/2 && x <= p[0]+r._bodyWidth/2 && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {
3500
- return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3501
- }
3502
- }
3503
- // if an open hi low close chart
3504
- else if (!r.hlc){
3505
- var yp = s._yaxis.series_u2p;
3506
- if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {
3507
- return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3508
- }
3509
- }
3510
- // a hi low close chart
3511
- else {
3512
- var yp = s._yaxis.series_u2p;
3513
- if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][1]) && y <= yp(s.data[j][2])) {
3514
- return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3515
- }
3516
- }
3517
-
3518
- }
3519
- else if (p[0] != null && p[1] != null){
3520
- d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );
3521
- if (d <= threshold && (d <= d0 || d0 == null)) {
3522
- d0 = d;
3523
- return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3524
- }
3525
- }
3526
- }
3527
- }
3528
- }
3529
- break;
3530
-
3531
- default:
3532
- x = gridpos.x;
3533
- y = gridpos.y;
3534
- r = s.renderer;
3535
- if (s.show) {
3536
- t = s.markerRenderer.size/2+s.neighborThreshold;
3537
- threshold = (t > 0) ? t : 0;
3538
- for (var j=0; j<s.gridData.length; j++) {
3539
- p = s.gridData[j];
3540
- // neighbor looks different to OHLC chart.
3541
- if (r.constructor == $.jqplot.OHLCRenderer) {
3542
- if (r.candleStick) {
3543
- var yp = s._yaxis.series_u2p;
3544
- if (x >= p[0]-r._bodyWidth/2 && x <= p[0]+r._bodyWidth/2 && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {
3545
- return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3546
- }
3547
- }
3548
- // if an open hi low close chart
3549
- else if (!r.hlc){
3550
- var yp = s._yaxis.series_u2p;
3551
- if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {
3552
- return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3553
- }
3554
- }
3555
- // a hi low close chart
3556
- else {
3557
- var yp = s._yaxis.series_u2p;
3558
- if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][1]) && y <= yp(s.data[j][2])) {
3559
- return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3560
- }
3561
- }
3562
-
3563
- }
3564
- else {
3565
- d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );
3566
- if (d <= threshold && (d <= d0 || d0 == null)) {
3567
- d0 = d;
3568
- return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3569
- }
3570
- }
3571
- }
3572
- }
3573
- break;
3574
- }
3575
- }
3576
-
3577
- return null;
3578
- }
3579
-
3580
-
3581
-
3582
- this.onClick = function(ev) {
3583
- // Event passed in is normalized and will have data attribute.
3584
- // Event passed out is unnormalized.
3585
- var positions = getEventPosition(ev);
3586
- var p = ev.data.plot;
3587
- var neighbor = checkIntersection(positions.gridPos, p);
3588
- var evt = $.Event('jqplotClick');
3589
- evt.pageX = ev.pageX;
3590
- evt.pageY = ev.pageY;
3591
- $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
3592
- };
3593
-
3594
- this.onDblClick = function(ev) {
3595
- // Event passed in is normalized and will have data attribute.
3596
- // Event passed out is unnormalized.
3597
- var positions = getEventPosition(ev);
3598
- var p = ev.data.plot;
3599
- var neighbor = checkIntersection(positions.gridPos, p);
3600
- var evt = $.Event('jqplotDblClick');
3601
- evt.pageX = ev.pageX;
3602
- evt.pageY = ev.pageY;
3603
- $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
3604
- };
3605
-
3606
- this.onMouseDown = function(ev) {
3607
- var positions = getEventPosition(ev);
3608
- var p = ev.data.plot;
3609
- var neighbor = checkIntersection(positions.gridPos, p);
3610
- var evt = $.Event('jqplotMouseDown');
3611
- evt.pageX = ev.pageX;
3612
- evt.pageY = ev.pageY;
3613
- $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
3614
- };
3615
-
3616
- this.onMouseUp = function(ev) {
3617
- var positions = getEventPosition(ev);
3618
- var evt = $.Event('jqplotMouseUp');
3619
- evt.pageX = ev.pageX;
3620
- evt.pageY = ev.pageY;
3621
- $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, ev.data.plot]);
3622
- };
3623
-
3624
- this.onRightClick = function(ev) {
3625
- var positions = getEventPosition(ev);
3626
- var p = ev.data.plot;
3627
- var neighbor = checkIntersection(positions.gridPos, p);
3628
- if (p.captureRightClick) {
3629
- if (ev.which == 3) {
3630
- var evt = $.Event('jqplotRightClick');
3631
- evt.pageX = ev.pageX;
3632
- evt.pageY = ev.pageY;
3633
- $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
3634
- }
3635
- else {
3636
- var evt = $.Event('jqplotMouseUp');
3637
- evt.pageX = ev.pageX;
3638
- evt.pageY = ev.pageY;
3639
- $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
3640
- }
3641
- }
3642
- };
3643
-
3644
- this.onMouseMove = function(ev) {
3645
- var positions = getEventPosition(ev);
3646
- var p = ev.data.plot;
3647
- var neighbor = checkIntersection(positions.gridPos, p);
3648
- var evt = $.Event('jqplotMouseMove');
3649
- evt.pageX = ev.pageX;
3650
- evt.pageY = ev.pageY;
3651
- $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
3652
- };
3653
-
3654
- this.onMouseEnter = function(ev) {
3655
- var positions = getEventPosition(ev);
3656
- var p = ev.data.plot;
3657
- var evt = $.Event('jqplotMouseEnter');
3658
- evt.pageX = ev.pageX;
3659
- evt.pageY = ev.pageY;
3660
- evt.relatedTarget = ev.relatedTarget;
3661
- $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, p]);
3662
- };
3663
-
3664
- this.onMouseLeave = function(ev) {
3665
- var positions = getEventPosition(ev);
3666
- var p = ev.data.plot;
3667
- var evt = $.Event('jqplotMouseLeave');
3668
- evt.pageX = ev.pageX;
3669
- evt.pageY = ev.pageY;
3670
- evt.relatedTarget = ev.relatedTarget;
3671
- $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, p]);
3672
- };
3673
-
3674
- // method: drawSeries
3675
- // Redraws all or just one series on the plot. No axis scaling
3676
- // is performed and no other elements on the plot are redrawn.
3677
- // options is an options object to pass on to the series renderers.
3678
- // It can be an empty object {}. idx is the series index
3679
- // to redraw if only one series is to be redrawn.
3680
- this.drawSeries = function(options, idx){
3681
- var i, series, ctx;
3682
- // if only one argument passed in and it is a number, use it ad idx.
3683
- idx = (typeof(options) === "number" && idx == null) ? options : idx;
3684
- options = (typeof(options) === "object") ? options : {};
3685
- // draw specified series
3686
- if (idx != undefined) {
3687
- series = this.series[idx];
3688
- ctx = series.shadowCanvas._ctx;
3689
- ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
3690
- series.drawShadow(ctx, options, this);
3691
- ctx = series.canvas._ctx;
3692
- ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
3693
- series.draw(ctx, options, this);
3694
- if (series.renderer.constructor == $.jqplot.BezierCurveRenderer) {
3695
- if (idx < this.series.length - 1) {
3696
- this.drawSeries(idx+1);
3697
- }
3698
- }
3699
- }
3700
-
3701
- else {
3702
- // if call series drawShadow method first, in case all series shadows
3703
- // should be drawn before any series. This will ensure, like for
3704
- // stacked bar plots, that shadows don't overlap series.
3705
- for (i=0; i<this.series.length; i++) {
3706
- // first clear the canvas
3707
- series = this.series[i];
3708
- ctx = series.shadowCanvas._ctx;
3709
- ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
3710
- series.drawShadow(ctx, options, this);
3711
- ctx = series.canvas._ctx;
3712
- ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
3713
- series.draw(ctx, options, this);
3714
- }
3715
- }
3716
- options = idx = i = series = ctx = null;
3717
- };
3718
-
3719
- // method: moveSeriesToFront
3720
- // This method requires jQuery 1.4+
3721
- // Moves the specified series canvas in front of all other series canvases.
3722
- // This effectively "draws" the specified series on top of all other series,
3723
- // although it is performed through DOM manipulation, no redrawing is performed.
3724
- //
3725
- // Parameters:
3726
- // idx - 0 based index of the series to move. This will be the index of the series
3727
- // as it was first passed into the jqplot function.
3728
- this.moveSeriesToFront = function (idx) {
3729
- idx = parseInt(idx, 10);
3730
- var stackIndex = $.inArray(idx, this.seriesStack);
3731
- // if already in front, return
3732
- if (stackIndex == -1) {
3733
- return;
3734
- }
3735
- if (stackIndex == this.seriesStack.length -1) {
3736
- this.previousSeriesStack = this.seriesStack.slice(0);
3737
- return;
3738
- }
3739
- var opidx = this.seriesStack[this.seriesStack.length -1];
3740
- var serelem = this.series[idx].canvas._elem.detach();
3741
- var shadelem = this.series[idx].shadowCanvas._elem.detach();
3742
- this.series[opidx].shadowCanvas._elem.after(shadelem);
3743
- this.series[opidx].canvas._elem.after(serelem);
3744
- this.previousSeriesStack = this.seriesStack.slice(0);
3745
- this.seriesStack.splice(stackIndex, 1);
3746
- this.seriesStack.push(idx);
3747
- };
3748
-
3749
- // method: moveSeriesToBack
3750
- // This method requires jQuery 1.4+
3751
- // Moves the specified series canvas behind all other series canvases.
3752
- //
3753
- // Parameters:
3754
- // idx - 0 based index of the series to move. This will be the index of the series
3755
- // as it was first passed into the jqplot function.
3756
- this.moveSeriesToBack = function (idx) {
3757
- idx = parseInt(idx, 10);
3758
- var stackIndex = $.inArray(idx, this.seriesStack);
3759
- // if already in back, return
3760
- if (stackIndex == 0 || stackIndex == -1) {
3761
- return;
3762
- }
3763
- var opidx = this.seriesStack[0];
3764
- var serelem = this.series[idx].canvas._elem.detach();
3765
- var shadelem = this.series[idx].shadowCanvas._elem.detach();
3766
- this.series[opidx].shadowCanvas._elem.before(shadelem);
3767
- this.series[opidx].canvas._elem.before(serelem);
3768
- this.previousSeriesStack = this.seriesStack.slice(0);
3769
- this.seriesStack.splice(stackIndex, 1);
3770
- this.seriesStack.unshift(idx);
3771
- };
3772
-
3773
- // method: restorePreviousSeriesOrder
3774
- // This method requires jQuery 1.4+
3775
- // Restore the series canvas order to its previous state.
3776
- // Useful to put a series back where it belongs after moving
3777
- // it to the front.
3778
- this.restorePreviousSeriesOrder = function () {
3779
- var i, j, serelem, shadelem, temp, move, keep;
3780
- // if no change, return.
3781
- if (this.seriesStack == this.previousSeriesStack) {
3782
- return;
3783
- }
3784
- for (i=1; i<this.previousSeriesStack.length; i++) {
3785
- move = this.previousSeriesStack[i];
3786
- keep = this.previousSeriesStack[i-1];
3787
- serelem = this.series[move].canvas._elem.detach();
3788
- shadelem = this.series[move].shadowCanvas._elem.detach();
3789
- this.series[keep].shadowCanvas._elem.after(shadelem);
3790
- this.series[keep].canvas._elem.after(serelem);
3791
- }
3792
- temp = this.seriesStack.slice(0);
3793
- this.seriesStack = this.previousSeriesStack.slice(0);
3794
- this.previousSeriesStack = temp;
3795
- };
3796
-
3797
- // method: restoreOriginalSeriesOrder
3798
- // This method requires jQuery 1.4+
3799
- // Restore the series canvas order to its original order
3800
- // when the plot was created.
3801
- this.restoreOriginalSeriesOrder = function () {
3802
- var i, j, arr=[], serelem, shadelem;
3803
- for (i=0; i<this.series.length; i++) {
3804
- arr.push(i);
3805
- }
3806
- if (this.seriesStack == arr) {
3807
- return;
3808
- }
3809
- this.previousSeriesStack = this.seriesStack.slice(0);
3810
- this.seriesStack = arr;
3811
- for (i=1; i<this.seriesStack.length; i++) {
3812
- serelem = this.series[i].canvas._elem.detach();
3813
- shadelem = this.series[i].shadowCanvas._elem.detach();
3814
- this.series[i-1].shadowCanvas._elem.after(shadelem);
3815
- this.series[i-1].canvas._elem.after(serelem);
3816
- }
3817
- };
3818
-
3819
- this.activateTheme = function (name) {
3820
- this.themeEngine.activate(this, name);
3821
- };
3822
- }
3823
-
3824
-
3825
- // conpute a highlight color or array of highlight colors from given colors.
3826
- $.jqplot.computeHighlightColors = function(colors) {
3827
- var ret;
3828
- if ($.isArray(colors)) {
3829
- ret = [];
3830
- for (var i=0; i<colors.length; i++){
3831
- var rgba = $.jqplot.getColorComponents(colors[i]);
3832
- var newrgb = [rgba[0], rgba[1], rgba[2]];
3833
- var sum = newrgb[0] + newrgb[1] + newrgb[2];
3834
- for (var j=0; j<3; j++) {
3835
- // when darkening, lowest color component can be is 60.
3836
- newrgb[j] = (sum > 660) ? newrgb[j] * 0.85 : 0.73 * newrgb[j] + 90;
3837
- newrgb[j] = parseInt(newrgb[j], 10);
3838
- (newrgb[j] > 255) ? 255 : newrgb[j];
3839
- }
3840
- // newrgb[3] = (rgba[3] > 0.4) ? rgba[3] * 0.4 : rgba[3] * 1.5;
3841
- // newrgb[3] = (rgba[3] > 0.5) ? 0.8 * rgba[3] - .1 : rgba[3] + 0.2;
3842
- newrgb[3] = 0.3 + 0.35 * rgba[3];
3843
- ret.push('rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+newrgb[3]+')');
3844
- }
3845
- }
3846
- else {
3847
- var rgba = $.jqplot.getColorComponents(colors);
3848
- var newrgb = [rgba[0], rgba[1], rgba[2]];
3849
- var sum = newrgb[0] + newrgb[1] + newrgb[2];
3850
- for (var j=0; j<3; j++) {
3851
- // when darkening, lowest color component can be is 60.
3852
- // newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
3853
- // newrgb[j] = parseInt(newrgb[j], 10);
3854
- newrgb[j] = (sum > 660) ? newrgb[j] * 0.85 : 0.73 * newrgb[j] + 90;
3855
- newrgb[j] = parseInt(newrgb[j], 10);
3856
- (newrgb[j] > 255) ? 255 : newrgb[j];
3857
- }
3858
- // newrgb[3] = (rgba[3] > 0.4) ? rgba[3] * 0.4 : rgba[3] * 1.5;
3859
- // newrgb[3] = (rgba[3] > 0.5) ? 0.8 * rgba[3] - .1 : rgba[3] + 0.2;
3860
- newrgb[3] = 0.3 + 0.35 * rgba[3];
3861
- ret = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+newrgb[3]+')';
3862
- }
3863
- return ret;
3864
- };
3865
-
3866
- $.jqplot.ColorGenerator = function(colors) {
3867
- colors = colors || $.jqplot.config.defaultColors;
3868
- var idx = 0;
3869
-
3870
- this.next = function () {
3871
- if (idx < colors.length) {
3872
- return colors[idx++];
3873
- }
3874
- else {
3875
- idx = 0;
3876
- return colors[idx++];
3877
- }
3878
- };
3879
-
3880
- this.previous = function () {
3881
- if (idx > 0) {
3882
- return colors[idx--];
3883
- }
3884
- else {
3885
- idx = colors.length-1;
3886
- return colors[idx];
3887
- }
3888
- };
3889
-
3890
- // get a color by index without advancing pointer.
3891
- this.get = function(i) {
3892
- var idx = i - colors.length * Math.floor(i/colors.length);
3893
- return colors[idx];
3894
- };
3895
-
3896
- this.setColors = function(c) {
3897
- colors = c;
3898
- };
3899
-
3900
- this.reset = function() {
3901
- idx = 0;
3902
- };
3903
-
3904
- this.getIndex = function() {
3905
- return idx;
3906
- };
3907
-
3908
- this.setIndex = function(index) {
3909
- idx = index;
3910
- };
3911
- };
3912
-
3913
- // convert a hex color string to rgb string.
3914
- // h - 3 or 6 character hex string, with or without leading #
3915
- // a - optional alpha
3916
- $.jqplot.hex2rgb = function(h, a) {
3917
- h = h.replace('#', '');
3918
- if (h.length == 3) {
3919
- h = h.charAt(0)+h.charAt(0)+h.charAt(1)+h.charAt(1)+h.charAt(2)+h.charAt(2);
3920
- }
3921
- var rgb;
3922
- rgb = 'rgba('+parseInt(h.slice(0,2), 16)+', '+parseInt(h.slice(2,4), 16)+', '+parseInt(h.slice(4,6), 16);
3923
- if (a) {
3924
- rgb += ', '+a;
3925
- }
3926
- rgb += ')';
3927
- return rgb;
3928
- };
3929
-
3930
- // convert an rgb color spec to a hex spec. ignore any alpha specification.
3931
- $.jqplot.rgb2hex = function(s) {
3932
- var pat = /rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;
3933
- var m = s.match(pat);
3934
- var h = '#';
3935
- for (var i=1; i<4; i++) {
3936
- var temp;
3937
- if (m[i].search(/%/) != -1) {
3938
- temp = parseInt(255*m[i]/100, 10).toString(16);
3939
- if (temp.length == 1) {
3940
- temp = '0'+temp;
3941
- }
3942
- }
3943
- else {
3944
- temp = parseInt(m[i], 10).toString(16);
3945
- if (temp.length == 1) {
3946
- temp = '0'+temp;
3947
- }
3948
- }
3949
- h += temp;
3950
- }
3951
- return h;
3952
- };
3953
-
3954
- // given a css color spec, return an rgb css color spec
3955
- $.jqplot.normalize2rgb = function(s, a) {
3956
- if (s.search(/^ *rgba?\(/) != -1) {
3957
- return s;
3958
- }
3959
- else if (s.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/) != -1) {
3960
- return $.jqplot.hex2rgb(s, a);
3961
- }
3962
- else {
3963
- throw new Error('Invalid color spec');
3964
- }
3965
- };
3966
-
3967
- // extract the r, g, b, a color components out of a css color spec.
3968
- $.jqplot.getColorComponents = function(s) {
3969
- // check to see if a color keyword.
3970
- s = $.jqplot.colorKeywordMap[s] || s;
3971
- var rgb = $.jqplot.normalize2rgb(s);
3972
- var pat = /rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;
3973
- var m = rgb.match(pat);
3974
- var ret = [];
3975
- for (var i=1; i<4; i++) {
3976
- if (m[i].search(/%/) != -1) {
3977
- ret[i-1] = parseInt(255*m[i]/100, 10);
3978
- }
3979
- else {
3980
- ret[i-1] = parseInt(m[i], 10);
3981
- }
3982
- }
3983
- ret[3] = parseFloat(m[4]) ? parseFloat(m[4]) : 1.0;
3984
- return ret;
3985
- };
3986
-
3987
- $.jqplot.colorKeywordMap = {
3988
- aliceblue: 'rgb(240, 248, 255)',
3989
- antiquewhite: 'rgb(250, 235, 215)',
3990
- aqua: 'rgb( 0, 255, 255)',
3991
- aquamarine: 'rgb(127, 255, 212)',
3992
- azure: 'rgb(240, 255, 255)',
3993
- beige: 'rgb(245, 245, 220)',
3994
- bisque: 'rgb(255, 228, 196)',
3995
- black: 'rgb( 0, 0, 0)',
3996
- blanchedalmond: 'rgb(255, 235, 205)',
3997
- blue: 'rgb( 0, 0, 255)',
3998
- blueviolet: 'rgb(138, 43, 226)',
3999
- brown: 'rgb(165, 42, 42)',
4000
- burlywood: 'rgb(222, 184, 135)',
4001
- cadetblue: 'rgb( 95, 158, 160)',
4002
- chartreuse: 'rgb(127, 255, 0)',
4003
- chocolate: 'rgb(210, 105, 30)',
4004
- coral: 'rgb(255, 127, 80)',
4005
- cornflowerblue: 'rgb(100, 149, 237)',
4006
- cornsilk: 'rgb(255, 248, 220)',
4007
- crimson: 'rgb(220, 20, 60)',
4008
- cyan: 'rgb( 0, 255, 255)',
4009
- darkblue: 'rgb( 0, 0, 139)',
4010
- darkcyan: 'rgb( 0, 139, 139)',
4011
- darkgoldenrod: 'rgb(184, 134, 11)',
4012
- darkgray: 'rgb(169, 169, 169)',
4013
- darkgreen: 'rgb( 0, 100, 0)',
4014
- darkgrey: 'rgb(169, 169, 169)',
4015
- darkkhaki: 'rgb(189, 183, 107)',
4016
- darkmagenta: 'rgb(139, 0, 139)',
4017
- darkolivegreen: 'rgb( 85, 107, 47)',
4018
- darkorange: 'rgb(255, 140, 0)',
4019
- darkorchid: 'rgb(153, 50, 204)',
4020
- darkred: 'rgb(139, 0, 0)',
4021
- darksalmon: 'rgb(233, 150, 122)',
4022
- darkseagreen: 'rgb(143, 188, 143)',
4023
- darkslateblue: 'rgb( 72, 61, 139)',
4024
- darkslategray: 'rgb( 47, 79, 79)',
4025
- darkslategrey: 'rgb( 47, 79, 79)',
4026
- darkturquoise: 'rgb( 0, 206, 209)',
4027
- darkviolet: 'rgb(148, 0, 211)',
4028
- deeppink: 'rgb(255, 20, 147)',
4029
- deepskyblue: 'rgb( 0, 191, 255)',
4030
- dimgray: 'rgb(105, 105, 105)',
4031
- dimgrey: 'rgb(105, 105, 105)',
4032
- dodgerblue: 'rgb( 30, 144, 255)',
4033
- firebrick: 'rgb(178, 34, 34)',
4034
- floralwhite: 'rgb(255, 250, 240)',
4035
- forestgreen: 'rgb( 34, 139, 34)',
4036
- fuchsia: 'rgb(255, 0, 255)',
4037
- gainsboro: 'rgb(220, 220, 220)',
4038
- ghostwhite: 'rgb(248, 248, 255)',
4039
- gold: 'rgb(255, 215, 0)',
4040
- goldenrod: 'rgb(218, 165, 32)',
4041
- gray: 'rgb(128, 128, 128)',
4042
- grey: 'rgb(128, 128, 128)',
4043
- green: 'rgb( 0, 128, 0)',
4044
- greenyellow: 'rgb(173, 255, 47)',
4045
- honeydew: 'rgb(240, 255, 240)',
4046
- hotpink: 'rgb(255, 105, 180)',
4047
- indianred: 'rgb(205, 92, 92)',
4048
- indigo: 'rgb( 75, 0, 130)',
4049
- ivory: 'rgb(255, 255, 240)',
4050
- khaki: 'rgb(240, 230, 140)',
4051
- lavender: 'rgb(230, 230, 250)',
4052
- lavenderblush: 'rgb(255, 240, 245)',
4053
- lawngreen: 'rgb(124, 252, 0)',
4054
- lemonchiffon: 'rgb(255, 250, 205)',
4055
- lightblue: 'rgb(173, 216, 230)',
4056
- lightcoral: 'rgb(240, 128, 128)',
4057
- lightcyan: 'rgb(224, 255, 255)',
4058
- lightgoldenrodyellow: 'rgb(250, 250, 210)',
4059
- lightgray: 'rgb(211, 211, 211)',
4060
- lightgreen: 'rgb(144, 238, 144)',
4061
- lightgrey: 'rgb(211, 211, 211)',
4062
- lightpink: 'rgb(255, 182, 193)',
4063
- lightsalmon: 'rgb(255, 160, 122)',
4064
- lightseagreen: 'rgb( 32, 178, 170)',
4065
- lightskyblue: 'rgb(135, 206, 250)',
4066
- lightslategray: 'rgb(119, 136, 153)',
4067
- lightslategrey: 'rgb(119, 136, 153)',
4068
- lightsteelblue: 'rgb(176, 196, 222)',
4069
- lightyellow: 'rgb(255, 255, 224)',
4070
- lime: 'rgb( 0, 255, 0)',
4071
- limegreen: 'rgb( 50, 205, 50)',
4072
- linen: 'rgb(250, 240, 230)',
4073
- magenta: 'rgb(255, 0, 255)',
4074
- maroon: 'rgb(128, 0, 0)',
4075
- mediumaquamarine: 'rgb(102, 205, 170)',
4076
- mediumblue: 'rgb( 0, 0, 205)',
4077
- mediumorchid: 'rgb(186, 85, 211)',
4078
- mediumpurple: 'rgb(147, 112, 219)',
4079
- mediumseagreen: 'rgb( 60, 179, 113)',
4080
- mediumslateblue: 'rgb(123, 104, 238)',
4081
- mediumspringgreen: 'rgb( 0, 250, 154)',
4082
- mediumturquoise: 'rgb( 72, 209, 204)',
4083
- mediumvioletred: 'rgb(199, 21, 133)',
4084
- midnightblue: 'rgb( 25, 25, 112)',
4085
- mintcream: 'rgb(245, 255, 250)',
4086
- mistyrose: 'rgb(255, 228, 225)',
4087
- moccasin: 'rgb(255, 228, 181)',
4088
- navajowhite: 'rgb(255, 222, 173)',
4089
- navy: 'rgb( 0, 0, 128)',
4090
- oldlace: 'rgb(253, 245, 230)',
4091
- olive: 'rgb(128, 128, 0)',
4092
- olivedrab: 'rgb(107, 142, 35)',
4093
- orange: 'rgb(255, 165, 0)',
4094
- orangered: 'rgb(255, 69, 0)',
4095
- orchid: 'rgb(218, 112, 214)',
4096
- palegoldenrod: 'rgb(238, 232, 170)',
4097
- palegreen: 'rgb(152, 251, 152)',
4098
- paleturquoise: 'rgb(175, 238, 238)',
4099
- palevioletred: 'rgb(219, 112, 147)',
4100
- papayawhip: 'rgb(255, 239, 213)',
4101
- peachpuff: 'rgb(255, 218, 185)',
4102
- peru: 'rgb(205, 133, 63)',
4103
- pink: 'rgb(255, 192, 203)',
4104
- plum: 'rgb(221, 160, 221)',
4105
- powderblue: 'rgb(176, 224, 230)',
4106
- purple: 'rgb(128, 0, 128)',
4107
- red: 'rgb(255, 0, 0)',
4108
- rosybrown: 'rgb(188, 143, 143)',
4109
- royalblue: 'rgb( 65, 105, 225)',
4110
- saddlebrown: 'rgb(139, 69, 19)',
4111
- salmon: 'rgb(250, 128, 114)',
4112
- sandybrown: 'rgb(244, 164, 96)',
4113
- seagreen: 'rgb( 46, 139, 87)',
4114
- seashell: 'rgb(255, 245, 238)',
4115
- sienna: 'rgb(160, 82, 45)',
4116
- silver: 'rgb(192, 192, 192)',
4117
- skyblue: 'rgb(135, 206, 235)',
4118
- slateblue: 'rgb(106, 90, 205)',
4119
- slategray: 'rgb(112, 128, 144)',
4120
- slategrey: 'rgb(112, 128, 144)',
4121
- snow: 'rgb(255, 250, 250)',
4122
- springgreen: 'rgb( 0, 255, 127)',
4123
- steelblue: 'rgb( 70, 130, 180)',
4124
- tan: 'rgb(210, 180, 140)',
4125
- teal: 'rgb( 0, 128, 128)',
4126
- thistle: 'rgb(216, 191, 216)',
4127
- tomato: 'rgb(255, 99, 71)',
4128
- turquoise: 'rgb( 64, 224, 208)',
4129
- violet: 'rgb(238, 130, 238)',
4130
- wheat: 'rgb(245, 222, 179)',
4131
- white: 'rgb(255, 255, 255)',
4132
- whitesmoke: 'rgb(245, 245, 245)',
4133
- yellow: 'rgb(255, 255, 0)',
4134
- yellowgreen: 'rgb(154, 205, 50)'
4135
- };
4136
-
4137
-
4138
-
4139
-
4140
- // class: $.jqplot.AxisLabelRenderer
4141
- // Renderer to place labels on the axes.
4142
- $.jqplot.AxisLabelRenderer = function(options) {
4143
- // Group: Properties
4144
- $.jqplot.ElemContainer.call(this);
4145
- // name of the axis associated with this tick
4146
- this.axis;
4147
- // prop: show
4148
- // whether or not to show the tick (mark and label).
4149
- this.show = true;
4150
- // prop: label
4151
- // The text or html for the label.
4152
- this.label = '';
4153
- this.fontFamily = null;
4154
- this.fontSize = null;
4155
- this.textColor = null;
4156
- this._elem;
4157
- // prop: escapeHTML
4158
- // true to escape HTML entities in the label.
4159
- this.escapeHTML = false;
4160
-
4161
- $.extend(true, this, options);
4162
- };
4163
-
4164
- $.jqplot.AxisLabelRenderer.prototype = new $.jqplot.ElemContainer();
4165
- $.jqplot.AxisLabelRenderer.prototype.constructor = $.jqplot.AxisLabelRenderer;
4166
-
4167
- $.jqplot.AxisLabelRenderer.prototype.init = function(options) {
4168
- $.extend(true, this, options);
4169
- };
4170
-
4171
- $.jqplot.AxisLabelRenderer.prototype.draw = function(ctx, plot) {
4172
- // Memory Leaks patch
4173
- if (this._elem) {
4174
- this._elem.emptyForce();
4175
- this._elem = null;
4176
- }
4177
-
4178
- this._elem = $('<div style="position:absolute;" class="jqplot-'+this.axis+'-label"></div>');
4179
-
4180
- if (Number(this.label)) {
4181
- this._elem.css('white-space', 'nowrap');
4182
- }
4183
-
4184
- if (!this.escapeHTML) {
4185
- this._elem.html(this.label);
4186
- }
4187
- else {
4188
- this._elem.text(this.label);
4189
- }
4190
- if (this.fontFamily) {
4191
- this._elem.css('font-family', this.fontFamily);
4192
- }
4193
- if (this.fontSize) {
4194
- this._elem.css('font-size', this.fontSize);
4195
- }
4196
- if (this.textColor) {
4197
- this._elem.css('color', this.textColor);
4198
- }
4199
-
4200
- return this._elem;
4201
- };
4202
-
4203
- $.jqplot.AxisLabelRenderer.prototype.pack = function() {
4204
- };
4205
-
4206
- // class: $.jqplot.AxisTickRenderer
4207
- // A "tick" object showing the value of a tick/gridline on the plot.
4208
- $.jqplot.AxisTickRenderer = function(options) {
4209
- // Group: Properties
4210
- $.jqplot.ElemContainer.call(this);
4211
- // prop: mark
4212
- // tick mark on the axis. One of 'inside', 'outside', 'cross', '' or null.
4213
- this.mark = 'outside';
4214
- // name of the axis associated with this tick
4215
- this.axis;
4216
- // prop: showMark
4217
- // whether or not to show the mark on the axis.
4218
- this.showMark = true;
4219
- // prop: showGridline
4220
- // whether or not to draw the gridline on the grid at this tick.
4221
- this.showGridline = true;
4222
- // prop: isMinorTick
4223
- // if this is a minor tick.
4224
- this.isMinorTick = false;
4225
- // prop: size
4226
- // Length of the tick beyond the grid in pixels.
4227
- // DEPRECATED: This has been superceeded by markSize
4228
- this.size = 4;
4229
- // prop: markSize
4230
- // Length of the tick marks in pixels. For 'cross' style, length
4231
- // will be stoked above and below axis, so total length will be twice this.
4232
- this.markSize = 6;
4233
- // prop: show
4234
- // whether or not to show the tick (mark and label).
4235
- // Setting this to false requires more testing. It is recommended
4236
- // to set showLabel and showMark to false instead.
4237
- this.show = true;
4238
- // prop: showLabel
4239
- // whether or not to show the label.
4240
- this.showLabel = true;
4241
- this.label = null;
4242
- this.value = null;
4243
- this._styles = {};
4244
- // prop: formatter
4245
- // A class of a formatter for the tick text. sprintf by default.
4246
- this.formatter = $.jqplot.DefaultTickFormatter;
4247
- // prop: prefix
4248
- // String to prepend to the tick label.
4249
- // Prefix is prepended to the formatted tick label.
4250
- this.prefix = '';
4251
- // prop: suffix
4252
- // String to append to the tick label.
4253
- // Suffix is appended to the formatted tick label.
4254
- this.suffix = '';
4255
- // prop: formatString
4256
- // string passed to the formatter.
4257
- this.formatString = '';
4258
- // prop: fontFamily
4259
- // css spec for the font-family css attribute.
4260
- this.fontFamily;
4261
- // prop: fontSize
4262
- // css spec for the font-size css attribute.
4263
- this.fontSize;
4264
- // prop: textColor
4265
- // css spec for the color attribute.
4266
- this.textColor;
4267
- // prop: escapeHTML
4268
- // true to escape HTML entities in the label.
4269
- this.escapeHTML = false;
4270
- this._elem;
4271
- this._breakTick = false;
4272
-
4273
- $.extend(true, this, options);
4274
- };
4275
-
4276
- $.jqplot.AxisTickRenderer.prototype.init = function(options) {
4277
- $.extend(true, this, options);
4278
- };
4279
-
4280
- $.jqplot.AxisTickRenderer.prototype = new $.jqplot.ElemContainer();
4281
- $.jqplot.AxisTickRenderer.prototype.constructor = $.jqplot.AxisTickRenderer;
4282
-
4283
- $.jqplot.AxisTickRenderer.prototype.setTick = function(value, axisName, isMinor) {
4284
- this.value = value;
4285
- this.axis = axisName;
4286
- if (isMinor) {
4287
- this.isMinorTick = true;
4288
- }
4289
- return this;
4290
- };
4291
-
4292
- $.jqplot.AxisTickRenderer.prototype.draw = function() {
4293
- if (this.label === null) {
4294
- this.label = this.prefix + this.formatter(this.formatString, this.value) + this.suffix;
4295
- }
4296
- var style = {position: 'absolute'};
4297
- if (Number(this.label)) {
4298
- style['whitSpace'] = 'nowrap';
4299
- }
4300
-
4301
- // Memory Leaks patch
4302
- if (this._elem) {
4303
- this._elem.emptyForce();
4304
- this._elem = null;
4305
- }
4306
-
4307
- this._elem = $(document.createElement('div'));
4308
- this._elem.addClass("jqplot-"+this.axis+"-tick");
4309
-
4310
- if (!this.escapeHTML) {
4311
- this._elem.html(this.label);
4312
- }
4313
- else {
4314
- this._elem.text(this.label);
4315
- }
4316
-
4317
- this._elem.css(style);
4318
-
4319
- for (var s in this._styles) {
4320
- this._elem.css(s, this._styles[s]);
4321
- }
4322
- if (this.fontFamily) {
4323
- this._elem.css('font-family', this.fontFamily);
4324
- }
4325
- if (this.fontSize) {
4326
- this._elem.css('font-size', this.fontSize);
4327
- }
4328
- if (this.textColor) {
4329
- this._elem.css('color', this.textColor);
4330
- }
4331
- if (this._breakTick) {
4332
- this._elem.addClass('jqplot-breakTick');
4333
- }
4334
-
4335
- return this._elem;
4336
- };
4337
-
4338
- $.jqplot.DefaultTickFormatter = function (format, val) {
4339
- if (typeof val == 'number') {
4340
- if (!format) {
4341
- format = $.jqplot.config.defaultTickFormatString;
4342
- }
4343
- return $.jqplot.sprintf(format, val);
4344
- }
4345
- else {
4346
- return String(val);
4347
- }
4348
- };
4349
-
4350
- $.jqplot.PercentTickFormatter = function (format, val) {
4351
- if (typeof val == 'number') {
4352
- val = 100 * val;
4353
- if (!format) {
4354
- format = $.jqplot.config.defaultTickFormatString;
4355
- }
4356
- return $.jqplot.sprintf(format, val);
4357
- }
4358
- else {
4359
- return String(val);
4360
- }
4361
- };
4362
-
4363
- $.jqplot.AxisTickRenderer.prototype.pack = function() {
4364
- };
4365
-
4366
- // Class: $.jqplot.CanvasGridRenderer
4367
- // The default jqPlot grid renderer, creating a grid on a canvas element.
4368
- // The renderer has no additional options beyond the <Grid> class.
4369
- $.jqplot.CanvasGridRenderer = function(){
4370
- this.shadowRenderer = new $.jqplot.ShadowRenderer();
4371
- };
4372
-
4373
- // called with context of Grid object
4374
- $.jqplot.CanvasGridRenderer.prototype.init = function(options) {
4375
- this._ctx;
4376
- $.extend(true, this, options);
4377
- // set the shadow renderer options
4378
- var sopts = {lineJoin:'miter', lineCap:'round', fill:false, isarc:false, angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, depth:this.shadowDepth, lineWidth:this.shadowWidth, closePath:false, strokeStyle:this.shadowColor};
4379
- this.renderer.shadowRenderer.init(sopts);
4380
- };
4381
-
4382
- // called with context of Grid.
4383
- $.jqplot.CanvasGridRenderer.prototype.createElement = function(plot) {
4384
- var elem;
4385
- // Memory Leaks patch
4386
- if (this._elem) {
4387
- if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
4388
- elem = this._elem.get(0);
4389
- window.G_vmlCanvasManager.uninitElement(elem);
4390
- elem = null;
4391
- }
4392
-
4393
- this._elem.emptyForce();
4394
- this._elem = null;
4395
- }
4396
-
4397
- elem = plot.canvasManager.getCanvas();
4398
-
4399
- var w = this._plotDimensions.width;
4400
- var h = this._plotDimensions.height;
4401
- elem.width = w;
4402
- elem.height = h;
4403
- this._elem = $(elem);
4404
- this._elem.addClass('jqplot-grid-canvas');
4405
- this._elem.css({ position: 'absolute', left: 0, top: 0 });
4406
-
4407
- elem = plot.canvasManager.initCanvas(elem);
4408
-
4409
- this._top = this._offsets.top;
4410
- this._bottom = h - this._offsets.bottom;
4411
- this._left = this._offsets.left;
4412
- this._right = w - this._offsets.right;
4413
- this._width = this._right - this._left;
4414
- this._height = this._bottom - this._top;
4415
- // avoid memory leak
4416
- elem = null;
4417
- return this._elem;
4418
- };
4419
-
4420
- $.jqplot.CanvasGridRenderer.prototype.draw = function() {
4421
- this._ctx = this._elem.get(0).getContext("2d");
4422
- var ctx = this._ctx;
4423
- var axes = this._axes;
4424
- // Add the grid onto the grid canvas. This is the bottom most layer.
4425
- ctx.save();
4426
- ctx.clearRect(0, 0, this._plotDimensions.width, this._plotDimensions.height);
4427
- ctx.fillStyle = this.backgroundColor || this.background;
4428
- ctx.fillRect(this._left, this._top, this._width, this._height);
4429
-
4430
- ctx.save();
4431
- ctx.lineJoin = 'miter';
4432
- ctx.lineCap = 'butt';
4433
- ctx.lineWidth = this.gridLineWidth;
4434
- ctx.strokeStyle = this.gridLineColor;
4435
- var b, e, s, m;
4436
- var ax = ['xaxis', 'yaxis', 'x2axis', 'y2axis'];
4437
- for (var i=4; i>0; i--) {
4438
- var name = ax[i-1];
4439
- var axis = axes[name];
4440
- var ticks = axis._ticks;
4441
- var numticks = ticks.length;
4442
- if (axis.show) {
4443
- if (axis.drawBaseline) {
4444
- var bopts = {};
4445
- if (axis.baselineWidth !== null) {
4446
- bopts.lineWidth = axis.baselineWidth;
4447
- }
4448
- if (axis.baselineColor !== null) {
4449
- bopts.strokeStyle = axis.baselineColor;
4450
- }
4451
- switch (name) {
4452
- case 'xaxis':
4453
- drawLine (this._left, this._bottom, this._right, this._bottom, bopts);
4454
- break;
4455
- case 'yaxis':
4456
- drawLine (this._left, this._bottom, this._left, this._top, bopts);
4457
- break;
4458
- case 'x2axis':
4459
- drawLine (this._left, this._bottom, this._right, this._bottom, bopts);
4460
- break;
4461
- case 'y2axis':
4462
- drawLine (this._right, this._bottom, this._right, this._top, bopts);
4463
- break;
4464
- }
4465
- }
4466
- for (var j=numticks; j>0; j--) {
4467
- var t = ticks[j-1];
4468
- if (t.show) {
4469
- var pos = Math.round(axis.u2p(t.value)) + 0.5;
4470
- switch (name) {
4471
- case 'xaxis':
4472
- // draw the grid line if we should
4473
- if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) {
4474
- drawLine(pos, this._top, pos, this._bottom);
4475
- }
4476
- // draw the mark
4477
- if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) {
4478
- s = t.markSize;
4479
- m = t.mark;
4480
- var pos = Math.round(axis.u2p(t.value)) + 0.5;
4481
- switch (m) {
4482
- case 'outside':
4483
- b = this._bottom;
4484
- e = this._bottom+s;
4485
- break;
4486
- case 'inside':
4487
- b = this._bottom-s;
4488
- e = this._bottom;
4489
- break;
4490
- case 'cross':
4491
- b = this._bottom-s;
4492
- e = this._bottom+s;
4493
- break;
4494
- default:
4495
- b = this._bottom;
4496
- e = this._bottom+s;
4497
- break;
4498
- }
4499
- // draw the shadow
4500
- if (this.shadow) {
4501
- this.renderer.shadowRenderer.draw(ctx, [[pos,b],[pos,e]], {lineCap:'butt', lineWidth:this.gridLineWidth, offset:this.gridLineWidth*0.75, depth:2, fill:false, closePath:false});
4502
- }
4503
- // draw the line
4504
- drawLine(pos, b, pos, e);
4505
- }
4506
- break;
4507
- case 'yaxis':
4508
- // draw the grid line
4509
- if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) {
4510
- drawLine(this._right, pos, this._left, pos);
4511
- }
4512
- // draw the mark
4513
- if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) {
4514
- s = t.markSize;
4515
- m = t.mark;
4516
- var pos = Math.round(axis.u2p(t.value)) + 0.5;
4517
- switch (m) {
4518
- case 'outside':
4519
- b = this._left-s;
4520
- e = this._left;
4521
- break;
4522
- case 'inside':
4523
- b = this._left;
4524
- e = this._left+s;
4525
- break;
4526
- case 'cross':
4527
- b = this._left-s;
4528
- e = this._left+s;
4529
- break;
4530
- default:
4531
- b = this._left-s;
4532
- e = this._left;
4533
- break;
4534
- }
4535
- // draw the shadow
4536
- if (this.shadow) {
4537
- this.renderer.shadowRenderer.draw(ctx, [[b, pos], [e, pos]], {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false});
4538
- }
4539
- drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
4540
- }
4541
- break;
4542
- case 'x2axis':
4543
- // draw the grid line
4544
- if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) {
4545
- drawLine(pos, this._bottom, pos, this._top);
4546
- }
4547
- // draw the mark
4548
- if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) {
4549
- s = t.markSize;
4550
- m = t.mark;
4551
- var pos = Math.round(axis.u2p(t.value)) + 0.5;
4552
- switch (m) {
4553
- case 'outside':
4554
- b = this._top-s;
4555
- e = this._top;
4556
- break;
4557
- case 'inside':
4558
- b = this._top;
4559
- e = this._top+s;
4560
- break;
4561
- case 'cross':
4562
- b = this._top-s;
4563
- e = this._top+s;
4564
- break;
4565
- default:
4566
- b = this._top-s;
4567
- e = this._top;
4568
- break;
4569
- }
4570
- // draw the shadow
4571
- if (this.shadow) {
4572
- this.renderer.shadowRenderer.draw(ctx, [[pos,b],[pos,e]], {lineCap:'butt', lineWidth:this.gridLineWidth, offset:this.gridLineWidth*0.75, depth:2, fill:false, closePath:false});
4573
- }
4574
- drawLine(pos, b, pos, e);
4575
- }
4576
- break;
4577
- case 'y2axis':
4578
- // draw the grid line
4579
- if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) {
4580
- drawLine(this._left, pos, this._right, pos);
4581
- }
4582
- // draw the mark
4583
- if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) {
4584
- s = t.markSize;
4585
- m = t.mark;
4586
- var pos = Math.round(axis.u2p(t.value)) + 0.5;
4587
- switch (m) {
4588
- case 'outside':
4589
- b = this._right;
4590
- e = this._right+s;
4591
- break;
4592
- case 'inside':
4593
- b = this._right-s;
4594
- e = this._right;
4595
- break;
4596
- case 'cross':
4597
- b = this._right-s;
4598
- e = this._right+s;
4599
- break;
4600
- default:
4601
- b = this._right;
4602
- e = this._right+s;
4603
- break;
4604
- }
4605
- // draw the shadow
4606
- if (this.shadow) {
4607
- this.renderer.shadowRenderer.draw(ctx, [[b, pos], [e, pos]], {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false});
4608
- }
4609
- drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
4610
- }
4611
- break;
4612
- default:
4613
- break;
4614
- }
4615
- }
4616
- }
4617
- t = null;
4618
- }
4619
- axis = null;
4620
- ticks = null;
4621
- }
4622
- // Now draw grid lines for additional y axes
4623
- //////
4624
- // TO DO: handle yMidAxis
4625
- //////
4626
- ax = ['y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis', 'yMidAxis'];
4627
- for (var i=7; i>0; i--) {
4628
- var axis = axes[ax[i-1]];
4629
- var ticks = axis._ticks;
4630
- if (axis.show) {
4631
- var tn = ticks[axis.numberTicks-1];
4632
- var t0 = ticks[0];
4633
- var left = axis.getLeft();
4634
- var points = [[left, tn.getTop() + tn.getHeight()/2], [left, t0.getTop() + t0.getHeight()/2 + 1.0]];
4635
- // draw the shadow
4636
- if (this.shadow) {
4637
- this.renderer.shadowRenderer.draw(ctx, points, {lineCap:'butt', fill:false, closePath:false});
4638
- }
4639
- // draw the line
4640
- drawLine(points[0][0], points[0][1], points[1][0], points[1][1], {lineCap:'butt', strokeStyle:axis.borderColor, lineWidth:axis.borderWidth});
4641
- // draw the tick marks
4642
- for (var j=ticks.length; j>0; j--) {
4643
- var t = ticks[j-1];
4644
- s = t.markSize;
4645
- m = t.mark;
4646
- var pos = Math.round(axis.u2p(t.value)) + 0.5;
4647
- if (t.showMark && t.mark) {
4648
- switch (m) {
4649
- case 'outside':
4650
- b = left;
4651
- e = left+s;
4652
- break;
4653
- case 'inside':
4654
- b = left-s;
4655
- e = left;
4656
- break;
4657
- case 'cross':
4658
- b = left-s;
4659
- e = left+s;
4660
- break;
4661
- default:
4662
- b = left;
4663
- e = left+s;
4664
- break;
4665
- }
4666
- points = [[b,pos], [e,pos]];
4667
- // draw the shadow
4668
- if (this.shadow) {
4669
- this.renderer.shadowRenderer.draw(ctx, points, {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false});
4670
- }
4671
- // draw the line
4672
- drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
4673
- }
4674
- t = null;
4675
- }
4676
- t0 = null;
4677
- }
4678
- axis = null;
4679
- ticks = null;
4680
- }
4681
-
4682
- ctx.restore();
4683
-
4684
- function drawLine(bx, by, ex, ey, opts) {
4685
- ctx.save();
4686
- opts = opts || {};
4687
- if (opts.lineWidth == null || opts.lineWidth != 0){
4688
- $.extend(true, ctx, opts);
4689
- ctx.beginPath();
4690
- ctx.moveTo(bx, by);
4691
- ctx.lineTo(ex, ey);
4692
- ctx.stroke();
4693
- ctx.restore();
4694
- }
4695
- }
4696
-
4697
- if (this.shadow) {
4698
- var points = [[this._left, this._bottom], [this._right, this._bottom], [this._right, this._top]];
4699
- this.renderer.shadowRenderer.draw(ctx, points);
4700
- }
4701
- // Now draw border around grid. Use axis border definitions. start at
4702
- // upper left and go clockwise.
4703
- if (this.borderWidth != 0 && this.drawBorder) {
4704
- drawLine (this._left, this._top, this._right, this._top, {lineCap:'round', strokeStyle:axes.x2axis.borderColor, lineWidth:axes.x2axis.borderWidth});
4705
- drawLine (this._right, this._top, this._right, this._bottom, {lineCap:'round', strokeStyle:axes.y2axis.borderColor, lineWidth:axes.y2axis.borderWidth});
4706
- drawLine (this._right, this._bottom, this._left, this._bottom, {lineCap:'round', strokeStyle:axes.xaxis.borderColor, lineWidth:axes.xaxis.borderWidth});
4707
- drawLine (this._left, this._bottom, this._left, this._top, {lineCap:'round', strokeStyle:axes.yaxis.borderColor, lineWidth:axes.yaxis.borderWidth});
4708
- }
4709
- // ctx.lineWidth = this.borderWidth;
4710
- // ctx.strokeStyle = this.borderColor;
4711
- // ctx.strokeRect(this._left, this._top, this._width, this._height);
4712
-
4713
- ctx.restore();
4714
- ctx = null;
4715
- axes = null;
4716
- };
4717
-
4718
- // Class: $.jqplot.DivTitleRenderer
4719
- // The default title renderer for jqPlot. This class has no options beyond the <Title> class.
4720
- $.jqplot.DivTitleRenderer = function() {
4721
- };
4722
-
4723
- $.jqplot.DivTitleRenderer.prototype.init = function(options) {
4724
- $.extend(true, this, options);
4725
- };
4726
-
4727
- $.jqplot.DivTitleRenderer.prototype.draw = function() {
4728
- // Memory Leaks patch
4729
- if (this._elem) {
4730
- this._elem.emptyForce();
4731
- this._elem = null;
4732
- }
4733
-
4734
- var r = this.renderer;
4735
- var elem = document.createElement('div');
4736
- this._elem = $(elem);
4737
- this._elem.addClass('jqplot-title');
4738
-
4739
- if (!this.text) {
4740
- this.show = false;
4741
- this._elem.height(0);
4742
- this._elem.width(0);
4743
- }
4744
- else if (this.text) {
4745
- var color;
4746
- if (this.color) {
4747
- color = this.color;
4748
- }
4749
- else if (this.textColor) {
4750
- color = this.textColor;
4751
- }
4752
-
4753
- // don't trust that a stylesheet is present, set the position.
4754
- var styles = {position:'absolute', top:'0px', left:'0px'};
4755
-
4756
- if (this._plotWidth) {
4757
- styles['width'] = this._plotWidth+'px';
4758
- }
4759
- if (this.fontSize) {
4760
- styles['fontSize'] = this.fontSize;
4761
- }
4762
- if (typeof this.textAlign === 'string') {
4763
- styles['textAlign'] = this.textAlign;
4764
- }
4765
- else {
4766
- styles['textAlign'] = 'center';
4767
- }
4768
- if (color) {
4769
- styles['color'] = color;
4770
- }
4771
- if (this.paddingBottom) {
4772
- styles['paddingBottom'] = this.paddingBottom;
4773
- }
4774
- if (this.fontFamily) {
4775
- styles['fontFamily'] = this.fontFamily;
4776
- }
4777
-
4778
- this._elem.css(styles);
4779
- if (this.escapeHtml) {
4780
- this._elem.text(this.text);
4781
- }
4782
- else {
4783
- this._elem.html(this.text);
4784
- }
4785
-
4786
-
4787
- // styletext += (this._plotWidth) ? 'width:'+this._plotWidth+'px;' : '';
4788
- // styletext += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
4789
- // styletext += (this.textAlign) ? 'text-align:'+this.textAlign+';' : 'text-align:center;';
4790
- // styletext += (color) ? 'color:'+color+';' : '';
4791
- // styletext += (this.paddingBottom) ? 'padding-bottom:'+this.paddingBottom+';' : '';
4792
- // this._elem = $('<div class="jqplot-title" style="'+styletext+'">'+this.text+'</div>');
4793
- // if (this.fontFamily) {
4794
- // this._elem.css('font-family', this.fontFamily);
4795
- // }
4796
- }
4797
-
4798
- elem = null;
4799
-
4800
- return this._elem;
4801
- };
4802
-
4803
- $.jqplot.DivTitleRenderer.prototype.pack = function() {
4804
- // nothing to do here
4805
- };
4806
-
4807
-
4808
- var dotlen = 0.1;
4809
-
4810
- $.jqplot.LinePattern = function (ctx, pattern) {
4811
-
4812
- var defaultLinePatterns = {
4813
- dotted: [ dotlen, $.jqplot.config.dotGapLength ],
4814
- dashed: [ $.jqplot.config.dashLength, $.jqplot.config.gapLength ],
4815
- solid: null
4816
- };
4817
-
4818
- if (typeof pattern === 'string') {
4819
- if (pattern[0] === '.' || pattern[0] === '-') {
4820
- var s = pattern;
4821
- pattern = [];
4822
- for (var i=0, imax=s.length; i<imax; i++) {
4823
- if (s[i] === '.') {
4824
- pattern.push( dotlen );
4825
- }
4826
- else if (s[i] === '-') {
4827
- pattern.push( $.jqplot.config.dashLength );
4828
- }
4829
- else {
4830
- continue;
4831
- }
4832
- pattern.push( $.jqplot.config.gapLength );
4833
- }
4834
- }
4835
- else {
4836
- pattern = defaultLinePatterns[pattern];
4837
- }
4838
- }
4839
-
4840
- if (!(pattern && pattern.length)) {
4841
- return ctx;
4842
- }
4843
-
4844
- var patternIndex = 0;
4845
- var patternDistance = pattern[0];
4846
- var px = 0;
4847
- var py = 0;
4848
- var pathx0 = 0;
4849
- var pathy0 = 0;
4850
-
4851
- var moveTo = function (x, y) {
4852
- ctx.moveTo( x, y );
4853
- px = x;
4854
- py = y;
4855
- pathx0 = x;
4856
- pathy0 = y;
4857
- };
4858
-
4859
- var lineTo = function (x, y) {
4860
- var scale = ctx.lineWidth;
4861
- var dx = x - px;
4862
- var dy = y - py;
4863
- var dist = Math.sqrt(dx*dx+dy*dy);
4864
- if ((dist > 0) && (scale > 0)) {
4865
- dx /= dist;
4866
- dy /= dist;
4867
- while (true) {
4868
- var dp = scale * patternDistance;
4869
- if (dp < dist) {
4870
- px += dp * dx;
4871
- py += dp * dy;
4872
- if ((patternIndex & 1) == 0) {
4873
- ctx.lineTo( px, py );
4874
- }
4875
- else {
4876
- ctx.moveTo( px, py );
4877
- }
4878
- dist -= dp;
4879
- patternIndex++;
4880
- if (patternIndex >= pattern.length) {
4881
- patternIndex = 0;
4882
- }
4883
- patternDistance = pattern[patternIndex];
4884
- }
4885
- else {
4886
- px = x;
4887
- py = y;
4888
- if ((patternIndex & 1) == 0) {
4889
- ctx.lineTo( px, py );
4890
- }
4891
- else {
4892
- ctx.moveTo( px, py );
4893
- }
4894
- patternDistance -= dist / scale;
4895
- break;
4896
- }
4897
- }
4898
- }
4899
- };
4900
-
4901
- var beginPath = function () {
4902
- ctx.beginPath();
4903
- };
4904
-
4905
- var closePath = function () {
4906
- lineTo( pathx0, pathy0 );
4907
- };
4908
-
4909
- return {
4910
- moveTo: moveTo,
4911
- lineTo: lineTo,
4912
- beginPath: beginPath,
4913
- closePath: closePath
4914
- };
4915
- };
4916
-
4917
- // Class: $.jqplot.LineRenderer
4918
- // The default line renderer for jqPlot, this class has no options beyond the <Series> class.
4919
- // Draws series as a line.
4920
- $.jqplot.LineRenderer = function(){
4921
- this.shapeRenderer = new $.jqplot.ShapeRenderer();
4922
- this.shadowRenderer = new $.jqplot.ShadowRenderer();
4923
- };
4924
-
4925
- // called with scope of series.
4926
- $.jqplot.LineRenderer.prototype.init = function(options, plot) {
4927
- // Group: Properties
4928
- //
4929
- options = options || {};
4930
- this._type='line';
4931
- this.renderer.animation = {
4932
- show: false,
4933
- direction: 'left',
4934
- speed: 2500,
4935
- _supported: true
4936
- };
4937
- // prop: smooth
4938
- // True to draw a smoothed (interpolated) line through the data points
4939
- // with automatically computed number of smoothing points.
4940
- // Set to an integer number > 2 to specify number of smoothing points
4941
- // to use between each data point.
4942
- this.renderer.smooth = false; // true or a number > 2 for smoothing.
4943
- this.renderer.tension = null; // null to auto compute or a number typically > 6. Fewer points requires higher tension.
4944
- // prop: constrainSmoothing
4945
- // True to use a more accurate smoothing algorithm that will
4946
- // not overshoot any data points. False to allow overshoot but
4947
- // produce a smoother looking line.
4948
- this.renderer.constrainSmoothing = true;
4949
- // this is smoothed data in grid coordinates, like gridData
4950
- this.renderer._smoothedData = [];
4951
- // this is smoothed data in plot units (plot coordinates), like plotData.
4952
- this.renderer._smoothedPlotData = [];
4953
- this.renderer._hiBandGridData = [];
4954
- this.renderer._lowBandGridData = [];
4955
- this.renderer._hiBandSmoothedData = [];
4956
- this.renderer._lowBandSmoothedData = [];
4957
-
4958
- // prop: bandData
4959
- // Data used to draw error bands or confidence intervals above/below a line.
4960
- //
4961
- // bandData can be input in 3 forms. jqPlot will figure out which is the
4962
- // low band line and which is the high band line for all forms:
4963
- //
4964
- // A 2 dimensional array like [[yl1, yl2, ...], [yu1, yu2, ...]] where
4965
- // [yl1, yl2, ...] are y values of the lower line and
4966
- // [yu1, yu2, ...] are y values of the upper line.
4967
- // In this case there must be the same number of y data points as data points
4968
- // in the series and the bands will inherit the x values of the series.
4969
- //
4970
- // A 2 dimensional array like [[[xl1, yl1], [xl2, yl2], ...], [[xh1, yh1], [xh2, yh2], ...]]
4971
- // where [xl1, yl1] are x,y data points for the lower line and
4972
- // [xh1, yh1] are x,y data points for the high line.
4973
- // x values do not have to correspond to the x values of the series and can
4974
- // be of any arbitrary length.
4975
- //
4976
- // Can be of form [[yl1, yu1], [yl2, yu2], [yl3, yu3], ...] where
4977
- // there must be 3 or more arrays and there must be the same number of arrays
4978
- // as there are data points in the series. In this case,
4979
- // [yl1, yu1] specifies the lower and upper y values for the 1st
4980
- // data point and so on. The bands will inherit the x
4981
- // values from the series.
4982
- this.renderer.bandData = [];
4983
-
4984
- // Group: bands
4985
- // Banding around line, e.g error bands or confidence intervals.
4986
- this.renderer.bands = {
4987
- // prop: show
4988
- // true to show the bands. If bandData or interval is
4989
- // supplied, show will be set to true by default.
4990
- show: false,
4991
- hiData: [],
4992
- lowData: [],
4993
- // prop: color
4994
- // color of lines at top and bottom of bands [default: series color].
4995
- color: this.color,
4996
- // prop: showLines
4997
- // True to show lines at top and bottom of bands [default: false].
4998
- showLines: false,
4999
- // prop: fill
5000
- // True to fill area between bands [default: true].
5001
- fill: true,
5002
- // prop: fillColor
5003
- // css color spec for filled area. [default: series color].
5004
- fillColor: null,
5005
- _min: null,
5006
- _max: null,
5007
- // prop: interval
5008
- // User specified interval above and below line for bands [default: '3%''].
5009
- // Can be a value like 3 or a string like '3%'
5010
- // or an upper/lower array like [1, -2] or ['2%', '-1.5%']
5011
- interval: '3%'
5012
- };
5013
-
5014
-
5015
- var lopts = {highlightMouseOver: options.highlightMouseOver, highlightMouseDown: options.highlightMouseDown, highlightColor: options.highlightColor};
5016
-
5017
- delete (options.highlightMouseOver);
5018
- delete (options.highlightMouseDown);
5019
- delete (options.highlightColor);
5020
-
5021
- $.extend(true, this.renderer, options);
5022
-
5023
- this.renderer.options = options;
5024
-
5025
- // if we are given some band data, and bands aren't explicity set to false in options, turn them on.
5026
- if (this.renderer.bandData.length > 1 && (!options.bands || options.bands.show == null)) {
5027
- this.renderer.bands.show = true;
5028
- }
5029
-
5030
- // if we are given an interval, and bands aren't explicity set to false in options, turn them on.
5031
- else if (options.bands && options.bands.show == null && options.bands.interval != null) {
5032
- this.renderer.bands.show = true;
5033
- }
5034
-
5035
- // if plot is filled, turn off bands.
5036
- if (this.fill) {
5037
- this.renderer.bands.show = false;
5038
- }
5039
-
5040
- if (this.renderer.bands.show) {
5041
- this.renderer.initBands.call(this, this.renderer.options, plot);
5042
- }
5043
-
5044
-
5045
- // smoothing is not compatible with stacked lines, disable
5046
- if (this._stack) {
5047
- this.renderer.smooth = false;
5048
- }
5049
-
5050
- // set the shape renderer options
5051
- var opts = {lineJoin:this.lineJoin, lineCap:this.lineCap, fill:this.fill, isarc:false, strokeStyle:this.color, fillStyle:this.fillColor, lineWidth:this.lineWidth, linePattern:this.linePattern, closePath:this.fill};
5052
- this.renderer.shapeRenderer.init(opts);
5053
-
5054
- var shadow_offset = options.shadowOffset;
5055
- // set the shadow renderer options
5056
- if (shadow_offset == null) {
5057
- // scale the shadowOffset to the width of the line.
5058
- if (this.lineWidth > 2.5) {
5059
- shadow_offset = 1.25 * (1 + (Math.atan((this.lineWidth/2.5))/0.785398163 - 1)*0.6);
5060
- // var shadow_offset = this.shadowOffset;
5061
- }
5062
- // for skinny lines, don't make such a big shadow.
5063
- else {
5064
- shadow_offset = 1.25 * Math.atan((this.lineWidth/2.5))/0.785398163;
5065
- }
5066
- }
5067
-
5068
- var sopts = {lineJoin:this.lineJoin, lineCap:this.lineCap, fill:this.fill, isarc:false, angle:this.shadowAngle, offset:shadow_offset, alpha:this.shadowAlpha, depth:this.shadowDepth, lineWidth:this.lineWidth, linePattern:this.linePattern, closePath:this.fill};
5069
- this.renderer.shadowRenderer.init(sopts);
5070
- this._areaPoints = [];
5071
- this._boundingBox = [[],[]];
5072
-
5073
- if (!this.isTrendline && this.fill || this.renderer.bands.show) {
5074
- // Group: Properties
5075
- //
5076
- // prop: highlightMouseOver
5077
- // True to highlight area on a filled plot when moused over.
5078
- // This must be false to enable highlightMouseDown to highlight when clicking on an area on a filled plot.
5079
- this.highlightMouseOver = true;
5080
- // prop: highlightMouseDown
5081
- // True to highlight when a mouse button is pressed over an area on a filled plot.
5082
- // This will be disabled if highlightMouseOver is true.
5083
- this.highlightMouseDown = false;
5084
- // prop: highlightColor
5085
- // color to use when highlighting an area on a filled plot.
5086
- this.highlightColor = null;
5087
- // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
5088
- if (lopts.highlightMouseDown && lopts.highlightMouseOver == null) {
5089
- lopts.highlightMouseOver = false;
5090
- }
5091
-
5092
- $.extend(true, this, {highlightMouseOver: lopts.highlightMouseOver, highlightMouseDown: lopts.highlightMouseDown, highlightColor: lopts.highlightColor});
5093
-
5094
- if (!this.highlightColor) {
5095
- var fc = (this.renderer.bands.show) ? this.renderer.bands.fillColor : this.fillColor;
5096
- this.highlightColor = $.jqplot.computeHighlightColors(fc);
5097
- }
5098
- // turn off (disable) the highlighter plugin
5099
- if (this.highlighter) {
5100
- this.highlighter.show = false;
5101
- }
5102
- }
5103
-
5104
- if (!this.isTrendline && plot) {
5105
- plot.plugins.lineRenderer = {};
5106
- plot.postInitHooks.addOnce(postInit);
5107
- plot.postDrawHooks.addOnce(postPlotDraw);
5108
- plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
5109
- plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
5110
- plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
5111
- plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
5112
- plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
5113
- }
5114
-
5115
- };
5116
-
5117
- $.jqplot.LineRenderer.prototype.initBands = function(options, plot) {
5118
- // use bandData if no data specified in bands option
5119
- //var bd = this.renderer.bandData;
5120
- var bd = options.bandData || [];
5121
- var bands = this.renderer.bands;
5122
- bands.hiData = [];
5123
- bands.lowData = [];
5124
- var data = this.data;
5125
- bands._max = null;
5126
- bands._min = null;
5127
- // If 2 arrays, and each array greater than 2 elements, assume it is hi and low data bands of y values.
5128
- if (bd.length == 2) {
5129
- // Do we have an array of x,y values?
5130
- // like [[[1,1], [2,4], [3,3]], [[1,3], [2,6], [3,5]]]
5131
- if ($.isArray(bd[0][0])) {
5132
- // since an arbitrary array of points, spin through all of them to determine max and min lines.
5133
-
5134
- var p;
5135
- var bdminidx = 0, bdmaxidx = 0;
5136
- for (var i = 0, l = bd[0].length; i<l; i++) {
5137
- p = bd[0][i];
5138
- if ((p[1] != null && p[1] > bands._max) || bands._max == null) {
5139
- bands._max = p[1];
5140
- }
5141
- if ((p[1] != null && p[1] < bands._min) || bands._min == null) {
5142
- bands._min = p[1];
5143
- }
5144
- }
5145
- for (var i = 0, l = bd[1].length; i<l; i++) {
5146
- p = bd[1][i];
5147
- if ((p[1] != null && p[1] > bands._max) || bands._max == null) {
5148
- bands._max = p[1];
5149
- bdmaxidx = 1;
5150
- }
5151
- if ((p[1] != null && p[1] < bands._min) || bands._min == null) {
5152
- bands._min = p[1];
5153
- bdminidx = 1;
5154
- }
5155
- }
5156
-
5157
- if (bdmaxidx === bdminidx) {
5158
- bands.show = false;
5159
- }
5160
-
5161
- bands.hiData = bd[bdmaxidx];
5162
- bands.lowData = bd[bdminidx];
5163
- }
5164
- // else data is arrays of y values
5165
- // like [[1,4,3], [3,6,5]]
5166
- // must have same number of band data points as points in series
5167
- else if (bd[0].length === data.length && bd[1].length === data.length) {
5168
- var hi = (bd[0][0] > bd[1][0]) ? 0 : 1;
5169
- var low = (hi) ? 0 : 1;
5170
- for (var i=0, l=data.length; i < l; i++) {
5171
- bands.hiData.push([data[i][0], bd[hi][i]]);
5172
- bands.lowData.push([data[i][0], bd[low][i]]);
5173
- }
5174
- }
5175
-
5176
- // we don't have proper data array, don't show bands.
5177
- else {
5178
- bands.show = false;
5179
- }
5180
- }
5181
-
5182
- // if more than 2 arrays, have arrays of [ylow, yhi] values.
5183
- // note, can't distinguish case of [[ylow, yhi], [ylow, yhi]] from [[ylow, ylow], [yhi, yhi]]
5184
- // this is assumed to be of the latter form.
5185
- else if (bd.length > 2 && !$.isArray(bd[0][0])) {
5186
- var hi = (bd[0][0] > bd[0][1]) ? 0 : 1;
5187
- var low = (hi) ? 0 : 1;
5188
- for (var i=0, l=bd.length; i<l; i++) {
5189
- bands.hiData.push([data[i][0], bd[i][hi]]);
5190
- bands.lowData.push([data[i][0], bd[i][low]]);
5191
- }
5192
- }
5193
-
5194
- // don't have proper data, auto calculate
5195
- else {
5196
- var intrv = bands.interval;
5197
- var a = null;
5198
- var b = null;
5199
- var afunc = null;
5200
- var bfunc = null;
5201
-
5202
- if ($.isArray(intrv)) {
5203
- a = intrv[0];
5204
- b = intrv[1];
5205
- }
5206
- else {
5207
- a = intrv;
5208
- }
5209
-
5210
- if (isNaN(a)) {
5211
- // we have a string
5212
- if (a.charAt(a.length - 1) === '%') {
5213
- afunc = 'multiply';
5214
- a = parseFloat(a)/100 + 1;
5215
- }
5216
- }
5217
-
5218
- else {
5219
- a = parseFloat(a);
5220
- afunc = 'add';
5221
- }
5222
-
5223
- if (b !== null && isNaN(b)) {
5224
- // we have a string
5225
- if (b.charAt(b.length - 1) === '%') {
5226
- bfunc = 'multiply';
5227
- b = parseFloat(b)/100 + 1;
5228
- }
5229
- }
5230
-
5231
- else if (b !== null) {
5232
- b = parseFloat(b);
5233
- bfunc = 'add';
5234
- }
5235
-
5236
- if (a !== null) {
5237
- if (b === null) {
5238
- b = -a;
5239
- bfunc = afunc;
5240
- if (bfunc === 'multiply') {
5241
- b += 2;
5242
- }
5243
- }
5244
-
5245
- // make sure a always applies to hi band.
5246
- if (a < b) {
5247
- var temp = a;
5248
- a = b;
5249
- b = temp;
5250
- temp = afunc;
5251
- afunc = bfunc;
5252
- bfunc = temp;
5253
- }
5254
-
5255
- for (var i=0, l = data.length; i < l; i++) {
5256
- switch (afunc) {
5257
- case 'add':
5258
- bands.hiData.push([data[i][0], data[i][1] + a]);
5259
- break;
5260
- case 'multiply':
5261
- bands.hiData.push([data[i][0], data[i][1] * a]);
5262
- break;
5263
- }
5264
- switch (bfunc) {
5265
- case 'add':
5266
- bands.lowData.push([data[i][0], data[i][1] + b]);
5267
- break;
5268
- case 'multiply':
5269
- bands.lowData.push([data[i][0], data[i][1] * b]);
5270
- break;
5271
- }
5272
- }
5273
- }
5274
-
5275
- else {
5276
- bands.show = false;
5277
- }
5278
- }
5279
-
5280
- var hd = bands.hiData;
5281
- var ld = bands.lowData;
5282
- for (var i = 0, l = hd.length; i<l; i++) {
5283
- if ((hd[i][1] != null && hd[i][1] > bands._max) || bands._max == null) {
5284
- bands._max = hd[i][1];
5285
- }
5286
- }
5287
- for (var i = 0, l = ld.length; i<l; i++) {
5288
- if ((ld[i][1] != null && ld[i][1] < bands._min) || bands._min == null) {
5289
- bands._min = ld[i][1];
5290
- }
5291
- }
5292
-
5293
- // one last check for proper data
5294
- // these don't apply any more since allowing arbitrary x,y values
5295
- // if (bands.hiData.length != bands.lowData.length) {
5296
- // bands.show = false;
5297
- // }
5298
-
5299
- // if (bands.hiData.length != this.data.length) {
5300
- // bands.show = false;
5301
- // }
5302
-
5303
- if (bands.fillColor === null) {
5304
- var c = $.jqplot.getColorComponents(bands.color);
5305
- // now adjust alpha to differentiate fill
5306
- c[3] = c[3] * 0.5;
5307
- bands.fillColor = 'rgba(' + c[0] +', '+ c[1] +', '+ c[2] +', '+ c[3] + ')';
5308
- }
5309
- };
5310
-
5311
- function getSteps (d, f) {
5312
- return (3.4182054+f) * Math.pow(d, -0.3534992);
5313
- }
5314
-
5315
- function computeSteps (d1, d2) {
5316
- var s = Math.sqrt(Math.pow((d2[0]- d1[0]), 2) + Math.pow ((d2[1] - d1[1]), 2));
5317
- return 5.7648 * Math.log(s) + 7.4456;
5318
- }
5319
-
5320
- function tanh (x) {
5321
- var a = (Math.exp(2*x) - 1) / (Math.exp(2*x) + 1);
5322
- return a;
5323
- }
5324
-
5325
- //////////
5326
- // computeConstrainedSmoothedData
5327
- // An implementation of the constrained cubic spline interpolation
5328
- // method as presented in:
5329
- //
5330
- // Kruger, CJC, Constrained Cubic Spine Interpolation for Chemical Engineering Applications
5331
- // http://www.korf.co.uk/spline.pdf
5332
- //
5333
- // The implementation below borrows heavily from the sample Visual Basic
5334
- // implementation by CJC Kruger found in http://www.korf.co.uk/spline.xls
5335
- //
5336
- /////////
5337
-
5338
- // called with scope of series
5339
- function computeConstrainedSmoothedData (gd) {
5340
- var smooth = this.renderer.smooth;
5341
- var dim = this.canvas.getWidth();
5342
- var xp = this._xaxis.series_p2u;
5343
- var yp = this._yaxis.series_p2u;
5344
- var steps =null;
5345
- var _steps = null;
5346
- var dist = gd.length/dim;
5347
- var _smoothedData = [];
5348
- var _smoothedPlotData = [];
5349
-
5350
- if (!isNaN(parseFloat(smooth))) {
5351
- steps = parseFloat(smooth);
5352
- }
5353
- else {
5354
- steps = getSteps(dist, 0.5);
5355
- }
5356
-
5357
- var yy = [];
5358
- var xx = [];
5359
-
5360
- for (var i=0, l = gd.length; i<l; i++) {
5361
- yy.push(gd[i][1]);
5362
- xx.push(gd[i][0]);
5363
- }
5364
-
5365
- function dxx(x1, x0) {
5366
- if (x1 - x0 == 0) {
5367
- return Math.pow(10,10);
5368
- }
5369
- else {
5370
- return x1 - x0;
5371
- }
5372
- }
5373
-
5374
- var A, B, C, D;
5375
- // loop through each line segment. Have # points - 1 line segments. Nmber segments starting at 1.
5376
- var nmax = gd.length - 1;
5377
- for (var num = 1, gdl = gd.length; num<gdl; num++) {
5378
- var gxx = [];
5379
- var ggxx = [];
5380
- // point at each end of segment.
5381
- for (var j = 0; j < 2; j++) {
5382
- var i = num - 1 + j; // point number, 0 to # points.
5383
-
5384
- if (i == 0 || i == nmax) {
5385
- gxx[j] = Math.pow(10, 10);
5386
- }
5387
- else if (yy[i+1] - yy[i] == 0 || yy[i] - yy[i-1] == 0) {
5388
- gxx[j] = 0;
5389
- }
5390
- else if (((xx[i+1] - xx[i]) / (yy[i+1] - yy[i]) + (xx[i] - xx[i-1]) / (yy[i] - yy[i-1])) == 0 ) {
5391
- gxx[j] = 0;
5392
- }
5393
- else if ( (yy[i+1] - yy[i]) * (yy[i] - yy[i-1]) < 0 ) {
5394
- gxx[j] = 0;
5395
- }
5396
-
5397
- else {
5398
- gxx[j] = 2 / (dxx(xx[i + 1], xx[i]) / (yy[i + 1] - yy[i]) + dxx(xx[i], xx[i - 1]) / (yy[i] - yy[i - 1]));
5399
- }
5400
- }
5401
-
5402
- // Reset first derivative (slope) at first and last point
5403
- if (num == 1) {
5404
- // First point has 0 2nd derivative
5405
- gxx[0] = 3 / 2 * (yy[1] - yy[0]) / dxx(xx[1], xx[0]) - gxx[1] / 2;
5406
- }
5407
- else if (num == nmax) {
5408
- // Last point has 0 2nd derivative
5409
- gxx[1] = 3 / 2 * (yy[nmax] - yy[nmax - 1]) / dxx(xx[nmax], xx[nmax - 1]) - gxx[0] / 2;
5410
- }
5411
-
5412
- // Calc second derivative at points
5413
- ggxx[0] = -2 * (gxx[1] + 2 * gxx[0]) / dxx(xx[num], xx[num - 1]) + 6 * (yy[num] - yy[num - 1]) / Math.pow(dxx(xx[num], xx[num - 1]), 2);
5414
- ggxx[1] = 2 * (2 * gxx[1] + gxx[0]) / dxx(xx[num], xx[num - 1]) - 6 * (yy[num] - yy[num - 1]) / Math.pow(dxx(xx[num], xx[num - 1]), 2);
5415
-
5416
- // Calc constants for cubic interpolation
5417
- D = 1 / 6 * (ggxx[1] - ggxx[0]) / dxx(xx[num], xx[num - 1]);
5418
- C = 1 / 2 * (xx[num] * ggxx[0] - xx[num - 1] * ggxx[1]) / dxx(xx[num], xx[num - 1]);
5419
- B = (yy[num] - yy[num - 1] - C * (Math.pow(xx[num], 2) - Math.pow(xx[num - 1], 2)) - D * (Math.pow(xx[num], 3) - Math.pow(xx[num - 1], 3))) / dxx(xx[num], xx[num - 1]);
5420
- A = yy[num - 1] - B * xx[num - 1] - C * Math.pow(xx[num - 1], 2) - D * Math.pow(xx[num - 1], 3);
5421
-
5422
- var increment = (xx[num] - xx[num - 1]) / steps;
5423
- var temp, tempx;
5424
-
5425
- for (var j = 0, l = steps; j < l; j++) {
5426
- temp = [];
5427
- tempx = xx[num - 1] + j * increment;
5428
- temp.push(tempx);
5429
- temp.push(A + B * tempx + C * Math.pow(tempx, 2) + D * Math.pow(tempx, 3));
5430
- _smoothedData.push(temp);
5431
- _smoothedPlotData.push([xp(temp[0]), yp(temp[1])]);
5432
- }
5433
- }
5434
-
5435
- _smoothedData.push(gd[i]);
5436
- _smoothedPlotData.push([xp(gd[i][0]), yp(gd[i][1])]);
5437
-
5438
- return [_smoothedData, _smoothedPlotData];
5439
- }
5440
-
5441
- ///////
5442
- // computeHermiteSmoothedData
5443
- // A hermite spline smoothing of the plot data.
5444
- // This implementation is derived from the one posted
5445
- // by krypin on the jqplot-users mailing list:
5446
- //
5447
- // http://groups.google.com/group/jqplot-users/browse_thread/thread/748be6a445723cea?pli=1
5448
- //
5449
- // with a blog post:
5450
- //
5451
- // http://blog.statscollector.com/a-plugin-renderer-for-jqplot-to-draw-a-hermite-spline/
5452
- //
5453
- // and download of the original plugin:
5454
- //
5455
- // http://blog.statscollector.com/wp-content/uploads/2010/02/jqplot.hermiteSplineRenderer.js
5456
- //////////
5457
-
5458
- // called with scope of series
5459
- function computeHermiteSmoothedData (gd) {
5460
- var smooth = this.renderer.smooth;
5461
- var tension = this.renderer.tension;
5462
- var dim = this.canvas.getWidth();
5463
- var xp = this._xaxis.series_p2u;
5464
- var yp = this._yaxis.series_p2u;
5465
- var steps =null;
5466
- var _steps = null;
5467
- var a = null;
5468
- var a1 = null;
5469
- var a2 = null;
5470
- var slope = null;
5471
- var slope2 = null;
5472
- var temp = null;
5473
- var t, s, h1, h2, h3, h4;
5474
- var TiX, TiY, Ti1X, Ti1Y;
5475
- var pX, pY, p;
5476
- var sd = [];
5477
- var spd = [];
5478
- var dist = gd.length/dim;
5479
- var min, max, stretch, scale, shift;
5480
- var _smoothedData = [];
5481
- var _smoothedPlotData = [];
5482
- if (!isNaN(parseFloat(smooth))) {
5483
- steps = parseFloat(smooth);
5484
- }
5485
- else {
5486
- steps = getSteps(dist, 0.5);
5487
- }
5488
- if (!isNaN(parseFloat(tension))) {
5489
- tension = parseFloat(tension);
5490
- }
5491
-
5492
- for (var i=0, l = gd.length-1; i < l; i++) {
5493
-
5494
- if (tension === null) {
5495
- slope = Math.abs((gd[i+1][1] - gd[i][1]) / (gd[i+1][0] - gd[i][0]));
5496
-
5497
- min = 0.3;
5498
- max = 0.6;
5499
- stretch = (max - min)/2.0;
5500
- scale = 2.5;
5501
- shift = -1.4;
5502
-
5503
- temp = slope/scale + shift;
5504
-
5505
- a1 = stretch * tanh(temp) - stretch * tanh(shift) + min;
5506
-
5507
- // if have both left and right line segments, will use minimum tension.
5508
- if (i > 0) {
5509
- slope2 = Math.abs((gd[i][1] - gd[i-1][1]) / (gd[i][0] - gd[i-1][0]));
5510
- }
5511
- temp = slope2/scale + shift;
5512
-
5513
- a2 = stretch * tanh(temp) - stretch * tanh(shift) + min;
5514
-
5515
- a = (a1 + a2)/2.0;
5516
-
5517
- }
5518
- else {
5519
- a = tension;
5520
- }
5521
- for (t=0; t < steps; t++) {
5522
- s = t / steps;
5523
- h1 = (1 + 2*s)*Math.pow((1-s),2);
5524
- h2 = s*Math.pow((1-s),2);
5525
- h3 = Math.pow(s,2)*(3-2*s);
5526
- h4 = Math.pow(s,2)*(s-1);
5527
-
5528
- if (gd[i-1]) {
5529
- TiX = a * (gd[i+1][0] - gd[i-1][0]);
5530
- TiY = a * (gd[i+1][1] - gd[i-1][1]);
5531
- } else {
5532
- TiX = a * (gd[i+1][0] - gd[i][0]);
5533
- TiY = a * (gd[i+1][1] - gd[i][1]);
5534
- }
5535
- if (gd[i+2]) {
5536
- Ti1X = a * (gd[i+2][0] - gd[i][0]);
5537
- Ti1Y = a * (gd[i+2][1] - gd[i][1]);
5538
- } else {
5539
- Ti1X = a * (gd[i+1][0] - gd[i][0]);
5540
- Ti1Y = a * (gd[i+1][1] - gd[i][1]);
5541
- }
5542
-
5543
- pX = h1*gd[i][0] + h3*gd[i+1][0] + h2*TiX + h4*Ti1X;
5544
- pY = h1*gd[i][1] + h3*gd[i+1][1] + h2*TiY + h4*Ti1Y;
5545
- p = [pX, pY];
5546
-
5547
- _smoothedData.push(p);
5548
- _smoothedPlotData.push([xp(pX), yp(pY)]);
5549
- }
5550
- }
5551
- _smoothedData.push(gd[l]);
5552
- _smoothedPlotData.push([xp(gd[l][0]), yp(gd[l][1])]);
5553
-
5554
- return [_smoothedData, _smoothedPlotData];
5555
- }
5556
-
5557
- // setGridData
5558
- // converts the user data values to grid coordinates and stores them
5559
- // in the gridData array.
5560
- // Called with scope of a series.
5561
- $.jqplot.LineRenderer.prototype.setGridData = function(plot) {
5562
- // recalculate the grid data
5563
- var xp = this._xaxis.series_u2p;
5564
- var yp = this._yaxis.series_u2p;
5565
- var data = this._plotData;
5566
- var pdata = this._prevPlotData;
5567
- this.gridData = [];
5568
- this._prevGridData = [];
5569
- this.renderer._smoothedData = [];
5570
- this.renderer._smoothedPlotData = [];
5571
- this.renderer._hiBandGridData = [];
5572
- this.renderer._lowBandGridData = [];
5573
- this.renderer._hiBandSmoothedData = [];
5574
- this.renderer._lowBandSmoothedData = [];
5575
- var bands = this.renderer.bands;
5576
- var hasNull = false;
5577
- for (var i=0, l=data.length; i < l; i++) {
5578
- // if not a line series or if no nulls in data, push the converted point onto the array.
5579
- if (data[i][0] != null && data[i][1] != null) {
5580
- this.gridData.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1])]);
5581
- }
5582
- // else if there is a null, preserve it.
5583
- else if (data[i][0] == null) {
5584
- hasNull = true;
5585
- this.gridData.push([null, yp.call(this._yaxis, data[i][1])]);
5586
- }
5587
- else if (data[i][1] == null) {
5588
- hasNull = true;
5589
- this.gridData.push([xp.call(this._xaxis, data[i][0]), null]);
5590
- }
5591
- // if not a line series or if no nulls in data, push the converted point onto the array.
5592
- if (pdata[i] != null && pdata[i][0] != null && pdata[i][1] != null) {
5593
- this._prevGridData.push([xp.call(this._xaxis, pdata[i][0]), yp.call(this._yaxis, pdata[i][1])]);
5594
- }
5595
- // else if there is a null, preserve it.
5596
- else if (pdata[i] != null && pdata[i][0] == null) {
5597
- this._prevGridData.push([null, yp.call(this._yaxis, pdata[i][1])]);
5598
- }
5599
- else if (pdata[i] != null && pdata[i][0] != null && pdata[i][1] == null) {
5600
- this._prevGridData.push([xp.call(this._xaxis, pdata[i][0]), null]);
5601
- }
5602
- }
5603
-
5604
- // don't do smoothing or bands on broken lines.
5605
- if (hasNull) {
5606
- this.renderer.smooth = false;
5607
- if (this._type === 'line') {
5608
- bands.show = false;
5609
- }
5610
- }
5611
-
5612
- if (this._type === 'line' && bands.show) {
5613
- for (var i=0, l=bands.hiData.length; i<l; i++) {
5614
- this.renderer._hiBandGridData.push([xp.call(this._xaxis, bands.hiData[i][0]), yp.call(this._yaxis, bands.hiData[i][1])]);
5615
- }
5616
- for (var i=0, l=bands.lowData.length; i<l; i++) {
5617
- this.renderer._lowBandGridData.push([xp.call(this._xaxis, bands.lowData[i][0]), yp.call(this._yaxis, bands.lowData[i][1])]);
5618
- }
5619
- }
5620
-
5621
- // calculate smoothed data if enough points and no nulls
5622
- if (this._type === 'line' && this.renderer.smooth && this.gridData.length > 2) {
5623
- var ret;
5624
- if (this.renderer.constrainSmoothing) {
5625
- ret = computeConstrainedSmoothedData.call(this, this.gridData);
5626
- this.renderer._smoothedData = ret[0];
5627
- this.renderer._smoothedPlotData = ret[1];
5628
-
5629
- if (bands.show) {
5630
- ret = computeConstrainedSmoothedData.call(this, this.renderer._hiBandGridData);
5631
- this.renderer._hiBandSmoothedData = ret[0];
5632
- ret = computeConstrainedSmoothedData.call(this, this.renderer._lowBandGridData);
5633
- this.renderer._lowBandSmoothedData = ret[0];
5634
- }
5635
-
5636
- ret = null;
5637
- }
5638
- else {
5639
- ret = computeHermiteSmoothedData.call(this, this.gridData);
5640
- this.renderer._smoothedData = ret[0];
5641
- this.renderer._smoothedPlotData = ret[1];
5642
-
5643
- if (bands.show) {
5644
- ret = computeHermiteSmoothedData.call(this, this.renderer._hiBandGridData);
5645
- this.renderer._hiBandSmoothedData = ret[0];
5646
- ret = computeHermiteSmoothedData.call(this, this.renderer._lowBandGridData);
5647
- this.renderer._lowBandSmoothedData = ret[0];
5648
- }
5649
-
5650
- ret = null;
5651
- }
5652
- }
5653
- };
5654
-
5655
- // makeGridData
5656
- // converts any arbitrary data values to grid coordinates and
5657
- // returns them. This method exists so that plugins can use a series'
5658
- // linerenderer to generate grid data points without overwriting the
5659
- // grid data associated with that series.
5660
- // Called with scope of a series.
5661
- $.jqplot.LineRenderer.prototype.makeGridData = function(data, plot) {
5662
- // recalculate the grid data
5663
- var xp = this._xaxis.series_u2p;
5664
- var yp = this._yaxis.series_u2p;
5665
- var gd = [];
5666
- var pgd = [];
5667
- this.renderer._smoothedData = [];
5668
- this.renderer._smoothedPlotData = [];
5669
- this.renderer._hiBandGridData = [];
5670
- this.renderer._lowBandGridData = [];
5671
- this.renderer._hiBandSmoothedData = [];
5672
- this.renderer._lowBandSmoothedData = [];
5673
- var bands = this.renderer.bands;
5674
- var hasNull = false;
5675
- for (var i=0; i<data.length; i++) {
5676
- // if not a line series or if no nulls in data, push the converted point onto the array.
5677
- if (data[i][0] != null && data[i][1] != null) {
5678
- if (this.step && i>0) {
5679
- gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i-1][1])]);
5680
- }
5681
- gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1])]);
5682
- }
5683
- // else if there is a null, preserve it.
5684
- else if (data[i][0] == null) {
5685
- hasNull = true;
5686
- gd.push([null, yp.call(this._yaxis, data[i][1])]);
5687
- }
5688
- else if (data[i][1] == null) {
5689
- hasNull = true;
5690
- gd.push([xp.call(this._xaxis, data[i][0]), null]);
5691
- }
5692
- }
5693
-
5694
- // don't do smoothing or bands on broken lines.
5695
- if (hasNull) {
5696
- this.renderer.smooth = false;
5697
- if (this._type === 'line') {
5698
- bands.show = false;
5699
- }
5700
- }
5701
-
5702
- if (this._type === 'line' && bands.show) {
5703
- for (var i=0, l=bands.hiData.length; i<l; i++) {
5704
- this.renderer._hiBandGridData.push([xp.call(this._xaxis, bands.hiData[i][0]), yp.call(this._yaxis, bands.hiData[i][1])]);
5705
- }
5706
- for (var i=0, l=bands.lowData.length; i<l; i++) {
5707
- this.renderer._lowBandGridData.push([xp.call(this._xaxis, bands.lowData[i][0]), yp.call(this._yaxis, bands.lowData[i][1])]);
5708
- }
5709
- }
5710
-
5711
- if (this._type === 'line' && this.renderer.smooth && gd.length > 2) {
5712
- var ret;
5713
- if (this.renderer.constrainSmoothing) {
5714
- ret = computeConstrainedSmoothedData.call(this, gd);
5715
- this.renderer._smoothedData = ret[0];
5716
- this.renderer._smoothedPlotData = ret[1];
5717
-
5718
- if (bands.show) {
5719
- ret = computeConstrainedSmoothedData.call(this, this.renderer._hiBandGridData);
5720
- this.renderer._hiBandSmoothedData = ret[0];
5721
- ret = computeConstrainedSmoothedData.call(this, this.renderer._lowBandGridData);
5722
- this.renderer._lowBandSmoothedData = ret[0];
5723
- }
5724
-
5725
- ret = null;
5726
- }
5727
- else {
5728
- ret = computeHermiteSmoothedData.call(this, gd);
5729
- this.renderer._smoothedData = ret[0];
5730
- this.renderer._smoothedPlotData = ret[1];
5731
-
5732
- if (bands.show) {
5733
- ret = computeHermiteSmoothedData.call(this, this.renderer._hiBandGridData);
5734
- this.renderer._hiBandSmoothedData = ret[0];
5735
- ret = computeHermiteSmoothedData.call(this, this.renderer._lowBandGridData);
5736
- this.renderer._lowBandSmoothedData = ret[0];
5737
- }
5738
-
5739
- ret = null;
5740
- }
5741
- }
5742
- return gd;
5743
- };
5744
-
5745
-
5746
- // called within scope of series.
5747
- $.jqplot.LineRenderer.prototype.draw = function(ctx, gd, options, plot) {
5748
- var i;
5749
- // get a copy of the options, so we don't modify the original object.
5750
- var opts = $.extend(true, {}, options);
5751
- var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
5752
- var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
5753
- var fill = (opts.fill != undefined) ? opts.fill : this.fill;
5754
- var fillAndStroke = (opts.fillAndStroke != undefined) ? opts.fillAndStroke : this.fillAndStroke;
5755
- var xmin, ymin, xmax, ymax;
5756
- ctx.save();
5757
- if (gd.length) {
5758
- if (showLine) {
5759
- // if we fill, we'll have to add points to close the curve.
5760
- if (fill) {
5761
- if (this.fillToZero) {
5762
- // have to break line up into shapes at axis crossings
5763
- var negativeColor = this.negativeColor;
5764
- if (! this.useNegativeColors) {
5765
- negativeColor = opts.fillStyle;
5766
- }
5767
- var isnegative = false;
5768
- var posfs = opts.fillStyle;
5769
-
5770
- // if stoking line as well as filling, get a copy of line data.
5771
- if (fillAndStroke) {
5772
- var fasgd = gd.slice(0);
5773
- }
5774
- // if not stacked, fill down to axis
5775
- if (this.index == 0 || !this._stack) {
5776
-
5777
- var tempgd = [];
5778
- var pd = (this.renderer.smooth) ? this.renderer._smoothedPlotData : this._plotData;
5779
- this._areaPoints = [];
5780
- var pyzero = this._yaxis.series_u2p(this.fillToValue);
5781
- var pxzero = this._xaxis.series_u2p(this.fillToValue);
5782
-
5783
- opts.closePath = true;
5784
-
5785
- if (this.fillAxis == 'y') {
5786
- tempgd.push([gd[0][0], pyzero]);
5787
- this._areaPoints.push([gd[0][0], pyzero]);
5788
-
5789
- for (var i=0; i<gd.length-1; i++) {
5790
- tempgd.push(gd[i]);
5791
- this._areaPoints.push(gd[i]);
5792
- // do we have an axis crossing?
5793
- if (pd[i][1] * pd[i+1][1] <= 0) {
5794
- if (pd[i][1] < 0) {
5795
- isnegative = true;
5796
- opts.fillStyle = negativeColor;
5797
- }
5798
- else {
5799
- isnegative = false;
5800
- opts.fillStyle = posfs;
5801
- }
5802
-
5803
- var xintercept = gd[i][0] + (gd[i+1][0] - gd[i][0]) * (pyzero-gd[i][1])/(gd[i+1][1] - gd[i][1]);
5804
- tempgd.push([xintercept, pyzero]);
5805
- this._areaPoints.push([xintercept, pyzero]);
5806
- // now draw this shape and shadow.
5807
- if (shadow) {
5808
- this.renderer.shadowRenderer.draw(ctx, tempgd, opts);
5809
- }
5810
- this.renderer.shapeRenderer.draw(ctx, tempgd, opts);
5811
- // now empty temp array and continue
5812
- tempgd = [[xintercept, pyzero]];
5813
- // this._areaPoints = [[xintercept, pyzero]];
5814
- }
5815
- }
5816
- if (pd[gd.length-1][1] < 0) {
5817
- isnegative = true;
5818
- opts.fillStyle = negativeColor;
5819
- }
5820
- else {
5821
- isnegative = false;
5822
- opts.fillStyle = posfs;
5823
- }
5824
- tempgd.push(gd[gd.length-1]);
5825
- this._areaPoints.push(gd[gd.length-1]);
5826
- tempgd.push([gd[gd.length-1][0], pyzero]);
5827
- this._areaPoints.push([gd[gd.length-1][0], pyzero]);
5828
- }
5829
- // now draw the last area.
5830
- if (shadow) {
5831
- this.renderer.shadowRenderer.draw(ctx, tempgd, opts);
5832
- }
5833
- this.renderer.shapeRenderer.draw(ctx, tempgd, opts);
5834
-
5835
-
5836
- // var gridymin = this._yaxis.series_u2p(0);
5837
- // // IE doesn't return new length on unshift
5838
- // gd.unshift([gd[0][0], gridymin]);
5839
- // len = gd.length;
5840
- // gd.push([gd[len - 1][0], gridymin]);
5841
- }
5842
- // if stacked, fill to line below
5843
- else {
5844
- var prev = this._prevGridData;
5845
- for (var i=prev.length; i>0; i--) {
5846
- gd.push(prev[i-1]);
5847
- // this._areaPoints.push(prev[i-1]);
5848
- }
5849
- if (shadow) {
5850
- this.renderer.shadowRenderer.draw(ctx, gd, opts);
5851
- }
5852
- this._areaPoints = gd;
5853
- this.renderer.shapeRenderer.draw(ctx, gd, opts);
5854
- }
5855
- }
5856
- /////////////////////////
5857
- // Not filled to zero
5858
- ////////////////////////
5859
- else {
5860
- // if stoking line as well as filling, get a copy of line data.
5861
- if (fillAndStroke) {
5862
- var fasgd = gd.slice(0);
5863
- }
5864
- // if not stacked, fill down to axis
5865
- if (this.index == 0 || !this._stack) {
5866
- // var gridymin = this._yaxis.series_u2p(this._yaxis.min) - this.gridBorderWidth / 2;
5867
- var gridymin = ctx.canvas.height;
5868
- // IE doesn't return new length on unshift
5869
- gd.unshift([gd[0][0], gridymin]);
5870
- var len = gd.length;
5871
- gd.push([gd[len - 1][0], gridymin]);
5872
- }
5873
- // if stacked, fill to line below
5874
- else {
5875
- var prev = this._prevGridData;
5876
- for (var i=prev.length; i>0; i--) {
5877
- gd.push(prev[i-1]);
5878
- }
5879
- }
5880
- this._areaPoints = gd;
5881
-
5882
- if (shadow) {
5883
- this.renderer.shadowRenderer.draw(ctx, gd, opts);
5884
- }
5885
-
5886
- this.renderer.shapeRenderer.draw(ctx, gd, opts);
5887
- }
5888
- if (fillAndStroke) {
5889
- var fasopts = $.extend(true, {}, opts, {fill:false, closePath:false});
5890
- this.renderer.shapeRenderer.draw(ctx, fasgd, fasopts);
5891
- //////////
5892
- // TODO: figure out some way to do shadows nicely
5893
- // if (shadow) {
5894
- // this.renderer.shadowRenderer.draw(ctx, fasgd, fasopts);
5895
- // }
5896
- // now draw the markers
5897
- if (this.markerRenderer.show) {
5898
- if (this.renderer.smooth) {
5899
- fasgd = this.gridData;
5900
- }
5901
- for (i=0; i<fasgd.length; i++) {
5902
- var markerOptions = opts.markerOptions || {};
5903
- if (this.markerOptionsCallback) {
5904
- markerOptions = $.extend(true, markerOptions, this.markerOptionsCallback(plot, this, i, this.data[i], gd[i]) || {});
5905
- }
5906
- this.markerRenderer.draw(fasgd[i][0], fasgd[i][1], ctx, markerOptions);
5907
- }
5908
- }
5909
- }
5910
- }
5911
- else {
5912
-
5913
- if (this.renderer.bands.show) {
5914
- var bdat;
5915
- var bopts = $.extend(true, {}, opts);
5916
- if (this.renderer.bands.showLines) {
5917
- bdat = (this.renderer.smooth) ? this.renderer._hiBandSmoothedData : this.renderer._hiBandGridData;
5918
- this.renderer.shapeRenderer.draw(ctx, bdat, opts);
5919
- bdat = (this.renderer.smooth) ? this.renderer._lowBandSmoothedData : this.renderer._lowBandGridData;
5920
- this.renderer.shapeRenderer.draw(ctx, bdat, bopts);
5921
- }
5922
-
5923
- if (this.renderer.bands.fill) {
5924
- if (this.renderer.smooth) {
5925
- bdat = this.renderer._hiBandSmoothedData.concat(this.renderer._lowBandSmoothedData.reverse());
5926
- }
5927
- else {
5928
- bdat = this.renderer._hiBandGridData.concat(this.renderer._lowBandGridData.reverse());
5929
- }
5930
- this._areaPoints = bdat;
5931
- bopts.closePath = true;
5932
- bopts.fill = true;
5933
- bopts.fillStyle = this.renderer.bands.fillColor;
5934
- this.renderer.shapeRenderer.draw(ctx, bdat, bopts);
5935
- }
5936
- }
5937
-
5938
- if (shadow) {
5939
- this.renderer.shadowRenderer.draw(ctx, gd, opts);
5940
- }
5941
-
5942
- this.renderer.shapeRenderer.draw(ctx, gd, opts);
5943
- }
5944
- }
5945
- // calculate the bounding box
5946
- var xmin = xmax = ymin = ymax = null;
5947
- for (i=0; i<this._areaPoints.length; i++) {
5948
- var p = this._areaPoints[i];
5949
- if (xmin > p[0] || xmin == null) {
5950
- xmin = p[0];
5951
- }
5952
- if (ymax < p[1] || ymax == null) {
5953
- ymax = p[1];
5954
- }
5955
- if (xmax < p[0] || xmax == null) {
5956
- xmax = p[0];
5957
- }
5958
- if (ymin > p[1] || ymin == null) {
5959
- ymin = p[1];
5960
- }
5961
- }
5962
-
5963
- if (this.type === 'line' && this.renderer.bands.show) {
5964
- ymax = this._yaxis.series_u2p(this.renderer.bands._min);
5965
- ymin = this._yaxis.series_u2p(this.renderer.bands._max);
5966
- }
5967
-
5968
- this._boundingBox = [[xmin, ymax], [xmax, ymin]];
5969
-
5970
- // now draw the markers
5971
- if (this.markerRenderer.show && !fill) {
5972
- if (this.renderer.smooth) {
5973
- gd = this.gridData;
5974
- }
5975
- for (i=0; i<gd.length; i++) {
5976
- var markerOptions = opts.markerOptions || {};
5977
- if (this.markerOptionsCallback) {
5978
- markerOptions = $.extend(true, markerOptions, this.markerOptionsCallback(plot, this, i, this.data[i], gd[i]) || {});
5979
- }
5980
- if (gd[i][0] != null && gd[i][1] != null) {
5981
- this.markerRenderer.draw(gd[i][0], gd[i][1], ctx, markerOptions);
5982
- }
5983
- }
5984
- }
5985
- }
5986
-
5987
- ctx.restore();
5988
- };
5989
-
5990
- $.jqplot.LineRenderer.prototype.drawShadow = function(ctx, gd, options) {
5991
- // This is a no-op, shadows drawn with lines.
5992
- };
5993
-
5994
- // called with scope of plot.
5995
- // make sure to not leave anything highlighted.
5996
- function postInit(target, data, options) {
5997
- for (var i=0; i<this.series.length; i++) {
5998
- if (this.series[i].renderer.constructor == $.jqplot.LineRenderer) {
5999
- // don't allow mouseover and mousedown at same time.
6000
- if (this.series[i].highlightMouseOver) {
6001
- this.series[i].highlightMouseDown = false;
6002
- }
6003
- }
6004
- }
6005
- }
6006
-
6007
- // called within context of plot
6008
- // create a canvas which we can draw on.
6009
- // insert it before the eventCanvas, so eventCanvas will still capture events.
6010
- function postPlotDraw() {
6011
- // Memory Leaks patch
6012
- if (this.plugins.lineRenderer && this.plugins.lineRenderer.highlightCanvas) {
6013
- this.plugins.lineRenderer.highlightCanvas.resetCanvas();
6014
- this.plugins.lineRenderer.highlightCanvas = null;
6015
- }
6016
-
6017
- this.plugins.lineRenderer.highlightedSeriesIndex = null;
6018
- this.plugins.lineRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
6019
-
6020
- this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-lineRenderer-highlight-canvas', this._plotDimensions, this));
6021
- this.plugins.lineRenderer.highlightCanvas.setContext();
6022
- this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
6023
- }
6024
-
6025
- function highlight (plot, sidx, pidx, points) {
6026
- var s = plot.series[sidx];
6027
- var canvas = plot.plugins.lineRenderer.highlightCanvas;
6028
- canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
6029
- s._highlightedPoint = pidx;
6030
- plot.plugins.lineRenderer.highlightedSeriesIndex = sidx;
6031
- var opts = {fillStyle: s.highlightColor};
6032
- if (s.type === 'line' && s.renderer.bands.show) {
6033
- opts.fill = true;
6034
- opts.closePath = true;
6035
- }
6036
- s.renderer.shapeRenderer.draw(canvas._ctx, points, opts);
6037
- canvas = null;
6038
- }
6039
-
6040
- function unhighlight (plot) {
6041
- var canvas = plot.plugins.lineRenderer.highlightCanvas;
6042
- canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
6043
- for (var i=0; i<plot.series.length; i++) {
6044
- plot.series[i]._highlightedPoint = null;
6045
- }
6046
- plot.plugins.lineRenderer.highlightedSeriesIndex = null;
6047
- plot.target.trigger('jqplotDataUnhighlight');
6048
- canvas = null;
6049
- }
6050
-
6051
-
6052
- function handleMove(ev, gridpos, datapos, neighbor, plot) {
6053
- if (neighbor) {
6054
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
6055
- var evt1 = jQuery.Event('jqplotDataMouseOver');
6056
- evt1.pageX = ev.pageX;
6057
- evt1.pageY = ev.pageY;
6058
- plot.target.trigger(evt1, ins);
6059
- if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.lineRenderer.highlightedSeriesIndex)) {
6060
- var evt = jQuery.Event('jqplotDataHighlight');
6061
- evt.which = ev.which;
6062
- evt.pageX = ev.pageX;
6063
- evt.pageY = ev.pageY;
6064
- plot.target.trigger(evt, ins);
6065
- highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
6066
- }
6067
- }
6068
- else if (neighbor == null) {
6069
- unhighlight (plot);
6070
- }
6071
- }
6072
-
6073
- function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
6074
- if (neighbor) {
6075
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
6076
- if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.lineRenderer.highlightedSeriesIndex)) {
6077
- var evt = jQuery.Event('jqplotDataHighlight');
6078
- evt.which = ev.which;
6079
- evt.pageX = ev.pageX;
6080
- evt.pageY = ev.pageY;
6081
- plot.target.trigger(evt, ins);
6082
- highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
6083
- }
6084
- }
6085
- else if (neighbor == null) {
6086
- unhighlight (plot);
6087
- }
6088
- }
6089
-
6090
- function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
6091
- var idx = plot.plugins.lineRenderer.highlightedSeriesIndex;
6092
- if (idx != null && plot.series[idx].highlightMouseDown) {
6093
- unhighlight(plot);
6094
- }
6095
- }
6096
-
6097
- function handleClick(ev, gridpos, datapos, neighbor, plot) {
6098
- if (neighbor) {
6099
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
6100
- var evt = jQuery.Event('jqplotDataClick');
6101
- evt.which = ev.which;
6102
- evt.pageX = ev.pageX;
6103
- evt.pageY = ev.pageY;
6104
- plot.target.trigger(evt, ins);
6105
- }
6106
- }
6107
-
6108
- function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
6109
- if (neighbor) {
6110
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
6111
- var idx = plot.plugins.lineRenderer.highlightedSeriesIndex;
6112
- if (idx != null && plot.series[idx].highlightMouseDown) {
6113
- unhighlight(plot);
6114
- }
6115
- var evt = jQuery.Event('jqplotDataRightClick');
6116
- evt.which = ev.which;
6117
- evt.pageX = ev.pageX;
6118
- evt.pageY = ev.pageY;
6119
- plot.target.trigger(evt, ins);
6120
- }
6121
- }
6122
-
6123
-
6124
-
6125
- // class: $.jqplot.LinearAxisRenderer
6126
- // The default jqPlot axis renderer, creating a numeric axis.
6127
- $.jqplot.LinearAxisRenderer = function() {
6128
- };
6129
-
6130
- // called with scope of axis object.
6131
- $.jqplot.LinearAxisRenderer.prototype.init = function(options){
6132
- // prop: breakPoints
6133
- // EXPERIMENTAL!! Use at your own risk!
6134
- // Works only with linear axes and the default tick renderer.
6135
- // Array of [start, stop] points to create a broken axis.
6136
- // Broken axes have a "jump" in them, which is an immediate
6137
- // transition from a smaller value to a larger value.
6138
- // Currently, axis ticks MUST be manually assigned if using breakPoints
6139
- // by using the axis ticks array option.
6140
- this.breakPoints = null;
6141
- // prop: breakTickLabel
6142
- // Label to use at the axis break if breakPoints are specified.
6143
- this.breakTickLabel = "&asymp;";
6144
- // prop: drawBaseline
6145
- // True to draw the axis baseline.
6146
- this.drawBaseline = true;
6147
- // prop: baselineWidth
6148
- // width of the baseline in pixels.
6149
- this.baselineWidth = null;
6150
- // prop: baselineColor
6151
- // CSS color spec for the baseline.
6152
- this.baselineColor = null;
6153
- // prop: forceTickAt0
6154
- // This will ensure that there is always a tick mark at 0.
6155
- // If data range is strictly positive or negative,
6156
- // this will force 0 to be inside the axis bounds unless
6157
- // the appropriate axis pad (pad, padMin or padMax) is set
6158
- // to 0, then this will force an axis min or max value at 0.
6159
- // This has know effect when any of the following options
6160
- // are set: autoscale, min, max, numberTicks or tickInterval.
6161
- this.forceTickAt0 = false;
6162
- // prop: forceTickAt100
6163
- // This will ensure that there is always a tick mark at 100.
6164
- // If data range is strictly above or below 100,
6165
- // this will force 100 to be inside the axis bounds unless
6166
- // the appropriate axis pad (pad, padMin or padMax) is set
6167
- // to 0, then this will force an axis min or max value at 100.
6168
- // This has know effect when any of the following options
6169
- // are set: autoscale, min, max, numberTicks or tickInterval.
6170
- this.forceTickAt100 = false;
6171
- // prop: tickInset
6172
- // Controls the amount to inset the first and last ticks from
6173
- // the edges of the grid, in multiples of the tick interval.
6174
- // 0 is no inset, 0.5 is one half a tick interval, 1 is a full
6175
- // tick interval, etc.
6176
- this.tickInset = 0;
6177
- // prop: minorTicks
6178
- // Number of ticks to add between "major" ticks.
6179
- // Major ticks are ticks supplied by user or auto computed.
6180
- // Minor ticks cannot be created by user.
6181
- this.minorTicks = 0;
6182
- // prop: alignTicks
6183
- // true to align tick marks across opposed axes
6184
- // such as from the y2axis to yaxis.
6185
- this.alignTicks = false;
6186
- this._autoFormatString = '';
6187
- this._overrideFormatString = false;
6188
- this._scalefact = 1.0;
6189
- $.extend(true, this, options);
6190
- if (this.breakPoints) {
6191
- if (!$.isArray(this.breakPoints)) {
6192
- this.breakPoints = null;
6193
- }
6194
- else if (this.breakPoints.length < 2 || this.breakPoints[1] <= this.breakPoints[0]) {
6195
- this.breakPoints = null;
6196
- }
6197
- }
6198
- if (this.numberTicks != null && this.numberTicks < 2) {
6199
- this.numberTicks = 2;
6200
- }
6201
- this.resetDataBounds();
6202
- };
6203
-
6204
- // called with scope of axis
6205
- $.jqplot.LinearAxisRenderer.prototype.draw = function(ctx, plot) {
6206
- if (this.show) {
6207
- // populate the axis label and value properties.
6208
- // createTicks is a method on the renderer, but
6209
- // call it within the scope of the axis.
6210
- this.renderer.createTicks.call(this, plot);
6211
- // fill a div with axes labels in the right direction.
6212
- // Need to pregenerate each axis to get its bounds and
6213
- // position it and the labels correctly on the plot.
6214
- var dim=0;
6215
- var temp;
6216
- // Added for theming.
6217
- if (this._elem) {
6218
- // Memory Leaks patch
6219
- //this._elem.empty();
6220
- this._elem.emptyForce();
6221
- this._elem = null;
6222
- }
6223
-
6224
- this._elem = $(document.createElement('div'));
6225
- this._elem.addClass('jqplot-axis jqplot-'+this.name);
6226
- this._elem.css('position', 'absolute');
6227
-
6228
-
6229
- if (this.name == 'xaxis' || this.name == 'x2axis') {
6230
- this._elem.width(this._plotDimensions.width);
6231
- }
6232
- else {
6233
- this._elem.height(this._plotDimensions.height);
6234
- }
6235
-
6236
- // create a _label object.
6237
- this.labelOptions.axis = this.name;
6238
- this._label = new this.labelRenderer(this.labelOptions);
6239
- if (this._label.show) {
6240
- var elem = this._label.draw(ctx, plot);
6241
- elem.appendTo(this._elem);
6242
- elem = null;
6243
- }
6244
-
6245
- var t = this._ticks;
6246
- var tick;
6247
- for (var i=0; i<t.length; i++) {
6248
- tick = t[i];
6249
- if (tick.show && tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
6250
- this._elem.append(tick.draw(ctx, plot));
6251
- }
6252
- }
6253
- tick = null;
6254
- t = null;
6255
- }
6256
- return this._elem;
6257
- };
6258
-
6259
- // called with scope of an axis
6260
- $.jqplot.LinearAxisRenderer.prototype.reset = function() {
6261
- this.min = this._options.min;
6262
- this.max = this._options.max;
6263
- this.tickInterval = this._options.tickInterval;
6264
- this.numberTicks = this._options.numberTicks;
6265
- this._autoFormatString = '';
6266
- if (this._overrideFormatString && this.tickOptions && this.tickOptions.formatString) {
6267
- this.tickOptions.formatString = '';
6268
- }
6269
-
6270
- // this._ticks = this.__ticks;
6271
- };
6272
-
6273
- // called with scope of axis
6274
- $.jqplot.LinearAxisRenderer.prototype.set = function() {
6275
- var dim = 0;
6276
- var temp;
6277
- var w = 0;
6278
- var h = 0;
6279
- var lshow = (this._label == null) ? false : this._label.show;
6280
- if (this.show) {
6281
- var t = this._ticks;
6282
- var tick;
6283
- for (var i=0; i<t.length; i++) {
6284
- tick = t[i];
6285
- if (!tick._breakTick && tick.show && tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
6286
- if (this.name == 'xaxis' || this.name == 'x2axis') {
6287
- temp = tick._elem.outerHeight(true);
6288
- }
6289
- else {
6290
- temp = tick._elem.outerWidth(true);
6291
- }
6292
- if (temp > dim) {
6293
- dim = temp;
6294
- }
6295
- }
6296
- }
6297
- tick = null;
6298
- t = null;
6299
-
6300
- if (lshow) {
6301
- w = this._label._elem.outerWidth(true);
6302
- h = this._label._elem.outerHeight(true);
6303
- }
6304
- if (this.name == 'xaxis') {
6305
- dim = dim + h;
6306
- this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'});
6307
- }
6308
- else if (this.name == 'x2axis') {
6309
- dim = dim + h;
6310
- this._elem.css({'height':dim+'px', left:'0px', top:'0px'});
6311
- }
6312
- else if (this.name == 'yaxis') {
6313
- dim = dim + w;
6314
- this._elem.css({'width':dim+'px', left:'0px', top:'0px'});
6315
- if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
6316
- this._label._elem.css('width', w+'px');
6317
- }
6318
- }
6319
- else {
6320
- dim = dim + w;
6321
- this._elem.css({'width':dim+'px', right:'0px', top:'0px'});
6322
- if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
6323
- this._label._elem.css('width', w+'px');
6324
- }
6325
- }
6326
- }
6327
- };
6328
-
6329
- // called with scope of axis
6330
- $.jqplot.LinearAxisRenderer.prototype.createTicks = function(plot) {
6331
- // we're are operating on an axis here
6332
- var ticks = this._ticks;
6333
- var userTicks = this.ticks;
6334
- var name = this.name;
6335
- // databounds were set on axis initialization.
6336
- var db = this._dataBounds;
6337
- var dim = (this.name.charAt(0) === 'x') ? this._plotDimensions.width : this._plotDimensions.height;
6338
- var interval;
6339
- var min, max;
6340
- var pos1, pos2;
6341
- var tt, i;
6342
- // get a copy of user's settings for min/max.
6343
- var userMin = this.min;
6344
- var userMax = this.max;
6345
- var userNT = this.numberTicks;
6346
- var userTI = this.tickInterval;
6347
-
6348
- var threshold = 30;
6349
- this._scalefact = (Math.max(dim, threshold+1) - threshold)/300.0;
6350
-
6351
- // if we already have ticks, use them.
6352
- // ticks must be in order of increasing value.
6353
-
6354
- if (userTicks.length) {
6355
- // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
6356
- for (i=0; i<userTicks.length; i++){
6357
- var ut = userTicks[i];
6358
- var t = new this.tickRenderer(this.tickOptions);
6359
- if ($.isArray(ut)) {
6360
- t.value = ut[0];
6361
- if (this.breakPoints) {
6362
- if (ut[0] == this.breakPoints[0]) {
6363
- t.label = this.breakTickLabel;
6364
- t._breakTick = true;
6365
- t.showGridline = false;
6366
- t.showMark = false;
6367
- }
6368
- else if (ut[0] > this.breakPoints[0] && ut[0] <= this.breakPoints[1]) {
6369
- t.show = false;
6370
- t.showGridline = false;
6371
- t.label = ut[1];
6372
- }
6373
- else {
6374
- t.label = ut[1];
6375
- }
6376
- }
6377
- else {
6378
- t.label = ut[1];
6379
- }
6380
- t.setTick(ut[0], this.name);
6381
- this._ticks.push(t);
6382
- }
6383
-
6384
- else if ($.isPlainObject(ut)) {
6385
- $.extend(true, t, ut);
6386
- t.axis = this.name;
6387
- this._ticks.push(t);
6388
- }
6389
-
6390
- else {
6391
- t.value = ut;
6392
- if (this.breakPoints) {
6393
- if (ut == this.breakPoints[0]) {
6394
- t.label = this.breakTickLabel;
6395
- t._breakTick = true;
6396
- t.showGridline = false;
6397
- t.showMark = false;
6398
- }
6399
- else if (ut > this.breakPoints[0] && ut <= this.breakPoints[1]) {
6400
- t.show = false;
6401
- t.showGridline = false;
6402
- }
6403
- }
6404
- t.setTick(ut, this.name);
6405
- this._ticks.push(t);
6406
- }
6407
- }
6408
- this.numberTicks = userTicks.length;
6409
- this.min = this._ticks[0].value;
6410
- this.max = this._ticks[this.numberTicks-1].value;
6411
- this.tickInterval = (this.max - this.min) / (this.numberTicks - 1);
6412
- }
6413
-
6414
- // we don't have any ticks yet, let's make some!
6415
- else {
6416
- if (name == 'xaxis' || name == 'x2axis') {
6417
- dim = this._plotDimensions.width;
6418
- }
6419
- else {
6420
- dim = this._plotDimensions.height;
6421
- }
6422
-
6423
- var _numberTicks = this.numberTicks;
6424
-
6425
- // if aligning this axis, use number of ticks from previous axis.
6426
- // Do I need to reset somehow if alignTicks is changed and then graph is replotted??
6427
- if (this.alignTicks) {
6428
- if (this.name === 'x2axis' && plot.axes.xaxis.show) {
6429
- _numberTicks = plot.axes.xaxis.numberTicks;
6430
- }
6431
- else if (this.name.charAt(0) === 'y' && this.name !== 'yaxis' && this.name !== 'yMidAxis' && plot.axes.yaxis.show) {
6432
- _numberTicks = plot.axes.yaxis.numberTicks;
6433
- }
6434
- }
6435
-
6436
- min = ((this.min != null) ? this.min : db.min);
6437
- max = ((this.max != null) ? this.max : db.max);
6438
-
6439
- var range = max - min;
6440
- var rmin, rmax;
6441
- var temp;
6442
-
6443
- if (this.tickOptions == null || !this.tickOptions.formatString) {
6444
- this._overrideFormatString = true;
6445
- }
6446
-
6447
- // Doing complete autoscaling
6448
- if (this.min == null || this.max == null && this.tickInterval == null && !this.autoscale) {
6449
- // Check if user must have tick at 0 or 100 and ensure they are in range.
6450
- // The autoscaling algorithm will always place ticks at 0 and 100 if they are in range.
6451
- if (this.forceTickAt0) {
6452
- if (min > 0) {
6453
- min = 0;
6454
- }
6455
- if (max < 0) {
6456
- max = 0;
6457
- }
6458
- }
6459
-
6460
- if (this.forceTickAt100) {
6461
- if (min > 100) {
6462
- min = 100;
6463
- }
6464
- if (max < 100) {
6465
- max = 100;
6466
- }
6467
- }
6468
-
6469
- var keepMin = false,
6470
- keepMax = false;
6471
-
6472
- if (this.min != null) {
6473
- keepMin = true;
6474
- }
6475
-
6476
- else if (this.max != null) {
6477
- keepMax = true;
6478
- }
6479
-
6480
- // var threshold = 30;
6481
- // var tdim = Math.max(dim, threshold+1);
6482
- // this._scalefact = (tdim-threshold)/300.0;
6483
- var ret = $.jqplot.LinearTickGenerator(min, max, this._scalefact, _numberTicks, keepMin, keepMax);
6484
- // calculate a padded max and min, points should be less than these
6485
- // so that they aren't too close to the edges of the plot.
6486
- // User can adjust how much padding is allowed with pad, padMin and PadMax options.
6487
- // If min or max is set, don't pad that end of axis.
6488
- var tumin = (this.min != null) ? min : min + range*(this.padMin - 1);
6489
- var tumax = (this.max != null) ? max : max - range*(this.padMax - 1);
6490
-
6491
- // if they're equal, we shouldn't have to do anything, right?
6492
- // if (min <=tumin || max >= tumax) {
6493
- if (min <tumin || max > tumax) {
6494
- tumin = (this.min != null) ? min : min - range*(this.padMin - 1);
6495
- tumax = (this.max != null) ? max : max + range*(this.padMax - 1);
6496
- ret = $.jqplot.LinearTickGenerator(tumin, tumax, this._scalefact, _numberTicks, keepMin, keepMax);
6497
- }
6498
-
6499
- this.min = ret[0];
6500
- this.max = ret[1];
6501
- // if numberTicks specified, it should return the same.
6502
- this.numberTicks = ret[2];
6503
- this._autoFormatString = ret[3];
6504
- this.tickInterval = ret[4];
6505
- }
6506
-
6507
- // User has specified some axis scale related option, can use auto algorithm
6508
- else {
6509
-
6510
- // if min and max are same, space them out a bit
6511
- if (min == max) {
6512
- var adj = 0.05;
6513
- if (min > 0) {
6514
- adj = Math.max(Math.log(min)/Math.LN10, 0.05);
6515
- }
6516
- min -= adj;
6517
- max += adj;
6518
- }
6519
-
6520
- // autoscale. Can't autoscale if min or max is supplied.
6521
- // Will use numberTicks and tickInterval if supplied. Ticks
6522
- // across multiple axes may not line up depending on how
6523
- // bars are to be plotted.
6524
- if (this.autoscale && this.min == null && this.max == null) {
6525
- var rrange, ti, margin;
6526
- var forceMinZero = false;
6527
- var forceZeroLine = false;
6528
- var intervals = {min:null, max:null, average:null, stddev:null};
6529
- // if any series are bars, or if any are fill to zero, and if this
6530
- // is the axis to fill toward, check to see if we can start axis at zero.
6531
- for (var i=0; i<this._series.length; i++) {
6532
- var s = this._series[i];
6533
- var faname = (s.fillAxis == 'x') ? s._xaxis.name : s._yaxis.name;
6534
- // check to see if this is the fill axis
6535
- if (this.name == faname) {
6536
- var vals = s._plotValues[s.fillAxis];
6537
- var vmin = vals[0];
6538
- var vmax = vals[0];
6539
- for (var j=1; j<vals.length; j++) {
6540
- if (vals[j] < vmin) {
6541
- vmin = vals[j];
6542
- }
6543
- else if (vals[j] > vmax) {
6544
- vmax = vals[j];
6545
- }
6546
- }
6547
- var dp = (vmax - vmin) / vmax;
6548
- // is this sries a bar?
6549
- if (s.renderer.constructor == $.jqplot.BarRenderer) {
6550
- // if no negative values and could also check range.
6551
- if (vmin >= 0 && (s.fillToZero || dp > 0.1)) {
6552
- forceMinZero = true;
6553
- }
6554
- else {
6555
- forceMinZero = false;
6556
- if (s.fill && s.fillToZero && vmin < 0 && vmax > 0) {
6557
- forceZeroLine = true;
6558
- }
6559
- else {
6560
- forceZeroLine = false;
6561
- }
6562
- }
6563
- }
6564
-
6565
- // if not a bar and filling, use appropriate method.
6566
- else if (s.fill) {
6567
- if (vmin >= 0 && (s.fillToZero || dp > 0.1)) {
6568
- forceMinZero = true;
6569
- }
6570
- else if (vmin < 0 && vmax > 0 && s.fillToZero) {
6571
- forceMinZero = false;
6572
- forceZeroLine = true;
6573
- }
6574
- else {
6575
- forceMinZero = false;
6576
- forceZeroLine = false;
6577
- }
6578
- }
6579
-
6580
- // if not a bar and not filling, only change existing state
6581
- // if it doesn't make sense
6582
- else if (vmin < 0) {
6583
- forceMinZero = false;
6584
- }
6585
- }
6586
- }
6587
-
6588
- // check if we need make axis min at 0.
6589
- if (forceMinZero) {
6590
- // compute number of ticks
6591
- this.numberTicks = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
6592
- this.min = 0;
6593
- userMin = 0;
6594
- // what order is this range?
6595
- // what tick interval does that give us?
6596
- ti = max/(this.numberTicks-1);
6597
- temp = Math.pow(10, Math.abs(Math.floor(Math.log(ti)/Math.LN10)));
6598
- if (ti/temp == parseInt(ti/temp, 10)) {
6599
- ti += temp;
6600
- }
6601
- this.tickInterval = Math.ceil(ti/temp) * temp;
6602
- this.max = this.tickInterval * (this.numberTicks - 1);
6603
- }
6604
-
6605
- // check if we need to make sure there is a tick at 0.
6606
- else if (forceZeroLine) {
6607
- // compute number of ticks
6608
- this.numberTicks = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
6609
- var ntmin = Math.ceil(Math.abs(min)/range*(this.numberTicks-1));
6610
- var ntmax = this.numberTicks - 1 - ntmin;
6611
- ti = Math.max(Math.abs(min/ntmin), Math.abs(max/ntmax));
6612
- temp = Math.pow(10, Math.abs(Math.floor(Math.log(ti)/Math.LN10)));
6613
- this.tickInterval = Math.ceil(ti/temp) * temp;
6614
- this.max = this.tickInterval * ntmax;
6615
- this.min = -this.tickInterval * ntmin;
6616
- }
6617
-
6618
- // if nothing else, do autoscaling which will try to line up ticks across axes.
6619
- else {
6620
- if (this.numberTicks == null){
6621
- if (this.tickInterval) {
6622
- this.numberTicks = 3 + Math.ceil(range / this.tickInterval);
6623
- }
6624
- else {
6625
- this.numberTicks = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
6626
- }
6627
- }
6628
-
6629
- if (this.tickInterval == null) {
6630
- // get a tick interval
6631
- ti = range/(this.numberTicks - 1);
6632
-
6633
- if (ti < 1) {
6634
- temp = Math.pow(10, Math.abs(Math.floor(Math.log(ti)/Math.LN10)));
6635
- }
6636
- else {
6637
- temp = 1;
6638
- }
6639
- this.tickInterval = Math.ceil(ti*temp*this.pad)/temp;
6640
- }
6641
- else {
6642
- temp = 1 / this.tickInterval;
6643
- }
6644
-
6645
- // try to compute a nicer, more even tick interval
6646
- // temp = Math.pow(10, Math.floor(Math.log(ti)/Math.LN10));
6647
- // this.tickInterval = Math.ceil(ti/temp) * temp;
6648
- rrange = this.tickInterval * (this.numberTicks - 1);
6649
- margin = (rrange - range)/2;
6650
-
6651
- if (this.min == null) {
6652
- this.min = Math.floor(temp*(min-margin))/temp;
6653
- }
6654
- if (this.max == null) {
6655
- this.max = this.min + rrange;
6656
- }
6657
- }
6658
-
6659
- // Compute a somewhat decent format string if it is needed.
6660
- // get precision of interval and determine a format string.
6661
- var sf = $.jqplot.getSignificantFigures(this.tickInterval);
6662
-
6663
- var fstr;
6664
-
6665
- // if we have only a whole number, use integer formatting
6666
- if (sf.digitsLeft >= sf.significantDigits) {
6667
- fstr = '%d';
6668
- }
6669
-
6670
- else {
6671
- var temp = Math.max(0, 5 - sf.digitsLeft);
6672
- temp = Math.min(temp, sf.digitsRight);
6673
- fstr = '%.'+ temp + 'f';
6674
- }
6675
-
6676
- this._autoFormatString = fstr;
6677
- }
6678
-
6679
- // Use the default algorithm which pads each axis to make the chart
6680
- // centered nicely on the grid.
6681
- else {
6682
-
6683
- rmin = (this.min != null) ? this.min : min - range*(this.padMin - 1);
6684
- rmax = (this.max != null) ? this.max : max + range*(this.padMax - 1);
6685
- range = rmax - rmin;
6686
-
6687
- if (this.numberTicks == null){
6688
- // if tickInterval is specified by user, we will ignore computed maximum.
6689
- // max will be equal or greater to fit even # of ticks.
6690
- if (this.tickInterval != null) {
6691
- this.numberTicks = Math.ceil((rmax - rmin)/this.tickInterval)+1;
6692
- }
6693
- else if (dim > 100) {
6694
- this.numberTicks = parseInt(3+(dim-100)/75, 10);
6695
- }
6696
- else {
6697
- this.numberTicks = 2;
6698
- }
6699
- }
6700
-
6701
- if (this.tickInterval == null) {
6702
- this.tickInterval = range / (this.numberTicks-1);
6703
- }
6704
-
6705
- if (this.max == null) {
6706
- rmax = rmin + this.tickInterval*(this.numberTicks - 1);
6707
- }
6708
- if (this.min == null) {
6709
- rmin = rmax - this.tickInterval*(this.numberTicks - 1);
6710
- }
6711
-
6712
- // get precision of interval and determine a format string.
6713
- var sf = $.jqplot.getSignificantFigures(this.tickInterval);
6714
-
6715
- var fstr;
6716
-
6717
- // if we have only a whole number, use integer formatting
6718
- if (sf.digitsLeft >= sf.significantDigits) {
6719
- fstr = '%d';
6720
- }
6721
-
6722
- else {
6723
- var temp = Math.max(0, 5 - sf.digitsLeft);
6724
- temp = Math.min(temp, sf.digitsRight);
6725
- fstr = '%.'+ temp + 'f';
6726
- }
6727
-
6728
-
6729
- this._autoFormatString = fstr;
6730
-
6731
- this.min = rmin;
6732
- this.max = rmax;
6733
- }
6734
-
6735
- if (this.renderer.constructor == $.jqplot.LinearAxisRenderer && this._autoFormatString == '') {
6736
- // fix for misleading tick display with small range and low precision.
6737
- range = this.max - this.min;
6738
- // figure out precision
6739
- var temptick = new this.tickRenderer(this.tickOptions);
6740
- // use the tick formatString or, the default.
6741
- var fs = temptick.formatString || $.jqplot.config.defaultTickFormatString;
6742
- var fs = fs.match($.jqplot.sprintf.regex)[0];
6743
- var precision = 0;
6744
- if (fs) {
6745
- if (fs.search(/[fFeEgGpP]/) > -1) {
6746
- var m = fs.match(/\%\.(\d{0,})?[eEfFgGpP]/);
6747
- if (m) {
6748
- precision = parseInt(m[1], 10);
6749
- }
6750
- else {
6751
- precision = 6;
6752
- }
6753
- }
6754
- else if (fs.search(/[di]/) > -1) {
6755
- precision = 0;
6756
- }
6757
- // fact will be <= 1;
6758
- var fact = Math.pow(10, -precision);
6759
- if (this.tickInterval < fact) {
6760
- // need to correct underrange
6761
- if (userNT == null && userTI == null) {
6762
- this.tickInterval = fact;
6763
- if (userMax == null && userMin == null) {
6764
- // this.min = Math.floor((this._dataBounds.min - this.tickInterval)/fact) * fact;
6765
- this.min = Math.floor(this._dataBounds.min/fact) * fact;
6766
- if (this.min == this._dataBounds.min) {
6767
- this.min = this._dataBounds.min - this.tickInterval;
6768
- }
6769
- // this.max = Math.ceil((this._dataBounds.max + this.tickInterval)/fact) * fact;
6770
- this.max = Math.ceil(this._dataBounds.max/fact) * fact;
6771
- if (this.max == this._dataBounds.max) {
6772
- this.max = this._dataBounds.max + this.tickInterval;
6773
- }
6774
- var n = (this.max - this.min)/this.tickInterval;
6775
- n = n.toFixed(11);
6776
- n = Math.ceil(n);
6777
- this.numberTicks = n + 1;
6778
- }
6779
- else if (userMax == null) {
6780
- // add one tick for top of range.
6781
- var n = (this._dataBounds.max - this.min) / this.tickInterval;
6782
- n = n.toFixed(11);
6783
- this.numberTicks = Math.ceil(n) + 2;
6784
- this.max = this.min + this.tickInterval * (this.numberTicks-1);
6785
- }
6786
- else if (userMin == null) {
6787
- // add one tick for bottom of range.
6788
- var n = (this.max - this._dataBounds.min) / this.tickInterval;
6789
- n = n.toFixed(11);
6790
- this.numberTicks = Math.ceil(n) + 2;
6791
- this.min = this.max - this.tickInterval * (this.numberTicks-1);
6792
- }
6793
- else {
6794
- // calculate a number of ticks so max is within axis scale
6795
- this.numberTicks = Math.ceil((userMax - userMin)/this.tickInterval) + 1;
6796
- // if user's min and max don't fit evenly in ticks, adjust.
6797
- // This takes care of cases such as user min set to 0, max set to 3.5 but tick
6798
- // format string set to %d (integer ticks)
6799
- this.min = Math.floor(userMin*Math.pow(10, precision))/Math.pow(10, precision);
6800
- this.max = Math.ceil(userMax*Math.pow(10, precision))/Math.pow(10, precision);
6801
- // this.max = this.min + this.tickInterval*(this.numberTicks-1);
6802
- this.numberTicks = Math.ceil((this.max - this.min)/this.tickInterval) + 1;
6803
- }
6804
- }
6805
- }
6806
- }
6807
- }
6808
-
6809
- }
6810
-
6811
- if (this._overrideFormatString && this._autoFormatString != '') {
6812
- this.tickOptions = this.tickOptions || {};
6813
- this.tickOptions.formatString = this._autoFormatString;
6814
- }
6815
-
6816
- var t, to;
6817
- for (var i=0; i<this.numberTicks; i++){
6818
- tt = this.min + i * this.tickInterval;
6819
- t = new this.tickRenderer(this.tickOptions);
6820
- // var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
6821
-
6822
- t.setTick(tt, this.name);
6823
- this._ticks.push(t);
6824
-
6825
- if (i < this.numberTicks - 1) {
6826
- for (var j=0; j<this.minorTicks; j++) {
6827
- tt += this.tickInterval/(this.minorTicks+1);
6828
- to = $.extend(true, {}, this.tickOptions, {name:this.name, value:tt, label:'', isMinorTick:true});
6829
- t = new this.tickRenderer(to);
6830
- this._ticks.push(t);
6831
- }
6832
- }
6833
- t = null;
6834
- }
6835
- }
6836
-
6837
- if (this.tickInset) {
6838
- this.min = this.min - this.tickInset * this.tickInterval;
6839
- this.max = this.max + this.tickInset * this.tickInterval;
6840
- }
6841
-
6842
- ticks = null;
6843
- };
6844
-
6845
- // Used to reset just the values of the ticks and then repack, which will
6846
- // recalculate the positioning functions. It is assuemd that the
6847
- // number of ticks is the same and the values of the new array are at the
6848
- // proper interval.
6849
- // This method needs to be called with the scope of an axis object, like:
6850
- //
6851
- // > plot.axes.yaxis.renderer.resetTickValues.call(plot.axes.yaxis, yarr);
6852
- //
6853
- $.jqplot.LinearAxisRenderer.prototype.resetTickValues = function(opts) {
6854
- if ($.isArray(opts) && opts.length == this._ticks.length) {
6855
- var t;
6856
- for (var i=0; i<opts.length; i++) {
6857
- t = this._ticks[i];
6858
- t.value = opts[i];
6859
- t.label = t.formatter(t.formatString, opts[i]);
6860
- t.label = t.prefix + t.label;
6861
- t._elem.html(t.label);
6862
- }
6863
- t = null;
6864
- this.min = $.jqplot.arrayMin(opts);
6865
- this.max = $.jqplot.arrayMax(opts);
6866
- this.pack();
6867
- }
6868
- // Not implemented yet.
6869
- // else if ($.isPlainObject(opts)) {
6870
- //
6871
- // }
6872
- };
6873
-
6874
- // called with scope of axis
6875
- $.jqplot.LinearAxisRenderer.prototype.pack = function(pos, offsets) {
6876
- // Add defaults for repacking from resetTickValues function.
6877
- pos = pos || {};
6878
- offsets = offsets || this._offsets;
6879
-
6880
- var ticks = this._ticks;
6881
- var max = this.max;
6882
- var min = this.min;
6883
- var offmax = offsets.max;
6884
- var offmin = offsets.min;
6885
- var lshow = (this._label == null) ? false : this._label.show;
6886
-
6887
- for (var p in pos) {
6888
- this._elem.css(p, pos[p]);
6889
- }
6890
-
6891
- this._offsets = offsets;
6892
- // pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
6893
- var pixellength = offmax - offmin;
6894
- var unitlength = max - min;
6895
-
6896
- // point to unit and unit to point conversions references to Plot DOM element top left corner.
6897
- if (this.breakPoints) {
6898
- unitlength = unitlength - this.breakPoints[1] + this.breakPoints[0];
6899
-
6900
- this.p2u = function(p){
6901
- return (p - offmin) * unitlength / pixellength + min;
6902
- };
6903
-
6904
- this.u2p = function(u){
6905
- if (u > this.breakPoints[0] && u < this.breakPoints[1]){
6906
- u = this.breakPoints[0];
6907
- }
6908
- if (u <= this.breakPoints[0]) {
6909
- return (u - min) * pixellength / unitlength + offmin;
6910
- }
6911
- else {
6912
- return (u - this.breakPoints[1] + this.breakPoints[0] - min) * pixellength / unitlength + offmin;
6913
- }
6914
- };
6915
-
6916
- if (this.name.charAt(0) == 'x'){
6917
- this.series_u2p = function(u){
6918
- if (u > this.breakPoints[0] && u < this.breakPoints[1]){
6919
- u = this.breakPoints[0];
6920
- }
6921
- if (u <= this.breakPoints[0]) {
6922
- return (u - min) * pixellength / unitlength;
6923
- }
6924
- else {
6925
- return (u - this.breakPoints[1] + this.breakPoints[0] - min) * pixellength / unitlength;
6926
- }
6927
- };
6928
- this.series_p2u = function(p){
6929
- return p * unitlength / pixellength + min;
6930
- };
6931
- }
6932
-
6933
- else {
6934
- this.series_u2p = function(u){
6935
- if (u > this.breakPoints[0] && u < this.breakPoints[1]){
6936
- u = this.breakPoints[0];
6937
- }
6938
- if (u >= this.breakPoints[1]) {
6939
- return (u - max) * pixellength / unitlength;
6940
- }
6941
- else {
6942
- return (u + this.breakPoints[1] - this.breakPoints[0] - max) * pixellength / unitlength;
6943
- }
6944
- };
6945
- this.series_p2u = function(p){
6946
- return p * unitlength / pixellength + max;
6947
- };
6948
- }
6949
- }
6950
- else {
6951
- this.p2u = function(p){
6952
- return (p - offmin) * unitlength / pixellength + min;
6953
- };
6954
-
6955
- this.u2p = function(u){
6956
- return (u - min) * pixellength / unitlength + offmin;
6957
- };
6958
-
6959
- if (this.name == 'xaxis' || this.name == 'x2axis'){
6960
- this.series_u2p = function(u){
6961
- return (u - min) * pixellength / unitlength;
6962
- };
6963
- this.series_p2u = function(p){
6964
- return p * unitlength / pixellength + min;
6965
- };
6966
- }
6967
-
6968
- else {
6969
- this.series_u2p = function(u){
6970
- return (u - max) * pixellength / unitlength;
6971
- };
6972
- this.series_p2u = function(p){
6973
- return p * unitlength / pixellength + max;
6974
- };
6975
- }
6976
- }
6977
-
6978
- if (this.show) {
6979
- if (this.name == 'xaxis' || this.name == 'x2axis') {
6980
- for (var i=0; i<ticks.length; i++) {
6981
- var t = ticks[i];
6982
- if (t.show && t.showLabel) {
6983
- var shim;
6984
-
6985
- if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
6986
- // will need to adjust auto positioning based on which axis this is.
6987
- var temp = (this.name == 'xaxis') ? 1 : -1;
6988
- switch (t.labelPosition) {
6989
- case 'auto':
6990
- // position at end
6991
- if (temp * t.angle < 0) {
6992
- shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
6993
- }
6994
- // position at start
6995
- else {
6996
- shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
6997
- }
6998
- break;
6999
- case 'end':
7000
- shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
7001
- break;
7002
- case 'start':
7003
- shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
7004
- break;
7005
- case 'middle':
7006
- shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
7007
- break;
7008
- default:
7009
- shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
7010
- break;
7011
- }
7012
- }
7013
- else {
7014
- shim = -t.getWidth()/2;
7015
- }
7016
- var val = this.u2p(t.value) + shim + 'px';
7017
- t._elem.css('left', val);
7018
- t.pack();
7019
- }
7020
- }
7021
- if (lshow) {
7022
- var w = this._label._elem.outerWidth(true);
7023
- this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
7024
- if (this.name == 'xaxis') {
7025
- this._label._elem.css('bottom', '0px');
7026
- }
7027
- else {
7028
- this._label._elem.css('top', '0px');
7029
- }
7030
- this._label.pack();
7031
- }
7032
- }
7033
- else {
7034
- for (var i=0; i<ticks.length; i++) {
7035
- var t = ticks[i];
7036
- if (t.show && t.showLabel) {
7037
- var shim;
7038
- if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
7039
- // will need to adjust auto positioning based on which axis this is.
7040
- var temp = (this.name == 'yaxis') ? 1 : -1;
7041
- switch (t.labelPosition) {
7042
- case 'auto':
7043
- // position at end
7044
- case 'end':
7045
- if (temp * t.angle < 0) {
7046
- shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
7047
- }
7048
- else {
7049
- shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
7050
- }
7051
- break;
7052
- case 'start':
7053
- if (t.angle > 0) {
7054
- shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
7055
- }
7056
- else {
7057
- shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
7058
- }
7059
- break;
7060
- case 'middle':
7061
- // if (t.angle > 0) {
7062
- // shim = -t.getHeight()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
7063
- // }
7064
- // else {
7065
- // shim = -t.getHeight()/2 - t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
7066
- // }
7067
- shim = -t.getHeight()/2;
7068
- break;
7069
- default:
7070
- shim = -t.getHeight()/2;
7071
- break;
7072
- }
7073
- }
7074
- else {
7075
- shim = -t.getHeight()/2;
7076
- }
7077
-
7078
- var val = this.u2p(t.value) + shim + 'px';
7079
- t._elem.css('top', val);
7080
- t.pack();
7081
- }
7082
- }
7083
- if (lshow) {
7084
- var h = this._label._elem.outerHeight(true);
7085
- this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
7086
- if (this.name == 'yaxis') {
7087
- this._label._elem.css('left', '0px');
7088
- }
7089
- else {
7090
- this._label._elem.css('right', '0px');
7091
- }
7092
- this._label.pack();
7093
- }
7094
- }
7095
- }
7096
-
7097
- ticks = null;
7098
- };
7099
-
7100
-
7101
- /**
7102
- * The following code was generaously given to me a while back by Scott Prahl.
7103
- * He did a good job at computing axes min, max and number of ticks for the
7104
- * case where the user has not set any scale related parameters (tickInterval,
7105
- * numberTicks, min or max). I had ignored this use case for a long time,
7106
- * focusing on the more difficult case where user has set some option controlling
7107
- * tick generation. Anyway, about time I got this into jqPlot.
7108
- * Thanks Scott!!
7109
- */
7110
-
7111
- /**
7112
- * Copyright (c) 2010 Scott Prahl
7113
- * The next three routines are currently available for use in all personal
7114
- * or commercial projects under both the MIT and GPL version 2.0 licenses.
7115
- * This means that you can choose the license that best suits your project
7116
- * and use it accordingly.
7117
- */
7118
-
7119
- // A good format string depends on the interval. If the interval is greater
7120
- // than 1 then there is no need to show any decimal digits. If it is < 1.0, then
7121
- // use the magnitude of the interval to determine the number of digits to show.
7122
- function bestFormatString (interval)
7123
- {
7124
- var fstr;
7125
- interval = Math.abs(interval);
7126
- if (interval >= 10) {
7127
- fstr = '%d';
7128
- }
7129
-
7130
- else if (interval > 1) {
7131
- if (interval === parseInt(interval, 10)) {
7132
- fstr = '%d';
7133
- }
7134
- else {
7135
- fstr = '%.1f';
7136
- }
7137
- }
7138
-
7139
- else {
7140
- var expv = -Math.floor(Math.log(interval)/Math.LN10);
7141
- fstr = '%.' + expv + 'f';
7142
- }
7143
-
7144
- return fstr;
7145
- }
7146
-
7147
- var _factors = [0.1, 0.2, 0.3, 0.4, 0.5, 0.8, 1, 2, 3, 4, 5];
7148
-
7149
- var _getLowerFactor = function(f) {
7150
- var i = _factors.indexOf(f);
7151
- if (i > 0) {
7152
- return _factors[i-1];
7153
- }
7154
- else {
7155
- return _factors[_factors.length - 1] / 100;
7156
- }
7157
- };
7158
-
7159
- var _getHigherFactor = function(f) {
7160
- var i = _factors.indexOf(f);
7161
- if (i < _factors.length-1) {
7162
- return _factors[i+1];
7163
- }
7164
- else {
7165
- return _factors[0] * 100;
7166
- }
7167
- };
7168
-
7169
- // Given a fixed minimum and maximum and a target number ot ticks
7170
- // figure out the best interval and
7171
- // return min, max, number ticks, format string and tick interval
7172
- function bestConstrainedInterval(min, max, nttarget) {
7173
- // run through possible number to ticks and see which interval is best
7174
- var low = Math.floor(nttarget/2);
7175
- var hi = Math.ceil(nttarget*1.5);
7176
- var badness = Number.MAX_VALUE;
7177
- var r = (max - min);
7178
- var temp;
7179
- var sd;
7180
- var bestNT;
7181
- var gsf = $.jqplot.getSignificantFigures;
7182
- var fsd;
7183
- var fs;
7184
- var currentNT;
7185
- var bestPrec;
7186
-
7187
- for (var i=0, l=hi-low+1; i<l; i++) {
7188
- currentNT = low + i;
7189
- temp = r/(currentNT-1);
7190
- sd = gsf(temp);
7191
-
7192
- temp = Math.abs(nttarget - currentNT) + sd.digitsRight;
7193
- if (temp < badness) {
7194
- badness = temp;
7195
- bestNT = currentNT;
7196
- bestPrec = sd.digitsRight;
7197
- }
7198
- else if (temp === badness) {
7199
- // let nicer ticks trump number ot ticks
7200
- if (sd.digitsRight < bestPrec) {
7201
- bestNT = currentNT;
7202
- bestPrec = sd.digitsRight;
7203
- }
7204
- }
7205
-
7206
- }
7207
-
7208
- fsd = Math.max(bestPrec, Math.max(gsf(min).digitsRight, gsf(max).digitsRight));
7209
- if (fsd === 0) {
7210
- fs = '%d';
7211
- }
7212
- else {
7213
- fs = '%.' + fsd + 'f';
7214
- }
7215
- temp = r / (bestNT - 1);
7216
- // min, max, number ticks, format string, tick interval
7217
- return [min, max, bestNT, fs, temp];
7218
- }
7219
-
7220
- // This will return an interval of form 2 * 10^n, 5 * 10^n or 10 * 10^n
7221
- // it is based soley on the range and number of ticks. So if user specifies
7222
- // number of ticks, use this.
7223
- function bestInterval(range, numberTicks) {
7224
- numberTicks = numberTicks || 7;
7225
- var minimum = range / (numberTicks - 1);
7226
- var magnitude = Math.pow(10, Math.floor(Math.log(minimum) / Math.LN10));
7227
- var residual = minimum / magnitude;
7228
- var interval;
7229
- // "nicest" ranges are 1, 2, 5 or powers of these.
7230
- // for magnitudes below 1, only allow these.
7231
- if (magnitude < 1) {
7232
- if (residual > 5) {
7233
- interval = 10 * magnitude;
7234
- }
7235
- else if (residual > 2) {
7236
- interval = 5 * magnitude;
7237
- }
7238
- else if (residual > 1) {
7239
- interval = 2 * magnitude;
7240
- }
7241
- else {
7242
- interval = magnitude;
7243
- }
7244
- }
7245
- // for large ranges (whole integers), allow intervals like 3, 4 or powers of these.
7246
- // this helps a lot with poor choices for number of ticks.
7247
- else {
7248
- if (residual > 5) {
7249
- interval = 10 * magnitude;
7250
- }
7251
- else if (residual > 4) {
7252
- interval = 5 * magnitude;
7253
- }
7254
- else if (residual > 3) {
7255
- interval = 4 * magnitude;
7256
- }
7257
- else if (residual > 2) {
7258
- interval = 3 * magnitude;
7259
- }
7260
- else if (residual > 1) {
7261
- interval = 2 * magnitude;
7262
- }
7263
- else {
7264
- interval = magnitude;
7265
- }
7266
- }
7267
-
7268
- return interval;
7269
- }
7270
-
7271
- // This will return an interval of form 2 * 10^n, 5 * 10^n or 10 * 10^n
7272
- // it is based soley on the range of data, number of ticks must be computed later.
7273
- function bestLinearInterval(range, scalefact) {
7274
- scalefact = scalefact || 1;
7275
- var expv = Math.floor(Math.log(range)/Math.LN10);
7276
- var magnitude = Math.pow(10, expv);
7277
- // 0 < f < 10
7278
- var f = range / magnitude;
7279
- var fact;
7280
- // for large plots, scalefact will decrease f and increase number of ticks.
7281
- // for small plots, scalefact will increase f and decrease number of ticks.
7282
- f = f/scalefact;
7283
-
7284
- // for large plots, smaller interval, more ticks.
7285
- if (f<=0.38) {
7286
- fact = 0.1;
7287
- }
7288
- else if (f<=1.6) {
7289
- fact = 0.2;
7290
- }
7291
- else if (f<=4.0) {
7292
- fact = 0.5;
7293
- }
7294
- else if (f<=8.0) {
7295
- fact = 1.0;
7296
- }
7297
- // for very small plots, larger interval, less ticks in number ticks
7298
- else if (f<=16.0) {
7299
- fact = 2;
7300
- }
7301
- else {
7302
- fact = 5;
7303
- }
7304
-
7305
- return fact*magnitude;
7306
- }
7307
-
7308
- function bestLinearComponents(range, scalefact) {
7309
- var expv = Math.floor(Math.log(range)/Math.LN10);
7310
- var magnitude = Math.pow(10, expv);
7311
- // 0 < f < 10
7312
- var f = range / magnitude;
7313
- var interval;
7314
- var fact;
7315
- // for large plots, scalefact will decrease f and increase number of ticks.
7316
- // for small plots, scalefact will increase f and decrease number of ticks.
7317
- f = f/scalefact;
7318
-
7319
- // for large plots, smaller interval, more ticks.
7320
- if (f<=0.38) {
7321
- fact = 0.1;
7322
- }
7323
- else if (f<=1.6) {
7324
- fact = 0.2;
7325
- }
7326
- else if (f<=4.0) {
7327
- fact = 0.5;
7328
- }
7329
- else if (f<=8.0) {
7330
- fact = 1.0;
7331
- }
7332
- // for very small plots, larger interval, less ticks in number ticks
7333
- else if (f<=16.0) {
7334
- fact = 2;
7335
- }
7336
- // else if (f<=20.0) {
7337
- // fact = 3;
7338
- // }
7339
- // else if (f<=24.0) {
7340
- // fact = 4;
7341
- // }
7342
- else {
7343
- fact = 5;
7344
- }
7345
-
7346
- interval = fact * magnitude;
7347
-
7348
- return [interval, fact, magnitude];
7349
- }
7350
-
7351
- // Given the min and max for a dataset, return suitable endpoints
7352
- // for the graphing, a good number for the number of ticks, and a
7353
- // format string so that extraneous digits are not displayed.
7354
- // returned is an array containing [min, max, nTicks, format]
7355
- $.jqplot.LinearTickGenerator = function(axis_min, axis_max, scalefact, numberTicks, keepMin, keepMax) {
7356
- // Set to preserve EITHER min OR max.
7357
- // If min is preserved, max must be free.
7358
- keepMin = (keepMin === null) ? false : keepMin;
7359
- keepMax = (keepMax === null || keepMin) ? false : keepMax;
7360
- // if endpoints are equal try to include zero otherwise include one
7361
- if (axis_min === axis_max) {
7362
- axis_max = (axis_max) ? 0 : 1;
7363
- }
7364
-
7365
- scalefact = scalefact || 1.0;
7366
-
7367
- // make sure range is positive
7368
- if (axis_max < axis_min) {
7369
- var a = axis_max;
7370
- axis_max = axis_min;
7371
- axis_min = a;
7372
- }
7373
-
7374
- var r = [];
7375
- var ss = bestLinearInterval(axis_max - axis_min, scalefact);
7376
-
7377
- var gsf = $.jqplot.getSignificantFigures;
7378
-
7379
- if (numberTicks == null) {
7380
-
7381
- // Figure out the axis min, max and number of ticks
7382
- // the min and max will be some multiple of the tick interval,
7383
- // 1*10^n, 2*10^n or 5*10^n. This gaurantees that, if the
7384
- // axis min is negative, 0 will be a tick.
7385
- if (!keepMin && !keepMax) {
7386
- r[0] = Math.floor(axis_min / ss) * ss; // min
7387
- r[1] = Math.ceil(axis_max / ss) * ss; // max
7388
- r[2] = Math.round((r[1]-r[0])/ss+1.0); // number of ticks
7389
- r[3] = bestFormatString(ss); // format string
7390
- r[4] = ss; // tick Interval
7391
- }
7392
-
7393
- else if (keepMin) {
7394
- r[0] = axis_min; // min
7395
- r[2] = Math.ceil((axis_max - axis_min) / ss + 1.0); // number of ticks
7396
- r[1] = axis_min + (r[2] - 1) * ss; // max
7397
- var digitsMin = gsf(axis_min).digitsRight;
7398
- var digitsSS = gsf(ss).digitsRight;
7399
- if (digitsMin < digitsSS) {
7400
- r[3] = bestFormatString(ss); // format string
7401
- }
7402
- else {
7403
- r[3] = '%.' + digitsMin + 'f';
7404
- }
7405
- r[4] = ss; // tick Interval
7406
- }
7407
-
7408
- else if (keepMax) {
7409
- r[1] = axis_max; // max
7410
- r[2] = Math.ceil((axis_max - axis_min) / ss + 1.0); // number of ticks
7411
- r[0] = axis_max - (r[2] - 1) * ss; // min
7412
- var digitsMax = gsf(axis_max).digitsRight;
7413
- var digitsSS = gsf(ss).digitsRight;
7414
- if (digitsMax < digitsSS) {
7415
- r[3] = bestFormatString(ss); // format string
7416
- }
7417
- else {
7418
- r[3] = '%.' + digitsMax + 'f';
7419
- }
7420
- r[4] = ss; // tick Interval
7421
- }
7422
- }
7423
-
7424
- else {
7425
- var tempr = [];
7426
-
7427
- // Figure out the axis min, max and number of ticks
7428
- // the min and max will be some multiple of the tick interval,
7429
- // 1*10^n, 2*10^n or 5*10^n. This gaurantees that, if the
7430
- // axis min is negative, 0 will be a tick.
7431
- tempr[0] = Math.floor(axis_min / ss) * ss; // min
7432
- tempr[1] = Math.ceil(axis_max / ss) * ss; // max
7433
- tempr[2] = Math.round((tempr[1]-tempr[0])/ss+1.0); // number of ticks
7434
- tempr[3] = bestFormatString(ss); // format string
7435
- tempr[4] = ss; // tick Interval
7436
-
7437
- // first, see if we happen to get the right number of ticks
7438
- if (tempr[2] === numberTicks) {
7439
- r = tempr;
7440
- }
7441
-
7442
- else {
7443
-
7444
- var newti = bestInterval(tempr[1] - tempr[0], numberTicks);
7445
-
7446
- r[0] = tempr[0]; // min
7447
- r[2] = numberTicks; // number of ticks
7448
- r[4] = newti; // tick interval
7449
- r[3] = bestFormatString(newti); // format string
7450
- r[1] = r[0] + (r[2] - 1) * r[4]; // max
7451
- }
7452
- }
7453
-
7454
- return r;
7455
- };
7456
-
7457
- $.jqplot.LinearTickGenerator.bestLinearInterval = bestLinearInterval;
7458
- $.jqplot.LinearTickGenerator.bestInterval = bestInterval;
7459
- $.jqplot.LinearTickGenerator.bestLinearComponents = bestLinearComponents;
7460
- $.jqplot.LinearTickGenerator.bestConstrainedInterval = bestConstrainedInterval;
7461
-
7462
-
7463
- // class: $.jqplot.MarkerRenderer
7464
- // The default jqPlot marker renderer, rendering the points on the line.
7465
- $.jqplot.MarkerRenderer = function(options){
7466
- // Group: Properties
7467
-
7468
- // prop: show
7469
- // whether or not to show the marker.
7470
- this.show = true;
7471
- // prop: style
7472
- // One of diamond, circle, square, x, plus, dash, filledDiamond, filledCircle, filledSquare
7473
- this.style = 'filledCircle';
7474
- // prop: lineWidth
7475
- // size of the line for non-filled markers.
7476
- this.lineWidth = 2;
7477
- // prop: size
7478
- // Size of the marker (diameter or circle, length of edge of square, etc.)
7479
- this.size = 9.0;
7480
- // prop: color
7481
- // color of marker. Will be set to color of series by default on init.
7482
- this.color = '#666666';
7483
- // prop: shadow
7484
- // whether or not to draw a shadow on the line
7485
- this.shadow = true;
7486
- // prop: shadowAngle
7487
- // Shadow angle in degrees
7488
- this.shadowAngle = 45;
7489
- // prop: shadowOffset
7490
- // Shadow offset from line in pixels
7491
- this.shadowOffset = 1;
7492
- // prop: shadowDepth
7493
- // Number of times shadow is stroked, each stroke offset shadowOffset from the last.
7494
- this.shadowDepth = 3;
7495
- // prop: shadowAlpha
7496
- // Alpha channel transparency of shadow. 0 = transparent.
7497
- this.shadowAlpha = '0.07';
7498
- // prop: shadowRenderer
7499
- // Renderer that will draws the shadows on the marker.
7500
- this.shadowRenderer = new $.jqplot.ShadowRenderer();
7501
- // prop: shapeRenderer
7502
- // Renderer that will draw the marker.
7503
- this.shapeRenderer = new $.jqplot.ShapeRenderer();
7504
-
7505
- $.extend(true, this, options);
7506
- };
7507
-
7508
- function getShadowRendererOptions(opts) {
7509
- var sdopt = {angle:opts.shadowAngle, offset:opts.shadowOffset, alpha:opts.shadowAlpha, lineWidth:opts.lineWidth, depth:opts.shadowDepth, closePath:true};
7510
- if (opts.style.indexOf('filled') != -1) {
7511
- sdopt.fill = true;
7512
- }
7513
- if (opts.style.indexOf('ircle') != -1) {
7514
- sdopt.isarc = true;
7515
- sdopt.closePath = false;
7516
- }
7517
- return $.extend(true, {}, sdopt);
7518
- }
7519
-
7520
- function getShapeRendererOptions(opts) {
7521
- var shopt = {fill:false, isarc:false, strokeStyle:opts.color, fillStyle:opts.color, lineWidth:opts.lineWidth, closePath:true};
7522
- if (opts.style.indexOf('filled') != -1) {
7523
- shopt.fill = true;
7524
- }
7525
- if (opts.style.indexOf('ircle') != -1) {
7526
- shopt.isarc = true;
7527
- shopt.closePath = false;
7528
- }
7529
- return $.extend(true, {}, shopt);
7530
- }
7531
-
7532
- $.jqplot.MarkerRenderer.prototype.init = function(options) {
7533
- $.extend(true, this, options);
7534
- };
7535
-
7536
- $.jqplot.MarkerRenderer.prototype.drawDiamond = function(x, y, ctx, fill, options) {
7537
- var opts;
7538
- if (options == null || $.isEmptyObject(options)) {
7539
- opts = this;
7540
- } else {
7541
- opts = $.extend(true, {}, this, options);
7542
- }
7543
- var stretch = 1.2;
7544
- var dx = this.size/2/stretch;
7545
- var dy = this.size/2*stretch;
7546
- var points = [[x-dx, y], [x, y+dy], [x+dx, y], [x, y-dy]];
7547
- if (opts.shadow) {
7548
- this.shadowRenderer.draw(ctx, points, getShadowRendererOptions(opts));
7549
- }
7550
- this.shapeRenderer.draw(ctx, points, getShapeRendererOptions(opts));
7551
- };
7552
-
7553
- $.jqplot.MarkerRenderer.prototype.drawPlus = function(x, y, ctx, fill, options) {
7554
- var opts = $.extend(true, {}, this, options, {closePath:false});
7555
- var stretch = 1.0;
7556
- var dx = opts.size/2*stretch;
7557
- var dy = opts.size/2*stretch;
7558
- var points1 = [[x, y-dy], [x, y+dy]];
7559
- var points2 = [[x+dx, y], [x-dx, y]];
7560
- if (opts.shadow) {
7561
- this.shadowRenderer.draw(ctx, points1, getShadowRendererOptions(opts));
7562
- this.shadowRenderer.draw(ctx, points2, getShadowRendererOptions(opts));
7563
- }
7564
- this.shapeRenderer.draw(ctx, points1, opts);
7565
- this.shapeRenderer.draw(ctx, points2, opts);
7566
- };
7567
-
7568
- $.jqplot.MarkerRenderer.prototype.drawX = function(x, y, ctx, fill, options) {
7569
- var opts = $.extend(true, {}, this, options, {closePath:false});
7570
- var stretch = 1.0;
7571
- var dx = opts.size/2*stretch;
7572
- var dy = opts.size/2*stretch;
7573
- var points1 = [[x-dx, y-dy], [x+dx, y+dy]];
7574
- var points2 = [[x-dx, y+dy], [x+dx, y-dy]];
7575
- if (opts.shadow) {
7576
- this.shadowRenderer.draw(ctx, points1, getShadowRendererOptions(opts));
7577
- this.shadowRenderer.draw(ctx, points2, getShadowRendererOptions(opts));
7578
- }
7579
- this.shapeRenderer.draw(ctx, points1, getShapeRendererOptions(opts));
7580
- this.shapeRenderer.draw(ctx, points2, getShapeRendererOptions(opts));
7581
- };
7582
-
7583
- $.jqplot.MarkerRenderer.prototype.drawDash = function(x, y, ctx, fill, options) {
7584
- var opts;
7585
- if (options == null || $.isEmptyObject(options)) {
7586
- opts = this;
7587
- } else {
7588
- opts = $.extend(true, {}, this, options);
7589
- }
7590
- var stretch = 1.0;
7591
- var dx = this.size/2*stretch;
7592
- var dy = this.size/2*stretch;
7593
- var points = [[x-dx, y], [x+dx, y]];
7594
- if (opts.shadow) {
7595
- this.shadowRenderer.draw(ctx, points);
7596
- }
7597
- this.shapeRenderer.draw(ctx, points, getShapeRendererOptions(opts));
7598
- };
7599
-
7600
- $.jqplot.MarkerRenderer.prototype.drawLine = function(p1, p2, ctx, fill, options) {
7601
- var opts;
7602
- if (options == null || $.isEmptyObject(options)) {
7603
- opts = this;
7604
- } else {
7605
- opts = $.extend(true, {}, this, options);
7606
- }
7607
- var points = [p1, p2];
7608
- if (opts.shadow) {
7609
- this.shadowRenderer.draw(ctx, points, getShadowRendererOptions(opts));
7610
- }
7611
- this.shapeRenderer.draw(ctx, points, getShapeRendererOptions(opts));
7612
- };
7613
-
7614
- $.jqplot.MarkerRenderer.prototype.drawSquare = function(x, y, ctx, fill, options) {
7615
- var opts;
7616
- if (options == null || $.isEmptyObject(options)) {
7617
- opts = this;
7618
- } else {
7619
- opts = $.extend(true, {}, this, options);
7620
- }
7621
- var stretch = 1.0;
7622
- var dx = this.size/2/stretch;
7623
- var dy = this.size/2*stretch;
7624
- var points = [[x-dx, y-dy], [x-dx, y+dy], [x+dx, y+dy], [x+dx, y-dy]];
7625
- if (opts.shadow) {
7626
- this.shadowRenderer.draw(ctx, points, getShadowRendererOptions(opts));
7627
- }
7628
- this.shapeRenderer.draw(ctx, points, getShapeRendererOptions(opts));
7629
- };
7630
-
7631
- $.jqplot.MarkerRenderer.prototype.drawCircle = function(x, y, ctx, fill, options) {
7632
- var opts;
7633
- if (options == null || $.isEmptyObject(options)) {
7634
- opts = this;
7635
- } else {
7636
- opts = $.extend(true, {}, this, options);
7637
- }
7638
- var radius = this.size/2;
7639
- var end = 2*Math.PI;
7640
- var points = [x, y, radius, 0, end, true];
7641
- if (opts.shadow) {
7642
- this.shadowRenderer.draw(ctx, points, getShadowRendererOptions(opts));
7643
- }
7644
- this.shapeRenderer.draw(ctx, points, getShapeRendererOptions(opts));
7645
- };
7646
-
7647
- $.jqplot.MarkerRenderer.prototype.draw = function(x, y, ctx, options) {
7648
- options = options || {};
7649
- // hack here b/c shape renderer uses canvas based color style options
7650
- // and marker uses css style names.
7651
- if (options.show == null || options.show != false) {
7652
- if (options.color && !options.fillStyle) {
7653
- options.fillStyle = options.color;
7654
- }
7655
- if (options.color && !options.strokeStyle) {
7656
- options.strokeStyle = options.color;
7657
- }
7658
- var style = options.style || this.style;
7659
- switch (style) {
7660
- case 'diamond':
7661
- this.drawDiamond(x,y,ctx, false, options);
7662
- break;
7663
- case 'filledDiamond':
7664
- this.drawDiamond(x,y,ctx, true, options);
7665
- break;
7666
- case 'circle':
7667
- this.drawCircle(x,y,ctx, false, options);
7668
- break;
7669
- case 'filledCircle':
7670
- this.drawCircle(x,y,ctx, true, options);
7671
- break;
7672
- case 'square':
7673
- this.drawSquare(x,y,ctx, false, options);
7674
- break;
7675
- case 'filledSquare':
7676
- this.drawSquare(x,y,ctx, true, options);
7677
- break;
7678
- case 'x':
7679
- this.drawX(x,y,ctx, true, options);
7680
- break;
7681
- case 'plus':
7682
- this.drawPlus(x,y,ctx, true, options);
7683
- break;
7684
- case 'dash':
7685
- this.drawDash(x,y,ctx, true, options);
7686
- break;
7687
- case 'line':
7688
- this.drawLine(x, y, ctx, false, options);
7689
- break;
7690
- default:
7691
- this.drawDiamond(x,y,ctx, false, options);
7692
- break;
7693
- }
7694
- }
7695
- };
7696
-
7697
-
7698
- // class: $.jqplot.shadowRenderer
7699
- // The default jqPlot shadow renderer, rendering shadows behind shapes.
7700
- $.jqplot.ShadowRenderer = function(options){
7701
- // Group: Properties
7702
-
7703
- // prop: angle
7704
- // Angle of the shadow in degrees. Measured counter-clockwise from the x axis.
7705
- this.angle = 45;
7706
- // prop: offset
7707
- // Pixel offset at the given shadow angle of each shadow stroke from the last stroke.
7708
- this.offset = 1;
7709
- // prop: alpha
7710
- // alpha transparency of shadow stroke.
7711
- this.alpha = 0.07;
7712
- // prop: lineWidth
7713
- // width of the shadow line stroke.
7714
- this.lineWidth = 1.5;
7715
- // prop: lineJoin
7716
- // How line segments of the shadow are joined.
7717
- this.lineJoin = 'miter';
7718
- // prop: lineCap
7719
- // how ends of the shadow line are rendered.
7720
- this.lineCap = 'round';
7721
- // prop; closePath
7722
- // whether line path segment is closed upon itself.
7723
- this.closePath = false;
7724
- // prop: fill
7725
- // whether to fill the shape.
7726
- this.fill = false;
7727
- // prop: depth
7728
- // how many times the shadow is stroked. Each stroke will be offset by offset at angle degrees.
7729
- this.depth = 3;
7730
- this.strokeStyle = 'rgba(0,0,0,0.1)';
7731
- // prop: isarc
7732
- // whether the shadow is an arc or not.
7733
- this.isarc = false;
7734
-
7735
- $.extend(true, this, options);
7736
- };
7737
-
7738
- $.jqplot.ShadowRenderer.prototype.init = function(options) {
7739
- $.extend(true, this, options);
7740
- };
7741
-
7742
- // function: draw
7743
- // draws an transparent black (i.e. gray) shadow.
7744
- //
7745
- // ctx - canvas drawing context
7746
- // points - array of points or [x, y, radius, start angle (rad), end angle (rad)]
7747
- $.jqplot.ShadowRenderer.prototype.draw = function(ctx, points, options) {
7748
- ctx.save();
7749
- var opts = (options != null) ? options : {};
7750
- var fill = (opts.fill != null) ? opts.fill : this.fill;
7751
- var fillRect = (opts.fillRect != null) ? opts.fillRect : this.fillRect;
7752
- var closePath = (opts.closePath != null) ? opts.closePath : this.closePath;
7753
- var offset = (opts.offset != null) ? opts.offset : this.offset;
7754
- var alpha = (opts.alpha != null) ? opts.alpha : this.alpha;
7755
- var depth = (opts.depth != null) ? opts.depth : this.depth;
7756
- var isarc = (opts.isarc != null) ? opts.isarc : this.isarc;
7757
- var linePattern = (opts.linePattern != null) ? opts.linePattern : this.linePattern;
7758
- ctx.lineWidth = (opts.lineWidth != null) ? opts.lineWidth : this.lineWidth;
7759
- ctx.lineJoin = (opts.lineJoin != null) ? opts.lineJoin : this.lineJoin;
7760
- ctx.lineCap = (opts.lineCap != null) ? opts.lineCap : this.lineCap;
7761
- ctx.strokeStyle = opts.strokeStyle || this.strokeStyle || 'rgba(0,0,0,'+alpha+')';
7762
- ctx.fillStyle = opts.fillStyle || this.fillStyle || 'rgba(0,0,0,'+alpha+')';
7763
- for (var j=0; j<depth; j++) {
7764
- var ctxPattern = $.jqplot.LinePattern(ctx, linePattern);
7765
- ctx.translate(Math.cos(this.angle*Math.PI/180)*offset, Math.sin(this.angle*Math.PI/180)*offset);
7766
- ctxPattern.beginPath();
7767
- if (isarc) {
7768
- ctx.arc(points[0], points[1], points[2], points[3], points[4], true);
7769
- }
7770
- else if (fillRect) {
7771
- if (fillRect) {
7772
- ctx.fillRect(points[0], points[1], points[2], points[3]);
7773
- }
7774
- }
7775
- else if (points && points.length){
7776
- var move = true;
7777
- for (var i=0; i<points.length; i++) {
7778
- // skip to the first non-null point and move to it.
7779
- if (points[i][0] != null && points[i][1] != null) {
7780
- if (move) {
7781
- ctxPattern.moveTo(points[i][0], points[i][1]);
7782
- move = false;
7783
- }
7784
- else {
7785
- ctxPattern.lineTo(points[i][0], points[i][1]);
7786
- }
7787
- }
7788
- else {
7789
- move = true;
7790
- }
7791
- }
7792
-
7793
- }
7794
- if (closePath) {
7795
- ctxPattern.closePath();
7796
- }
7797
- if (fill) {
7798
- ctx.fill();
7799
- }
7800
- else {
7801
- ctx.stroke();
7802
- }
7803
- }
7804
- ctx.restore();
7805
- };
7806
-
7807
- // class: $.jqplot.shapeRenderer
7808
- // The default jqPlot shape renderer. Given a set of points will
7809
- // plot them and either stroke a line (fill = false) or fill them (fill = true).
7810
- // If a filled shape is desired, closePath = true must also be set to close
7811
- // the shape.
7812
- $.jqplot.ShapeRenderer = function(options){
7813
-
7814
- this.lineWidth = 1.5;
7815
- // prop: linePattern
7816
- // line pattern 'dashed', 'dotted', 'solid', some combination
7817
- // of '-' and '.' characters such as '.-.' or a numerical array like
7818
- // [draw, skip, draw, skip, ...] such as [1, 10] to draw a dotted line,
7819
- // [1, 10, 20, 10] to draw a dot-dash line, and so on.
7820
- this.linePattern = 'solid';
7821
- // prop: lineJoin
7822
- // How line segments of the shadow are joined.
7823
- this.lineJoin = 'miter';
7824
- // prop: lineCap
7825
- // how ends of the shadow line are rendered.
7826
- this.lineCap = 'round';
7827
- // prop; closePath
7828
- // whether line path segment is closed upon itself.
7829
- this.closePath = false;
7830
- // prop: fill
7831
- // whether to fill the shape.
7832
- this.fill = false;
7833
- // prop: isarc
7834
- // whether the shadow is an arc or not.
7835
- this.isarc = false;
7836
- // prop: fillRect
7837
- // true to draw shape as a filled rectangle.
7838
- this.fillRect = false;
7839
- // prop: strokeRect
7840
- // true to draw shape as a stroked rectangle.
7841
- this.strokeRect = false;
7842
- // prop: clearRect
7843
- // true to cear a rectangle.
7844
- this.clearRect = false;
7845
- // prop: strokeStyle
7846
- // css color spec for the stoke style
7847
- this.strokeStyle = '#999999';
7848
- // prop: fillStyle
7849
- // css color spec for the fill style.
7850
- this.fillStyle = '#999999';
7851
-
7852
- $.extend(true, this, options);
7853
- };
7854
-
7855
- $.jqplot.ShapeRenderer.prototype.init = function(options) {
7856
- $.extend(true, this, options);
7857
- };
7858
-
7859
- // function: draw
7860
- // draws the shape.
7861
- //
7862
- // ctx - canvas drawing context
7863
- // points - array of points for shapes or
7864
- // [x, y, width, height] for rectangles or
7865
- // [x, y, radius, start angle (rad), end angle (rad)] for circles and arcs.
7866
- $.jqplot.ShapeRenderer.prototype.draw = function(ctx, points, options) {
7867
- ctx.save();
7868
- var opts = (options != null) ? options : {};
7869
- var fill = (opts.fill != null) ? opts.fill : this.fill;
7870
- var closePath = (opts.closePath != null) ? opts.closePath : this.closePath;
7871
- var fillRect = (opts.fillRect != null) ? opts.fillRect : this.fillRect;
7872
- var strokeRect = (opts.strokeRect != null) ? opts.strokeRect : this.strokeRect;
7873
- var clearRect = (opts.clearRect != null) ? opts.clearRect : this.clearRect;
7874
- var isarc = (opts.isarc != null) ? opts.isarc : this.isarc;
7875
- var linePattern = (opts.linePattern != null) ? opts.linePattern : this.linePattern;
7876
- var ctxPattern = $.jqplot.LinePattern(ctx, linePattern);
7877
- ctx.lineWidth = opts.lineWidth || this.lineWidth;
7878
- ctx.lineJoin = opts.lineJoin || this.lineJoin;
7879
- ctx.lineCap = opts.lineCap || this.lineCap;
7880
- ctx.strokeStyle = (opts.strokeStyle || opts.color) || this.strokeStyle;
7881
- ctx.fillStyle = opts.fillStyle || this.fillStyle;
7882
- ctx.beginPath();
7883
- if (isarc) {
7884
- ctx.arc(points[0], points[1], points[2], points[3], points[4], true);
7885
- if (closePath) {
7886
- ctx.closePath();
7887
- }
7888
- if (fill) {
7889
- ctx.fill();
7890
- }
7891
- else {
7892
- ctx.stroke();
7893
- }
7894
- ctx.restore();
7895
- return;
7896
- }
7897
- else if (clearRect) {
7898
- ctx.clearRect(points[0], points[1], points[2], points[3]);
7899
- ctx.restore();
7900
- return;
7901
- }
7902
- else if (fillRect || strokeRect) {
7903
- if (fillRect) {
7904
- ctx.fillRect(points[0], points[1], points[2], points[3]);
7905
- }
7906
- if (strokeRect) {
7907
- ctx.strokeRect(points[0], points[1], points[2], points[3]);
7908
- ctx.restore();
7909
- return;
7910
- }
7911
- }
7912
- else if (points && points.length){
7913
- var move = true;
7914
- for (var i=0; i<points.length; i++) {
7915
- // skip to the first non-null point and move to it.
7916
- if (points[i][0] != null && points[i][1] != null) {
7917
- if (move) {
7918
- ctxPattern.moveTo(points[i][0], points[i][1]);
7919
- move = false;
7920
- }
7921
- else {
7922
- ctxPattern.lineTo(points[i][0], points[i][1]);
7923
- }
7924
- }
7925
- else {
7926
- move = true;
7927
- }
7928
- }
7929
- if (closePath) {
7930
- ctxPattern.closePath();
7931
- }
7932
- if (fill) {
7933
- ctx.fill();
7934
- }
7935
- else {
7936
- ctx.stroke();
7937
- }
7938
- }
7939
- ctx.restore();
7940
- };
7941
-
7942
- // class $.jqplot.TableLegendRenderer
7943
- // The default legend renderer for jqPlot.
7944
- $.jqplot.TableLegendRenderer = function(){
7945
- //
7946
- };
7947
-
7948
- $.jqplot.TableLegendRenderer.prototype.init = function(options) {
7949
- $.extend(true, this, options);
7950
- };
7951
-
7952
- $.jqplot.TableLegendRenderer.prototype.addrow = function (label, color, pad, reverse) {
7953
- var rs = (pad) ? this.rowSpacing+'px' : '0px';
7954
- var tr;
7955
- var td;
7956
- var elem;
7957
- var div0;
7958
- var div1;
7959
- elem = document.createElement('tr');
7960
- tr = $(elem);
7961
- tr.addClass('jqplot-table-legend');
7962
- elem = null;
7963
-
7964
- if (reverse){
7965
- tr.prependTo(this._elem);
7966
- }
7967
-
7968
- else{
7969
- tr.appendTo(this._elem);
7970
- }
7971
-
7972
- if (this.showSwatches) {
7973
- td = $(document.createElement('td'));
7974
- td.addClass('jqplot-table-legend jqplot-table-legend-swatch');
7975
- td.css({textAlign: 'center', paddingTop: rs});
7976
-
7977
- div0 = $(document.createElement('div'));
7978
- div0.addClass('jqplot-table-legend-swatch-outline');
7979
- div1 = $(document.createElement('div'));
7980
- div1.addClass('jqplot-table-legend-swatch');
7981
- div1.css({backgroundColor: color, borderColor: color});
7982
-
7983
- tr.append(td.append(div0.append(div1)));
7984
-
7985
- // $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
7986
- // '<div><div class="jqplot-table-legend-swatch" style="background-color:'+color+';border-color:'+color+';"></div>'+
7987
- // '</div></td>').appendTo(tr);
7988
- }
7989
- if (this.showLabels) {
7990
- td = $(document.createElement('td'));
7991
- td.addClass('jqplot-table-legend jqplot-table-legend-label');
7992
- td.css('paddingTop', rs);
7993
- tr.append(td);
7994
-
7995
- // elem = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
7996
- // elem.appendTo(tr);
7997
- if (this.escapeHtml) {
7998
- td.text(label);
7999
- }
8000
- else {
8001
- td.html(label);
8002
- }
8003
- }
8004
- td = null;
8005
- div0 = null;
8006
- div1 = null;
8007
- tr = null;
8008
- elem = null;
8009
- };
8010
-
8011
- // called with scope of legend
8012
- $.jqplot.TableLegendRenderer.prototype.draw = function() {
8013
- if (this._elem) {
8014
- this._elem.emptyForce();
8015
- this._elem = null;
8016
- }
8017
-
8018
- if (this.show) {
8019
- var series = this._series;
8020
- // make a table. one line label per row.
8021
- var elem = document.createElement('table');
8022
- this._elem = $(elem);
8023
- this._elem.addClass('jqplot-table-legend');
8024
-
8025
- var ss = {position:'absolute'};
8026
- if (this.background) {
8027
- ss['background'] = this.background;
8028
- }
8029
- if (this.border) {
8030
- ss['border'] = this.border;
8031
- }
8032
- if (this.fontSize) {
8033
- ss['fontSize'] = this.fontSize;
8034
- }
8035
- if (this.fontFamily) {
8036
- ss['fontFamily'] = this.fontFamily;
8037
- }
8038
- if (this.textColor) {
8039
- ss['textColor'] = this.textColor;
8040
- }
8041
- if (this.marginTop != null) {
8042
- ss['marginTop'] = this.marginTop;
8043
- }
8044
- if (this.marginBottom != null) {
8045
- ss['marginBottom'] = this.marginBottom;
8046
- }
8047
- if (this.marginLeft != null) {
8048
- ss['marginLeft'] = this.marginLeft;
8049
- }
8050
- if (this.marginRight != null) {
8051
- ss['marginRight'] = this.marginRight;
8052
- }
8053
-
8054
-
8055
- var pad = false,
8056
- reverse = false,
8057
- s;
8058
- for (var i = 0; i< series.length; i++) {
8059
- s = series[i];
8060
- if (s._stack || s.renderer.constructor == $.jqplot.BezierCurveRenderer){
8061
- reverse = true;
8062
- }
8063
- if (s.show && s.showLabel) {
8064
- var lt = this.labels[i] || s.label.toString();
8065
- if (lt) {
8066
- var color = s.color;
8067
- if (reverse && i < series.length - 1){
8068
- pad = true;
8069
- }
8070
- else if (reverse && i == series.length - 1){
8071
- pad = false;
8072
- }
8073
- this.renderer.addrow.call(this, lt, color, pad, reverse);
8074
- pad = true;
8075
- }
8076
- // let plugins add more rows to legend. Used by trend line plugin.
8077
- for (var j=0; j<$.jqplot.addLegendRowHooks.length; j++) {
8078
- var item = $.jqplot.addLegendRowHooks[j].call(this, s);
8079
- if (item) {
8080
- this.renderer.addrow.call(this, item.label, item.color, pad);
8081
- pad = true;
8082
- }
8083
- }
8084
- lt = null;
8085
- }
8086
- }
8087
- }
8088
- return this._elem;
8089
- };
8090
-
8091
- $.jqplot.TableLegendRenderer.prototype.pack = function(offsets) {
8092
- if (this.show) {
8093
- if (this.placement == 'insideGrid') {
8094
- switch (this.location) {
8095
- case 'nw':
8096
- var a = offsets.left;
8097
- var b = offsets.top;
8098
- this._elem.css('left', a);
8099
- this._elem.css('top', b);
8100
- break;
8101
- case 'n':
8102
- var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
8103
- var b = offsets.top;
8104
- this._elem.css('left', a);
8105
- this._elem.css('top', b);
8106
- break;
8107
- case 'ne':
8108
- var a = offsets.right;
8109
- var b = offsets.top;
8110
- this._elem.css({right:a, top:b});
8111
- break;
8112
- case 'e':
8113
- var a = offsets.right;
8114
- var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
8115
- this._elem.css({right:a, top:b});
8116
- break;
8117
- case 'se':
8118
- var a = offsets.right;
8119
- var b = offsets.bottom;
8120
- this._elem.css({right:a, bottom:b});
8121
- break;
8122
- case 's':
8123
- var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
8124
- var b = offsets.bottom;
8125
- this._elem.css({left:a, bottom:b});
8126
- break;
8127
- case 'sw':
8128
- var a = offsets.left;
8129
- var b = offsets.bottom;
8130
- this._elem.css({left:a, bottom:b});
8131
- break;
8132
- case 'w':
8133
- var a = offsets.left;
8134
- var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
8135
- this._elem.css({left:a, top:b});
8136
- break;
8137
- default: // same as 'se'
8138
- var a = offsets.right;
8139
- var b = offsets.bottom;
8140
- this._elem.css({right:a, bottom:b});
8141
- break;
8142
- }
8143
-
8144
- }
8145
- else if (this.placement == 'outside'){
8146
- switch (this.location) {
8147
- case 'nw':
8148
- var a = this._plotDimensions.width - offsets.left;
8149
- var b = offsets.top;
8150
- this._elem.css('right', a);
8151
- this._elem.css('top', b);
8152
- break;
8153
- case 'n':
8154
- var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
8155
- var b = this._plotDimensions.height - offsets.top;
8156
- this._elem.css('left', a);
8157
- this._elem.css('bottom', b);
8158
- break;
8159
- case 'ne':
8160
- var a = this._plotDimensions.width - offsets.right;
8161
- var b = offsets.top;
8162
- this._elem.css({left:a, top:b});
8163
- break;
8164
- case 'e':
8165
- var a = this._plotDimensions.width - offsets.right;
8166
- var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
8167
- this._elem.css({left:a, top:b});
8168
- break;
8169
- case 'se':
8170
- var a = this._plotDimensions.width - offsets.right;
8171
- var b = offsets.bottom;
8172
- this._elem.css({left:a, bottom:b});
8173
- break;
8174
- case 's':
8175
- var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
8176
- var b = this._plotDimensions.height - offsets.bottom;
8177
- this._elem.css({left:a, top:b});
8178
- break;
8179
- case 'sw':
8180
- var a = this._plotDimensions.width - offsets.left;
8181
- var b = offsets.bottom;
8182
- this._elem.css({right:a, bottom:b});
8183
- break;
8184
- case 'w':
8185
- var a = this._plotDimensions.width - offsets.left;
8186
- var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
8187
- this._elem.css({right:a, top:b});
8188
- break;
8189
- default: // same as 'se'
8190
- var a = offsets.right;
8191
- var b = offsets.bottom;
8192
- this._elem.css({right:a, bottom:b});
8193
- break;
8194
- }
8195
- }
8196
- else {
8197
- switch (this.location) {
8198
- case 'nw':
8199
- this._elem.css({left:0, top:offsets.top});
8200
- break;
8201
- case 'n':
8202
- var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
8203
- this._elem.css({left: a, top:offsets.top});
8204
- break;
8205
- case 'ne':
8206
- this._elem.css({right:0, top:offsets.top});
8207
- break;
8208
- case 'e':
8209
- var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
8210
- this._elem.css({right:offsets.right, top:b});
8211
- break;
8212
- case 'se':
8213
- this._elem.css({right:offsets.right, bottom:offsets.bottom});
8214
- break;
8215
- case 's':
8216
- var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
8217
- this._elem.css({left: a, bottom:offsets.bottom});
8218
- break;
8219
- case 'sw':
8220
- this._elem.css({left:offsets.left, bottom:offsets.bottom});
8221
- break;
8222
- case 'w':
8223
- var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
8224
- this._elem.css({left:offsets.left, top:b});
8225
- break;
8226
- default: // same as 'se'
8227
- this._elem.css({right:offsets.right, bottom:offsets.bottom});
8228
- break;
8229
- }
8230
- }
8231
- }
8232
- };
8233
-
8234
- /**
8235
- * Class: $.jqplot.ThemeEngine
8236
- * Theme Engine provides a programatic way to change some of the more
8237
- * common jqplot styling options such as fonts, colors and grid options.
8238
- * A theme engine instance is created with each plot. The theme engine
8239
- * manages a collection of themes which can be modified, added to, or
8240
- * applied to the plot.
8241
- *
8242
- * The themeEngine class is not instantiated directly.
8243
- * When a plot is initialized, the current plot options are scanned
8244
- * an a default theme named "Default" is created. This theme is
8245
- * used as the basis for other themes added to the theme engine and
8246
- * is always available.
8247
- *
8248
- * A theme is a simple javascript object with styling parameters for
8249
- * various entities of the plot. A theme has the form:
8250
- *
8251
- *
8252
- * > {
8253
- * > _name:f "Default",
8254
- * > target: {
8255
- * > backgroundColor: "transparent"
8256
- * > },
8257
- * > legend: {
8258
- * > textColor: null,
8259
- * > fontFamily: null,
8260
- * > fontSize: null,
8261
- * > border: null,
8262
- * > background: null
8263
- * > },
8264
- * > title: {
8265
- * > textColor: "rgb(102, 102, 102)",
8266
- * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif",
8267
- * > fontSize: "19.2px",
8268
- * > textAlign: "center"
8269
- * > },
8270
- * > seriesStyles: {},
8271
- * > series: [{
8272
- * > color: "#4bb2c5",
8273
- * > lineWidth: 2.5,
8274
- * > linePattern: "solid",
8275
- * > shadow: true,
8276
- * > fillColor: "#4bb2c5",
8277
- * > showMarker: true,
8278
- * > markerOptions: {
8279
- * > color: "#4bb2c5",
8280
- * > show: true,
8281
- * > style: 'filledCircle',
8282
- * > lineWidth: 1.5,
8283
- * > size: 4,
8284
- * > shadow: true
8285
- * > }
8286
- * > }],
8287
- * > grid: {
8288
- * > drawGridlines: true,
8289
- * > gridLineColor: "#cccccc",
8290
- * > gridLineWidth: 1,
8291
- * > backgroundColor: "#fffdf6",
8292
- * > borderColor: "#999999",
8293
- * > borderWidth: 2,
8294
- * > shadow: true
8295
- * > },
8296
- * > axesStyles: {
8297
- * > label: {},
8298
- * > ticks: {}
8299
- * > },
8300
- * > axes: {
8301
- * > xaxis: {
8302
- * > borderColor: "#999999",
8303
- * > borderWidth: 2,
8304
- * > ticks: {
8305
- * > show: true,
8306
- * > showGridline: true,
8307
- * > showLabel: true,
8308
- * > showMark: true,
8309
- * > size: 4,
8310
- * > textColor: "",
8311
- * > whiteSpace: "nowrap",
8312
- * > fontSize: "12px",
8313
- * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif"
8314
- * > },
8315
- * > label: {
8316
- * > textColor: "rgb(102, 102, 102)",
8317
- * > whiteSpace: "normal",
8318
- * > fontSize: "14.6667px",
8319
- * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif",
8320
- * > fontWeight: "400"
8321
- * > }
8322
- * > },
8323
- * > yaxis: {
8324
- * > borderColor: "#999999",
8325
- * > borderWidth: 2,
8326
- * > ticks: {
8327
- * > show: true,
8328
- * > showGridline: true,
8329
- * > showLabel: true,
8330
- * > showMark: true,
8331
- * > size: 4,
8332
- * > textColor: "",
8333
- * > whiteSpace: "nowrap",
8334
- * > fontSize: "12px",
8335
- * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif"
8336
- * > },
8337
- * > label: {
8338
- * > textColor: null,
8339
- * > whiteSpace: null,
8340
- * > fontSize: null,
8341
- * > fontFamily: null,
8342
- * > fontWeight: null
8343
- * > }
8344
- * > },
8345
- * > x2axis: {...
8346
- * > },
8347
- * > ...
8348
- * > y9axis: {...
8349
- * > }
8350
- * > }
8351
- * > }
8352
- *
8353
- * "seriesStyles" is a style object that will be applied to all series in the plot.
8354
- * It will forcibly override any styles applied on the individual series. "axesStyles" is
8355
- * a style object that will be applied to all axes in the plot. It will also forcibly
8356
- * override any styles on the individual axes.
8357
- *
8358
- * The example shown above has series options for a line series. Options for other
8359
- * series types are shown below:
8360
- *
8361
- * Bar Series:
8362
- *
8363
- * > {
8364
- * > color: "#4bb2c5",
8365
- * > seriesColors: ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"],
8366
- * > lineWidth: 2.5,
8367
- * > shadow: true,
8368
- * > barPadding: 2,
8369
- * > barMargin: 10,
8370
- * > barWidth: 15.09375,
8371
- * > highlightColors: ["rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)"]
8372
- * > }
8373
- *
8374
- * Pie Series:
8375
- *
8376
- * > {
8377
- * > seriesColors: ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"],
8378
- * > padding: 20,
8379
- * > sliceMargin: 0,
8380
- * > fill: true,
8381
- * > shadow: true,
8382
- * > startAngle: 0,
8383
- * > lineWidth: 2.5,
8384
- * > highlightColors: ["rgb(129,201,214)", "rgb(240,189,104)", "rgb(214,202,165)", "rgb(137,180,158)", "rgb(168,180,137)", "rgb(180,174,89)", "rgb(180,113,161)", "rgb(129,141,236)", "rgb(227,205,120)", "rgb(255,138,76)", "rgb(76,169,219)", "rgb(215,126,190)", "rgb(220,232,135)", "rgb(200,167,96)", "rgb(103,202,235)", "rgb(208,154,215)"]
8385
- * > }
8386
- *
8387
- * Funnel Series:
8388
- *
8389
- * > {
8390
- * > color: "#4bb2c5",
8391
- * > lineWidth: 2,
8392
- * > shadow: true,
8393
- * > padding: {
8394
- * > top: 20,
8395
- * > right: 20,
8396
- * > bottom: 20,
8397
- * > left: 20
8398
- * > },
8399
- * > sectionMargin: 6,
8400
- * > seriesColors: ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"],
8401
- * > highlightColors: ["rgb(147,208,220)", "rgb(242,199,126)", "rgb(220,210,178)", "rgb(154,191,172)", "rgb(180,191,154)", "rgb(191,186,112)", "rgb(191,133,174)", "rgb(147,157,238)", "rgb(231,212,139)", "rgb(255,154,102)", "rgb(102,181,224)", "rgb(221,144,199)", "rgb(225,235,152)", "rgb(200,167,96)", "rgb(124,210,238)", "rgb(215,169,221)"]
8402
- * > }
8403
- *
8404
- */
8405
- $.jqplot.ThemeEngine = function(){
8406
- // Group: Properties
8407
- //
8408
- // prop: themes
8409
- // hash of themes managed by the theme engine.
8410
- // Indexed by theme name.
8411
- this.themes = {};
8412
- // prop: activeTheme
8413
- // Pointer to currently active theme
8414
- this.activeTheme=null;
8415
-
8416
- };
8417
-
8418
- // called with scope of plot
8419
- $.jqplot.ThemeEngine.prototype.init = function() {
8420
- // get the Default theme from the current plot settings.
8421
- var th = new $.jqplot.Theme({_name:'Default'});
8422
- var n, i, nn;
8423
-
8424
- for (n in th.target) {
8425
- if (n == "textColor") {
8426
- th.target[n] = this.target.css('color');
8427
- }
8428
- else {
8429
- th.target[n] = this.target.css(n);
8430
- }
8431
- }
8432
-
8433
- if (this.title.show && this.title._elem) {
8434
- for (n in th.title) {
8435
- if (n == "textColor") {
8436
- th.title[n] = this.title._elem.css('color');
8437
- }
8438
- else {
8439
- th.title[n] = this.title._elem.css(n);
8440
- }
8441
- }
8442
- }
8443
-
8444
- for (n in th.grid) {
8445
- th.grid[n] = this.grid[n];
8446
- }
8447
- if (th.grid.backgroundColor == null && this.grid.background != null) {
8448
- th.grid.backgroundColor = this.grid.background;
8449
- }
8450
- if (this.legend.show && this.legend._elem) {
8451
- for (n in th.legend) {
8452
- if (n == 'textColor') {
8453
- th.legend[n] = this.legend._elem.css('color');
8454
- }
8455
- else {
8456
- th.legend[n] = this.legend._elem.css(n);
8457
- }
8458
- }
8459
- }
8460
- var s;
8461
-
8462
- for (i=0; i<this.series.length; i++) {
8463
- s = this.series[i];
8464
- if (s.renderer.constructor == $.jqplot.LineRenderer) {
8465
- th.series.push(new LineSeriesProperties());
8466
- }
8467
- else if (s.renderer.constructor == $.jqplot.BarRenderer) {
8468
- th.series.push(new BarSeriesProperties());
8469
- }
8470
- else if (s.renderer.constructor == $.jqplot.PieRenderer) {
8471
- th.series.push(new PieSeriesProperties());
8472
- }
8473
- else if (s.renderer.constructor == $.jqplot.DonutRenderer) {
8474
- th.series.push(new DonutSeriesProperties());
8475
- }
8476
- else if (s.renderer.constructor == $.jqplot.FunnelRenderer) {
8477
- th.series.push(new FunnelSeriesProperties());
8478
- }
8479
- else if (s.renderer.constructor == $.jqplot.MeterGaugeRenderer) {
8480
- th.series.push(new MeterSeriesProperties());
8481
- }
8482
- else {
8483
- th.series.push({});
8484
- }
8485
- for (n in th.series[i]) {
8486
- th.series[i][n] = s[n];
8487
- }
8488
- }
8489
- var a, ax;
8490
- for (n in this.axes) {
8491
- ax = this.axes[n];
8492
- a = th.axes[n] = new AxisProperties();
8493
- a.borderColor = ax.borderColor;
8494
- a.borderWidth = ax.borderWidth;
8495
- if (ax._ticks && ax._ticks[0]) {
8496
- for (nn in a.ticks) {
8497
- if (ax._ticks[0].hasOwnProperty(nn)) {
8498
- a.ticks[nn] = ax._ticks[0][nn];
8499
- }
8500
- else if (ax._ticks[0]._elem){
8501
- a.ticks[nn] = ax._ticks[0]._elem.css(nn);
8502
- }
8503
- }
8504
- }
8505
- if (ax._label && ax._label.show) {
8506
- for (nn in a.label) {
8507
- // a.label[nn] = ax._label._elem.css(nn);
8508
- if (ax._label[nn]) {
8509
- a.label[nn] = ax._label[nn];
8510
- }
8511
- else if (ax._label._elem){
8512
- if (nn == 'textColor') {
8513
- a.label[nn] = ax._label._elem.css('color');
8514
- }
8515
- else {
8516
- a.label[nn] = ax._label._elem.css(nn);
8517
- }
8518
- }
8519
- }
8520
- }
8521
- }
8522
- this.themeEngine._add(th);
8523
- this.themeEngine.activeTheme = this.themeEngine.themes[th._name];
8524
- };
8525
- /**
8526
- * Group: methods
8527
- *
8528
- * method: get
8529
- *
8530
- * Get and return the named theme or the active theme if no name given.
8531
- *
8532
- * parameter:
8533
- *
8534
- * name - name of theme to get.
8535
- *
8536
- * returns:
8537
- *
8538
- * Theme instance of given name.
8539
- */
8540
- $.jqplot.ThemeEngine.prototype.get = function(name) {
8541
- if (!name) {
8542
- // return the active theme
8543
- return this.activeTheme;
8544
- }
8545
- else {
8546
- return this.themes[name];
8547
- }
8548
- };
8549
-
8550
- function numericalOrder(a,b) { return a-b; }
8551
-
8552
- /**
8553
- * method: getThemeNames
8554
- *
8555
- * Return the list of theme names in this manager in alpha-numerical order.
8556
- *
8557
- * parameter:
8558
- *
8559
- * None
8560
- *
8561
- * returns:
8562
- *
8563
- * A the list of theme names in this manager in alpha-numerical order.
8564
- */
8565
- $.jqplot.ThemeEngine.prototype.getThemeNames = function() {
8566
- var tn = [];
8567
- for (var n in this.themes) {
8568
- tn.push(n);
8569
- }
8570
- return tn.sort(numericalOrder);
8571
- };
8572
-
8573
- /**
8574
- * method: getThemes
8575
- *
8576
- * Return a list of themes in alpha-numerical order by name.
8577
- *
8578
- * parameter:
8579
- *
8580
- * None
8581
- *
8582
- * returns:
8583
- *
8584
- * A list of themes in alpha-numerical order by name.
8585
- */
8586
- $.jqplot.ThemeEngine.prototype.getThemes = function() {
8587
- var tn = [];
8588
- var themes = [];
8589
- for (var n in this.themes) {
8590
- tn.push(n);
8591
- }
8592
- tn.sort(numericalOrder);
8593
- for (var i=0; i<tn.length; i++) {
8594
- themes.push(this.themes[tn[i]]);
8595
- }
8596
- return themes;
8597
- };
8598
-
8599
- $.jqplot.ThemeEngine.prototype.activate = function(plot, name) {
8600
- // sometimes need to redraw whole plot.
8601
- var redrawPlot = false;
8602
- if (!name && this.activeTheme && this.activeTheme._name) {
8603
- name = this.activeTheme._name;
8604
- }
8605
- if (!this.themes.hasOwnProperty(name)) {
8606
- throw new Error("No theme of that name");
8607
- }
8608
- else {
8609
- var th = this.themes[name];
8610
- this.activeTheme = th;
8611
- var val, checkBorderColor = false, checkBorderWidth = false;
8612
- var arr = ['xaxis', 'x2axis', 'yaxis', 'y2axis'];
8613
-
8614
- for (i=0; i<arr.length; i++) {
8615
- var ax = arr[i];
8616
- if (th.axesStyles.borderColor != null) {
8617
- plot.axes[ax].borderColor = th.axesStyles.borderColor;
8618
- }
8619
- if (th.axesStyles.borderWidth != null) {
8620
- plot.axes[ax].borderWidth = th.axesStyles.borderWidth;
8621
- }
8622
- }
8623
-
8624
- for (var axname in plot.axes) {
8625
- var axis = plot.axes[axname];
8626
- if (axis.show) {
8627
- var thaxis = th.axes[axname] || {};
8628
- var thaxstyle = th.axesStyles;
8629
- var thax = $.jqplot.extend(true, {}, thaxis, thaxstyle);
8630
- val = (th.axesStyles.borderColor != null) ? th.axesStyles.borderColor : thax.borderColor;
8631
- if (thax.borderColor != null) {
8632
- axis.borderColor = thax.borderColor;
8633
- redrawPlot = true;
8634
- }
8635
- val = (th.axesStyles.borderWidth != null) ? th.axesStyles.borderWidth : thax.borderWidth;
8636
- if (thax.borderWidth != null) {
8637
- axis.borderWidth = thax.borderWidth;
8638
- redrawPlot = true;
8639
- }
8640
- if (axis._ticks && axis._ticks[0]) {
8641
- for (var nn in thax.ticks) {
8642
- // val = null;
8643
- // if (th.axesStyles.ticks && th.axesStyles.ticks[nn] != null) {
8644
- // val = th.axesStyles.ticks[nn];
8645
- // }
8646
- // else if (thax.ticks[nn] != null){
8647
- // val = thax.ticks[nn]
8648
- // }
8649
- val = thax.ticks[nn];
8650
- if (val != null) {
8651
- axis.tickOptions[nn] = val;
8652
- axis._ticks = [];
8653
- redrawPlot = true;
8654
- }
8655
- }
8656
- }
8657
- if (axis._label && axis._label.show) {
8658
- for (var nn in thax.label) {
8659
- // val = null;
8660
- // if (th.axesStyles.label && th.axesStyles.label[nn] != null) {
8661
- // val = th.axesStyles.label[nn];
8662
- // }
8663
- // else if (thax.label && thax.label[nn] != null){
8664
- // val = thax.label[nn]
8665
- // }
8666
- val = thax.label[nn];
8667
- if (val != null) {
8668
- axis.labelOptions[nn] = val;
8669
- redrawPlot = true;
8670
- }
8671
- }
8672
- }
8673
-
8674
- }
8675
- }
8676
-
8677
- for (var n in th.grid) {
8678
- if (th.grid[n] != null) {
8679
- plot.grid[n] = th.grid[n];
8680
- }
8681
- }
8682
- if (!redrawPlot) {
8683
- plot.grid.draw();
8684
- }
8685
-
8686
- if (plot.legend.show) {
8687
- for (n in th.legend) {
8688
- if (th.legend[n] != null) {
8689
- plot.legend[n] = th.legend[n];
8690
- }
8691
- }
8692
- }
8693
- if (plot.title.show) {
8694
- for (n in th.title) {
8695
- if (th.title[n] != null) {
8696
- plot.title[n] = th.title[n];
8697
- }
8698
- }
8699
- }
8700
-
8701
- var i;
8702
- for (i=0; i<th.series.length; i++) {
8703
- var opts = {};
8704
- var redrawSeries = false;
8705
- for (n in th.series[i]) {
8706
- val = (th.seriesStyles[n] != null) ? th.seriesStyles[n] : th.series[i][n];
8707
- if (val != null) {
8708
- opts[n] = val;
8709
- if (n == 'color') {
8710
- plot.series[i].renderer.shapeRenderer.fillStyle = val;
8711
- plot.series[i].renderer.shapeRenderer.strokeStyle = val;
8712
- plot.series[i][n] = val;
8713
- }
8714
- else if ((n == 'lineWidth') || (n == 'linePattern')) {
8715
- plot.series[i].renderer.shapeRenderer[n] = val;
8716
- plot.series[i][n] = val;
8717
- }
8718
- else if (n == 'markerOptions') {
8719
- merge (plot.series[i].markerOptions, val);
8720
- merge (plot.series[i].markerRenderer, val);
8721
- }
8722
- else {
8723
- plot.series[i][n] = val;
8724
- }
8725
- redrawPlot = true;
8726
- }
8727
- }
8728
- }
8729
-
8730
- if (redrawPlot) {
8731
- plot.target.empty();
8732
- plot.draw();
8733
- }
8734
-
8735
- for (n in th.target) {
8736
- if (th.target[n] != null) {
8737
- plot.target.css(n, th.target[n]);
8738
- }
8739
- }
8740
- }
8741
-
8742
- };
8743
-
8744
- $.jqplot.ThemeEngine.prototype._add = function(theme, name) {
8745
- if (name) {
8746
- theme._name = name;
8747
- }
8748
- if (!theme._name) {
8749
- theme._name = Date.parse(new Date());
8750
- }
8751
- if (!this.themes.hasOwnProperty(theme._name)) {
8752
- this.themes[theme._name] = theme;
8753
- }
8754
- else {
8755
- throw new Error("jqplot.ThemeEngine Error: Theme already in use");
8756
- }
8757
- };
8758
-
8759
- // method remove
8760
- // Delete the named theme, return true on success, false on failure.
8761
-
8762
-
8763
- /**
8764
- * method: remove
8765
- *
8766
- * Remove the given theme from the themeEngine.
8767
- *
8768
- * parameters:
8769
- *
8770
- * name - name of the theme to remove.
8771
- *
8772
- * returns:
8773
- *
8774
- * true on success, false on failure.
8775
- */
8776
- $.jqplot.ThemeEngine.prototype.remove = function(name) {
8777
- if (name == 'Default') {
8778
- return false;
8779
- }
8780
- return delete this.themes[name];
8781
- };
8782
-
8783
- /**
8784
- * method: newTheme
8785
- *
8786
- * Create a new theme based on the default theme, adding it the themeEngine.
8787
- *
8788
- * parameters:
8789
- *
8790
- * name - name of the new theme.
8791
- * obj - optional object of styles to be applied to this new theme.
8792
- *
8793
- * returns:
8794
- *
8795
- * new Theme object.
8796
- */
8797
- $.jqplot.ThemeEngine.prototype.newTheme = function(name, obj) {
8798
- if (typeof(name) == 'object') {
8799
- obj = obj || name;
8800
- name = null;
8801
- }
8802
- if (obj && obj._name) {
8803
- name = obj._name;
8804
- }
8805
- else {
8806
- name = name || Date.parse(new Date());
8807
- }
8808
- // var th = new $.jqplot.Theme(name);
8809
- var th = this.copy(this.themes['Default']._name, name);
8810
- $.jqplot.extend(th, obj);
8811
- return th;
8812
- };
8813
-
8814
- // function clone(obj) {
8815
- // return eval(obj.toSource());
8816
- // }
8817
-
8818
- function clone(obj){
8819
- if(obj == null || typeof(obj) != 'object'){
8820
- return obj;
8821
- }
8822
-
8823
- var temp = new obj.constructor();
8824
- for(var key in obj){
8825
- temp[key] = clone(obj[key]);
8826
- }
8827
- return temp;
8828
- }
8829
-
8830
- $.jqplot.clone = clone;
8831
-
8832
- function merge(obj1, obj2) {
8833
- if (obj2 == null || typeof(obj2) != 'object') {
8834
- return;
8835
- }
8836
- for (var key in obj2) {
8837
- if (key == 'highlightColors') {
8838
- obj1[key] = clone(obj2[key]);
8839
- }
8840
- if (obj2[key] != null && typeof(obj2[key]) == 'object') {
8841
- if (!obj1.hasOwnProperty(key)) {
8842
- obj1[key] = {};
8843
- }
8844
- merge(obj1[key], obj2[key]);
8845
- }
8846
- else {
8847
- obj1[key] = obj2[key];
8848
- }
8849
- }
8850
- }
8851
-
8852
- $.jqplot.merge = merge;
8853
-
8854
- // Use the jQuery 1.3.2 extend function since behaviour in jQuery 1.4 seems problematic
8855
- $.jqplot.extend = function() {
8856
- // copy reference to target object
8857
- var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
8858
-
8859
- // Handle a deep copy situation
8860
- if ( typeof target === "boolean" ) {
8861
- deep = target;
8862
- target = arguments[1] || {};
8863
- // skip the boolean and the target
8864
- i = 2;
8865
- }
8866
-
8867
- // Handle case when target is a string or something (possible in deep copy)
8868
- if ( typeof target !== "object" && !toString.call(target) === "[object Function]" ) {
8869
- target = {};
8870
- }
8871
-
8872
- for ( ; i < length; i++ ){
8873
- // Only deal with non-null/undefined values
8874
- if ( (options = arguments[ i ]) != null ) {
8875
- // Extend the base object
8876
- for ( var name in options ) {
8877
- var src = target[ name ], copy = options[ name ];
8878
-
8879
- // Prevent never-ending loop
8880
- if ( target === copy ) {
8881
- continue;
8882
- }
8883
-
8884
- // Recurse if we're merging object values
8885
- if ( deep && copy && typeof copy === "object" && !copy.nodeType ) {
8886
- target[ name ] = $.jqplot.extend( deep,
8887
- // Never move original objects, clone them
8888
- src || ( copy.length != null ? [ ] : { } )
8889
- , copy );
8890
- }
8891
- // Don't bring in undefined values
8892
- else if ( copy !== undefined ) {
8893
- target[ name ] = copy;
8894
- }
8895
- }
8896
- }
8897
- }
8898
- // Return the modified object
8899
- return target;
8900
- };
8901
-
8902
- /**
8903
- * method: rename
8904
- *
8905
- * Rename a theme.
8906
- *
8907
- * parameters:
8908
- *
8909
- * oldName - current name of the theme.
8910
- * newName - desired name of the theme.
8911
- *
8912
- * returns:
8913
- *
8914
- * new Theme object.
8915
- */
8916
- $.jqplot.ThemeEngine.prototype.rename = function (oldName, newName) {
8917
- if (oldName == 'Default' || newName == 'Default') {
8918
- throw new Error ("jqplot.ThemeEngine Error: Cannot rename from/to Default");
8919
- }
8920
- if (this.themes.hasOwnProperty(newName)) {
8921
- throw new Error ("jqplot.ThemeEngine Error: New name already in use.");
8922
- }
8923
- else if (this.themes.hasOwnProperty(oldName)) {
8924
- var th = this.copy (oldName, newName);
8925
- this.remove(oldName);
8926
- return th;
8927
- }
8928
- throw new Error("jqplot.ThemeEngine Error: Old name or new name invalid");
8929
- };
8930
-
8931
- /**
8932
- * method: copy
8933
- *
8934
- * Create a copy of an existing theme in the themeEngine, adding it the themeEngine.
8935
- *
8936
- * parameters:
8937
- *
8938
- * sourceName - name of the existing theme.
8939
- * targetName - name of the copy.
8940
- * obj - optional object of style parameter to apply to the new theme.
8941
- *
8942
- * returns:
8943
- *
8944
- * new Theme object.
8945
- */
8946
- $.jqplot.ThemeEngine.prototype.copy = function (sourceName, targetName, obj) {
8947
- if (targetName == 'Default') {
8948
- throw new Error ("jqplot.ThemeEngine Error: Cannot copy over Default theme");
8949
- }
8950
- if (!this.themes.hasOwnProperty(sourceName)) {
8951
- var s = "jqplot.ThemeEngine Error: Source name invalid";
8952
- throw new Error(s);
8953
- }
8954
- if (this.themes.hasOwnProperty(targetName)) {
8955
- var s = "jqplot.ThemeEngine Error: Target name invalid";
8956
- throw new Error(s);
8957
- }
8958
- else {
8959
- var th = clone(this.themes[sourceName]);
8960
- th._name = targetName;
8961
- $.jqplot.extend(true, th, obj);
8962
- this._add(th);
8963
- return th;
8964
- }
8965
- };
8966
-
8967
-
8968
- $.jqplot.Theme = function(name, obj) {
8969
- if (typeof(name) == 'object') {
8970
- obj = obj || name;
8971
- name = null;
8972
- }
8973
- name = name || Date.parse(new Date());
8974
- this._name = name;
8975
- this.target = {
8976
- backgroundColor: null
8977
- };
8978
- this.legend = {
8979
- textColor: null,
8980
- fontFamily: null,
8981
- fontSize: null,
8982
- border: null,
8983
- background: null
8984
- };
8985
- this.title = {
8986
- textColor: null,
8987
- fontFamily: null,
8988
- fontSize: null,
8989
- textAlign: null
8990
- };
8991
- this.seriesStyles = {};
8992
- this.series = [];
8993
- this.grid = {
8994
- drawGridlines: null,
8995
- gridLineColor: null,
8996
- gridLineWidth: null,
8997
- backgroundColor: null,
8998
- borderColor: null,
8999
- borderWidth: null,
9000
- shadow: null
9001
- };
9002
- this.axesStyles = {label:{}, ticks:{}};
9003
- this.axes = {};
9004
- if (typeof(obj) == 'string') {
9005
- this._name = obj;
9006
- }
9007
- else if(typeof(obj) == 'object') {
9008
- $.jqplot.extend(true, this, obj);
9009
- }
9010
- };
9011
-
9012
- var AxisProperties = function() {
9013
- this.borderColor = null;
9014
- this.borderWidth = null;
9015
- this.ticks = new AxisTicks();
9016
- this.label = new AxisLabel();
9017
- };
9018
-
9019
- var AxisTicks = function() {
9020
- this.show = null;
9021
- this.showGridline = null;
9022
- this.showLabel = null;
9023
- this.showMark = null;
9024
- this.size = null;
9025
- this.textColor = null;
9026
- this.whiteSpace = null;
9027
- this.fontSize = null;
9028
- this.fontFamily = null;
9029
- };
9030
-
9031
- var AxisLabel = function() {
9032
- this.textColor = null;
9033
- this.whiteSpace = null;
9034
- this.fontSize = null;
9035
- this.fontFamily = null;
9036
- this.fontWeight = null;
9037
- };
9038
-
9039
- var LineSeriesProperties = function() {
9040
- this.color=null;
9041
- this.lineWidth=null;
9042
- this.linePattern=null;
9043
- this.shadow=null;
9044
- this.fillColor=null;
9045
- this.showMarker=null;
9046
- this.markerOptions = new MarkerOptions();
9047
- };
9048
-
9049
- var MarkerOptions = function() {
9050
- this.show = null;
9051
- this.style = null;
9052
- this.lineWidth = null;
9053
- this.size = null;
9054
- this.color = null;
9055
- this.shadow = null;
9056
- };
9057
-
9058
- var BarSeriesProperties = function() {
9059
- this.color=null;
9060
- this.seriesColors=null;
9061
- this.lineWidth=null;
9062
- this.shadow=null;
9063
- this.barPadding=null;
9064
- this.barMargin=null;
9065
- this.barWidth=null;
9066
- this.highlightColors=null;
9067
- };
9068
-
9069
- var PieSeriesProperties = function() {
9070
- this.seriesColors=null;
9071
- this.padding=null;
9072
- this.sliceMargin=null;
9073
- this.fill=null;
9074
- this.shadow=null;
9075
- this.startAngle=null;
9076
- this.lineWidth=null;
9077
- this.highlightColors=null;
9078
- };
9079
-
9080
- var DonutSeriesProperties = function() {
9081
- this.seriesColors=null;
9082
- this.padding=null;
9083
- this.sliceMargin=null;
9084
- this.fill=null;
9085
- this.shadow=null;
9086
- this.startAngle=null;
9087
- this.lineWidth=null;
9088
- this.innerDiameter=null;
9089
- this.thickness=null;
9090
- this.ringMargin=null;
9091
- this.highlightColors=null;
9092
- };
9093
-
9094
- var FunnelSeriesProperties = function() {
9095
- this.color=null;
9096
- this.lineWidth=null;
9097
- this.shadow=null;
9098
- this.padding=null;
9099
- this.sectionMargin=null;
9100
- this.seriesColors=null;
9101
- this.highlightColors=null;
9102
- };
9103
-
9104
- var MeterSeriesProperties = function() {
9105
- this.padding=null;
9106
- this.backgroundColor=null;
9107
- this.ringColor=null;
9108
- this.tickColor=null;
9109
- this.ringWidth=null;
9110
- this.intervalColors=null;
9111
- this.intervalInnerRadius=null;
9112
- this.intervalOuterRadius=null;
9113
- this.hubRadius=null;
9114
- this.needleThickness=null;
9115
- this.needlePad=null;
9116
- };
9117
-
9118
-
9119
-
9120
-
9121
- $.fn.jqplotChildText = function() {
9122
- return $(this).contents().filter(function() {
9123
- return this.nodeType == 3; // Node.TEXT_NODE not defined in I7
9124
- }).text();
9125
- };
9126
-
9127
- // Returns font style as abbreviation for "font" property.
9128
- $.fn.jqplotGetComputedFontStyle = function() {
9129
- var css = window.getComputedStyle ? window.getComputedStyle(this[0], "") : this[0].currentStyle;
9130
- var attrs = css['font-style'] ? ['font-style', 'font-weight', 'font-size', 'font-family'] : ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily'];
9131
- var style = [];
9132
-
9133
- for (var i=0 ; i < attrs.length; ++i) {
9134
- var attr = String(css[attrs[i]]);
9135
-
9136
- if (attr && attr != 'normal') {
9137
- style.push(attr);
9138
- }
9139
- }
9140
- return style.join(' ');
9141
- };
9142
-
9143
- /**
9144
- * Namespace: $.fn
9145
- * jQuery namespace to attach functions to jQuery elements.
9146
- *
9147
- */
9148
-
9149
- $.fn.jqplotToImageCanvas = function(options) {
9150
-
9151
- options = options || {};
9152
- var x_offset = (options.x_offset == null) ? 0 : options.x_offset;
9153
- var y_offset = (options.y_offset == null) ? 0 : options.y_offset;
9154
- var backgroundColor = (options.backgroundColor == null) ? 'rgb(255,255,255)' : options.backgroundColor;
9155
-
9156
- if ($(this).width() == 0 || $(this).height() == 0) {
9157
- return null;
9158
- }
9159
-
9160
- // excanvas and hence IE < 9 do not support toDataURL and cannot export images.
9161
- if ($.jqplot.use_excanvas) {
9162
- return null;
9163
- }
9164
-
9165
- var newCanvas = document.createElement("canvas");
9166
- var h = $(this).outerHeight(true);
9167
- var w = $(this).outerWidth(true);
9168
- var offs = $(this).offset();
9169
- var plotleft = offs.left;
9170
- var plottop = offs.top;
9171
- var transx = 0, transy = 0;
9172
-
9173
- // have to check if any elements are hanging outside of plot area before rendering,
9174
- // since changing width of canvas will erase canvas.
9175
-
9176
- var clses = ['jqplot-table-legend', 'jqplot-xaxis-tick', 'jqplot-x2axis-tick', 'jqplot-yaxis-tick', 'jqplot-y2axis-tick', 'jqplot-y3axis-tick',
9177
- 'jqplot-y4axis-tick', 'jqplot-y5axis-tick', 'jqplot-y6axis-tick', 'jqplot-y7axis-tick', 'jqplot-y8axis-tick', 'jqplot-y9axis-tick',
9178
- 'jqplot-xaxis-label', 'jqplot-x2axis-label', 'jqplot-yaxis-label', 'jqplot-y2axis-label', 'jqplot-y3axis-label', 'jqplot-y4axis-label',
9179
- 'jqplot-y5axis-label', 'jqplot-y6axis-label', 'jqplot-y7axis-label', 'jqplot-y8axis-label', 'jqplot-y9axis-label' ];
9180
-
9181
- var temptop, templeft, tempbottom, tempright;
9182
-
9183
- for (var i = 0; i < clses.length; i++) {
9184
- $(this).find('.'+clses[i]).each(function() {
9185
- temptop = $(this).offset().top - plottop;
9186
- templeft = $(this).offset().left - plotleft;
9187
- tempright = templeft + $(this).outerWidth(true) + transx;
9188
- tempbottom = temptop + $(this).outerHeight(true) + transy;
9189
- if (templeft < -transx) {
9190
- w = w - transx - templeft;
9191
- transx = -templeft;
9192
- }
9193
- if (temptop < -transy) {
9194
- h = h - transy - temptop;
9195
- transy = - temptop;
9196
- }
9197
- if (tempright > w) {
9198
- w = tempright;
9199
- }
9200
- if (tempbottom > h) {
9201
- h = tempbottom;
9202
- }
9203
- });
9204
- }
9205
-
9206
- newCanvas.width = w + Number(x_offset);
9207
- newCanvas.height = h + Number(y_offset);
9208
-
9209
- var newContext = newCanvas.getContext("2d");
9210
-
9211
- newContext.save();
9212
- newContext.fillStyle = backgroundColor;
9213
- newContext.fillRect(0,0, newCanvas.width, newCanvas.height);
9214
- newContext.restore();
9215
-
9216
- newContext.translate(transx, transy);
9217
- newContext.textAlign = 'left';
9218
- newContext.textBaseline = 'top';
9219
-
9220
- function getLineheight(el) {
9221
- var lineheight = parseInt($(el).css('line-height'), 10);
9222
-
9223
- if (isNaN(lineheight)) {
9224
- lineheight = parseInt($(el).css('font-size'), 10) * 1.2;
9225
- }
9226
- return lineheight;
9227
- }
9228
-
9229
- function writeWrappedText (el, context, text, left, top, canvasWidth) {
9230
- var lineheight = getLineheight(el);
9231
- var tagwidth = $(el).innerWidth();
9232
- var tagheight = $(el).innerHeight();
9233
- var words = text.split(/\s+/);
9234
- var wl = words.length;
9235
- var w = '';
9236
- var breaks = [];
9237
- var temptop = top;
9238
- var templeft = left;
9239
-
9240
- for (var i=0; i<wl; i++) {
9241
- w += words[i];
9242
- if (context.measureText(w).width > tagwidth && w.length > words[i].length) {
9243
- breaks.push(i);
9244
- w = '';
9245
- i--;
9246
- }
9247
- }
9248
- if (breaks.length === 0) {
9249
- // center text if necessary
9250
- if ($(el).css('textAlign') === 'center') {
9251
- templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx;
9252
- }
9253
- context.fillText(text, templeft, top);
9254
- }
9255
- else {
9256
- w = words.slice(0, breaks[0]).join(' ');
9257
- // center text if necessary
9258
- if ($(el).css('textAlign') === 'center') {
9259
- templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx;
9260
- }
9261
- context.fillText(w, templeft, temptop);
9262
- temptop += lineheight;
9263
- for (var i=1, l=breaks.length; i<l; i++) {
9264
- w = words.slice(breaks[i-1], breaks[i]).join(' ');
9265
- // center text if necessary
9266
- if ($(el).css('textAlign') === 'center') {
9267
- templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx;
9268
- }
9269
- context.fillText(w, templeft, temptop);
9270
- temptop += lineheight;
9271
- }
9272
- w = words.slice(breaks[i-1], words.length).join(' ');
9273
- // center text if necessary
9274
- if ($(el).css('textAlign') === 'center') {
9275
- templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx;
9276
- }
9277
- context.fillText(w, templeft, temptop);
9278
- }
9279
-
9280
- }
9281
-
9282
- function _jqpToImage(el, x_offset, y_offset) {
9283
- var tagname = el.tagName.toLowerCase();
9284
- var p = $(el).position();
9285
- var css = window.getComputedStyle ? window.getComputedStyle(el, "") : el.currentStyle; // for IE < 9
9286
- var left = x_offset + p.left + parseInt(css.marginLeft, 10) + parseInt(css.borderLeftWidth, 10) + parseInt(css.paddingLeft, 10);
9287
- var top = y_offset + p.top + parseInt(css.marginTop, 10) + parseInt(css.borderTopWidth, 10)+ parseInt(css.paddingTop, 10);
9288
- var w = newCanvas.width;
9289
- // var left = x_offset + p.left + $(el).css('marginLeft') + $(el).css('borderLeftWidth')
9290
-
9291
- // somehow in here, for divs within divs, the width of the inner div should be used instead of the canvas.
9292
-
9293
- if ((tagname == 'div' || tagname == 'span') && !$(el).hasClass('jqplot-highlighter-tooltip') && !$(el).hasClass('jqplot-canvasOverlay-tooltip')) {
9294
- $(el).children().each(function() {
9295
- _jqpToImage(this, left, top);
9296
- });
9297
- var text = $(el).jqplotChildText();
9298
-
9299
- if (text) {
9300
- newContext.font = $(el).jqplotGetComputedFontStyle();
9301
- newContext.fillStyle = $(el).css('color');
9302
-
9303
- writeWrappedText(el, newContext, text, left, top, w);
9304
- }
9305
- }
9306
-
9307
- // handle the standard table legend
9308
-
9309
- else if (tagname === 'table' && $(el).hasClass('jqplot-table-legend')) {
9310
- newContext.strokeStyle = $(el).css('border-top-color');
9311
- newContext.fillStyle = $(el).css('background-color');
9312
- newContext.fillRect(left, top, $(el).innerWidth(), $(el).innerHeight());
9313
- if (parseInt($(el).css('border-top-width'), 10) > 0) {
9314
- newContext.strokeRect(left, top, $(el).innerWidth(), $(el).innerHeight());
9315
- }
9316
-
9317
- // find all the swatches
9318
- $(el).find('div.jqplot-table-legend-swatch-outline').each(function() {
9319
- // get the first div and stroke it
9320
- var elem = $(this);
9321
- newContext.strokeStyle = elem.css('border-top-color');
9322
- var l = left + elem.position().left;
9323
- var t = top + elem.position().top;
9324
- newContext.strokeRect(l, t, elem.innerWidth(), elem.innerHeight());
9325
-
9326
- // now fill the swatch
9327
-
9328
- l += parseInt(elem.css('padding-left'), 10);
9329
- t += parseInt(elem.css('padding-top'), 10);
9330
- var h = elem.innerHeight() - 2 * parseInt(elem.css('padding-top'), 10);
9331
- var w = elem.innerWidth() - 2 * parseInt(elem.css('padding-left'), 10);
9332
-
9333
- var swatch = elem.children('div.jqplot-table-legend-swatch');
9334
- newContext.fillStyle = swatch.css('background-color');
9335
- newContext.fillRect(l, t, w, h);
9336
- });
9337
-
9338
- // now add text
9339
-
9340
- $(el).find('td.jqplot-table-legend-label').each(function(){
9341
- var elem = $(this);
9342
- var l = left + elem.position().left;
9343
- var t = top + elem.position().top + parseInt(elem.css('padding-top'), 10);
9344
- newContext.font = elem.jqplotGetComputedFontStyle();
9345
- newContext.fillStyle = elem.css('color');
9346
- writeWrappedText(elem, newContext, elem.text(), l, t, w);
9347
- });
9348
-
9349
- var elem = null;
9350
- }
9351
-
9352
- else if (tagname == 'canvas') {
9353
- newContext.drawImage(el, left, top);
9354
- }
9355
- }
9356
- $(this).children().each(function() {
9357
- _jqpToImage(this, x_offset, y_offset);
9358
- });
9359
- return newCanvas;
9360
- };
9361
-
9362
- // return the raw image data string.
9363
- // Should work on canvas supporting browsers.
9364
- $.fn.jqplotToImageStr = function(options) {
9365
- var imgCanvas = $(this).jqplotToImageCanvas(options);
9366
- if (imgCanvas) {
9367
- return imgCanvas.toDataURL("image/png");
9368
- }
9369
- else {
9370
- return null;
9371
- }
9372
- };
9373
-
9374
- // return a DOM <img> element and return it.
9375
- // Should work on canvas supporting browsers.
9376
- $.fn.jqplotToImageElem = function(options) {
9377
- var elem = document.createElement("img");
9378
- var str = $(this).jqplotToImageStr(options);
9379
- elem.src = str;
9380
- return elem;
9381
- };
9382
-
9383
- // return a string for an <img> element and return it.
9384
- // Should work on canvas supporting browsers.
9385
- $.fn.jqplotToImageElemStr = function(options) {
9386
- var str = '<img src='+$(this).jqplotToImageStr(options)+' />';
9387
- return str;
9388
- };
9389
-
9390
- // Not guaranteed to work, even on canvas supporting browsers due to
9391
- // limitations with location.href and browser support.
9392
- $.fn.jqplotSaveImage = function() {
9393
- var imgData = $(this).jqplotToImageStr({});
9394
- if (imgData) {
9395
- window.location.href = imgData.replace("image/png", "image/octet-stream");
9396
- }
9397
-
9398
- };
9399
-
9400
- // Not guaranteed to work, even on canvas supporting browsers due to
9401
- // limitations with window.open and arbitrary data.
9402
- $.fn.jqplotViewImage = function() {
9403
- var imgStr = $(this).jqplotToImageElemStr({});
9404
- var imgData = $(this).jqplotToImageStr({});
9405
- if (imgStr) {
9406
- var w = window.open('');
9407
- w.document.open("image/png");
9408
- w.document.write(imgStr);
9409
- w.document.close();
9410
- w = null;
9411
- }
9412
- };
9413
-
9414
-
9415
-
9416
-
9417
- /**
9418
- * @description
9419
- * <p>Object with extended date parsing and formatting capabilities.
9420
- * This library borrows many concepts and ideas from the Date Instance
9421
- * Methods by Ken Snyder along with some parts of Ken's actual code.</p>
9422
- *
9423
- * <p>jsDate takes a different approach by not extending the built-in
9424
- * Date Object, improving date parsing, allowing for multiple formatting
9425
- * syntaxes and multiple and more easily expandable localization.</p>
9426
- *
9427
- * @author Chris Leonello
9428
- * @date #date#
9429
- * @version #VERSION#
9430
- * @copyright (c) 2010-2015 Chris Leonello
9431
- * jsDate is currently available for use in all personal or commercial projects
9432
- * under both the MIT and GPL version 2.0 licenses. This means that you can
9433
- * choose the license that best suits your project and use it accordingly.
9434
- *
9435
- * <p>Ken's original Date Instance Methods and copyright notice:</p>
9436
- * <pre>
9437
- * Ken Snyder (ken d snyder at gmail dot com)
9438
- * 2008-09-10
9439
- * version 2.0.2 (http://kendsnyder.com/sandbox/date/)
9440
- * Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
9441
- * </pre>
9442
- *
9443
- * @class
9444
- * @name jsDate
9445
- * @param {String | Number | Array | Date&nbsp;Object | Options&nbsp;Object} arguments Optional arguments, either a parsable date/time string,
9446
- * a JavaScript timestamp, an array of numbers of form [year, month, day, hours, minutes, seconds, milliseconds],
9447
- * a Date object, or an options object of form {syntax: "perl", date:some Date} where all options are optional.
9448
- */
9449
-
9450
- var jsDate = function () {
9451
-
9452
- this.syntax = jsDate.config.syntax;
9453
- this._type = "jsDate";
9454
- this.proxy = new Date();
9455
- this.options = {};
9456
- this.locale = jsDate.regional.getLocale();
9457
- this.formatString = '';
9458
- this.defaultCentury = jsDate.config.defaultCentury;
9459
-
9460
- switch ( arguments.length ) {
9461
- case 0:
9462
- break;
9463
- case 1:
9464
- // other objects either won't have a _type property or,
9465
- // if they do, it shouldn't be set to "jsDate", so
9466
- // assume it is an options argument.
9467
- if (get_type(arguments[0]) == "[object Object]" && arguments[0]._type != "jsDate") {
9468
- var opts = this.options = arguments[0];
9469
- this.syntax = opts.syntax || this.syntax;
9470
- this.defaultCentury = opts.defaultCentury || this.defaultCentury;
9471
- this.proxy = jsDate.createDate(opts.date);
9472
- }
9473
- else {
9474
- this.proxy = jsDate.createDate(arguments[0]);
9475
- }
9476
- break;
9477
- default:
9478
- var a = [];
9479
- for ( var i=0; i<arguments.length; i++ ) {
9480
- a.push(arguments[i]);
9481
- }
9482
- // this should be the current date/time?
9483
- this.proxy = new Date();
9484
- this.proxy.setFullYear.apply( this.proxy, a.slice(0,3) );
9485
- if ( a.slice(3).length ) {
9486
- this.proxy.setHours.apply( this.proxy, a.slice(3) );
9487
- }
9488
- break;
9489
- }
9490
- };
9491
-
9492
- /**
9493
- * @namespace Configuration options that will be used as defaults for all instances on the page.
9494
- * @property {String} defaultLocale The default locale to use [en].
9495
- * @property {String} syntax The default syntax to use [perl].
9496
- * @property {Number} defaultCentury The default centry for 2 digit dates.
9497
- */
9498
- jsDate.config = {
9499
- defaultLocale: 'en',
9500
- syntax: 'perl',
9501
- defaultCentury: 1900
9502
- };
9503
-
9504
- /**
9505
- * Add an arbitrary amount to the currently stored date
9506
- *
9507
- * @param {Number} number
9508
- * @param {String} unit
9509
- * @returns {jsDate}
9510
- */
9511
-
9512
- jsDate.prototype.add = function(number, unit) {
9513
- var factor = multipliers[unit] || multipliers.day;
9514
- if (typeof factor == 'number') {
9515
- // Get the offset from the current time.
9516
- var oldOffset = this.proxy.getTimezoneOffset();
9517
-
9518
- // Set the new time.
9519
- this.proxy.setTime(this.proxy.getTime() + (factor * number));
9520
-
9521
- // Check to see if we've crossed a daylight savings time boundary, if so convert to a number of milliseconds to add back to the diff.
9522
- OffsetDiff = oldOffset - this.proxy.getTimezoneOffset();
9523
-
9524
- // Reset the time to account for daylight savings time.
9525
- this.proxy.setTime(this.proxy.getTime() - (OffsetDiff * 60 * 1000));
9526
- } else {
9527
- factor.add(this, number);
9528
- }
9529
- return this;
9530
- };
9531
-
9532
- /**
9533
- * Create a new jqplot.date object with the same date
9534
- *
9535
- * @returns {jsDate}
9536
- */
9537
-
9538
- jsDate.prototype.clone = function() {
9539
- return new jsDate(this.proxy.getTime());
9540
- };
9541
-
9542
- /**
9543
- * Get the UTC TimeZone Offset of this date in milliseconds.
9544
- *
9545
- * @returns {Number}
9546
- */
9547
-
9548
- jsDate.prototype.getUtcOffset = function() {
9549
- return this.proxy.getTimezoneOffset() * 60000;
9550
- };
9551
-
9552
- /**
9553
- * Find the difference between this jsDate and another date.
9554
- *
9555
- * @param {String| Number| Array| jsDate&nbsp;Object| Date&nbsp;Object} dateObj
9556
- * @param {String} unit
9557
- * @param {Boolean} allowDecimal
9558
- * @returns {Number} Number of units difference between dates.
9559
- */
9560
-
9561
- jsDate.prototype.diff = function(dateObj, unit, allowDecimal) {
9562
- // ensure we have a Date object
9563
- dateObj = new jsDate(dateObj);
9564
- if (dateObj === null) {
9565
- return null;
9566
- }
9567
- // get the multiplying factor integer or factor function
9568
- var factor = multipliers[unit] || multipliers.day;
9569
- if (typeof factor == 'number') {
9570
- // multiply
9571
-
9572
- // Check to see if we've crossed a daylight savings time boundary, if so convert to a number of milliseconds to add back to the diff.
9573
- var OffsetDiff = (dateObj.proxy.getTimezoneOffset() - this.proxy.getTimezoneOffset()) * 60 * 1000;
9574
-
9575
- // Now find the difference, add back in the offset and then divide by the factor.
9576
- var unitDiff = (this.proxy.getTime() - dateObj.proxy.getTime() + OffsetDiff) / factor;
9577
- } else {
9578
- // run function
9579
- var unitDiff = factor.diff(this.proxy, dateObj.proxy);
9580
- }
9581
- // if decimals are not allowed, round toward zero
9582
- return (allowDecimal ? unitDiff : Math[unitDiff > 0 ? 'floor' : 'ceil'](unitDiff));
9583
- };
9584
-
9585
- /**
9586
- * Get the abbreviated name of the current week day
9587
- *
9588
- * @returns {String}
9589
- */
9590
-
9591
- jsDate.prototype.getAbbrDayName = function() {
9592
- return jsDate.regional[this.locale]["dayNamesShort"][this.proxy.getDay()];
9593
- };
9594
-
9595
- /**
9596
- * Get the abbreviated name of the current month
9597
- *
9598
- * @returns {String}
9599
- */
9600
-
9601
- jsDate.prototype.getAbbrMonthName = function() {
9602
- return jsDate.regional[this.locale]["monthNamesShort"][this.proxy.getMonth()];
9603
- };
9604
-
9605
- /**
9606
- * Get UPPER CASE AM or PM for the current time
9607
- *
9608
- * @returns {String}
9609
- */
9610
-
9611
- jsDate.prototype.getAMPM = function() {
9612
- return this.proxy.getHours() >= 12 ? 'PM' : 'AM';
9613
- };
9614
-
9615
- /**
9616
- * Get lower case am or pm for the current time
9617
- *
9618
- * @returns {String}
9619
- */
9620
-
9621
- jsDate.prototype.getAmPm = function() {
9622
- return this.proxy.getHours() >= 12 ? 'pm' : 'am';
9623
- };
9624
-
9625
- /**
9626
- * Get the century (19 for 20th Century)
9627
- *
9628
- * @returns {Integer} Century (19 for 20th century).
9629
- */
9630
- jsDate.prototype.getCentury = function() {
9631
- return parseInt(this.proxy.getFullYear()/100, 10);
9632
- };
9633
-
9634
- /**
9635
- * Implements Date functionality
9636
- */
9637
- jsDate.prototype.getDate = function() {
9638
- return this.proxy.getDate();
9639
- };
9640
-
9641
- /**
9642
- * Implements Date functionality
9643
- */
9644
- jsDate.prototype.getDay = function() {
9645
- return this.proxy.getDay();
9646
- };
9647
-
9648
- /**
9649
- * Get the Day of week 1 (Monday) thru 7 (Sunday)
9650
- *
9651
- * @returns {Integer} Day of week 1 (Monday) thru 7 (Sunday)
9652
- */
9653
- jsDate.prototype.getDayOfWeek = function() {
9654
- var dow = this.proxy.getDay();
9655
- return dow===0?7:dow;
9656
- };
9657
-
9658
- /**
9659
- * Get the day of the year
9660
- *
9661
- * @returns {Integer} 1 - 366, day of the year
9662
- */
9663
- jsDate.prototype.getDayOfYear = function() {
9664
- var d = this.proxy;
9665
- var ms = d - new Date('' + d.getFullYear() + '/1/1 GMT');
9666
- ms += d.getTimezoneOffset()*60000;
9667
- d = null;
9668
- return parseInt(ms/60000/60/24, 10)+1;
9669
- };
9670
-
9671
- /**
9672
- * Get the name of the current week day
9673
- *
9674
- * @returns {String}
9675
- */
9676
-
9677
- jsDate.prototype.getDayName = function() {
9678
- return jsDate.regional[this.locale]["dayNames"][this.proxy.getDay()];
9679
- };
9680
-
9681
- /**
9682
- * Get the week number of the given year, starting with the first Sunday as the first week
9683
- * @returns {Integer} Week number (13 for the 13th full week of the year).
9684
- */
9685
- jsDate.prototype.getFullWeekOfYear = function() {
9686
- var d = this.proxy;
9687
- var doy = this.getDayOfYear();
9688
- var rdow = 6-d.getDay();
9689
- var woy = parseInt((doy+rdow)/7, 10);
9690
- return woy;
9691
- };
9692
-
9693
- /**
9694
- * Implements Date functionality
9695
- */
9696
- jsDate.prototype.getFullYear = function() {
9697
- return this.proxy.getFullYear();
9698
- };
9699
-
9700
- /**
9701
- * Get the GMT offset in hours and minutes (e.g. +06:30)
9702
- *
9703
- * @returns {String}
9704
- */
9705
-
9706
- jsDate.prototype.getGmtOffset = function() {
9707
- // divide the minutes offset by 60
9708
- var hours = this.proxy.getTimezoneOffset() / 60;
9709
- // decide if we are ahead of or behind GMT
9710
- var prefix = hours < 0 ? '+' : '-';
9711
- // remove the negative sign if any
9712
- hours = Math.abs(hours);
9713
- // add the +/- to the padded number of hours to : to the padded minutes
9714
- return prefix + addZeros(Math.floor(hours), 2) + ':' + addZeros((hours % 1) * 60, 2);
9715
- };
9716
-
9717
- /**
9718
- * Implements Date functionality
9719
- */
9720
- jsDate.prototype.getHours = function() {
9721
- return this.proxy.getHours();
9722
- };
9723
-
9724
- /**
9725
- * Get the current hour on a 12-hour scheme
9726
- *
9727
- * @returns {Integer}
9728
- */
9729
-
9730
- jsDate.prototype.getHours12 = function() {
9731
- var hours = this.proxy.getHours();
9732
- return hours > 12 ? hours - 12 : (hours == 0 ? 12 : hours);
9733
- };
9734
-
9735
-
9736
- jsDate.prototype.getIsoWeek = function() {
9737
- var d = this.proxy;
9738
- var woy = this.getWeekOfYear();
9739
- var dow1_1 = (new Date('' + d.getFullYear() + '/1/1')).getDay();
9740
- // First week is 01 and not 00 as in the case of %U and %W,
9741
- // so we add 1 to the final result except if day 1 of the year
9742
- // is a Monday (then %W returns 01).
9743
- // We also need to subtract 1 if the day 1 of the year is
9744
- // Friday-Sunday, so the resulting equation becomes:
9745
- var idow = woy + (dow1_1 > 4 || dow1_1 <= 1 ? 0 : 1);
9746
- if(idow == 53 && (new Date('' + d.getFullYear() + '/12/31')).getDay() < 4)
9747
- {
9748
- idow = 1;
9749
- }
9750
- else if(idow === 0)
9751
- {
9752
- d = new jsDate(new Date('' + (d.getFullYear()-1) + '/12/31'));
9753
- idow = d.getIsoWeek();
9754
- }
9755
- d = null;
9756
- return idow;
9757
- };
9758
-
9759
- /**
9760
- * Implements Date functionality
9761
- */
9762
- jsDate.prototype.getMilliseconds = function() {
9763
- return this.proxy.getMilliseconds();
9764
- };
9765
-
9766
- /**
9767
- * Implements Date functionality
9768
- */
9769
- jsDate.prototype.getMinutes = function() {
9770
- return this.proxy.getMinutes();
9771
- };
9772
-
9773
- /**
9774
- * Implements Date functionality
9775
- */
9776
- jsDate.prototype.getMonth = function() {
9777
- return this.proxy.getMonth();
9778
- };
9779
-
9780
- /**
9781
- * Get the name of the current month
9782
- *
9783
- * @returns {String}
9784
- */
9785
-
9786
- jsDate.prototype.getMonthName = function() {
9787
- return jsDate.regional[this.locale]["monthNames"][this.proxy.getMonth()];
9788
- };
9789
-
9790
- /**
9791
- * Get the number of the current month, 1-12
9792
- *
9793
- * @returns {Integer}
9794
- */
9795
-
9796
- jsDate.prototype.getMonthNumber = function() {
9797
- return this.proxy.getMonth() + 1;
9798
- };
9799
-
9800
- /**
9801
- * Implements Date functionality
9802
- */
9803
- jsDate.prototype.getSeconds = function() {
9804
- return this.proxy.getSeconds();
9805
- };
9806
-
9807
- /**
9808
- * Return a proper two-digit year integer
9809
- *
9810
- * @returns {Integer}
9811
- */
9812
-
9813
- jsDate.prototype.getShortYear = function() {
9814
- return this.proxy.getYear() % 100;
9815
- };
9816
-
9817
- /**
9818
- * Implements Date functionality
9819
- */
9820
- jsDate.prototype.getTime = function() {
9821
- return this.proxy.getTime();
9822
- };
9823
-
9824
- /**
9825
- * Get the timezone abbreviation
9826
- *
9827
- * @returns {String} Abbreviation for the timezone
9828
- */
9829
- jsDate.prototype.getTimezoneAbbr = function() {
9830
- return this.proxy.toString().replace(/^.*\(([^)]+)\)$/, '$1');
9831
- };
9832
-
9833
- /**
9834
- * Get the browser-reported name for the current timezone (e.g. MDT, Mountain Daylight Time)
9835
- *
9836
- * @returns {String}
9837
- */
9838
- jsDate.prototype.getTimezoneName = function() {
9839
- var match = /(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());
9840
- return match[1] || match[2] || 'GMT' + this.getGmtOffset();
9841
- };
9842
-
9843
- /**
9844
- * Implements Date functionality
9845
- */
9846
- jsDate.prototype.getTimezoneOffset = function() {
9847
- return this.proxy.getTimezoneOffset();
9848
- };
9849
-
9850
-
9851
- /**
9852
- * Get the week number of the given year, starting with the first Monday as the first week
9853
- * @returns {Integer} Week number (13 for the 13th week of the year).
9854
- */
9855
- jsDate.prototype.getWeekOfYear = function() {
9856
- var doy = this.getDayOfYear();
9857
- var rdow = 7 - this.getDayOfWeek();
9858
- var woy = parseInt((doy+rdow)/7, 10);
9859
- return woy;
9860
- };
9861
-
9862
- /**
9863
- * Get the current date as a Unix timestamp
9864
- *
9865
- * @returns {Integer}
9866
- */
9867
-
9868
- jsDate.prototype.getUnix = function() {
9869
- return Math.round(this.proxy.getTime() / 1000, 0);
9870
- };
9871
-
9872
- /**
9873
- * Implements Date functionality
9874
- */
9875
- jsDate.prototype.getYear = function() {
9876
- return this.proxy.getYear();
9877
- };
9878
-
9879
- /**
9880
- * Return a date one day ahead (or any other unit)
9881
- *
9882
- * @param {String} unit Optional, year | month | day | week | hour | minute | second | millisecond
9883
- * @returns {jsDate}
9884
- */
9885
-
9886
- jsDate.prototype.next = function(unit) {
9887
- unit = unit || 'day';
9888
- return this.clone().add(1, unit);
9889
- };
9890
-
9891
- /**
9892
- * Set the jsDate instance to a new date.
9893
- *
9894
- * @param {String | Number | Array | Date Object | jsDate Object | Options Object} arguments Optional arguments,
9895
- * either a parsable date/time string,
9896
- * a JavaScript timestamp, an array of numbers of form [year, month, day, hours, minutes, seconds, milliseconds],
9897
- * a Date object, jsDate Object or an options object of form {syntax: "perl", date:some Date} where all options are optional.
9898
- */
9899
- jsDate.prototype.set = function() {
9900
- switch ( arguments.length ) {
9901
- case 0:
9902
- this.proxy = new Date();
9903
- break;
9904
- case 1:
9905
- // other objects either won't have a _type property or,
9906
- // if they do, it shouldn't be set to "jsDate", so
9907
- // assume it is an options argument.
9908
- if (get_type(arguments[0]) == "[object Object]" && arguments[0]._type != "jsDate") {
9909
- var opts = this.options = arguments[0];
9910
- this.syntax = opts.syntax || this.syntax;
9911
- this.defaultCentury = opts.defaultCentury || this.defaultCentury;
9912
- this.proxy = jsDate.createDate(opts.date);
9913
- }
9914
- else {
9915
- this.proxy = jsDate.createDate(arguments[0]);
9916
- }
9917
- break;
9918
- default:
9919
- var a = [];
9920
- for ( var i=0; i<arguments.length; i++ ) {
9921
- a.push(arguments[i]);
9922
- }
9923
- // this should be the current date/time
9924
- this.proxy = new Date();
9925
- this.proxy.setFullYear.apply( this.proxy, a.slice(0,3) );
9926
- if ( a.slice(3).length ) {
9927
- this.proxy.setHours.apply( this.proxy, a.slice(3) );
9928
- }
9929
- break;
9930
- }
9931
- return this;
9932
- };
9933
-
9934
- /**
9935
- * Sets the day of the month for a specified date according to local time.
9936
- * @param {Integer} dayValue An integer from 1 to 31, representing the day of the month.
9937
- */
9938
- jsDate.prototype.setDate = function(n) {
9939
- this.proxy.setDate(n);
9940
- return this;
9941
- };
9942
-
9943
- /**
9944
- * Sets the full year for a specified date according to local time.
9945
- * @param {Integer} yearValue The numeric value of the year, for example, 1995.
9946
- * @param {Integer} monthValue Optional, between 0 and 11 representing the months January through December.
9947
- * @param {Integer} dayValue Optional, between 1 and 31 representing the day of the month. If you specify the dayValue parameter, you must also specify the monthValue.
9948
- */
9949
- jsDate.prototype.setFullYear = function() {
9950
- this.proxy.setFullYear.apply(this.proxy, arguments);
9951
- return this;
9952
- };
9953
-
9954
- /**
9955
- * Sets the hours for a specified date according to local time.
9956
- *
9957
- * @param {Integer} hoursValue An integer between 0 and 23, representing the hour.
9958
- * @param {Integer} minutesValue Optional, An integer between 0 and 59, representing the minutes.
9959
- * @param {Integer} secondsValue Optional, An integer between 0 and 59, representing the seconds.
9960
- * If you specify the secondsValue parameter, you must also specify the minutesValue.
9961
- * @param {Integer} msValue Optional, A number between 0 and 999, representing the milliseconds.
9962
- * If you specify the msValue parameter, you must also specify the minutesValue and secondsValue.
9963
- */
9964
- jsDate.prototype.setHours = function() {
9965
- this.proxy.setHours.apply(this.proxy, arguments);
9966
- return this;
9967
- };
9968
-
9969
- /**
9970
- * Implements Date functionality
9971
- */
9972
- jsDate.prototype.setMilliseconds = function(n) {
9973
- this.proxy.setMilliseconds(n);
9974
- return this;
9975
- };
9976
-
9977
- /**
9978
- * Implements Date functionality
9979
- */
9980
- jsDate.prototype.setMinutes = function() {
9981
- this.proxy.setMinutes.apply(this.proxy, arguments);
9982
- return this;
9983
- };
9984
-
9985
- /**
9986
- * Implements Date functionality
9987
- */
9988
- jsDate.prototype.setMonth = function() {
9989
- this.proxy.setMonth.apply(this.proxy, arguments);
9990
- return this;
9991
- };
9992
-
9993
- /**
9994
- * Implements Date functionality
9995
- */
9996
- jsDate.prototype.setSeconds = function() {
9997
- this.proxy.setSeconds.apply(this.proxy, arguments);
9998
- return this;
9999
- };
10000
-
10001
- /**
10002
- * Implements Date functionality
10003
- */
10004
- jsDate.prototype.setTime = function(n) {
10005
- this.proxy.setTime(n);
10006
- return this;
10007
- };
10008
-
10009
- /**
10010
- * Implements Date functionality
10011
- */
10012
- jsDate.prototype.setYear = function() {
10013
- this.proxy.setYear.apply(this.proxy, arguments);
10014
- return this;
10015
- };
10016
-
10017
- /**
10018
- * Provide a formatted string representation of this date.
10019
- *
10020
- * @param {String} formatString A format string.
10021
- * See: {@link jsDate.formats}.
10022
- * @returns {String} Date String.
10023
- */
10024
-
10025
- jsDate.prototype.strftime = function(formatString) {
10026
- formatString = formatString || this.formatString || jsDate.regional[this.locale]['formatString'];
10027
- return jsDate.strftime(this, formatString, this.syntax);
10028
- };
10029
-
10030
- /**
10031
- * Return a String representation of this jsDate object.
10032
- * @returns {String} Date string.
10033
- */
10034
-
10035
- jsDate.prototype.toString = function() {
10036
- return this.proxy.toString();
10037
- };
10038
-
10039
- /**
10040
- * Convert the current date to an 8-digit integer (%Y%m%d)
10041
- *
10042
- * @returns {Integer}
10043
- */
10044
-
10045
- jsDate.prototype.toYmdInt = function() {
10046
- return (this.proxy.getFullYear() * 10000) + (this.getMonthNumber() * 100) + this.proxy.getDate();
10047
- };
10048
-
10049
- /**
10050
- * @namespace Holds localizations for month/day names.
10051
- * <p>jsDate attempts to detect locale when loaded and defaults to 'en'.
10052
- * If a localization is detected which is not available, jsDate defaults to 'en'.
10053
- * Additional localizations can be added after jsDate loads. After adding a localization,
10054
- * call the jsDate.regional.getLocale() method. Currently, en, fr and de are defined.</p>
10055
- *
10056
- * <p>Localizations must be an object and have the following properties defined: monthNames, monthNamesShort, dayNames, dayNamesShort and Localizations are added like:</p>
10057
- * <pre class="code">
10058
- * jsDate.regional['en'] = {
10059
- * monthNames : 'January February March April May June July August September October November December'.split(' '),
10060
- * monthNamesShort : 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '),
10061
- * dayNames : 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday'.split(' '),
10062
- * dayNamesShort : 'Sun Mon Tue Wed Thu Fri Sat'.split(' ')
10063
- * };
10064
- * </pre>
10065
- * <p>After adding localizations, call <code>jsDate.regional.getLocale();</code> to update the locale setting with the
10066
- * new localizations.</p>
10067
- */
10068
-
10069
- jsDate.regional = {
10070
- 'en': {
10071
- monthNames: ['January','February','March','April','May','June','July','August','September','October','November','December'],
10072
- monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
10073
- dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
10074
- dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
10075
- formatString: '%Y-%m-%d %H:%M:%S'
10076
- },
10077
-
10078
- 'fr': {
10079
- monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
10080
- monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun','Jul','Aoû','Sep','Oct','Nov','Déc'],
10081
- dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
10082
- dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
10083
- formatString: '%Y-%m-%d %H:%M:%S'
10084
- },
10085
-
10086
- 'de': {
10087
- monthNames: ['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'],
10088
- monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],
10089
- dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
10090
- dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
10091
- formatString: '%Y-%m-%d %H:%M:%S'
10092
- },
10093
-
10094
- 'es': {
10095
- monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
10096
- monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', 'Jul','Ago','Sep','Oct','Nov','Dic'],
10097
- dayNames: ['Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','S&aacute;bado'],
10098
- dayNamesShort: ['Dom','Lun','Mar','Mi&eacute;','Juv','Vie','S&aacute;b'],
10099
- formatString: '%Y-%m-%d %H:%M:%S'
10100
- },
10101
-
10102
- 'ru': {
10103
- monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
10104
- monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн','Июл','Авг','Сен','Окт','Ноя','Дек'],
10105
- dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
10106
- dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
10107
- formatString: '%Y-%m-%d %H:%M:%S'
10108
- },
10109
-
10110
- 'ar': {
10111
- monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'آذار', 'حزيران','تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'],
10112
- monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
10113
- dayNames: ['السبت', 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة'],
10114
- dayNamesShort: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'],
10115
- formatString: '%Y-%m-%d %H:%M:%S'
10116
- },
10117
-
10118
- 'pt': {
10119
- monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
10120
- monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
10121
- dayNames: ['Domingo','Segunda-feira','Ter&ccedil;a-feira','Quarta-feira','Quinta-feira','Sexta-feira','S&aacute;bado'],
10122
- dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
10123
- formatString: '%Y-%m-%d %H:%M:%S'
10124
- },
10125
-
10126
- 'pt-BR': {
10127
- monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho', 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
10128
- monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
10129
- dayNames: ['Domingo','Segunda-feira','Ter&ccedil;a-feira','Quarta-feira','Quinta-feira','Sexta-feira','S&aacute;bado'],
10130
- dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
10131
- formatString: '%Y-%m-%d %H:%M:%S'
10132
- },
10133
-
10134
- 'pl': {
10135
- monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
10136
- monthNamesShort: ['Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze','Lip', 'Sie', 'Wrz', 'Paź', 'Lis', 'Gru'],
10137
- dayNames: ['Niedziela', 'Poniedziałek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota'],
10138
- dayNamesShort: ['Ni', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'Sb'],
10139
- formatString: '%Y-%m-%d %H:%M:%S'
10140
- },
10141
-
10142
- 'nl': {
10143
- monthNames: ['Januari','Februari','Maart','April','Mei','Juni','July','Augustus','September','Oktober','November','December'],
10144
- monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun','Jul','Aug','Sep','Okt','Nov','Dec'],
10145
- dayNames:','['Zondag','Maandag','Dinsdag','Woensdag','Donderdag','Vrijdag','Zaterdag'],
10146
- dayNamesShort: ['Zo','Ma','Di','Wo','Do','Vr','Za'],
10147
- formatString: '%Y-%m-%d %H:%M:%S'
10148
- },
10149
-
10150
- 'sv': {
10151
- monthNames: ['januari','februari','mars','april','maj','juni','juli','augusti','september','oktober','november','december'],
10152
- monthNamesShort: ['jan','feb','mar','apr','maj','jun','jul','aug','sep','okt','nov','dec'],
10153
- dayNames: ['söndag','måndag','tisdag','onsdag','torsdag','fredag','lördag'],
10154
- dayNamesShort: ['sön','mån','tis','ons','tor','fre','lör'],
10155
- formatString: '%Y-%m-%d %H:%M:%S'
10156
- },
10157
-
10158
- 'it': {
10159
- monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
10160
- monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago','Set','Ott','Nov','Dic'],
10161
- dayNames: ['Domenica','Lunedi','Martedi','Mercoledi','Giovedi','Venerdi','Sabato'],
10162
- dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
10163
- formatString: '%d-%m-%Y %H:%M:%S'
10164
- }
10165
-
10166
- };
10167
-
10168
- // Set english variants to 'en'
10169
- jsDate.regional['en-US'] = jsDate.regional['en-GB'] = jsDate.regional['en'];
10170
-
10171
- /**
10172
- * Try to determine the users locale based on the lang attribute of the html page. Defaults to 'en'
10173
- * if it cannot figure out a locale of if the locale does not have a localization defined.
10174
- * @returns {String} locale
10175
- */
10176
-
10177
- jsDate.regional.getLocale = function () {
10178
- var l = jsDate.config.defaultLocale;
10179
-
10180
- if ( document && document.getElementsByTagName('html') && document.getElementsByTagName('html')[0].lang ) {
10181
- l = document.getElementsByTagName('html')[0].lang;
10182
- if (!jsDate.regional.hasOwnProperty(l)) {
10183
- l = jsDate.config.defaultLocale;
10184
- }
10185
- }
10186
-
10187
- return l;
10188
- };
10189
-
10190
- // ms in day
10191
- var day = 24 * 60 * 60 * 1000;
10192
-
10193
- // padd a number with zeros
10194
- var addZeros = function(num, digits) {
10195
- num = String(num);
10196
- var i = digits - num.length;
10197
- var s = String(Math.pow(10, i)).slice(1);
10198
- return s.concat(num);
10199
- };
10200
-
10201
- // representations used for calculating differences between dates.
10202
- // This borrows heavily from Ken Snyder's work.
10203
- var multipliers = {
10204
- millisecond: 1,
10205
- second: 1000,
10206
- minute: 60 * 1000,
10207
- hour: 60 * 60 * 1000,
10208
- day: day,
10209
- week: 7 * day,
10210
- month: {
10211
- // add a number of months
10212
- add: function(d, number) {
10213
- // add any years needed (increments of 12)
10214
- multipliers.year.add(d, Math[number > 0 ? 'floor' : 'ceil'](number / 12));
10215
- // ensure that we properly wrap betwen December and January
10216
- // 11 % 12 = 11
10217
- // 12 % 12 = 0
10218
- var prevMonth = d.getMonth() + (number % 12);
10219
- if (prevMonth == 12) {
10220
- prevMonth = 0;
10221
- d.setYear(d.getFullYear() + 1);
10222
- } else if (prevMonth == -1) {
10223
- prevMonth = 11;
10224
- d.setYear(d.getFullYear() - 1);
10225
- }
10226
- d.setMonth(prevMonth);
10227
- },
10228
- // get the number of months between two Date objects (decimal to the nearest day)
10229
- diff: function(d1, d2) {
10230
- // get the number of years
10231
- var diffYears = d1.getFullYear() - d2.getFullYear();
10232
- // get the number of remaining months
10233
- var diffMonths = d1.getMonth() - d2.getMonth() + (diffYears * 12);
10234
- // get the number of remaining days
10235
- var diffDays = d1.getDate() - d2.getDate();
10236
- // return the month difference with the days difference as a decimal
10237
- return diffMonths + (diffDays / 30);
10238
- }
10239
- },
10240
- year: {
10241
- // add a number of years
10242
- add: function(d, number) {
10243
- d.setYear(d.getFullYear() + Math[number > 0 ? 'floor' : 'ceil'](number));
10244
- },
10245
- // get the number of years between two Date objects (decimal to the nearest day)
10246
- diff: function(d1, d2) {
10247
- return multipliers.month.diff(d1, d2) / 12;
10248
- }
10249
- }
10250
- };
10251
- //
10252
- // Alias each multiplier with an 's' to allow 'year' and 'years' for example.
10253
- // This comes from Ken Snyders work.
10254
- //
10255
- for (var unit in multipliers) {
10256
- if (unit.substring(unit.length - 1) != 's') { // IE will iterate newly added properties :|
10257
- multipliers[unit + 's'] = multipliers[unit];
10258
- }
10259
- }
10260
-
10261
- //
10262
- // take a jsDate instance and a format code and return the formatted value.
10263
- // This is a somewhat modified version of Ken Snyder's method.
10264
- //
10265
- var format = function(d, code, syntax) {
10266
- // if shorcut codes are used, recursively expand those.
10267
- if (jsDate.formats[syntax]["shortcuts"][code]) {
10268
- return jsDate.strftime(d, jsDate.formats[syntax]["shortcuts"][code], syntax);
10269
- } else {
10270
- // get the format code function and addZeros() argument
10271
- var getter = (jsDate.formats[syntax]["codes"][code] || '').split('.');
10272
- var nbr = d['get' + getter[0]] ? d['get' + getter[0]]() : '';
10273
- if (getter[1]) {
10274
- nbr = addZeros(nbr, getter[1]);
10275
- }
10276
- return nbr;
10277
- }
10278
- };
10279
-
10280
- /**
10281
- * @static
10282
- * Static function for convert a date to a string according to a given format. Also acts as namespace for strftime format codes.
10283
- * <p>strftime formatting can be accomplished without creating a jsDate object by calling jsDate.strftime():</p>
10284
- * <pre class="code">
10285
- * var formattedDate = jsDate.strftime('Feb 8, 2006 8:48:32', '%Y-%m-%d %H:%M:%S');
10286
- * </pre>
10287
- * @param {String | Number | Array | jsDate&nbsp;Object | Date&nbsp;Object} date A parsable date string, JavaScript time stamp, Array of form [year, month, day, hours, minutes, seconds, milliseconds], jsDate Object or Date object.
10288
- * @param {String} formatString String with embedded date formatting codes.
10289
- * See: {@link jsDate.formats}.
10290
- * @param {String} syntax Optional syntax to use [default perl].
10291
- * @param {String} locale Optional locale to use.
10292
- * @returns {String} Formatted representation of the date.
10293
- */
10294
- //
10295
- // Logic as implemented here is very similar to Ken Snyder's Date Instance Methods.
10296
- //
10297
- jsDate.strftime = function(d, formatString, syntax, locale) {
10298
- var syn = 'perl';
10299
- var loc = jsDate.regional.getLocale();
10300
-
10301
- // check if syntax and locale are available or reversed
10302
- if (syntax && jsDate.formats.hasOwnProperty(syntax)) {
10303
- syn = syntax;
10304
- }
10305
- else if (syntax && jsDate.regional.hasOwnProperty(syntax)) {
10306
- loc = syntax;
10307
- }
10308
-
10309
- if (locale && jsDate.formats.hasOwnProperty(locale)) {
10310
- syn = locale;
10311
- }
10312
- else if (locale && jsDate.regional.hasOwnProperty(locale)) {
10313
- loc = locale;
10314
- }
10315
-
10316
- if (get_type(d) != "[object Object]" || d._type != "jsDate") {
10317
- d = new jsDate(d);
10318
- d.locale = loc;
10319
- }
10320
- if (!formatString) {
10321
- formatString = d.formatString || jsDate.regional[loc]['formatString'];
10322
- }
10323
- // default the format string to year-month-day
10324
- var source = formatString || '%Y-%m-%d',
10325
- result = '',
10326
- match;
10327
- // replace each format code
10328
- while (source.length > 0) {
10329
- if (match = source.match(jsDate.formats[syn].codes.matcher)) {
10330
- result += source.slice(0, match.index);
10331
- result += (match[1] || '') + format(d, match[2], syn);
10332
- source = source.slice(match.index + match[0].length);
10333
- } else {
10334
- result += source;
10335
- source = '';
10336
- }
10337
- }
10338
- return result;
10339
- };
10340
-
10341
- /**
10342
- * @namespace
10343
- * Namespace to hold format codes and format shortcuts. "perl" and "php" format codes
10344
- * and shortcuts are defined by default. Additional codes and shortcuts can be
10345
- * added like:
10346
- *
10347
- * <pre class="code">
10348
- * jsDate.formats["perl"] = {
10349
- * "codes": {
10350
- * matcher: /someregex/,
10351
- * Y: "fullYear", // name of "get" method without the "get",
10352
- * ..., // more codes
10353
- * },
10354
- * "shortcuts": {
10355
- * F: '%Y-%m-%d',
10356
- * ..., // more shortcuts
10357
- * }
10358
- * };
10359
- * </pre>
10360
- *
10361
- * <p>Additionally, ISO and SQL shortcuts are defined and can be accesses via:
10362
- * <code>jsDate.formats.ISO</code> and <code>jsDate.formats.SQL</code>
10363
- */
10364
-
10365
- jsDate.formats = {
10366
- ISO:'%Y-%m-%dT%H:%M:%S.%N%G',
10367
- SQL:'%Y-%m-%d %H:%M:%S'
10368
- };
10369
-
10370
- /**
10371
- * Perl format codes and shortcuts for strftime.
10372
- *
10373
- * A hash (object) of codes where each code must be an array where the first member is
10374
- * the name of a Date.prototype or jsDate.prototype function to call
10375
- * and optionally a second member indicating the number to pass to addZeros()
10376
- *
10377
- * <p>The following format codes are defined:</p>
10378
- *
10379
- * <pre class="code">
10380
- * Code Result Description
10381
- * == Years ==
10382
- * %Y 2008 Four-digit year
10383
- * %y 08 Two-digit year
10384
- *
10385
- * == Months ==
10386
- * %m 09 Two-digit month
10387
- * %#m 9 One or two-digit month
10388
- * %B September Full month name
10389
- * %b Sep Abbreviated month name
10390
- *
10391
- * == Days ==
10392
- * %d 05 Two-digit day of month
10393
- * %#d 5 One or two-digit day of month
10394
- * %e 5 One or two-digit day of month
10395
- * %A Sunday Full name of the day of the week
10396
- * %a Sun Abbreviated name of the day of the week
10397
- * %w 0 Number of the day of the week (0 = Sunday, 6 = Saturday)
10398
- *
10399
- * == Hours ==
10400
- * %H 23 Hours in 24-hour format (two digits)
10401
- * %#H 3 Hours in 24-hour integer format (one or two digits)
10402
- * %I 11 Hours in 12-hour format (two digits)
10403
- * %#I 3 Hours in 12-hour integer format (one or two digits)
10404
- * %p PM AM or PM
10405
- *
10406
- * == Minutes ==
10407
- * %M 09 Minutes (two digits)
10408
- * %#M 9 Minutes (one or two digits)
10409
- *
10410
- * == Seconds ==
10411
- * %S 02 Seconds (two digits)
10412
- * %#S 2 Seconds (one or two digits)
10413
- * %s 1206567625723 Unix timestamp (Seconds past 1970-01-01 00:00:00)
10414
- *
10415
- * == Milliseconds ==
10416
- * %N 008 Milliseconds (three digits)
10417
- * %#N 8 Milliseconds (one to three digits)
10418
- *
10419
- * == Timezone ==
10420
- * %O 360 difference in minutes between local time and GMT
10421
- * %Z Mountain Standard Time Name of timezone as reported by browser
10422
- * %G 06:00 Hours and minutes between GMT
10423
- *
10424
- * == Shortcuts ==
10425
- * %F 2008-03-26 %Y-%m-%d
10426
- * %T 05:06:30 %H:%M:%S
10427
- * %X 05:06:30 %H:%M:%S
10428
- * %x 03/26/08 %m/%d/%y
10429
- * %D 03/26/08 %m/%d/%y
10430
- * %#c Wed Mar 26 15:31:00 2008 %a %b %e %H:%M:%S %Y
10431
- * %v 3-Sep-2008 %e-%b-%Y
10432
- * %R 15:31 %H:%M
10433
- * %r 03:31:00 PM %I:%M:%S %p
10434
- *
10435
- * == Characters ==
10436
- * %n \n Newline
10437
- * %t \t Tab
10438
- * %% % Percent Symbol
10439
- * </pre>
10440
- *
10441
- * <p>Formatting shortcuts that will be translated into their longer version.
10442
- * Be sure that format shortcuts do not refer to themselves: this will cause an infinite loop.</p>
10443
- *
10444
- * <p>Format codes and format shortcuts can be redefined after the jsDate
10445
- * module is imported.</p>
10446
- *
10447
- * <p>Note that if you redefine the whole hash (object), you must supply a "matcher"
10448
- * regex for the parser. The default matcher is:</p>
10449
- *
10450
- * <code>/()%(#?(%|[a-z]))/i</code>
10451
- *
10452
- * <p>which corresponds to the Perl syntax used by default.</p>
10453
- *
10454
- * <p>By customizing the matcher and format codes, nearly any strftime functionality is possible.</p>
10455
- */
10456
-
10457
- jsDate.formats.perl = {
10458
- codes: {
10459
- //
10460
- // 2-part regex matcher for format codes
10461
- //
10462
- // first match must be the character before the code (to account for escaping)
10463
- // second match must be the format code character(s)
10464
- //
10465
- matcher: /()%(#?(%|[a-z]))/i,
10466
- // year
10467
- Y: 'FullYear',
10468
- y: 'ShortYear.2',
10469
- // month
10470
- m: 'MonthNumber.2',
10471
- '#m': 'MonthNumber',
10472
- B: 'MonthName',
10473
- b: 'AbbrMonthName',
10474
- // day
10475
- d: 'Date.2',
10476
- '#d': 'Date',
10477
- e: 'Date',
10478
- A: 'DayName',
10479
- a: 'AbbrDayName',
10480
- w: 'Day',
10481
- // hours
10482
- H: 'Hours.2',
10483
- '#H': 'Hours',
10484
- I: 'Hours12.2',
10485
- '#I': 'Hours12',
10486
- p: 'AMPM',
10487
- // minutes
10488
- M: 'Minutes.2',
10489
- '#M': 'Minutes',
10490
- // seconds
10491
- S: 'Seconds.2',
10492
- '#S': 'Seconds',
10493
- s: 'Unix',
10494
- // milliseconds
10495
- N: 'Milliseconds.3',
10496
- '#N': 'Milliseconds',
10497
- // timezone
10498
- O: 'TimezoneOffset',
10499
- Z: 'TimezoneName',
10500
- G: 'GmtOffset'
10501
- },
10502
-
10503
- shortcuts: {
10504
- // date
10505
- F: '%Y-%m-%d',
10506
- // time
10507
- T: '%H:%M:%S',
10508
- X: '%H:%M:%S',
10509
- // local format date
10510
- x: '%m/%d/%y',
10511
- D: '%m/%d/%y',
10512
- // local format extended
10513
- '#c': '%a %b %e %H:%M:%S %Y',
10514
- // local format short
10515
- v: '%e-%b-%Y',
10516
- R: '%H:%M',
10517
- r: '%I:%M:%S %p',
10518
- // tab and newline
10519
- t: '\t',
10520
- n: '\n',
10521
- '%': '%'
10522
- }
10523
- };
10524
-
10525
- /**
10526
- * PHP format codes and shortcuts for strftime.
10527
- *
10528
- * A hash (object) of codes where each code must be an array where the first member is
10529
- * the name of a Date.prototype or jsDate.prototype function to call
10530
- * and optionally a second member indicating the number to pass to addZeros()
10531
- *
10532
- * <p>The following format codes are defined:</p>
10533
- *
10534
- * <pre class="code">
10535
- * Code Result Description
10536
- * === Days ===
10537
- * %a Sun through Sat An abbreviated textual representation of the day
10538
- * %A Sunday - Saturday A full textual representation of the day
10539
- * %d 01 to 31 Two-digit day of the month (with leading zeros)
10540
- * %e 1 to 31 Day of the month, with a space preceding single digits.
10541
- * %j 001 to 366 Day of the year, 3 digits with leading zeros
10542
- * %u 1 - 7 (Mon - Sun) ISO-8601 numeric representation of the day of the week
10543
- * %w 0 - 6 (Sun - Sat) Numeric representation of the day of the week
10544
- *
10545
- * === Week ===
10546
- * %U 13 Full Week number, starting with the first Sunday as the first week
10547
- * %V 01 through 53 ISO-8601:1988 week number, starting with the first week of the year
10548
- * with at least 4 weekdays, with Monday being the start of the week
10549
- * %W 46 A numeric representation of the week of the year,
10550
- * starting with the first Monday as the first week
10551
- * === Month ===
10552
- * %b Jan through Dec Abbreviated month name, based on the locale
10553
- * %B January - December Full month name, based on the locale
10554
- * %h Jan through Dec Abbreviated month name, based on the locale (an alias of %b)
10555
- * %m 01 - 12 (Jan - Dec) Two digit representation of the month
10556
- *
10557
- * === Year ===
10558
- * %C 19 Two digit century (year/100, truncated to an integer)
10559
- * %y 09 for 2009 Two digit year
10560
- * %Y 2038 Four digit year
10561
- *
10562
- * === Time ===
10563
- * %H 00 through 23 Two digit representation of the hour in 24-hour format
10564
- * %I 01 through 12 Two digit representation of the hour in 12-hour format
10565
- * %l 1 through 12 Hour in 12-hour format, with a space preceeding single digits
10566
- * %M 00 through 59 Two digit representation of the minute
10567
- * %p AM/PM UPPER-CASE 'AM' or 'PM' based on the given time
10568
- * %P am/pm lower-case 'am' or 'pm' based on the given time
10569
- * %r 09:34:17 PM Same as %I:%M:%S %p
10570
- * %R 00:35 Same as %H:%M
10571
- * %S 00 through 59 Two digit representation of the second
10572
- * %T 21:34:17 Same as %H:%M:%S
10573
- * %X 03:59:16 Preferred time representation based on locale, without the date
10574
- * %z -0500 or EST Either the time zone offset from UTC or the abbreviation
10575
- * %Z -0500 or EST The time zone offset/abbreviation option NOT given by %z
10576
- *
10577
- * === Time and Date ===
10578
- * %D 02/05/09 Same as %m/%d/%y
10579
- * %F 2009-02-05 Same as %Y-%m-%d (commonly used in database datestamps)
10580
- * %s 305815200 Unix Epoch Time timestamp (same as the time() function)
10581
- * %x 02/05/09 Preferred date representation, without the time
10582
- *
10583
- * === Miscellaneous ===
10584
- * %n --- A newline character (\n)
10585
- * %t --- A Tab character (\t)
10586
- * %% --- A literal percentage character (%)
10587
- * </pre>
10588
- */
10589
-
10590
- jsDate.formats.php = {
10591
- codes: {
10592
- //
10593
- // 2-part regex matcher for format codes
10594
- //
10595
- // first match must be the character before the code (to account for escaping)
10596
- // second match must be the format code character(s)
10597
- //
10598
- matcher: /()%((%|[a-z]))/i,
10599
- // day
10600
- a: 'AbbrDayName',
10601
- A: 'DayName',
10602
- d: 'Date.2',
10603
- e: 'Date',
10604
- j: 'DayOfYear.3',
10605
- u: 'DayOfWeek',
10606
- w: 'Day',
10607
- // week
10608
- U: 'FullWeekOfYear.2',
10609
- V: 'IsoWeek.2',
10610
- W: 'WeekOfYear.2',
10611
- // month
10612
- b: 'AbbrMonthName',
10613
- B: 'MonthName',
10614
- m: 'MonthNumber.2',
10615
- h: 'AbbrMonthName',
10616
- // year
10617
- C: 'Century.2',
10618
- y: 'ShortYear.2',
10619
- Y: 'FullYear',
10620
- // time
10621
- H: 'Hours.2',
10622
- I: 'Hours12.2',
10623
- l: 'Hours12',
10624
- p: 'AMPM',
10625
- P: 'AmPm',
10626
- M: 'Minutes.2',
10627
- S: 'Seconds.2',
10628
- s: 'Unix',
10629
- O: 'TimezoneOffset',
10630
- z: 'GmtOffset',
10631
- Z: 'TimezoneAbbr'
10632
- },
10633
-
10634
- shortcuts: {
10635
- D: '%m/%d/%y',
10636
- F: '%Y-%m-%d',
10637
- T: '%H:%M:%S',
10638
- X: '%H:%M:%S',
10639
- x: '%m/%d/%y',
10640
- R: '%H:%M',
10641
- r: '%I:%M:%S %p',
10642
- t: '\t',
10643
- n: '\n',
10644
- '%': '%'
10645
- }
10646
- };
10647
- //
10648
- // Conceptually, the logic implemented here is similar to Ken Snyder's Date Instance Methods.
10649
- // I use his idea of a set of parsers which can be regular expressions or functions,
10650
- // iterating through those, and then seeing if Date.parse() will create a date.
10651
- // The parser expressions and functions are a little different and some bugs have been
10652
- // worked out. Also, a lot of "pre-parsing" is done to fix implementation
10653
- // variations of Date.parse() between browsers.
10654
- //
10655
- jsDate.createDate = function(date) {
10656
- // if passing in multiple arguments, try Date constructor
10657
- if (date == null) {
10658
- return new Date();
10659
- }
10660
- // If the passed value is already a date object, return it
10661
- if (date instanceof Date) {
10662
- return date;
10663
- }
10664
- // if (typeof date == 'number') return new Date(date * 1000);
10665
- // If the passed value is an integer, interpret it as a javascript timestamp
10666
- if (typeof date == 'number') {
10667
- return new Date(date);
10668
- }
10669
-
10670
- // Before passing strings into Date.parse(), have to normalize them for certain conditions.
10671
- // If strings are not formatted staccording to the EcmaScript spec, results from Date parse will be implementation dependent.
10672
- //
10673
- // For example:
10674
- // * FF and Opera assume 2 digit dates are pre y2k, Chome assumes <50 is pre y2k, 50+ is 21st century.
10675
- // * Chrome will correctly parse '1984-1-25' into localtime, FF and Opera will not parse.
10676
- // * Both FF, Chrome and Opera will parse '1984/1/25' into localtime.
10677
-
10678
- // remove leading and trailing spaces
10679
- var parsable = String(date).replace(/^\s*(.+)\s*$/g, '$1');
10680
-
10681
- // replace dahses (-) with slashes (/) in dates like n[nnn]/n[n]/n[nnn]
10682
- parsable = parsable.replace(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/, "$1/$2/$3");
10683
-
10684
- /////////
10685
- // Need to check for '15-Dec-09' also.
10686
- // FF will not parse, but Chrome will.
10687
- // Chrome will set date to 2009 as well.
10688
- /////////
10689
-
10690
- // first check for 'dd-mmm-yyyy' or 'dd/mmm/yyyy' like '15-Dec-2010'
10691
- parsable = parsable.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{4})/i, "$1 $2 $3");
10692
-
10693
- // Now check for 'dd-mmm-yy' or 'dd/mmm/yy' and normalize years to default century.
10694
- var match = parsable.match(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i);
10695
- if (match && match.length > 3) {
10696
- var m3 = parseFloat(match[3]);
10697
- var ny = jsDate.config.defaultCentury + m3;
10698
- ny = String(ny);
10699
-
10700
- // now replace 2 digit year with 4 digit year
10701
- parsable = parsable.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i, match[1] +' '+ match[2] +' '+ ny);
10702
-
10703
- }
10704
-
10705
- // Check for '1/19/70 8:14PM'
10706
- // where starts with mm/dd/yy or yy/mm/dd and have something after
10707
- // Check if 1st postiion is greater than 31, assume it is year.
10708
- // Assme all 2 digit years are 1900's.
10709
- // Finally, change them into US style mm/dd/yyyy representations.
10710
- match = parsable.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})[^0-9]/);
10711
-
10712
- function h1(parsable, match) {
10713
- var m1 = parseFloat(match[1]);
10714
- var m2 = parseFloat(match[2]);
10715
- var m3 = parseFloat(match[3]);
10716
- var cent = jsDate.config.defaultCentury;
10717
- var ny, nd, nm, str;
10718
-
10719
- if (m1 > 31) { // first number is a year
10720
- nd = m3;
10721
- nm = m2;
10722
- ny = cent + m1;
10723
- }
10724
-
10725
- else { // last number is the year
10726
- nd = m2;
10727
- nm = m1;
10728
- ny = cent + m3;
10729
- }
10730
-
10731
- str = nm+'/'+nd+'/'+ny;
10732
-
10733
- // now replace 2 digit year with 4 digit year
10734
- return parsable.replace(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})/, str);
10735
-
10736
- }
10737
-
10738
- if (match && match.length > 3) {
10739
- parsable = h1(parsable, match);
10740
- }
10741
-
10742
- // Now check for '1/19/70' with nothing after and do as above
10743
- var match = parsable.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})$/);
10744
-
10745
- if (match && match.length > 3) {
10746
- parsable = h1(parsable, match);
10747
- }
10748
-
10749
-
10750
- var i = 0;
10751
- var length = jsDate.matchers.length;
10752
- var pattern,
10753
- ms,
10754
- current = parsable,
10755
- obj;
10756
- while (i < length) {
10757
- ms = Date.parse(current);
10758
- if (!isNaN(ms)) {
10759
- return new Date(ms);
10760
- }
10761
- pattern = jsDate.matchers[i];
10762
- if (typeof pattern == 'function') {
10763
- obj = pattern.call(jsDate, current);
10764
- if (obj instanceof Date) {
10765
- return obj;
10766
- }
10767
- } else {
10768
- current = parsable.replace(pattern[0], pattern[1]);
10769
- }
10770
- i++;
10771
- }
10772
- return NaN;
10773
- };
10774
-
10775
-
10776
- /**
10777
- * @static
10778
- * Handy static utility function to return the number of days in a given month.
10779
- * @param {Integer} year Year
10780
- * @param {Integer} month Month (1-12)
10781
- * @returns {Integer} Number of days in the month.
10782
- */
10783
- //
10784
- // handy utility method Borrowed right from Ken Snyder's Date Instance Mehtods.
10785
- //
10786
- jsDate.daysInMonth = function(year, month) {
10787
- if (month == 2) {
10788
- return new Date(year, 1, 29).getDate() == 29 ? 29 : 28;
10789
- }
10790
- return [undefined,31,undefined,31,30,31,30,31,31,30,31,30,31][month];
10791
- };
10792
-
10793
-
10794
- //
10795
- // An Array of regular expressions or functions that will attempt to match the date string.
10796
- // Functions are called with scope of a jsDate instance.
10797
- //
10798
- jsDate.matchers = [
10799
- // convert dd.mmm.yyyy to mm/dd/yyyy (world date to US date).
10800
- [/(3[01]|[0-2]\d)\s*\.\s*(1[0-2]|0\d)\s*\.\s*([1-9]\d{3})/, '$2/$1/$3'],
10801
- // convert yyyy-mm-dd to mm/dd/yyyy (ISO date to US date).
10802
- [/([1-9]\d{3})\s*-\s*(1[0-2]|0\d)\s*-\s*(3[01]|[0-2]\d)/, '$2/$3/$1'],
10803
- // Handle 12 hour or 24 hour time with milliseconds am/pm and optional date part.
10804
- function(str) {
10805
- var match = str.match(/^(?:(.+)\s+)?([012]?\d)(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d(\.\d*)?))?\s*(am|pm)?\s*$/i);
10806
- // opt. date hour opt. minute opt. second opt. msec opt. am or pm
10807
- if (match) {
10808
- if (match[1]) {
10809
- var d = this.createDate(match[1]);
10810
- if (isNaN(d)) {
10811
- return;
10812
- }
10813
- } else {
10814
- var d = new Date();
10815
- d.setMilliseconds(0);
10816
- }
10817
- var hour = parseFloat(match[2]);
10818
- if (match[6]) {
10819
- hour = match[6].toLowerCase() == 'am' ? (hour == 12 ? 0 : hour) : (hour == 12 ? 12 : hour + 12);
10820
- }
10821
- d.setHours(hour, parseInt(match[3] || 0, 10), parseInt(match[4] || 0, 10), ((parseFloat(match[5] || 0)) || 0)*1000);
10822
- return d;
10823
- }
10824
- else {
10825
- return str;
10826
- }
10827
- },
10828
- // Handle ISO timestamp with time zone.
10829
- function(str) {
10830
- var match = str.match(/^(?:(.+))[T|\s+]([012]\d)(?:\:(\d\d))(?:\:(\d\d))(?:\.\d+)([\+\-]\d\d\:\d\d)$/i);
10831
- if (match) {
10832
- if (match[1]) {
10833
- var d = this.createDate(match[1]);
10834
- if (isNaN(d)) {
10835
- return;
10836
- }
10837
- } else {
10838
- var d = new Date();
10839
- d.setMilliseconds(0);
10840
- }
10841
- var hour = parseFloat(match[2]);
10842
- d.setHours(hour, parseInt(match[3], 10), parseInt(match[4], 10), parseFloat(match[5])*1000);
10843
- return d;
10844
- }
10845
- else {
10846
- return str;
10847
- }
10848
- },
10849
- // Try to match ambiguous strings like 12/8/22.
10850
- // Use FF date assumption that 2 digit years are 20th century (i.e. 1900's).
10851
- // This may be redundant with pre processing of date already performed.
10852
- function(str) {
10853
- var match = str.match(/^([0-3]?\d)\s*[-\/.\s]{1}\s*([a-zA-Z]{3,9})\s*[-\/.\s]{1}\s*([0-3]?\d)$/);
10854
- if (match) {
10855
- var d = new Date();
10856
- var cent = jsDate.config.defaultCentury;
10857
- var m1 = parseFloat(match[1]);
10858
- var m3 = parseFloat(match[3]);
10859
- var ny, nd, nm;
10860
- if (m1 > 31) { // first number is a year
10861
- nd = m3;
10862
- ny = cent + m1;
10863
- }
10864
-
10865
- else { // last number is the year
10866
- nd = m1;
10867
- ny = cent + m3;
10868
- }
10869
-
10870
- var nm = inArray(match[2], jsDate.regional[jsDate.regional.getLocale()]["monthNamesShort"]);
10871
-
10872
- if (nm == -1) {
10873
- nm = inArray(match[2], jsDate.regional[jsDate.regional.getLocale()]["monthNames"]);
10874
- }
10875
-
10876
- d.setFullYear(ny, nm, nd);
10877
- d.setHours(0,0,0,0);
10878
- return d;
10879
- }
10880
-
10881
- else {
10882
- return str;
10883
- }
10884
- }
10885
- ];
10886
-
10887
- //
10888
- // I think John Reisig published this method on his blog, ejohn.
10889
- //
10890
- function inArray( elem, array ) {
10891
- if ( array.indexOf ) {
10892
- return array.indexOf( elem );
10893
- }
10894
-
10895
- for ( var i = 0, length = array.length; i < length; i++ ) {
10896
- if ( array[ i ] === elem ) {
10897
- return i;
10898
- }
10899
- }
10900
-
10901
- return -1;
10902
- }
10903
-
10904
- //
10905
- // Thanks to Kangax, Christian Sciberras and Stack Overflow for this method.
10906
- //
10907
- function get_type(thing){
10908
- if(thing===null) return "[object Null]"; // special case
10909
- return Object.prototype.toString.call(thing);
10910
- }
10911
-
10912
- $.jsDate = jsDate;
10913
-
10914
-
10915
- /**
10916
- * JavaScript printf/sprintf functions.
10917
- *
10918
- * This code has been adapted from the publicly available sprintf methods
10919
- * by Ash Searle. His original header follows:
10920
- *
10921
- * This code is unrestricted: you are free to use it however you like.
10922
- *
10923
- * The functions should work as expected, performing left or right alignment,
10924
- * truncating strings, outputting numbers with a required precision etc.
10925
- *
10926
- * For complex cases, these functions follow the Perl implementations of
10927
- * (s)printf, allowing arguments to be passed out-of-order, and to set the
10928
- * precision or length of the output based on arguments instead of fixed
10929
- * numbers.
10930
- *
10931
- * See http://perldoc.perl.org/functions/sprintf.html for more information.
10932
- *
10933
- * Implemented:
10934
- * - zero and space-padding
10935
- * - right and left-alignment,
10936
- * - base X prefix (binary, octal and hex)
10937
- * - positive number prefix
10938
- * - (minimum) width
10939
- * - precision / truncation / maximum width
10940
- * - out of order arguments
10941
- *
10942
- * Not implemented (yet):
10943
- * - vector flag
10944
- * - size (bytes, words, long-words etc.)
10945
- *
10946
- * Will not implement:
10947
- * - %n or %p (no pass-by-reference in JavaScript)
10948
- *
10949
- * @version 2007.04.27
10950
- * @author Ash Searle
10951
- *
10952
- * You can see the original work and comments on his blog:
10953
- * http://hexmen.com/blog/2007/03/printf-sprintf/
10954
- * http://hexmen.com/js/sprintf.js
10955
- */
10956
-
10957
- /**
10958
- * @Modifications 2009.05.26
10959
- * @author Chris Leonello
10960
- *
10961
- * Added %p %P specifier
10962
- * Acts like %g or %G but will not add more significant digits to the output than present in the input.
10963
- * Example:
10964
- * Format: '%.3p', Input: 0.012, Output: 0.012
10965
- * Format: '%.3g', Input: 0.012, Output: 0.0120
10966
- * Format: '%.4p', Input: 12.0, Output: 12.0
10967
- * Format: '%.4g', Input: 12.0, Output: 12.00
10968
- * Format: '%.4p', Input: 4.321e-5, Output: 4.321e-5
10969
- * Format: '%.4g', Input: 4.321e-5, Output: 4.3210e-5
10970
- *
10971
- * Example:
10972
- * >>> $.jqplot.sprintf('%.2f, %d', 23.3452, 43.23)
10973
- * "23.35, 43"
10974
- * >>> $.jqplot.sprintf("no value: %n, decimal with thousands separator: %'d", 23.3452, 433524)
10975
- * "no value: , decimal with thousands separator: 433,524"
10976
- */
10977
- $.jqplot.sprintf = function() {
10978
- function pad(str, len, chr, leftJustify) {
10979
- var padding = (str.length >= len) ? '' : Array(1 + len - str.length >>> 0).join(chr);
10980
- return leftJustify ? str + padding : padding + str;
10981
-
10982
- }
10983
-
10984
- function thousand_separate(value) {
10985
- var value_str = new String(value);
10986
- for (var i=10; i>0; i--) {
10987
- if (value_str == (value_str = value_str.replace(/^(\d+)(\d{3})/, "$1"+$.jqplot.sprintf.thousandsSeparator+"$2"))) break;
10988
- }
10989
- return value_str;
10990
- }
10991
-
10992
- function justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace) {
10993
- var diff = minWidth - value.length;
10994
- if (diff > 0) {
10995
- var spchar = ' ';
10996
- if (htmlSpace) { spchar = '&nbsp;'; }
10997
- if (leftJustify || !zeroPad) {
10998
- value = pad(value, minWidth, spchar, leftJustify);
10999
- } else {
11000
- value = value.slice(0, prefix.length) + pad('', diff, '0', true) + value.slice(prefix.length);
11001
- }
11002
- }
11003
- return value;
11004
- }
11005
-
11006
- function formatBaseX(value, base, prefix, leftJustify, minWidth, precision, zeroPad, htmlSpace) {
11007
- // Note: casts negative numbers to positive ones
11008
- var number = value >>> 0;
11009
- prefix = prefix && number && {'2': '0b', '8': '0', '16': '0x'}[base] || '';
11010
- value = prefix + pad(number.toString(base), precision || 0, '0', false);
11011
- return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace);
11012
- }
11013
-
11014
- function formatString(value, leftJustify, minWidth, precision, zeroPad, htmlSpace) {
11015
- if (precision != null) {
11016
- value = value.slice(0, precision);
11017
- }
11018
- return justify(value, '', leftJustify, minWidth, zeroPad, htmlSpace);
11019
- }
11020
-
11021
- var a = arguments, i = 0, format = a[i++];
11022
-
11023
- return format.replace($.jqplot.sprintf.regex, function(substring, valueIndex, flags, minWidth, _, precision, type) {
11024
- if (substring == '%%') { return '%'; }
11025
-
11026
- // parse flags
11027
- var leftJustify = false, positivePrefix = '', zeroPad = false, prefixBaseX = false, htmlSpace = false, thousandSeparation = false;
11028
- for (var j = 0; flags && j < flags.length; j++) switch (flags.charAt(j)) {
11029
- case ' ': positivePrefix = ' '; break;
11030
- case '+': positivePrefix = '+'; break;
11031
- case '-': leftJustify = true; break;
11032
- case '0': zeroPad = true; break;
11033
- case '#': prefixBaseX = true; break;
11034
- case '&': htmlSpace = true; break;
11035
- case '\'': thousandSeparation = true; break;
11036
- }
11037
-
11038
- // parameters may be null, undefined, empty-string or real valued
11039
- // we want to ignore null, undefined and empty-string values
11040
-
11041
- if (!minWidth) {
11042
- minWidth = 0;
11043
- }
11044
- else if (minWidth == '*') {
11045
- minWidth = +a[i++];
11046
- }
11047
- else if (minWidth.charAt(0) == '*') {
11048
- minWidth = +a[minWidth.slice(1, -1)];
11049
- }
11050
- else {
11051
- minWidth = +minWidth;
11052
- }
11053
-
11054
- // Note: undocumented perl feature:
11055
- if (minWidth < 0) {
11056
- minWidth = -minWidth;
11057
- leftJustify = true;
11058
- }
11059
-
11060
- if (!isFinite(minWidth)) {
11061
- throw new Error('$.jqplot.sprintf: (minimum-)width must be finite');
11062
- }
11063
-
11064
- if (!precision) {
11065
- precision = 'fFeE'.indexOf(type) > -1 ? 6 : (type == 'd') ? 0 : void(0);
11066
- }
11067
- else if (precision == '*') {
11068
- precision = +a[i++];
11069
- }
11070
- else if (precision.charAt(0) == '*') {
11071
- precision = +a[precision.slice(1, -1)];
11072
- }
11073
- else {
11074
- precision = +precision;
11075
- }
11076
-
11077
- // grab value using valueIndex if required?
11078
- var value = valueIndex ? a[valueIndex.slice(0, -1)] : a[i++];
11079
-
11080
- switch (type) {
11081
- case 's': {
11082
- if (value == null) {
11083
- return '';
11084
- }
11085
- return formatString(String(value), leftJustify, minWidth, precision, zeroPad, htmlSpace);
11086
- }
11087
- case 'c': return formatString(String.fromCharCode(+value), leftJustify, minWidth, precision, zeroPad, htmlSpace);
11088
- case 'b': return formatBaseX(value, 2, prefixBaseX, leftJustify, minWidth, precision, zeroPad,htmlSpace);
11089
- case 'o': return formatBaseX(value, 8, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace);
11090
- case 'x': return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace);
11091
- case 'X': return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace).toUpperCase();
11092
- case 'u': return formatBaseX(value, 10, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace);
11093
- case 'i': {
11094
- var number = parseInt(+value, 10);
11095
- if (isNaN(number)) {
11096
- return '';
11097
- }
11098
- var prefix = number < 0 ? '-' : positivePrefix;
11099
- var number_str = thousandSeparation ? thousand_separate(String(Math.abs(number))): String(Math.abs(number));
11100
- value = prefix + pad(number_str, precision, '0', false);
11101
- //value = prefix + pad(String(Math.abs(number)), precision, '0', false);
11102
- return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace);
11103
- }
11104
- case 'd': {
11105
- var number = Math.round(+value);
11106
- if (isNaN(number)) {
11107
- return '';
11108
- }
11109
- var prefix = number < 0 ? '-' : positivePrefix;
11110
- var number_str = thousandSeparation ? thousand_separate(String(Math.abs(number))): String(Math.abs(number));
11111
- value = prefix + pad(number_str, precision, '0', false);
11112
- return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace);
11113
- }
11114
- case 'e':
11115
- case 'E':
11116
- case 'f':
11117
- case 'F':
11118
- case 'g':
11119
- case 'G':
11120
- {
11121
- var number = +value;
11122
- if (isNaN(number)) {
11123
- return '';
11124
- }
11125
- var prefix = number < 0 ? '-' : positivePrefix;
11126
- var method = ['toExponential', 'toFixed', 'toPrecision']['efg'.indexOf(type.toLowerCase())];
11127
- var textTransform = ['toString', 'toUpperCase']['eEfFgG'.indexOf(type) % 2];
11128
- var number_str = Math.abs(number)[method](precision);
11129
-
11130
- // Apply the decimal mark properly by splitting the number by the
11131
- // decimalMark, applying thousands separator, and then placing it
11132
- // back in.
11133
- var parts = number_str.toString().split('.');
11134
- parts[0] = thousandSeparation ? thousand_separate(parts[0]) : parts[0];
11135
- number_str = parts.join($.jqplot.sprintf.decimalMark);
11136
-
11137
- value = prefix + number_str;
11138
- var justified = justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace)[textTransform]();
11139
-
11140
- return justified;
11141
- }
11142
- case 'p':
11143
- case 'P':
11144
- {
11145
- // make sure number is a number
11146
- var number = +value;
11147
- if (isNaN(number)) {
11148
- return '';
11149
- }
11150
- var prefix = number < 0 ? '-' : positivePrefix;
11151
-
11152
- var parts = String(Number(Math.abs(number)).toExponential()).split(/e|E/);
11153
- var sd = (parts[0].indexOf('.') != -1) ? parts[0].length - 1 : String(number).length;
11154
- var zeros = (parts[1] < 0) ? -parts[1] - 1 : 0;
11155
-
11156
- if (Math.abs(number) < 1) {
11157
- if (sd + zeros <= precision) {
11158
- value = prefix + Math.abs(number).toPrecision(sd);
11159
- }
11160
- else {
11161
- if (sd <= precision - 1) {
11162
- value = prefix + Math.abs(number).toExponential(sd-1);
11163
- }
11164
- else {
11165
- value = prefix + Math.abs(number).toExponential(precision-1);
11166
- }
11167
- }
11168
- }
11169
- else {
11170
- var prec = (sd <= precision) ? sd : precision;
11171
- value = prefix + Math.abs(number).toPrecision(prec);
11172
- }
11173
- var textTransform = ['toString', 'toUpperCase']['pP'.indexOf(type) % 2];
11174
- return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace)[textTransform]();
11175
- }
11176
- case 'n': return '';
11177
- default: return substring;
11178
- }
11179
- });
11180
- };
11181
-
11182
- $.jqplot.sprintf.thousandsSeparator = ',';
11183
- // Specifies the decimal mark for floating point values. By default a period '.'
11184
- // is used. If you change this value to for example a comma be sure to also
11185
- // change the thousands separator or else this won't work since a simple String
11186
- // replace is used (replacing all periods with the mark specified here).
11187
- $.jqplot.sprintf.decimalMark = '.';
11188
-
11189
- $.jqplot.sprintf.regex = /%%|%(\d+\$)?([-+#0&\' ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g;
11190
-
11191
- $.jqplot.getSignificantFigures = function(number) {
11192
- var parts = String(Number(Math.abs(number)).toExponential()).split(/e|E/);
11193
- // total significant digits
11194
- var sd = (parts[0].indexOf('.') != -1) ? parts[0].length - 1 : parts[0].length;
11195
- var zeros = (parts[1] < 0) ? -parts[1] - 1 : 0;
11196
- // exponent
11197
- var expn = parseInt(parts[1], 10);
11198
- // digits to the left of the decimal place
11199
- var dleft = (expn + 1 > 0) ? expn + 1 : 0;
11200
- // digits to the right of the decimal place
11201
- var dright = (sd <= dleft) ? 0 : sd - expn - 1;
11202
- return {significantDigits: sd, digitsLeft: dleft, digitsRight: dright, zeros: zeros, exponent: expn} ;
11203
- };
11204
-
11205
- $.jqplot.getPrecision = function(number) {
11206
- return $.jqplot.getSignificantFigures(number).digitsRight;
11207
- };
11208
-
11209
-
11210
-
11211
-
11212
- var backCompat = $.uiBackCompat !== false;
11213
-
11214
- $.jqplot.effects = {
11215
- effect: {}
11216
- };
11217
-
11218
- // prefix used for storing data on .data()
11219
- var dataSpace = "jqplot.storage.";
11220
-
11221
- /******************************************************************************/
11222
- /*********************************** EFFECTS **********************************/
11223
- /******************************************************************************/
11224
-
11225
- $.extend( $.jqplot.effects, {
11226
- version: "1.9pre",
11227
-
11228
- // Saves a set of properties in a data storage
11229
- save: function( element, set ) {
11230
- for( var i=0; i < set.length; i++ ) {
11231
- if ( set[ i ] !== null ) {
11232
- element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
11233
- }
11234
- }
11235
- },
11236
-
11237
- // Restores a set of previously saved properties from a data storage
11238
- restore: function( element, set ) {
11239
- for( var i=0; i < set.length; i++ ) {
11240
- if ( set[ i ] !== null ) {
11241
- element.css( set[ i ], element.data( dataSpace + set[ i ] ) );
11242
- }
11243
- }
11244
- },
11245
-
11246
- setMode: function( el, mode ) {
11247
- if (mode === "toggle") {
11248
- mode = el.is( ":hidden" ) ? "show" : "hide";
11249
- }
11250
- return mode;
11251
- },
11252
-
11253
- // Wraps the element around a wrapper that copies position properties
11254
- createWrapper: function( element ) {
11255
-
11256
- // if the element is already wrapped, return it
11257
- if ( element.parent().is( ".ui-effects-wrapper" )) {
11258
- return element.parent();
11259
- }
11260
-
11261
- // wrap the element
11262
- var props = {
11263
- width: element.outerWidth(true),
11264
- height: element.outerHeight(true),
11265
- "float": element.css( "float" )
11266
- },
11267
- wrapper = $( "<div></div>" )
11268
- .addClass( "ui-effects-wrapper" )
11269
- .css({
11270
- fontSize: "100%",
11271
- background: "transparent",
11272
- border: "none",
11273
- margin: 0,
11274
- padding: 0
11275
- }),
11276
- // Store the size in case width/height are defined in % - Fixes #5245
11277
- size = {
11278
- width: element.width(),
11279
- height: element.height()
11280
- },
11281
- active = document.activeElement;
11282
-
11283
- element.wrap( wrapper );
11284
-
11285
- // Fixes #7595 - Elements lose focus when wrapped.
11286
- if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
11287
- $( active ).focus();
11288
- }
11289
-
11290
- wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element
11291
-
11292
- // transfer positioning properties to the wrapper
11293
- if ( element.css( "position" ) === "static" ) {
11294
- wrapper.css({ position: "relative" });
11295
- element.css({ position: "relative" });
11296
- } else {
11297
- $.extend( props, {
11298
- position: element.css( "position" ),
11299
- zIndex: element.css( "z-index" )
11300
- });
11301
- $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
11302
- props[ pos ] = element.css( pos );
11303
- if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
11304
- props[ pos ] = "auto";
11305
- }
11306
- });
11307
- element.css({
11308
- position: "relative",
11309
- top: 0,
11310
- left: 0,
11311
- right: "auto",
11312
- bottom: "auto"
11313
- });
11314
- }
11315
- element.css(size);
11316
-
11317
- return wrapper.css( props ).show();
11318
- },
11319
-
11320
- removeWrapper: function( element ) {
11321
- var active = document.activeElement;
11322
-
11323
- if ( element.parent().is( ".ui-effects-wrapper" ) ) {
11324
- element.parent().replaceWith( element );
11325
-
11326
- // Fixes #7595 - Elements lose focus when wrapped.
11327
- if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
11328
- $( active ).focus();
11329
- }
11330
- }
11331
-
11332
-
11333
- return element;
11334
- }
11335
- });
11336
-
11337
- // return an effect options object for the given parameters:
11338
- function _normalizeArguments( effect, options, speed, callback ) {
11339
-
11340
- // short path for passing an effect options object:
11341
- if ( $.isPlainObject( effect ) ) {
11342
- return effect;
11343
- }
11344
-
11345
- // convert to an object
11346
- effect = { effect: effect };
11347
-
11348
- // catch (effect)
11349
- if ( options === undefined ) {
11350
- options = {};
11351
- }
11352
-
11353
- // catch (effect, callback)
11354
- if ( $.isFunction( options ) ) {
11355
- callback = options;
11356
- speed = null;
11357
- options = {};
11358
- }
11359
-
11360
- // catch (effect, speed, ?)
11361
- if ( $.type( options ) === "number" || $.fx.speeds[ options ]) {
11362
- callback = speed;
11363
- speed = options;
11364
- options = {};
11365
- }
11366
-
11367
- // catch (effect, options, callback)
11368
- if ( $.isFunction( speed ) ) {
11369
- callback = speed;
11370
- speed = null;
11371
- }
11372
-
11373
- // add options to effect
11374
- if ( options ) {
11375
- $.extend( effect, options );
11376
- }
11377
-
11378
- speed = speed || options.duration;
11379
- effect.duration = $.fx.off ? 0 : typeof speed === "number"
11380
- ? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default;
11381
-
11382
- effect.complete = callback || options.complete;
11383
-
11384
- return effect;
11385
- }
11386
-
11387
- function standardSpeed( speed ) {
11388
- // valid standard speeds
11389
- if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {
11390
- return true;
11391
- }
11392
-
11393
- // invalid strings - treat as "normal" speed
11394
- if ( typeof speed === "string" && !$.jqplot.effects.effect[ speed ] ) {
11395
- // TODO: remove in 2.0 (#7115)
11396
- if ( backCompat && $.jqplot.effects[ speed ] ) {
11397
- return false;
11398
- }
11399
- return true;
11400
- }
11401
-
11402
- return false;
11403
- }
11404
-
11405
- $.fn.extend({
11406
- jqplotEffect: function( effect, options, speed, callback ) {
11407
- var args = _normalizeArguments.apply( this, arguments ),
11408
- mode = args.mode,
11409
- queue = args.queue,
11410
- effectMethod = $.jqplot.effects.effect[ args.effect ],
11411
-
11412
- // DEPRECATED: remove in 2.0 (#7115)
11413
- oldEffectMethod = !effectMethod && backCompat && $.jqplot.effects[ args.effect ];
11414
-
11415
- if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) {
11416
- // delegate to the original method (e.g., .show()) if possible
11417
- if ( mode ) {
11418
- return this[ mode ]( args.duration, args.complete );
11419
- } else {
11420
- return this.each( function() {
11421
- if ( args.complete ) {
11422
- args.complete.call( this );
11423
- }
11424
- });
11425
- }
11426
- }
11427
-
11428
- function run( next ) {
11429
- var elem = $( this ),
11430
- complete = args.complete,
11431
- mode = args.mode;
11432
-
11433
- function done() {
11434
- if ( $.isFunction( complete ) ) {
11435
- complete.call( elem[0] );
11436
- }
11437
- if ( $.isFunction( next ) ) {
11438
- next();
11439
- }
11440
- }
11441
-
11442
- // if the element is hiddden and mode is hide,
11443
- // or element is visible and mode is show
11444
- if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
11445
- done();
11446
- } else {
11447
- effectMethod.call( elem[0], args, done );
11448
- }
11449
- }
11450
-
11451
- // TODO: remove this check in 2.0, effectMethod will always be true
11452
- if ( effectMethod ) {
11453
- return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
11454
- } else {
11455
- // DEPRECATED: remove in 2.0 (#7115)
11456
- return oldEffectMethod.call(this, {
11457
- options: args,
11458
- duration: args.duration,
11459
- callback: args.complete,
11460
- mode: args.mode
11461
- });
11462
- }
11463
- }
11464
- });
11465
-
11466
-
11467
-
11468
-
11469
- var rvertical = /up|down|vertical/,
11470
- rpositivemotion = /up|left|vertical|horizontal/;
11471
-
11472
- $.jqplot.effects.effect.blind = function( o, done ) {
11473
- // Create element
11474
- var el = $( this ),
11475
- props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
11476
- mode = $.jqplot.effects.setMode( el, o.mode || "hide" ),
11477
- direction = o.direction || "up",
11478
- vertical = rvertical.test( direction ),
11479
- ref = vertical ? "height" : "width",
11480
- ref2 = vertical ? "top" : "left",
11481
- motion = rpositivemotion.test( direction ),
11482
- animation = {},
11483
- show = mode === "show",
11484
- wrapper, distance, top;
11485
-
11486
- // // if already wrapped, the wrapper's properties are my property. #6245
11487
- if ( el.parent().is( ".ui-effects-wrapper" ) ) {
11488
- $.jqplot.effects.save( el.parent(), props );
11489
- } else {
11490
- $.jqplot.effects.save( el, props );
11491
- }
11492
- el.show();
11493
- top = parseInt(el.css('top'), 10);
11494
- wrapper = $.jqplot.effects.createWrapper( el ).css({
11495
- overflow: "hidden"
11496
- });
11497
-
11498
- distance = vertical ? wrapper[ ref ]() + top : wrapper[ ref ]();
11499
-
11500
- animation[ ref ] = show ? String(distance) : '0';
11501
- if ( !motion ) {
11502
- el
11503
- .css( vertical ? "bottom" : "right", 0 )
11504
- .css( vertical ? "top" : "left", "" )
11505
- .css({ position: "absolute" });
11506
- animation[ ref2 ] = show ? '0' : String(distance);
11507
- }
11508
-
11509
- // // start at 0 if we are showing
11510
- if ( show ) {
11511
- wrapper.css( ref, 0 );
11512
- if ( ! motion ) {
11513
- wrapper.css( ref2, distance );
11514
- }
11515
- }
11516
-
11517
- // // Animate
11518
- wrapper.animate( animation, {
11519
- duration: o.duration,
11520
- easing: o.easing,
11521
- queue: false,
11522
- complete: function() {
11523
- if ( mode === "hide" ) {
11524
- el.hide();
11525
- }
11526
- $.jqplot.effects.restore( el, props );
11527
- $.jqplot.effects.removeWrapper( el );
11528
- done();
11529
- }
11530
- });
11531
-
11532
- };
11533
-
11534
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/jqplot/jquery.jqplot.min.css DELETED
@@ -1 +0,0 @@
1
- .jqplot-xaxis,.jqplot-xaxis-label{margin-top:10px}.jqplot-x2axis,.jqplot-x2axis-label{margin-bottom:10px}.jqplot-target{position:relative;color:#666;font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;font-size:1em}.jqplot-axis{font-size:.75em}.jqplot-yaxis{margin-right:10px}.jqplot-y2axis,.jqplot-y3axis,.jqplot-y4axis,.jqplot-y5axis,.jqplot-y6axis,.jqplot-y7axis,.jqplot-y8axis,.jqplot-y9axis,.jqplot-yMidAxis{margin-left:10px;margin-right:10px}.jqplot-axis-tick,.jqplot-x2axis-tick,.jqplot-xaxis-tick,.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick,.jqplot-yMidAxis-tick,.jqplot-yaxis-tick{position:absolute;white-space:pre}.jqplot-xaxis-tick{top:0;left:15px;vertical-align:top}.jqplot-x2axis-tick{bottom:0;left:15px;vertical-align:bottom}.jqplot-yaxis-tick{right:0;top:15px;text-align:right}.jqplot-yaxis-tick.jqplot-breakTick{right:-20px;margin-right:0;padding:1px 5px;z-index:2;font-size:1.5em}.jqplot-x2axis-label,.jqplot-xaxis-label,.jqplot-yMidAxis-label,.jqplot-yaxis-label{font-size:11pt;position:absolute}.jqplot-y2axis-tick,.jqplot-y3axis-tick,.jqplot-y4axis-tick,.jqplot-y5axis-tick,.jqplot-y6axis-tick,.jqplot-y7axis-tick,.jqplot-y8axis-tick,.jqplot-y9axis-tick{left:0;top:15px;text-align:left}.jqplot-yMidAxis-tick{text-align:center;white-space:nowrap}.jqplot-yaxis-label{margin-right:10px}.jqplot-y2axis-label,.jqplot-y3axis-label,.jqplot-y4axis-label,.jqplot-y5axis-label,.jqplot-y6axis-label,.jqplot-y7axis-label,.jqplot-y8axis-label,.jqplot-y9axis-label{font-size:11pt;margin-left:10px;position:absolute}.jqplot-meterGauge-tick{font-size:.75em;color:#999}.jqplot-meterGauge-label{font-size:1em;color:#999}table.jqplot-table-legend{margin:12px}table.jqplot-cursor-legend,table.jqplot-table-legend{background-color:rgba(255,255,255,.6);border:1px solid #ccc;position:absolute;font-size:.75em}td.jqplot-table-legend{vertical-align:middle}td.jqplot-seriesToggle:active,td.jqplot-seriesToggle:hover{cursor:pointer}.jqplot-table-legend .jqplot-series-hidden{text-decoration:line-through}div.jqplot-table-legend-swatch-outline{border:1px solid #ccc;padding:1px}div.jqplot-table-legend-swatch{width:0;height:0;border-width:5px 6px;border-style:solid}.jqplot-title{top:0;left:0;padding-bottom:.5em;font-size:1.2em}table.jqplot-cursor-tooltip{border:1px solid #ccc;font-size:.75em}.jqplot-canvasOverlay-tooltip,.jqplot-cursor-tooltip,.jqplot-highlighter-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,.5);padding:1px}.jqplot-point-label{font-size:.75em;z-index:2}td.jqplot-cursor-legend-swatch{vertical-align:middle;text-align:center}div.jqplot-cursor-legend-swatch{width:1.2em;height:.7em}.jqplot-error{text-align:center}.jqplot-error-message{position:relative;top:46%;display:inline-block}div.jqplot-bubble-label{font-size:.8em;padding-left:2px;padding-right:2px;color:rgb(20%,20%,20%)}div.jqplot-bubble-label.jqplot-bubble-label-highlight{background:rgba(90%,90%,90%,.7)}div.jqplot-noData-container{text-align:center;background-color:rgba(96%,96%,96%,.3)}
 
assets/jqplot/jquery.jqplot.min.js DELETED
@@ -1,8 +0,0 @@
1
- /* jqplot 1.0.9 | (c) 2009-2016 Chris Leonello | jqplot.com
2
- jsDate | (c) 2010-2016 Chris Leonello
3
- */
4
- !function(a){function b(b){a.jqplot.ElemContainer.call(this),this.name=b,this._series=[],this.show=!1,this.tickRenderer=a.jqplot.AxisTickRenderer,this.tickOptions={},this.labelRenderer=a.jqplot.AxisLabelRenderer,this.labelOptions={},this.label=null,this.showLabel=!0,this.min=null,this.max=null,this.autoscale=!1,this.pad=1.2,this.padMax=null,this.padMin=null,this.ticks=[],this.numberTicks,this.tickInterval,this.renderer=a.jqplot.LinearAxisRenderer,this.rendererOptions={},this.showTicks=!0,this.showTickMarks=!0,this.showMinorTicks=!0,this.drawMajorGridlines=!0,this.drawMinorGridlines=!1,this.drawMajorTickMarks=!0,this.drawMinorTickMarks=!0,this.useSeriesColor=!1,this.borderWidth=null,this.borderColor=null,this.scaleToHiddenSeries=!1,this._dataBounds={min:null,max:null},this._intervalStats=[],this._offsets={min:null,max:null},this._ticks=[],this._label=null,this.syncTicks=null,this.tickSpacing=75,this._min=null,this._max=null,this._tickInterval=null,this._numberTicks=null,this.__ticks=null,this._options={}}function c(b){a.jqplot.ElemContainer.call(this),this.show=!1,this.location="ne",this.labels=[],this.showLabels=!0,this.showSwatches=!0,this.placement="insideGrid",this.xoffset=0,this.yoffset=0,this.border,this.background,this.textColor,this.fontFamily,this.fontSize,this.rowSpacing="0.5em",this.renderer=a.jqplot.TableLegendRenderer,this.rendererOptions={},this.preDraw=!1,this.marginTop=null,this.marginRight=null,this.marginBottom=null,this.marginLeft=null,this.escapeHtml=!1,this._series=[],a.extend(!0,this,b)}function d(b){a.jqplot.ElemContainer.call(this),this.text=b,this.show=!0,this.fontFamily,this.fontSize,this.textAlign,this.textColor,this.renderer=a.jqplot.DivTitleRenderer,this.rendererOptions={},this.escapeHtml=!1}function e(b){b=b||{},a.jqplot.ElemContainer.call(this),this.show=!0,this.xaxis="xaxis",this._xaxis,this.yaxis="yaxis",this._yaxis,this.gridBorderWidth=2,this.renderer=a.jqplot.LineRenderer,this.rendererOptions={},this.data=[],this.gridData=[],this.label="",this.showLabel=!0,this.color,this.negativeColor,this.lineWidth=2.5,this.lineJoin="round",this.lineCap="round",this.linePattern="solid",this.shadow=!0,this.shadowAngle=45,this.shadowOffset=1.25,this.shadowDepth=3,this.shadowAlpha="0.1",this.breakOnNull=!1,this.markerRenderer=a.jqplot.MarkerRenderer,this.markerOptions={},this.showLine=!0,this.showMarker=!0,this.index,this.fill=!1,this.fillColor,this.fillAlpha,this.fillAndStroke=!1,this.disableStack=!1,this._stack=!1,this.neighborThreshold=4,this.fillToZero=!1,this.fillToValue=0,this.fillAxis="y",this.useNegativeColors=!0,this._stackData=[],this._plotData=[],this._plotValues={x:[],y:[]},this._intervals={x:{},y:{}},this._prevPlotData=[],this._prevGridData=[],this._stackAxis="y",this._primaryAxis="_xaxis",this.canvas=new a.jqplot.GenericCanvas,this.shadowCanvas=new a.jqplot.GenericCanvas,this.plugins={},this._sumy=0,this._sumx=0,this._type="",this.step=!1}function f(){a.jqplot.ElemContainer.call(this),this.drawGridlines=!0,this.gridLineColor="#cccccc",this.gridLineWidth=1,this.background="#fffdf6",this.borderColor="#999999",this.borderWidth=2,this.drawBorder=!0,this.shadow=!0,this.shadowAngle=45,this.shadowOffset=1.5,this.shadowWidth=3,this.shadowDepth=3,this.shadowColor=null,this.shadowAlpha="0.07",this._left,this._top,this._right,this._bottom,this._width,this._height,this._axes=[],this.renderer=a.jqplot.CanvasGridRenderer,this.rendererOptions={},this._offsets={top:null,bottom:null,left:null,right:null}}function g(){function h(a){for(var b,c=0;c<a.length;c++)for(var d,e=[a[c].data,a[c]._stackData,a[c]._plotData,a[c]._prevPlotData],f=0;f<4;f++)if(d=!0,b=e[f],"x"==a[c]._stackAxis){for(var g=0;g<b.length;g++)if("number"!=typeof b[g][1]){d=!1;break}d&&b.sort(function(a,b){return a[1]-b[1]})}else{for(var g=0;g<b.length;g++)if("number"!=typeof b[g][0]){d=!1;break}d&&b.sort(function(a,b){return a[0]-b[0]})}}function i(a){var b,c,d=a.data.plot,e=d.eventCanvas._elem.offset(),f={x:a.pageX-e.left,y:a.pageY-e.top},g={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null,yMidAxis:null},h=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"],i=d.axes;for(b=11;b>0;b--)c=h[b-1],i[c].show&&(g[c]=i[c].series_p2u(f[c.charAt(0)]));return{offsets:e,gridPos:f,dataPos:g}}function j(b,c){function d(a,b,c){var d=(b[1]-c[1])/(b[0]-c[0]),e=b[1]-d*b[0],f=a+b[1];return[(f-e)/d,f]}var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=c.series;for(g=c.seriesStack.length-1;g>=0;g--)switch(e=c.seriesStack[g],h=x[e],u=h._highlightThreshold,h.renderer.constructor){case a.jqplot.BarRenderer:for(j=b.x,k=b.y,f=0;f<h._barPoints.length;f++)if(t=h._barPoints[f],s=h.gridData[f],j>t[0][0]&&j<t[2][0]&&(k>t[2][1]&&k<t[0][1]||k<t[2][1]&&k>t[0][1]))return{seriesIndex:h.index,pointIndex:f,gridData:s,data:h.data[f],points:h._barPoints[f]};break;case a.jqplot.PyramidRenderer:for(j=b.x,k=b.y,f=0;f<h._barPoints.length;f++)if(t=h._barPoints[f],s=h.gridData[f],j>t[0][0]+u[0][0]&&j<t[2][0]+u[2][0]&&k>t[2][1]&&k<t[0][1])return{seriesIndex:h.index,pointIndex:f,gridData:s,data:h.data[f],points:h._barPoints[f]};break;case a.jqplot.DonutRenderer:if(n=h.startAngle/180*Math.PI,j=b.x-h._center[0],k=b.y-h._center[1],i=Math.sqrt(Math.pow(j,2)+Math.pow(k,2)),j>0&&-k>=0?l=2*Math.PI-Math.atan(-k/j):j>0&&-k<0?l=-Math.atan(-k/j):j<0?l=Math.PI-Math.atan(-k/j):0==j&&-k>0?l=3*Math.PI/2:0==j&&-k<0?l=Math.PI/2:0==j&&0==k&&(l=0),n&&(l-=n,l<0?l+=2*Math.PI:l>2*Math.PI&&(l-=2*Math.PI)),m=h.sliceMargin/180*Math.PI,i<h._radius&&i>h._innerRadius)for(f=0;f<h.gridData.length;f++)if(o=f>0?h.gridData[f-1][1]+m:m,p=h.gridData[f][1],l>o&&l<p)return{seriesIndex:h.index,pointIndex:f,gridData:[b.x,b.y],data:h.data[f]};break;case a.jqplot.PieRenderer:if(n=h.startAngle/180*Math.PI,j=b.x-h._center[0],k=b.y-h._center[1],i=Math.sqrt(Math.pow(j,2)+Math.pow(k,2)),j>0&&-k>=0?l=2*Math.PI-Math.atan(-k/j):j>0&&-k<0?l=-Math.atan(-k/j):j<0?l=Math.PI-Math.atan(-k/j):0==j&&-k>0?l=3*Math.PI/2:0==j&&-k<0?l=Math.PI/2:0==j&&0==k&&(l=0),n&&(l-=n,l<0?l+=2*Math.PI:l>2*Math.PI&&(l-=2*Math.PI)),m=h.sliceMargin/180*Math.PI,i<h._radius)for(f=0;f<h.gridData.length;f++)if(o=f>0?h.gridData[f-1][1]+m:m,p=h.gridData[f][1],l>o&&l<p)return{seriesIndex:h.index,pointIndex:f,gridData:[b.x,b.y],data:h.data[f]};break;case a.jqplot.BubbleRenderer:j=b.x,k=b.y;var y=null;if(h.show){for(var f=0;f<h.gridData.length;f++)s=h.gridData[f],r=Math.sqrt((j-s[0])*(j-s[0])+(k-s[1])*(k-s[1])),r<=s[2]&&(r<=q||null==q)&&(q=r,y={seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]});if(null!=y)return y}break;case a.jqplot.FunnelRenderer:j=b.x,k=b.y;var z,A,B,C=h._vertices,D=C[0],E=C[C.length-1];for(z=d(k,D[0],E[3]),A=d(k,D[1],E[2]),f=0;f<C.length;f++)if(B=C[f],k>=B[0][1]&&k<=B[3][1]&&j>=z[0]&&j<=A[0])return{seriesIndex:h.index,pointIndex:f,gridData:null,data:h.data[f]};break;case a.jqplot.LineRenderer:if(j=b.x,k=b.y,i=h.renderer,h.show){if(!(!(h.fill||h.renderer.bands.show&&h.renderer.bands.fill)||c.plugins.highlighter&&c.plugins.highlighter.show)){var F=!1;if(j>h._boundingBox[0][0]&&j<h._boundingBox[1][0]&&k>h._boundingBox[1][1]&&k<h._boundingBox[0][1])for(var G,H=h._areaPoints.length,f=H-1,G=0;G<H;G++){var I=[h._areaPoints[G][0],h._areaPoints[G][1]],J=[h._areaPoints[f][0],h._areaPoints[f][1]];(I[1]<k&&J[1]>=k||J[1]<k&&I[1]>=k)&&I[0]+(k-I[1])/(J[1]-I[1])*(J[0]-I[0])<j&&(F=!F),f=G}if(F)return{seriesIndex:e,pointIndex:null,gridData:h.gridData,data:h.data,points:h._areaPoints};break}w=h.markerRenderer.size/2+h.neighborThreshold,v=w>0?w:0;for(var f=0;f<h.gridData.length;f++)if(s=h.gridData[f],i.constructor==a.jqplot.OHLCRenderer)if(i.candleStick){var K=h._yaxis.series_u2p;if(j>=s[0]-i._bodyWidth/2&&j<=s[0]+i._bodyWidth/2&&k>=K(h.data[f][2])&&k<=K(h.data[f][3]))return{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}else if(i.hlc){var K=h._yaxis.series_u2p;if(j>=s[0]-i._tickLength&&j<=s[0]+i._tickLength&&k>=K(h.data[f][1])&&k<=K(h.data[f][2]))return{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}else{var K=h._yaxis.series_u2p;if(j>=s[0]-i._tickLength&&j<=s[0]+i._tickLength&&k>=K(h.data[f][2])&&k<=K(h.data[f][3]))return{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}else if(null!=s[0]&&null!=s[1]&&(r=Math.sqrt((j-s[0])*(j-s[0])+(k-s[1])*(k-s[1])),r<=v&&(r<=q||null==q)))return q=r,{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}break;default:if(j=b.x,k=b.y,i=h.renderer,h.show){w=h.markerRenderer.size/2+h.neighborThreshold,v=w>0?w:0;for(var f=0;f<h.gridData.length;f++)if(s=h.gridData[f],i.constructor==a.jqplot.OHLCRenderer)if(i.candleStick){var K=h._yaxis.series_u2p;if(j>=s[0]-i._bodyWidth/2&&j<=s[0]+i._bodyWidth/2&&k>=K(h.data[f][2])&&k<=K(h.data[f][3]))return{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}else if(i.hlc){var K=h._yaxis.series_u2p;if(j>=s[0]-i._tickLength&&j<=s[0]+i._tickLength&&k>=K(h.data[f][1])&&k<=K(h.data[f][2]))return{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}else{var K=h._yaxis.series_u2p;if(j>=s[0]-i._tickLength&&j<=s[0]+i._tickLength&&k>=K(h.data[f][2])&&k<=K(h.data[f][3]))return{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}else if(r=Math.sqrt((j-s[0])*(j-s[0])+(k-s[1])*(k-s[1])),r<=v&&(r<=q||null==q))return q=r,{seriesIndex:e,pointIndex:f,gridData:s,data:h.data[f]}}}return null}this.animate=!1,this.animateReplot=!1,this.axes={xaxis:new b("xaxis"),yaxis:new b("yaxis"),x2axis:new b("x2axis"),y2axis:new b("y2axis"),y3axis:new b("y3axis"),y4axis:new b("y4axis"),y5axis:new b("y5axis"),y6axis:new b("y6axis"),y7axis:new b("y7axis"),y8axis:new b("y8axis"),y9axis:new b("y9axis"),yMidAxis:new b("yMidAxis")},this.baseCanvas=new a.jqplot.GenericCanvas,this.captureRightClick=!1,this.data=[],this.dataRenderer,this.dataRendererOptions,this.defaults={axesDefaults:{},axes:{xaxis:{},yaxis:{},x2axis:{},y2axis:{},y3axis:{},y4axis:{},y5axis:{},y6axis:{},y7axis:{},y8axis:{},y9axis:{},yMidAxis:{}},seriesDefaults:{},series:[]},this.defaultAxisStart=1,this.drawIfHidden=!1,this.eventCanvas=new a.jqplot.GenericCanvas,this.fillBetween={series1:null,series2:null,color:null,baseSeries:0,fill:!0},this.fontFamily,this.fontSize,this.grid=new f,this.legend=new c,this.noDataIndicator={show:!1,indicator:"Loading Data...",axes:{xaxis:{min:0,max:10,tickInterval:2,show:!0},yaxis:{min:0,max:12,tickInterval:3,show:!0}}},this.negativeSeriesColors=a.jqplot.config.defaultNegativeColors,this.options={},this.previousSeriesStack=[],this.plugins={},this.series=[],this.seriesStack=[],this.seriesColors=a.jqplot.config.defaultColors,this.sortData=!0,this.stackSeries=!1,this.syncXTicks=!0,this.syncYTicks=!0,this.target=null,this.targetId=null,this.textColor,this.title=new d,this._drawCount=0,this._sumy=0,this._sumx=0,this._stackData=[],this._plotData=[],this._width=null,this._height=null,this._plotDimensions={height:null,width:null},this._gridPadding={top:null,right:null,bottom:null,left:null},this._defaultGridPadding={top:10,right:10,bottom:23,left:10},this._addDomReference=a.jqplot.config.addDomReference,this.preInitHooks=new a.jqplot.HooksManager,this.postInitHooks=new a.jqplot.HooksManager,this.preParseOptionsHooks=new a.jqplot.HooksManager,this.postParseOptionsHooks=new a.jqplot.HooksManager,this.preDrawHooks=new a.jqplot.HooksManager,this.postDrawHooks=new a.jqplot.HooksManager,this.preDrawSeriesHooks=new a.jqplot.HooksManager,this.postDrawSeriesHooks=new a.jqplot.HooksManager,this.preDrawLegendHooks=new a.jqplot.HooksManager,this.addLegendRowHooks=new a.jqplot.HooksManager,this.preSeriesInitHooks=new a.jqplot.HooksManager,this.postSeriesInitHooks=new a.jqplot.HooksManager,this.preParseSeriesOptionsHooks=new a.jqplot.HooksManager,this.postParseSeriesOptionsHooks=new a.jqplot.HooksManager,this.eventListenerHooks=new a.jqplot.EventListenerManager,this.preDrawSeriesShadowHooks=new a.jqplot.HooksManager,this.postDrawSeriesShadowHooks=new a.jqplot.HooksManager,this.colorGenerator=new a.jqplot.ColorGenerator,this.negativeColorGenerator=new a.jqplot.ColorGenerator,this.canvasManager=new a.jqplot.CanvasManager,this.themeEngine=new a.jqplot.ThemeEngine;this.init=function(c,d,e){e=e||{};for(var f=0;f<a.jqplot.preInitHooks.length;f++)a.jqplot.preInitHooks[f].call(this,c,d,e);for(var f=0;f<this.preInitHooks.hooks.length;f++)this.preInitHooks.hooks[f].call(this,c,d,e);if(this.targetId="#"+c,this.target=a("#"+c),this._addDomReference&&this.target.data("jqplot",this),this.target.removeClass("jqplot-error"),!this.target.get(0))throw new Error("No plot target specified");if("static"==this.target.css("position")&&this.target.css("position","relative"),this.target.hasClass("jqplot-target")||this.target.addClass("jqplot-target"),this.target.height())this._height=g=this.target.height();else{var g;g=e&&e.height?parseInt(e.height,10):this.target.attr("data-height")?parseInt(this.target.attr("data-height"),10):parseInt(a.jqplot.config.defaultHeight,10),this._height=g,this.target.css("height",g+"px")}if(this.target.width())this._width=i=this.target.width();else{var i;i=e&&e.width?parseInt(e.width,10):this.target.attr("data-width")?parseInt(this.target.attr("data-width"),10):parseInt(a.jqplot.config.defaultWidth,10),this._width=i,this.target.css("width",i+"px")}for(var f=0,j=I.length;f<j;f++)this.axes[I[f]]=new b(I[f]);if(this._plotDimensions.height=this._height,this._plotDimensions.width=this._width,this.grid._plotDimensions=this._plotDimensions,this.title._plotDimensions=this._plotDimensions,this.baseCanvas._plotDimensions=this._plotDimensions,this.eventCanvas._plotDimensions=this._plotDimensions,this.legend._plotDimensions=this._plotDimensions,this._height<=0||this._width<=0||!this._height||!this._width)throw new Error("Canvas dimension not set");if(e.dataRenderer&&a.isFunction(e.dataRenderer)&&(e.dataRendererOptions&&(this.dataRendererOptions=e.dataRendererOptions),this.dataRenderer=e.dataRenderer,d=this.dataRenderer(d,this,this.dataRendererOptions)),e.noDataIndicator&&a.isPlainObject(e.noDataIndicator)&&a.extend(!0,this.noDataIndicator,e.noDataIndicator),null==d||0==a.isArray(d)||0==d.length||0==a.isArray(d[0])||0==d[0].length){if(0==this.noDataIndicator.show)throw new Error("No data specified");for(var k in this.noDataIndicator.axes)for(var l in this.noDataIndicator.axes[k])this.axes[k][l]=this.noDataIndicator.axes[k][l];this.postDrawHooks.add(function(){var b=this.eventCanvas.getHeight(),c=this.eventCanvas.getWidth(),d=a('<div class="jqplot-noData-container" style="position:absolute;"></div>');this.target.append(d),d.height(b),d.width(c),d.css("top",this.eventCanvas._offsets.top),d.css("left",this.eventCanvas._offsets.left);var e=a('<div class="jqplot-noData-contents" style="text-align:center; position:relative; margin-left:auto; margin-right:auto;"></div>');d.append(e),e.html(this.noDataIndicator.indicator);var f=e.height(),g=e.width();e.height(f),e.width(g),e.css("top",(b-f)/2+"px")})}this.data=a.extend(!0,[],d),this.parseOptions(e),this.textColor&&this.target.css("color",this.textColor),this.fontFamily&&this.target.css("font-family",this.fontFamily),this.fontSize&&this.target.css("font-size",this.fontSize),this.title.init(),this.legend.init(),this._sumy=0,this._sumx=0,this.computePlotData();for(var f=0;f<this.series.length;f++){this.seriesStack.push(f),this.previousSeriesStack.push(f),this.series[f].shadowCanvas._plotDimensions=this._plotDimensions,this.series[f].canvas._plotDimensions=this._plotDimensions;for(var m=0;m<a.jqplot.preSeriesInitHooks.length;m++)a.jqplot.preSeriesInitHooks[m].call(this.series[f],c,this.data,this.options.seriesDefaults,this.options.series[f],this);for(var m=0;m<this.preSeriesInitHooks.hooks.length;m++)this.preSeriesInitHooks.hooks[m].call(this.series[f],c,this.data,this.options.seriesDefaults,this.options.series[f],this);this.series[f]._plotDimensions=this._plotDimensions,this.series[f].init(f,this.grid.borderWidth,this);for(var m=0;m<a.jqplot.postSeriesInitHooks.length;m++)a.jqplot.postSeriesInitHooks[m].call(this.series[f],c,this.data,this.options.seriesDefaults,this.options.series[f],this);for(var m=0;m<this.postSeriesInitHooks.hooks.length;m++)this.postSeriesInitHooks.hooks[m].call(this.series[f],c,this.data,this.options.seriesDefaults,this.options.series[f],this);this._sumy+=this.series[f]._sumy,this._sumx+=this.series[f]._sumx}for(var n,o,f=0,j=I.length;f<j;f++)n=I[f],o=this.axes[n],o._plotDimensions=this._plotDimensions,o.init(),null==this.axes[n].borderColor&&("x"!==n.charAt(0)&&o.useSeriesColor===!0&&o.show?o.borderColor=o._series[0].color:o.borderColor=this.grid.borderColor);this.sortData&&h(this.series),this.grid.init(),this.grid._axes=this.axes,this.legend._series=this.series;for(var f=0;f<a.jqplot.postInitHooks.length;f++)a.jqplot.postInitHooks[f].call(this,c,this.data,e);for(var f=0;f<this.postInitHooks.hooks.length;f++)this.postInitHooks.hooks[f].call(this,c,this.data,e)},this.resetAxesScale=function(b,c){var d=c||{},e=b||this.axes;if(e===!0&&(e=this.axes),a.isArray(e))for(var f=0;f<e.length;f++)this.axes[e[f]].resetScale(d[e[f]]);else if("object"==typeof e)for(var g in e)this.axes[g].resetScale(d[g])},this.reInitialize=function(c,d){for(var e=a.extend(!0,{},this.options,d),f=this.targetId.substr(1),g=null==c?this.data:c,i=0;i<a.jqplot.preInitHooks.length;i++)a.jqplot.preInitHooks[i].call(this,f,g,e);for(var i=0;i<this.preInitHooks.hooks.length;i++)this.preInitHooks.hooks[i].call(this,f,g,e);if(this._height=this.target.height(),this._width=this.target.width(),this._height<=0||this._width<=0||!this._height||!this._width)throw new Error("Target dimension not set");this._plotDimensions.height=this._height,this._plotDimensions.width=this._width,this.grid._plotDimensions=this._plotDimensions,this.title._plotDimensions=this._plotDimensions,this.baseCanvas._plotDimensions=this._plotDimensions,this.eventCanvas._plotDimensions=this._plotDimensions,this.legend._plotDimensions=this._plotDimensions;for(var j,k,l,m,i=0,n=I.length;i<n;i++){j=I[i],m=this.axes[j],k=m._ticks;for(var l=0,o=k.length;l<o;l++){var p=k[l]._elem;p&&(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==H&&window.G_vmlCanvasManager.uninitElement(p.get(0)),p.emptyForce(),p=null,k._elem=null)}k=null,delete m.ticks,delete m._ticks,this.axes[j]=new b(j),this.axes[j]._plotWidth=this._width,this.axes[j]._plotHeight=this._height}c&&(e.dataRenderer&&a.isFunction(e.dataRenderer)&&(e.dataRendererOptions&&(this.dataRendererOptions=e.dataRendererOptions),this.dataRenderer=e.dataRenderer,c=this.dataRenderer(c,this,this.dataRendererOptions)),this.data=a.extend(!0,[],c)),d&&this.parseOptions(e),this.title._plotWidth=this._width,this.textColor&&this.target.css("color",this.textColor),this.fontFamily&&this.target.css("font-family",this.fontFamily),this.fontSize&&this.target.css("font-size",this.fontSize),this.title.init(),this.legend.init(),this._sumy=0,this._sumx=0,this.seriesStack=[],this.previousSeriesStack=[],this.computePlotData();for(var i=0,n=this.series.length;i<n;i++){this.seriesStack.push(i),this.previousSeriesStack.push(i),this.series[i].shadowCanvas._plotDimensions=this._plotDimensions,this.series[i].canvas._plotDimensions=this._plotDimensions;for(var l=0;l<a.jqplot.preSeriesInitHooks.length;l++)a.jqplot.preSeriesInitHooks[l].call(this.series[i],f,this.data,this.options.seriesDefaults,this.options.series[i],this);for(var l=0;l<this.preSeriesInitHooks.hooks.length;l++)this.preSeriesInitHooks.hooks[l].call(this.series[i],f,this.data,this.options.seriesDefaults,this.options.series[i],this);this.series[i]._plotDimensions=this._plotDimensions,this.series[i].init(i,this.grid.borderWidth,this);for(var l=0;l<a.jqplot.postSeriesInitHooks.length;l++)a.jqplot.postSeriesInitHooks[l].call(this.series[i],f,this.data,this.options.seriesDefaults,this.options.series[i],this);for(var l=0;l<this.postSeriesInitHooks.hooks.length;l++)this.postSeriesInitHooks.hooks[l].call(this.series[i],f,this.data,this.options.seriesDefaults,this.options.series[i],this);this._sumy+=this.series[i]._sumy,this._sumx+=this.series[i]._sumx}for(var i=0,n=I.length;i<n;i++)j=I[i],m=this.axes[j],m._plotDimensions=this._plotDimensions,m.init(),null==m.borderColor&&("x"!==j.charAt(0)&&m.useSeriesColor===!0&&m.show?m.borderColor=m._series[0].color:m.borderColor=this.grid.borderColor);this.sortData&&h(this.series),this.grid.init(),this.grid._axes=this.axes,this.legend._series=this.series;for(var i=0,n=a.jqplot.postInitHooks.length;i<n;i++)a.jqplot.postInitHooks[i].call(this,f,this.data,e);for(var i=0,n=this.postInitHooks.hooks.length;i<n;i++)this.postInitHooks.hooks[i].call(this,f,this.data,e)},this.quickInit=function(){if(this._height=this.target.height(),this._width=this.target.width(),this._height<=0||this._width<=0||!this._height||!this._width)throw new Error("Target dimension not set");this._plotDimensions.height=this._height,this._plotDimensions.width=this._width,this.grid._plotDimensions=this._plotDimensions,this.title._plotDimensions=this._plotDimensions,this.baseCanvas._plotDimensions=this._plotDimensions,this.eventCanvas._plotDimensions=this._plotDimensions,this.legend._plotDimensions=this._plotDimensions;for(var b in this.axes)this.axes[b]._plotWidth=this._width,this.axes[b]._plotHeight=this._height;this.title._plotWidth=this._width,this.textColor&&this.target.css("color",this.textColor),this.fontFamily&&this.target.css("font-family",this.fontFamily),this.fontSize&&this.target.css("font-size",this.fontSize),this._sumy=0,this._sumx=0,this.computePlotData();for(var c=0;c<this.series.length;c++)"line"===this.series[c]._type&&this.series[c].renderer.bands.show&&this.series[c].renderer.initBands.call(this.series[c],this.series[c].renderer.options,this),this.series[c]._plotDimensions=this._plotDimensions,this.series[c].canvas._plotDimensions=this._plotDimensions,this._sumy+=this.series[c]._sumy,this._sumx+=this.series[c]._sumx;for(var d,e=0;e<12;e++){d=I[e];for(var f=this.axes[d]._ticks,c=0;c<f.length;c++){var g=f[c]._elem;g&&(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==H&&window.G_vmlCanvasManager.uninitElement(g.get(0)),g.emptyForce(),g=null,f._elem=null)}f=null,this.axes[d]._plotDimensions=this._plotDimensions,this.axes[d]._ticks=[]}this.sortData&&h(this.series),this.grid._axes=this.axes,this.legend._series=this.series},this.computePlotData=function(){this._plotData=[],this._stackData=[];var b,c,d;for(c=0,d=this.series.length;c<d;c++){b=this.series[c],this._plotData.push([]),this._stackData.push([]);var e=b.data;this._plotData[c]=a.extend(!0,[],e),this._stackData[c]=a.extend(!0,[],e),b._plotData=this._plotData[c],b._stackData=this._stackData[c];var f={x:[],y:[]};if(this.stackSeries&&!b.disableStack){b._stack=!0;for(var g="x"===b._stackAxis?0:1,h=0,i=e.length;h<i;h++){var j=e[h][g];if(null==j&&(j=0),this._plotData[c][h][g]=j,this._stackData[c][h][g]=j,c>0)for(var k=c;k--;){var l=this._plotData[k][h][g];if(j*l>=0){this._plotData[c][h][g]+=l,this._stackData[c][h][g]+=l;break}}}}else{for(var m=0;m<b.data.length;m++)f.x.push(b.data[m][0]),f.y.push(b.data[m][1]);this._stackData.push(b.data),this.series[c]._stackData=b.data,this._plotData.push(b.data),b._plotData=b.data,b._plotValues=f}for(c>0&&(b._prevPlotData=this.series[c-1]._plotData),b._sumy=0,b._sumx=0,m=b.data.length-1;m>-1;m--)b._sumy+=b.data[m][1],b._sumx+=b.data[m][0]}},this.populatePlotData=function(b,c){this._plotData=[],this._stackData=[],b._stackData=[],b._plotData=[];var d={x:[],y:[]};if(this.stackSeries&&!b.disableStack){b._stack=!0;for(var e,f,g,h,i="x"===b._stackAxis?0:1,j=a.extend(!0,[],b.data),k=a.extend(!0,[],b.data),l=0;l<c;l++)for(var m=this.series[l].data,n=0;n<m.length;n++)g=m[n],e=null!=g[0]?g[0]:0,f=null!=g[1]?g[1]:0,j[n][0]+=e,j[n][1]+=f,h=i?f:e,b.data[n][i]*h>=0&&(k[n][i]+=h);for(var o=0;o<k.length;o++)d.x.push(k[o][0]),d.y.push(k[o][1]);this._plotData.push(k),this._stackData.push(j),b._stackData=j,b._plotData=k,b._plotValues=d}else{for(var o=0;o<b.data.length;o++)d.x.push(b.data[o][0]),d.y.push(b.data[o][1]);this._stackData.push(b.data),this.series[c]._stackData=b.data,this._plotData.push(b.data),b._plotData=b.data,b._plotValues=d}for(c>0&&(b._prevPlotData=this.series[c-1]._plotData),b._sumy=0,b._sumx=0,o=b.data.length-1;o>-1;o--)b._sumy+=b.data[o][1],b._sumx+=b.data[o][0]},this.getNextSeriesColor=function(a){var b=0,c=a.seriesColors;return function(){return b<c.length?c[b++]:(b=0,c[b++])}}(this),this.parseOptions=function(b){for(var c=0;c<this.preParseOptionsHooks.hooks.length;c++)this.preParseOptionsHooks.hooks[c].call(this,b);for(var c=0;c<a.jqplot.preParseOptionsHooks.length;c++)a.jqplot.preParseOptionsHooks[c].call(this,b);this.options=a.extend(!0,{},this.defaults,b);var d=this.options;if(this.animate=d.animate,this.animateReplot=d.animateReplot,this.stackSeries=d.stackSeries,a.isPlainObject(d.fillBetween))for(var f,g=["series1","series2","color","baseSeries","fill"],c=0,h=g.length;c<h;c++)f=g[c],null!=d.fillBetween[f]&&(this.fillBetween[f]=d.fillBetween[f]);d.seriesColors&&(this.seriesColors=d.seriesColors),d.negativeSeriesColors&&(this.negativeSeriesColors=d.negativeSeriesColors),d.captureRightClick&&(this.captureRightClick=d.captureRightClick),this.defaultAxisStart=b&&null!=b.defaultAxisStart?b.defaultAxisStart:this.defaultAxisStart,this.colorGenerator.setColors(this.seriesColors),this.negativeColorGenerator.setColors(this.negativeSeriesColors),a.extend(!0,this._gridPadding,d.gridPadding),this.sortData=null!=d.sortData?d.sortData:this.sortData;for(var c=0;c<12;c++){var i=I[c],j=this.axes[i];j._options=a.extend(!0,{},d.axesDefaults,d.axes[i]),a.extend(!0,j,d.axesDefaults,d.axes[i]),j._plotWidth=this._width,j._plotHeight=this._height}var k=function(b,c,d){var e,f,g=[];if(c=c||"vertical",a.isArray(b[0]))a.extend(!0,g,b);else for(e=0,f=b.length;e<f;e++)"vertical"==c?g.push([d+e,b[e]]):g.push([b[e],d+e]);return g};this.series=[];for(var c=0;c<this.data.length;c++){for(var l=a.extend(!0,{index:c},{seriesColors:this.seriesColors,negativeSeriesColors:this.negativeSeriesColors},this.options.seriesDefaults,this.options.series[c],{rendererOptions:{animation:{show:this.animate}}}),g=new e(l),m=0;m<a.jqplot.preParseSeriesOptionsHooks.length;m++)a.jqplot.preParseSeriesOptionsHooks[m].call(g,this.options.seriesDefaults,this.options.series[c]);for(var m=0;m<this.preParseSeriesOptionsHooks.hooks.length;m++)this.preParseSeriesOptionsHooks.hooks[m].call(g,this.options.seriesDefaults,this.options.series[c]);a.extend(!0,g,l);var n="vertical";switch(g.renderer===a.jqplot.BarRenderer&&g.rendererOptions&&"horizontal"==g.rendererOptions.barDirection&&(n="horizontal",g._stackAxis="x",g._primaryAxis="_yaxis"),g.data=k(this.data[c],n,this.defaultAxisStart),g.xaxis){case"xaxis":g._xaxis=this.axes.xaxis;break;case"x2axis":g._xaxis=this.axes.x2axis}g._yaxis=this.axes[g.yaxis],g._xaxis._series.push(g),g._yaxis._series.push(g),g.show?(g._xaxis.show=!0,g._yaxis.show=!0):(g._xaxis.scaleToHiddenSeries&&(g._xaxis.show=!0),g._yaxis.scaleToHiddenSeries&&(g._yaxis.show=!0)),g.label||(g.label="Series "+(c+1).toString()),this.series.push(g);for(var m=0;m<a.jqplot.postParseSeriesOptionsHooks.length;m++)a.jqplot.postParseSeriesOptionsHooks[m].call(this.series[c],this.options.seriesDefaults,this.options.series[c]);for(var m=0;m<this.postParseSeriesOptionsHooks.hooks.length;m++)this.postParseSeriesOptionsHooks.hooks[m].call(this.series[c],this.options.seriesDefaults,this.options.series[c])}a.extend(!0,this.grid,this.options.grid);for(var c=0,h=I.length;c<h;c++){var i=I[c],j=this.axes[i];null==j.borderWidth&&(j.borderWidth=this.grid.borderWidth)}"string"==typeof this.options.title?this.title.text=this.options.title:"object"==typeof this.options.title&&a.extend(!0,this.title,this.options.title),this.title._plotWidth=this._width,this.legend.setOptions(this.options.legend);for(var c=0;c<a.jqplot.postParseOptionsHooks.length;c++)a.jqplot.postParseOptionsHooks[c].call(this,b);for(var c=0;c<this.postParseOptionsHooks.hooks.length;c++)this.postParseOptionsHooks.hooks[c].call(this,b)},this.destroy=function(){this.canvasManager.freeAllCanvases(),this.eventCanvas&&this.eventCanvas._elem&&this.eventCanvas._elem.unbind(),this.target.empty(),this.target[0].innerHTML=""},this.replot=function(b){var c=b||{},d=c.data||null,e=c.clear!==!1,f=c.resetAxes||!1;delete c.data,delete c.clear,delete c.resetAxes,this.target.trigger("jqplotPreReplot"),e&&this.destroy(),d||!a.isEmptyObject(c)?this.reInitialize(d,c):this.quickInit(),f&&this.resetAxesScale(f,c.axes),this.draw(),this.target.trigger("jqplotPostReplot")},this.redraw=function(a){a=null==a||a,this.target.trigger("jqplotPreRedraw"),a&&(this.canvasManager.freeAllCanvases(),this.eventCanvas._elem.unbind(),this.target.empty());for(var b in this.axes)this.axes[b]._ticks=[];this.computePlotData(),this._sumy=0,this._sumx=0;for(var c=0,d=this.series.length;c<d;c++)this._sumy+=this.series[c]._sumy,this._sumx+=this.series[c]._sumx;this.draw(),this.target.trigger("jqplotPostRedraw")},this.draw=function(){if(this.drawIfHidden||this.target.is(":visible")){this.target.trigger("jqplotPreDraw");var b,c,d;for(b=0,d=a.jqplot.preDrawHooks.length;b<d;b++)a.jqplot.preDrawHooks[b].call(this);for(b=0,d=this.preDrawHooks.hooks.length;b<d;b++)this.preDrawHooks.hooks[b].apply(this,this.preDrawSeriesHooks.args[b]);this.target.append(this.baseCanvas.createElement({left:0,right:0,top:0,bottom:0},"jqplot-base-canvas",null,this)),this.baseCanvas.setContext(),this.target.append(this.title.draw()),this.title.pack({top:0,left:0});var e=this.legend.draw({},this),f={top:0,left:0,bottom:0,right:0};if("outsideGrid"==this.legend.placement){switch(this.target.append(e),this.legend.location){case"n":f.top+=this.legend.getHeight();break;case"s":f.bottom+=this.legend.getHeight();break;case"ne":case"e":case"se":f.right+=this.legend.getWidth();break;case"nw":case"w":case"sw":f.left+=this.legend.getWidth();break;default:f.right+=this.legend.getWidth()}e=e.detach()}var g,h=this.axes;for(b=0;b<12;b++)g=I[b],this.target.append(h[g].draw(this.baseCanvas._ctx,this)),h[g].set();h.yaxis.show&&(f.left+=h.yaxis.getWidth());var i,j=["y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"],k=[0,0,0,0,0,0,0,0],l=0;for(i=0;i<8;i++)h[j[i]].show&&(l+=h[j[i]].getWidth(),k[i]=l);if(f.right+=l,h.x2axis.show&&(f.top+=h.x2axis.getHeight()),this.title.show&&(f.top+=this.title.getHeight()),h.xaxis.show&&(f.bottom+=h.xaxis.getHeight()),this.options.gridDimensions&&a.isPlainObject(this.options.gridDimensions)){var m=parseInt(this.options.gridDimensions.width,10)||0,n=parseInt(this.options.gridDimensions.height,10)||0,o=(this._width-f.left-f.right-m)/2,p=(this._height-f.top-f.bottom-n)/2;p>=0&&o>=0&&(f.top+=p,f.bottom+=p,f.left+=o,f.right+=o)}var q=["top","bottom","left","right"];for(var i in q)null==this._gridPadding[q[i]]&&f[q[i]]>0?this._gridPadding[q[i]]=f[q[i]]:null==this._gridPadding[q[i]]&&(this._gridPadding[q[i]]=this._defaultGridPadding[q[i]]);var r=this._gridPadding;for("outsideGrid"===this.legend.placement&&(r={top:this.title.getHeight(),left:0,right:0,bottom:0}),h.xaxis.pack({position:"absolute",bottom:this._gridPadding.bottom-h.xaxis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right}),h.yaxis.pack({position:"absolute",top:0,left:this._gridPadding.left-h.yaxis.getWidth(),height:this._height},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top}),h.x2axis.pack({position:"absolute",top:this._gridPadding.top-h.x2axis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right}),b=8;b>0;b--)h[j[b-1]].pack({position:"absolute",top:0,right:this._gridPadding.right-k[b-1]},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});var s=(this._width-this._gridPadding.left-this._gridPadding.right)/2+this._gridPadding.left-h.yMidAxis.getWidth()/2;h.yMidAxis.pack({position:"absolute",top:0,left:s,zIndex:9,textAlign:"center"},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top}),this.target.append(this.grid.createElement(this._gridPadding,this)),
5
- this.grid.draw();var t=this.series,u=t.length;for(b=0,d=u;b<d;b++)c=this.seriesStack[b],this.target.append(t[c].shadowCanvas.createElement(this._gridPadding,"jqplot-series-shadowCanvas",null,this)),t[c].shadowCanvas.setContext(),t[c].shadowCanvas._elem.data("seriesIndex",c);for(b=0,d=u;b<d;b++)c=this.seriesStack[b],this.target.append(t[c].canvas.createElement(this._gridPadding,"jqplot-series-canvas",null,this)),t[c].canvas.setContext(),t[c].canvas._elem.data("seriesIndex",c);this.target.append(this.eventCanvas.createElement(this._gridPadding,"jqplot-event-canvas",null,this)),this.eventCanvas.setContext(),this.eventCanvas._ctx.fillStyle="rgba(0,0,0,0)",this.eventCanvas._ctx.fillRect(0,0,this.eventCanvas._ctx.canvas.width,this.eventCanvas._ctx.canvas.height),this.bindCustomEvents(),this.legend.preDraw?(this.eventCanvas._elem.before(e),this.legend.pack(r),this.legend._elem?this.drawSeries({legendInfo:{location:this.legend.location,placement:this.legend.placement,width:this.legend.getWidth(),height:this.legend.getHeight(),xoffset:this.legend.xoffset,yoffset:this.legend.yoffset}}):this.drawSeries()):(this.drawSeries(),u&&a(t[u-1].canvas._elem).after(e),this.legend.pack(r));for(var b=0,d=a.jqplot.eventListenerHooks.length;b<d;b++)this.eventCanvas._elem.bind(a.jqplot.eventListenerHooks[b][0],{plot:this},a.jqplot.eventListenerHooks[b][1]);for(var b=0,d=this.eventListenerHooks.hooks.length;b<d;b++)this.eventCanvas._elem.bind(this.eventListenerHooks.hooks[b][0],{plot:this},this.eventListenerHooks.hooks[b][1]);var v=this.fillBetween;if("number"==typeof v.series1)v.fill&&v.series1!==v.series2&&v.series1<u&&v.series2<u&&"line"===t[v.series1]._type&&"line"===t[v.series2]._type&&this.doFillBetweenLines();else if(null!=v.series1&&null!=v.series2){var w=!1;if(v.series1.length===v.series2.length)for(var x=0,y=0,z=0;z<v.series1.length;z++){if(x=v.series1[z],y=v.series2[z],!(x!==y&&x<u&&y<u&&"line"===t[x]._type&&"line"===t[y]._type)){w=!1;break}w=!0}v.fill&&w&&this.doFillBetweenLines()}for(var b=0,d=a.jqplot.postDrawHooks.length;b<d;b++)a.jqplot.postDrawHooks[b].call(this);for(var b=0,d=this.postDrawHooks.hooks.length;b<d;b++)this.postDrawHooks.hooks[b].apply(this,this.postDrawHooks.args[b]);this.target.is(":visible")&&(this._drawCount+=1);var A,B,C,D;for(b=0,d=u;b<d;b++)A=t[b],B=A.renderer,C=".jqplot-point-label.jqplot-series-"+b,B.animation&&B.animation._supported&&B.animation.show&&(this._drawCount<2||this.animateReplot)&&(D=this.target.find(C),D.stop(!0,!0).hide(),A.canvas._elem.stop(!0,!0).hide(),A.shadowCanvas._elem.stop(!0,!0).hide(),A.canvas._elem.jqplotEffect("blind",{mode:"show",direction:B.animation.direction},B.animation.speed),A.shadowCanvas._elem.jqplotEffect("blind",{mode:"show",direction:B.animation.direction},B.animation.speed),D.fadeIn(.8*B.animation.speed));D=null,this.target.trigger("jqplotPostDraw",[this])}},g.prototype.doFillBetweenLines=function(){function a(a,d){var e=c[a],f=c[d];if(f.renderer.smooth)var g=f.renderer._smoothedData.slice(0).reverse();else var g=f.gridData.slice(0).reverse();if(e.renderer.smooth)var h=e.renderer._smoothedData.concat(g);else var h=e.gridData.concat(g);var i=null!==b.color?b.color:c[a].fillColor,j=null!==b.baseSeries?b.baseSeries:a,k=c[j].renderer.shapeRenderer,l={fillStyle:i,fill:!0,closePath:!0};k.draw(e.shadowCanvas._ctx,h,l)}var b=this.fillBetween,c=this.series,d=b.series1,e=b.series2,f=0,g=0;if("number"==typeof d&&"number"==typeof e)f=d<e?d:e,g=e>d?e:d,a(f,g);else for(var h=0;h<d.length;h++)f=d[h]<e[h]?d[h]:e[h],g=e[h]>d[h]?e[h]:d[h],a(f,g)},this.bindCustomEvents=function(){this.eventCanvas._elem.bind("click",{plot:this},this.onClick),this.eventCanvas._elem.bind("dblclick",{plot:this},this.onDblClick),this.eventCanvas._elem.bind("mousedown",{plot:this},this.onMouseDown),this.eventCanvas._elem.bind("mousemove",{plot:this},this.onMouseMove),this.eventCanvas._elem.bind("mouseenter",{plot:this},this.onMouseEnter),this.eventCanvas._elem.bind("mouseleave",{plot:this},this.onMouseLeave),this.captureRightClick?(this.eventCanvas._elem.bind("mouseup",{plot:this},this.onRightClick),this.eventCanvas._elem.get(0).oncontextmenu=function(){return!1}):this.eventCanvas._elem.bind("mouseup",{plot:this},this.onMouseUp)},this.onClick=function(b){var c=i(b),d=b.data.plot,e=j(c.gridPos,d),f=a.Event("jqplotClick");f.pageX=b.pageX,f.pageY=b.pageY,a(this).trigger(f,[c.gridPos,c.dataPos,e,d])},this.onDblClick=function(b){var c=i(b),d=b.data.plot,e=j(c.gridPos,d),f=a.Event("jqplotDblClick");f.pageX=b.pageX,f.pageY=b.pageY,a(this).trigger(f,[c.gridPos,c.dataPos,e,d])},this.onMouseDown=function(b){var c=i(b),d=b.data.plot,e=j(c.gridPos,d),f=a.Event("jqplotMouseDown");f.pageX=b.pageX,f.pageY=b.pageY,a(this).trigger(f,[c.gridPos,c.dataPos,e,d])},this.onMouseUp=function(b){var c=i(b),d=a.Event("jqplotMouseUp");d.pageX=b.pageX,d.pageY=b.pageY,a(this).trigger(d,[c.gridPos,c.dataPos,null,b.data.plot])},this.onRightClick=function(b){var c=i(b),d=b.data.plot,e=j(c.gridPos,d);if(d.captureRightClick)if(3==b.which){var f=a.Event("jqplotRightClick");f.pageX=b.pageX,f.pageY=b.pageY,a(this).trigger(f,[c.gridPos,c.dataPos,e,d])}else{var f=a.Event("jqplotMouseUp");f.pageX=b.pageX,f.pageY=b.pageY,a(this).trigger(f,[c.gridPos,c.dataPos,e,d])}},this.onMouseMove=function(b){var c=i(b),d=b.data.plot,e=j(c.gridPos,d),f=a.Event("jqplotMouseMove");f.pageX=b.pageX,f.pageY=b.pageY,a(this).trigger(f,[c.gridPos,c.dataPos,e,d])},this.onMouseEnter=function(b){var c=i(b),d=b.data.plot,e=a.Event("jqplotMouseEnter");e.pageX=b.pageX,e.pageY=b.pageY,e.relatedTarget=b.relatedTarget,a(this).trigger(e,[c.gridPos,c.dataPos,null,d])},this.onMouseLeave=function(b){var c=i(b),d=b.data.plot,e=a.Event("jqplotMouseLeave");e.pageX=b.pageX,e.pageY=b.pageY,e.relatedTarget=b.relatedTarget,a(this).trigger(e,[c.gridPos,c.dataPos,null,d])},this.drawSeries=function(b,c){var d,e,f;if(c="number"==typeof b&&null==c?b:c,b="object"==typeof b?b:{},c!=H)e=this.series[c],f=e.shadowCanvas._ctx,f.clearRect(0,0,f.canvas.width,f.canvas.height),e.drawShadow(f,b,this),f=e.canvas._ctx,f.clearRect(0,0,f.canvas.width,f.canvas.height),e.draw(f,b,this),e.renderer.constructor==a.jqplot.BezierCurveRenderer&&c<this.series.length-1&&this.drawSeries(c+1);else for(d=0;d<this.series.length;d++)e=this.series[d],f=e.shadowCanvas._ctx,f.clearRect(0,0,f.canvas.width,f.canvas.height),e.drawShadow(f,b,this),f=e.canvas._ctx,f.clearRect(0,0,f.canvas.width,f.canvas.height),e.draw(f,b,this);b=c=d=e=f=null},this.moveSeriesToFront=function(b){b=parseInt(b,10);var c=a.inArray(b,this.seriesStack);if(c!=-1){if(c==this.seriesStack.length-1)return void(this.previousSeriesStack=this.seriesStack.slice(0));var d=this.seriesStack[this.seriesStack.length-1],e=this.series[b].canvas._elem.detach(),f=this.series[b].shadowCanvas._elem.detach();this.series[d].shadowCanvas._elem.after(f),this.series[d].canvas._elem.after(e),this.previousSeriesStack=this.seriesStack.slice(0),this.seriesStack.splice(c,1),this.seriesStack.push(b)}},this.moveSeriesToBack=function(b){b=parseInt(b,10);var c=a.inArray(b,this.seriesStack);if(0!=c&&c!=-1){var d=this.seriesStack[0],e=this.series[b].canvas._elem.detach(),f=this.series[b].shadowCanvas._elem.detach();this.series[d].shadowCanvas._elem.before(f),this.series[d].canvas._elem.before(e),this.previousSeriesStack=this.seriesStack.slice(0),this.seriesStack.splice(c,1),this.seriesStack.unshift(b)}},this.restorePreviousSeriesOrder=function(){var a,b,c,d,e,f;if(this.seriesStack!=this.previousSeriesStack){for(a=1;a<this.previousSeriesStack.length;a++)e=this.previousSeriesStack[a],f=this.previousSeriesStack[a-1],b=this.series[e].canvas._elem.detach(),c=this.series[e].shadowCanvas._elem.detach(),this.series[f].shadowCanvas._elem.after(c),this.series[f].canvas._elem.after(b);d=this.seriesStack.slice(0),this.seriesStack=this.previousSeriesStack.slice(0),this.previousSeriesStack=d}},this.restoreOriginalSeriesOrder=function(){var a,b,c,d=[];for(a=0;a<this.series.length;a++)d.push(a);if(this.seriesStack!=d)for(this.previousSeriesStack=this.seriesStack.slice(0),this.seriesStack=d,a=1;a<this.seriesStack.length;a++)b=this.series[a].canvas._elem.detach(),c=this.series[a].shadowCanvas._elem.detach(),this.series[a-1].shadowCanvas._elem.after(c),this.series[a-1].canvas._elem.after(b)},this.activateTheme=function(a){this.themeEngine.activate(this,a)}}function h(a,b){return(3.4182054+b)*Math.pow(a,-.3534992)}function i(a){var b=(Math.exp(2*a)-1)/(Math.exp(2*a)+1);return b}function j(a){function b(a,b){return a-b==0?Math.pow(10,10):a-b}var c=this.renderer.smooth,d=this.canvas.getWidth(),e=this._xaxis.series_p2u,f=this._yaxis.series_p2u,g=null,i=a.length/d,j=[],k=[];g=isNaN(parseFloat(c))?h(i,.5):parseFloat(c);for(var l=[],m=[],n=0,o=a.length;n<o;n++)l.push(a[n][1]),m.push(a[n][0]);for(var p,q,r,s,t=a.length-1,u=1,v=a.length;u<v;u++){for(var w=[],x=[],y=0;y<2;y++){var n=u-1+y;0==n||n==t?w[y]=Math.pow(10,10):l[n+1]-l[n]==0||l[n]-l[n-1]==0?w[y]=0:(m[n+1]-m[n])/(l[n+1]-l[n])+(m[n]-m[n-1])/(l[n]-l[n-1])==0?w[y]=0:(l[n+1]-l[n])*(l[n]-l[n-1])<0?w[y]=0:w[y]=2/(b(m[n+1],m[n])/(l[n+1]-l[n])+b(m[n],m[n-1])/(l[n]-l[n-1]))}1==u?w[0]=1.5*(l[1]-l[0])/b(m[1],m[0])-w[1]/2:u==t&&(w[1]=1.5*(l[t]-l[t-1])/b(m[t],m[t-1])-w[0]/2),x[0]=-2*(w[1]+2*w[0])/b(m[u],m[u-1])+6*(l[u]-l[u-1])/Math.pow(b(m[u],m[u-1]),2),x[1]=2*(2*w[1]+w[0])/b(m[u],m[u-1])-6*(l[u]-l[u-1])/Math.pow(b(m[u],m[u-1]),2),s=1/6*(x[1]-x[0])/b(m[u],m[u-1]),r=.5*(m[u]*x[0]-m[u-1]*x[1])/b(m[u],m[u-1]),q=(l[u]-l[u-1]-r*(Math.pow(m[u],2)-Math.pow(m[u-1],2))-s*(Math.pow(m[u],3)-Math.pow(m[u-1],3)))/b(m[u],m[u-1]),p=l[u-1]-q*m[u-1]-r*Math.pow(m[u-1],2)-s*Math.pow(m[u-1],3);for(var z,A,B=(m[u]-m[u-1])/g,y=0,o=g;y<o;y++)z=[],A=m[u-1]+y*B,z.push(A),z.push(p+q*A+r*Math.pow(A,2)+s*Math.pow(A,3)),j.push(z),k.push([e(z[0]),f(z[1])])}return j.push(a[n]),k.push([e(a[n][0]),f(a[n][1])]),[j,k]}function k(a){var b,c,d,e,f,g,j,k,l,m,n,o,p,q,r,s,t,u,v=this.renderer.smooth,w=this.renderer.tension,x=this.canvas.getWidth(),y=this._xaxis.series_p2u,z=this._yaxis.series_p2u,A=null,B=null,C=null,D=null,E=null,F=null,G=null,H=a.length/x,I=[],J=[];A=isNaN(parseFloat(v))?h(H,.5):parseFloat(v),isNaN(parseFloat(w))||(w=parseFloat(w));for(var K=0,L=a.length-1;K<L;K++)for(null===w?(E=Math.abs((a[K+1][1]-a[K][1])/(a[K+1][0]-a[K][0])),q=.3,r=.6,s=(r-q)/2,t=2.5,u=-1.4,G=E/t+u,C=s*i(G)-s*i(u)+q,K>0&&(F=Math.abs((a[K][1]-a[K-1][1])/(a[K][0]-a[K-1][0]))),G=F/t+u,D=s*i(G)-s*i(u)+q,B=(C+D)/2):B=w,b=0;b<A;b++)c=b/A,d=(1+2*c)*Math.pow(1-c,2),e=c*Math.pow(1-c,2),f=Math.pow(c,2)*(3-2*c),g=Math.pow(c,2)*(c-1),a[K-1]?(j=B*(a[K+1][0]-a[K-1][0]),k=B*(a[K+1][1]-a[K-1][1])):(j=B*(a[K+1][0]-a[K][0]),k=B*(a[K+1][1]-a[K][1])),a[K+2]?(l=B*(a[K+2][0]-a[K][0]),m=B*(a[K+2][1]-a[K][1])):(l=B*(a[K+1][0]-a[K][0]),m=B*(a[K+1][1]-a[K][1])),n=d*a[K][0]+f*a[K+1][0]+e*j+g*l,o=d*a[K][1]+f*a[K+1][1]+e*k+g*m,p=[n,o],I.push(p),J.push([y(n),z(o)]);return I.push(a[L]),J.push([y(a[L][0]),z(a[L][1])]),[I,J]}function l(b,c,d){for(var e=0;e<this.series.length;e++)this.series[e].renderer.constructor==a.jqplot.LineRenderer&&this.series[e].highlightMouseOver&&(this.series[e].highlightMouseDown=!1)}function m(){this.plugins.lineRenderer&&this.plugins.lineRenderer.highlightCanvas&&(this.plugins.lineRenderer.highlightCanvas.resetCanvas(),this.plugins.lineRenderer.highlightCanvas=null),this.plugins.lineRenderer.highlightedSeriesIndex=null,this.plugins.lineRenderer.highlightCanvas=new a.jqplot.GenericCanvas,this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-lineRenderer-highlight-canvas",this._plotDimensions,this)),this.plugins.lineRenderer.highlightCanvas.setContext(),this.eventCanvas._elem.bind("mouseleave",{plot:this},function(a){o(a.data.plot)})}function n(a,b,c,d){var e=a.series[b],f=a.plugins.lineRenderer.highlightCanvas;f._ctx.clearRect(0,0,f._ctx.canvas.width,f._ctx.canvas.height),e._highlightedPoint=c,a.plugins.lineRenderer.highlightedSeriesIndex=b;var g={fillStyle:e.highlightColor};"line"===e.type&&e.renderer.bands.show&&(g.fill=!0,g.closePath=!0),e.renderer.shapeRenderer.draw(f._ctx,d,g),f=null}function o(a){var b=a.plugins.lineRenderer.highlightCanvas;b._ctx.clearRect(0,0,b._ctx.canvas.width,b._ctx.canvas.height);for(var c=0;c<a.series.length;c++)a.series[c]._highlightedPoint=null;a.plugins.lineRenderer.highlightedSeriesIndex=null,a.target.trigger("jqplotDataUnhighlight"),b=null}function p(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data],g=jQuery.Event("jqplotDataMouseOver");if(g.pageX=a.pageX,g.pageY=a.pageY,e.target.trigger(g,f),e.series[f[0]].highlightMouseOver&&f[0]!=e.plugins.lineRenderer.highlightedSeriesIndex){var h=jQuery.Event("jqplotDataHighlight");h.which=a.which,h.pageX=a.pageX,h.pageY=a.pageY,e.target.trigger(h,f),n(e,d.seriesIndex,d.pointIndex,d.points)}}else null==d&&o(e)}function q(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data];if(e.series[f[0]].highlightMouseDown&&f[0]!=e.plugins.lineRenderer.highlightedSeriesIndex){var g=jQuery.Event("jqplotDataHighlight");g.which=a.which,g.pageX=a.pageX,g.pageY=a.pageY,e.target.trigger(g,f),n(e,d.seriesIndex,d.pointIndex,d.points)}}else null==d&&o(e)}function r(a,b,c,d,e){var f=e.plugins.lineRenderer.highlightedSeriesIndex;null!=f&&e.series[f].highlightMouseDown&&o(e)}function s(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data],g=jQuery.Event("jqplotDataClick");g.which=a.which,g.pageX=a.pageX,g.pageY=a.pageY,e.target.trigger(g,f)}}function t(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data],g=e.plugins.lineRenderer.highlightedSeriesIndex;null!=g&&e.series[g].highlightMouseDown&&o(e);var h=jQuery.Event("jqplotDataRightClick");h.which=a.which,h.pageX=a.pageX,h.pageY=a.pageY,e.target.trigger(h,f)}}function u(a){var b;if(a=Math.abs(a),a>=10)b="%d";else if(a>1)b=a===parseInt(a,10)?"%d":"%.1f";else{var c=-Math.floor(Math.log(a)/Math.LN10);b="%."+c+"f"}return b}function v(b,c,d){for(var e,f,g,h,i,j,k,l=Math.floor(d/2),m=Math.ceil(1.5*d),n=Number.MAX_VALUE,o=c-b,p=a.jqplot.getSignificantFigures,q=0,r=m-l+1;q<r;q++)j=l+q,e=o/(j-1),f=p(e),e=Math.abs(d-j)+f.digitsRight,e<n?(n=e,g=j,k=f.digitsRight):e===n&&f.digitsRight<k&&(g=j,k=f.digitsRight);return h=Math.max(k,Math.max(p(b).digitsRight,p(c).digitsRight)),i=0===h?"%d":"%."+h+"f",e=o/(g-1),[b,c,g,i,e]}function w(a,b){b=b||7;var c,d=a/(b-1),e=Math.pow(10,Math.floor(Math.log(d)/Math.LN10)),f=d/e;return c=e<1?f>5?10*e:f>2?5*e:f>1?2*e:e:f>5?10*e:f>4?5*e:f>3?4*e:f>2?3*e:f>1?2*e:e}function x(a,b){b=b||1;var c,d=Math.floor(Math.log(a)/Math.LN10),e=Math.pow(10,d),f=a/e;return f/=b,c=f<=.38?.1:f<=1.6?.2:f<=4?.5:f<=8?1:f<=16?2:5,c*e}function y(a,b){var c,d,e=Math.floor(Math.log(a)/Math.LN10),f=Math.pow(10,e),g=a/f;return g/=b,d=g<=.38?.1:g<=1.6?.2:g<=4?.5:g<=8?1:g<=16?2:5,c=d*f,[c,d,f]}function z(b){var c={angle:b.shadowAngle,offset:b.shadowOffset,alpha:b.shadowAlpha,lineWidth:b.lineWidth,depth:b.shadowDepth,closePath:!0};return b.style.indexOf("filled")!=-1&&(c.fill=!0),b.style.indexOf("ircle")!=-1&&(c.isarc=!0,c.closePath=!1),a.extend(!0,{},c)}function A(b){var c={fill:!1,isarc:!1,strokeStyle:b.color,fillStyle:b.color,lineWidth:b.lineWidth,closePath:!0};return b.style.indexOf("filled")!=-1&&(c.fill=!0),b.style.indexOf("ircle")!=-1&&(c.isarc=!0,c.closePath=!1),a.extend(!0,{},c)}function B(a,b){return a-b}function C(a){if(null==a||"object"!=typeof a)return a;var b=new a.constructor;for(var c in a)b[c]=C(a[c]);return b}function D(a,b){if(null!=b&&"object"==typeof b)for(var c in b)"highlightColors"==c&&(a[c]=C(b[c])),null!=b[c]&&"object"==typeof b[c]?(a.hasOwnProperty(c)||(a[c]={}),D(a[c],b[c])):a[c]=b[c]}function E(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1}function F(a){return null===a?"[object Null]":Object.prototype.toString.call(a)}function G(b,c,d,e){return a.isPlainObject(b)?b:(b={effect:b},c===H&&(c={}),a.isFunction(c)&&(e=c,d=null,c={}),("number"===a.type(c)||a.fx.speeds[c])&&(e=d,d=c,c={}),a.isFunction(d)&&(e=d,d=null),c&&a.extend(b,c),d=d||c.duration,b.duration=a.fx.off?0:"number"==typeof d?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,b.complete=e||c.complete,b)}var H;a.fn.emptyForce=function(){for(var b,c=0;null!=(b=a(this)[c]);c++){if(1===b.nodeType&&a.cleanData(b.getElementsByTagName("*")),a.jqplot.use_excanvas)b.outerHTML="";else for(;b.firstChild;)b.removeChild(b.firstChild);b=null}return a(this)},a.fn.removeChildForce=function(a){for(;a.firstChild;)this.removeChildForce(a.firstChild),a.removeChild(a.firstChild)},a.fn.jqplot=function(){for(var b=[],c=[],d=0,e=arguments.length;d<e;d++)a.isArray(arguments[d])?b.push(arguments[d]):a.isPlainObject(arguments[d])&&c.push(arguments[d]);return this.each(function(d){var e,f,g,h,i=a(this),j=b.length,k=c.length;g=d<j?b[d]:j?b[j-1]:null,h=d<k?c[d]:k?c[k-1]:null,e=i.attr("id"),e===H&&(e="jqplot_target_"+a.jqplot.targetCounter++,i.attr("id",e)),f=a.jqplot(e,g,h),i.data("jqplot",f)})},a.jqplot=function(b,c,d){var e=null,f=null;3===arguments.length?(e=c,f=d):2===arguments.length&&(a.isArray(c)?e=c:a.isPlainObject(c)&&(f=c)),null===e&&null!==f&&f.data&&(e=f.data);var h=new g;if(a("#"+b).removeClass("jqplot-error"),!a.jqplot.config.catchErrors)return h.init(b,e,f),h.draw(),h.themeEngine.init.call(h),h;try{return h.init(b,e,f),h.draw(),h.themeEngine.init.call(h),h}catch(c){var i=a.jqplot.config.errorMessage||c.message;a("#"+b).append('<div class="jqplot-error-message">'+i+"</div>"),a("#"+b).addClass("jqplot-error"),document.getElementById(b).style.background=a.jqplot.config.errorBackground,document.getElementById(b).style.border=a.jqplot.config.errorBorder,document.getElementById(b).style.fontFamily=a.jqplot.config.errorFontFamily,document.getElementById(b).style.fontSize=a.jqplot.config.errorFontSize,document.getElementById(b).style.fontStyle=a.jqplot.config.errorFontStyle,document.getElementById(b).style.fontWeight=a.jqplot.config.errorFontWeight}},a.jqplot.version="1.0.9",a.jqplot.revision="c465c44",a.jqplot.targetCounter=1,a.jqplot.CanvasManager=function(){"undefined"==typeof a.jqplot.CanvasManager.canvases&&(a.jqplot.CanvasManager.canvases=[],a.jqplot.CanvasManager.free=[]);var b=[];this.getCanvas=function(){var c,d=!0;if(!a.jqplot.use_excanvas)for(var e=0,f=a.jqplot.CanvasManager.canvases.length;e<f;e++)if(a.jqplot.CanvasManager.free[e]===!0){d=!1,c=a.jqplot.CanvasManager.canvases[e],a.jqplot.CanvasManager.free[e]=!1,b.push(e);break}return d&&(c=document.createElement("canvas"),b.push(a.jqplot.CanvasManager.canvases.length),a.jqplot.CanvasManager.canvases.push(c),a.jqplot.CanvasManager.free.push(!1)),c},this.initCanvas=function(b){if(a.jqplot.use_excanvas)return window.G_vmlCanvasManager.initElement(b);var c=b.getContext("2d"),d=1;window.devicePixelRatio>1&&(c.webkitBackingStorePixelRatio===H||c.webkitBackingStorePixelRatio<2)&&(d=window.devicePixelRatio);var e=b.width,f=b.height;return b.width=d*b.width,b.height=d*b.height,b.style.width=e+"px",b.style.height=f+"px",c.save(),c.scale(d,d),b},this.freeAllCanvases=function(){for(var a=0,c=b.length;a<c;a++)this.freeCanvas(b[a]);b=[]},this.freeCanvas=function(b){if(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==H)window.G_vmlCanvasManager.uninitElement(a.jqplot.CanvasManager.canvases[b]),a.jqplot.CanvasManager.canvases[b]=null;else{var c=a.jqplot.CanvasManager.canvases[b];c.getContext("2d").clearRect(0,0,c.width,c.height),a(c).unbind().removeAttr("class").removeAttr("style"),a(c).css({left:"",top:"",position:""}),c.width=0,c.height=0,a.jqplot.CanvasManager.free[b]=!0}}},a.jqplot.log=function(){window.console&&window.console.log.apply(window.console,arguments)},a.jqplot.config={addDomReference:!1,enablePlugins:!1,defaultHeight:300,defaultWidth:400,UTCAdjust:!1,timezoneOffset:new Date(6e4*(new Date).getTimezoneOffset()),errorMessage:"",errorBackground:"",errorBorder:"",errorFontFamily:"",errorFontSize:"",errorFontStyle:"",errorFontWeight:"",catchErrors:!1,defaultTickFormatString:"%.1f",defaultColors:["#4bb2c5","#EAA228","#c5b47f","#579575","#839557","#958c12","#953579","#4b5de4","#d8b83f","#ff5800","#0085cc","#c747a3","#cddf54","#FBD178","#26B4E3","#bd70c7"],defaultNegativeColors:["#498991","#C08840","#9F9274","#546D61","#646C4A","#6F6621","#6E3F5F","#4F64B0","#A89050","#C45923","#187399","#945381","#959E5C","#C7AF7B","#478396","#907294"],dashLength:4,gapLength:4,dotGapLength:2.5,srcLocation:"jqplot/src/",pluginLocation:"jqplot/src/plugins/"},a.jqplot.arrayMax=function(a){return Math.max.apply(Math,a)},a.jqplot.arrayMin=function(a){return Math.min.apply(Math,a)},a.jqplot.enablePlugins=a.jqplot.config.enablePlugins,a.jqplot.support_canvas=function(){return"undefined"==typeof a.jqplot.support_canvas.result&&(a.jqplot.support_canvas.result=!!document.createElement("canvas").getContext),a.jqplot.support_canvas.result},a.jqplot.support_canvas_text=function(){return"undefined"==typeof a.jqplot.support_canvas_text.result&&(window.G_vmlCanvasManager!==H&&window.G_vmlCanvasManager._version>887?a.jqplot.support_canvas_text.result=!0:a.jqplot.support_canvas_text.result=!(!document.createElement("canvas").getContext||"function"!=typeof document.createElement("canvas").getContext("2d").fillText)),a.jqplot.support_canvas_text.result},a.jqplot.use_excanvas=!(a.support.boxModel&&a.support.objectAll&&$support.leadingWhitespace||a.jqplot.support_canvas()),a.jqplot.preInitHooks=[],a.jqplot.postInitHooks=[],a.jqplot.preParseOptionsHooks=[],a.jqplot.postParseOptionsHooks=[],a.jqplot.preDrawHooks=[],a.jqplot.postDrawHooks=[],a.jqplot.preDrawSeriesHooks=[],a.jqplot.postDrawSeriesHooks=[],a.jqplot.preDrawLegendHooks=[],a.jqplot.addLegendRowHooks=[],a.jqplot.preSeriesInitHooks=[],a.jqplot.postSeriesInitHooks=[],a.jqplot.preParseSeriesOptionsHooks=[],a.jqplot.postParseSeriesOptionsHooks=[],a.jqplot.eventListenerHooks=[],a.jqplot.preDrawSeriesShadowHooks=[],a.jqplot.postDrawSeriesShadowHooks=[],a.jqplot.ElemContainer=function(){this._elem,this._plotWidth,this._plotHeight,this._plotDimensions={height:null,width:null}},a.jqplot.ElemContainer.prototype.createElement=function(b,c,d,e,f){this._offsets=c;var g=d||"jqplot",h=document.createElement(b);return this._elem=a(h),this._elem.addClass(g),this._elem.css(e),this._elem.attr(f),h=null,this._elem},a.jqplot.ElemContainer.prototype.getWidth=function(){return this._elem?this._elem.outerWidth(!0):null},a.jqplot.ElemContainer.prototype.getHeight=function(){return this._elem?this._elem.outerHeight(!0):null},a.jqplot.ElemContainer.prototype.getPosition=function(){return this._elem?this._elem.position():{top:null,left:null,bottom:null,right:null}},a.jqplot.ElemContainer.prototype.getTop=function(){return this.getPosition().top},a.jqplot.ElemContainer.prototype.getLeft=function(){return this.getPosition().left},a.jqplot.ElemContainer.prototype.getBottom=function(){return this._elem.css("bottom")},a.jqplot.ElemContainer.prototype.getRight=function(){return this._elem.css("right")},b.prototype=new a.jqplot.ElemContainer,b.prototype.constructor=b,b.prototype.init=function(){a.isFunction(this.renderer)&&(this.renderer=new this.renderer),this.tickOptions.axis=this.name,null==this.tickOptions.showMark&&(this.tickOptions.showMark=this.showTicks),null==this.tickOptions.showMark&&(this.tickOptions.showMark=this.showTickMarks),null==this.tickOptions.showLabel&&(this.tickOptions.showLabel=this.showTicks),null==this.label||""==this.label?this.showLabel=!1:this.labelOptions.label=this.label,0==this.showLabel&&(this.labelOptions.show=!1),0==this.pad&&(this.pad=1),0==this.padMax&&(this.padMax=1),0==this.padMin&&(this.padMin=1),null==this.padMax&&(this.padMax=(this.pad-1)/2+1),null==this.padMin&&(this.padMin=(this.pad-1)/2+1),this.pad=this.padMax+this.padMin-1,null==this.min&&null==this.max||(this.autoscale=!1),null==this.syncTicks&&this.name.indexOf("y")>-1?this.syncTicks=!0:null==this.syncTicks&&(this.syncTicks=!1),this.renderer.init.call(this,this.rendererOptions)},b.prototype.draw=function(a,b){return this.__ticks&&(this.__ticks=null),this.renderer.draw.call(this,a,b)},b.prototype.set=function(){this.renderer.set.call(this)},b.prototype.pack=function(a,b){this.show&&this.renderer.pack.call(this,a,b),null==this._min&&(this._min=this.min,this._max=this.max,this._tickInterval=this.tickInterval,this._numberTicks=this.numberTicks,this.__ticks=this._ticks)},b.prototype.reset=function(){this.renderer.reset.call(this)},b.prototype.resetScale=function(b){a.extend(!0,this,{min:null,max:null,numberTicks:null,tickInterval:null,_ticks:[],ticks:[]},b),this.resetDataBounds()},b.prototype.resetDataBounds=function(){var b=this._dataBounds;b.min=null,b.max=null;for(var c,d,e,f=!!this.show,g=0;g<this._series.length;g++)if(d=this._series[g],d.show||this.scaleToHiddenSeries){e=d._plotData,"line"===d._type&&d.renderer.bands.show&&"x"!==this.name.charAt(0)&&(e=[[0,d.renderer.bands._min],[1,d.renderer.bands._max]]);var h=1,i=1;null!=d._type&&"ohlc"==d._type&&(h=3,i=2);for(var j=0,c=e.length;j<c;j++)"xaxis"==this.name||"x2axis"==this.name?((null!=e[j][0]&&e[j][0]<b.min||null==b.min)&&(b.min=e[j][0]),(null!=e[j][0]&&e[j][0]>b.max||null==b.max)&&(b.max=e[j][0])):((null!=e[j][h]&&e[j][h]<b.min||null==b.min)&&(b.min=e[j][h]),(null!=e[j][i]&&e[j][i]>b.max||null==b.max)&&(b.max=e[j][i]));f&&d.renderer.constructor!==a.jqplot.BarRenderer?f=!1:f&&this._options.hasOwnProperty("forceTickAt0")&&0==this._options.forceTickAt0?f=!1:f&&d.renderer.constructor===a.jqplot.BarRenderer&&("vertical"==d.barDirection&&"xaxis"!=this.name&&"x2axis"!=this.name?null==this._options.pad&&null==this._options.padMin||(f=!1):"horizontal"!=d.barDirection||"xaxis"!=this.name&&"x2axis"!=this.name||null==this._options.pad&&null==this._options.padMin||(f=!1))}f&&this.renderer.constructor===a.jqplot.LinearAxisRenderer&&b.min>=0&&(this.padMin=1,this.forceTickAt0=!0)},c.prototype=new a.jqplot.ElemContainer,c.prototype.constructor=c,c.prototype.setOptions=function(b){if(a.extend(!0,this,b),"inside"==this.placement&&(this.placement="insideGrid"),this.xoffset>0){if("insideGrid"==this.placement)switch(this.location){case"nw":case"w":case"sw":null==this.marginLeft&&(this.marginLeft=this.xoffset+"px"),this.marginRight="0px";break;case"ne":case"e":case"se":default:null==this.marginRight&&(this.marginRight=this.xoffset+"px"),this.marginLeft="0px"}else if("outside"==this.placement)switch(this.location){case"nw":case"w":case"sw":null==this.marginRight&&(this.marginRight=this.xoffset+"px"),this.marginLeft="0px";break;case"ne":case"e":case"se":default:null==this.marginLeft&&(this.marginLeft=this.xoffset+"px"),this.marginRight="0px"}this.xoffset=0}if(this.yoffset>0){if("outside"==this.placement)switch(this.location){case"sw":case"s":case"se":null==this.marginTop&&(this.marginTop=this.yoffset+"px"),this.marginBottom="0px";break;case"ne":case"n":case"nw":default:null==this.marginBottom&&(this.marginBottom=this.yoffset+"px"),this.marginTop="0px"}else if("insideGrid"==this.placement)switch(this.location){case"sw":case"s":case"se":null==this.marginBottom&&(this.marginBottom=this.yoffset+"px"),this.marginTop="0px";break;case"ne":case"n":case"nw":default:null==this.marginTop&&(this.marginTop=this.yoffset+"px"),this.marginBottom="0px"}this.yoffset=0}},c.prototype.init=function(){a.isFunction(this.renderer)&&(this.renderer=new this.renderer),this.renderer.init.call(this,this.rendererOptions)},c.prototype.draw=function(b,c){for(var d=0;d<a.jqplot.preDrawLegendHooks.length;d++)a.jqplot.preDrawLegendHooks[d].call(this,b);return this.renderer.draw.call(this,b,c)},c.prototype.pack=function(a){this.renderer.pack.call(this,a)},d.prototype=new a.jqplot.ElemContainer,d.prototype.constructor=d,d.prototype.init=function(){a.isFunction(this.renderer)&&(this.renderer=new this.renderer),this.renderer.init.call(this,this.rendererOptions)},d.prototype.draw=function(a){return this.renderer.draw.call(this,a)},d.prototype.pack=function(){this.renderer.pack.call(this)},e.prototype=new a.jqplot.ElemContainer,e.prototype.constructor=e,e.prototype.init=function(b,c,d){this.index=b,this.gridBorderWidth=c;var e,f,g=this.data,h=[];for(e=0,f=g.length;e<f;e++)if(this.breakOnNull)h.push(g[e]);else{if(null==g[e]||null==g[e][0]||null==g[e][1])continue;h.push(g[e])}if(this.data=h,this.color||(this.color=d.colorGenerator.get(this.index)),this.negativeColor||(this.negativeColor=d.negativeColorGenerator.get(this.index)),this.fillColor||(this.fillColor=this.color),this.fillAlpha){var i=a.jqplot.normalize2rgb(this.fillColor),i=a.jqplot.getColorComponents(i);this.fillColor="rgba("+i[0]+","+i[1]+","+i[2]+","+this.fillAlpha+")"}a.isFunction(this.renderer)&&(this.renderer=new this.renderer),this.renderer.init.call(this,this.rendererOptions,d),this.markerRenderer=new this.markerRenderer,this.markerOptions.color||(this.markerOptions.color=this.color),null==this.markerOptions.show&&(this.markerOptions.show=this.showMarker),this.showMarker=this.markerOptions.show,this.markerRenderer.init(this.markerOptions)},e.prototype.draw=function(b,c,d){var e=c==H?{}:c;b=b==H?this.canvas._ctx:b;var f,g,h;for(f=0;f<a.jqplot.preDrawSeriesHooks.length;f++)a.jqplot.preDrawSeriesHooks[f].call(this,b,e);for(this.show&&(this.renderer.setGridData.call(this,d),e.preventJqPlotSeriesDrawTrigger||a(b.canvas).trigger("jqplotSeriesDraw",[this.data,this.gridData]),g=[],g=e.data?e.data:this._stack?this._plotData:this.data,h=e.gridData||this.renderer.makeGridData.call(this,g,d),"line"===this._type&&this.renderer.smooth&&this.renderer._smoothedData.length&&(h=this.renderer._smoothedData),this.renderer.draw.call(this,b,h,e,d)),f=0;f<a.jqplot.postDrawSeriesHooks.length;f++)a.jqplot.postDrawSeriesHooks[f].call(this,b,e,d);b=c=d=f=g=h=null},e.prototype.drawShadow=function(b,c,d){var e=c==H?{}:c;b=b==H?this.shadowCanvas._ctx:b;var f,g,h;for(f=0;f<a.jqplot.preDrawSeriesShadowHooks.length;f++)a.jqplot.preDrawSeriesShadowHooks[f].call(this,b,e);for(this.shadow&&(this.renderer.setGridData.call(this,d),g=[],g=e.data?e.data:this._stack?this._plotData:this.data,h=e.gridData||this.renderer.makeGridData.call(this,g,d),this.renderer.drawShadow.call(this,b,h,e,d)),f=0;f<a.jqplot.postDrawSeriesShadowHooks.length;f++)a.jqplot.postDrawSeriesShadowHooks[f].call(this,b,e);b=c=d=f=g=h=null},e.prototype.toggleDisplay=function(a,b){var c,d;c=a.data.series?a.data.series:this,a.data.speed&&(d=a.data.speed),d?c.canvas._elem.is(":hidden")||!c.show?(c.show=!0,c.canvas._elem.removeClass("jqplot-series-hidden"),c.shadowCanvas._elem&&c.shadowCanvas._elem.fadeIn(d),c.canvas._elem.fadeIn(d,b),c.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+c.index).fadeIn(d)):(c.show=!1,c.canvas._elem.addClass("jqplot-series-hidden"),c.shadowCanvas._elem&&c.shadowCanvas._elem.fadeOut(d),c.canvas._elem.fadeOut(d,b),c.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+c.index).fadeOut(d)):c.canvas._elem.is(":hidden")||!c.show?(c.show=!0,c.canvas._elem.removeClass("jqplot-series-hidden"),c.shadowCanvas._elem&&c.shadowCanvas._elem.show(),c.canvas._elem.show(0,b),c.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+c.index).show()):(c.show=!1,c.canvas._elem.addClass("jqplot-series-hidden"),c.shadowCanvas._elem&&c.shadowCanvas._elem.hide(),c.canvas._elem.hide(0,b),c.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+c.index).hide())},f.prototype=new a.jqplot.ElemContainer,f.prototype.constructor=f,f.prototype.init=function(){a.isFunction(this.renderer)&&(this.renderer=new this.renderer),this.renderer.init.call(this,this.rendererOptions)},f.prototype.createElement=function(a,b){return this._offsets=a,this.renderer.createElement.call(this,b)},f.prototype.draw=function(){this.renderer.draw.call(this)},a.jqplot.GenericCanvas=function(){a.jqplot.ElemContainer.call(this),this._ctx},a.jqplot.GenericCanvas.prototype=new a.jqplot.ElemContainer,a.jqplot.GenericCanvas.prototype.constructor=a.jqplot.GenericCanvas,a.jqplot.GenericCanvas.prototype.createElement=function(b,c,d,e){this._offsets=b;var f="jqplot";c!=H&&(f=c);var g;return g=e.canvasManager.getCanvas(),null!=d&&(this._plotDimensions=d),g.width=this._plotDimensions.width-this._offsets.left-this._offsets.right,
6
- g.height=this._plotDimensions.height-this._offsets.top-this._offsets.bottom,this._elem=a(g),this._elem.css({position:"absolute",left:this._offsets.left,top:this._offsets.top}),this._elem.addClass(f),g=e.canvasManager.initCanvas(g),g=null,this._elem},a.jqplot.GenericCanvas.prototype.setContext=function(){return this._ctx=this._elem.get(0).getContext("2d"),this._ctx},a.jqplot.GenericCanvas.prototype.resetCanvas=function(){this._elem&&(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==H&&window.G_vmlCanvasManager.uninitElement(this._elem.get(0)),this._elem.emptyForce()),this._ctx=null},a.jqplot.HooksManager=function(){this.hooks=[],this.args=[]},a.jqplot.HooksManager.prototype.addOnce=function(a,b){b=b||[];for(var c=!1,d=0,e=this.hooks.length;d<e;d++)this.hooks[d]==a&&(c=!0);c||(this.hooks.push(a),this.args.push(b))},a.jqplot.HooksManager.prototype.add=function(a,b){b=b||[],this.hooks.push(a),this.args.push(b)},a.jqplot.EventListenerManager=function(){this.hooks=[]},a.jqplot.EventListenerManager.prototype.addOnce=function(a,b){for(var c,d,e=!1,d=0,f=this.hooks.length;d<f;d++)c=this.hooks[d],c[0]==a&&c[1]==b&&(e=!0);e||this.hooks.push([a,b])},a.jqplot.EventListenerManager.prototype.add=function(a,b){this.hooks.push([a,b])};var I=["yMidAxis","xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];a.jqplot.computeHighlightColors=function(b){var c;if(a.isArray(b)){c=[];for(var d=0;d<b.length;d++){for(var e=a.jqplot.getColorComponents(b[d]),f=[e[0],e[1],e[2]],g=f[0]+f[1]+f[2],h=0;h<3;h++)f[h]=g>660?.85*f[h]:.73*f[h]+90,f[h]=parseInt(f[h],10),f[h]>255?255:f[h];f[3]=.3+.35*e[3],c.push("rgba("+f[0]+","+f[1]+","+f[2]+","+f[3]+")")}}else{for(var e=a.jqplot.getColorComponents(b),f=[e[0],e[1],e[2]],g=f[0]+f[1]+f[2],h=0;h<3;h++)f[h]=g>660?.85*f[h]:.73*f[h]+90,f[h]=parseInt(f[h],10),f[h]>255?255:f[h];f[3]=.3+.35*e[3],c="rgba("+f[0]+","+f[1]+","+f[2]+","+f[3]+")"}return c},a.jqplot.ColorGenerator=function(b){b=b||a.jqplot.config.defaultColors;var c=0;this.next=function(){return c<b.length?b[c++]:(c=0,b[c++])},this.previous=function(){return c>0?b[c--]:(c=b.length-1,b[c])},this.get=function(a){var c=a-b.length*Math.floor(a/b.length);return b[c]},this.setColors=function(a){b=a},this.reset=function(){c=0},this.getIndex=function(){return c},this.setIndex=function(a){c=a}},a.jqplot.hex2rgb=function(a,b){a=a.replace("#",""),3==a.length&&(a=a.charAt(0)+a.charAt(0)+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2));var c;return c="rgba("+parseInt(a.slice(0,2),16)+", "+parseInt(a.slice(2,4),16)+", "+parseInt(a.slice(4,6),16),b&&(c+=", "+b),c+=")"},a.jqplot.rgb2hex=function(a){for(var b=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/,c=a.match(b),d="#",e=1;e<4;e++){var f;c[e].search(/%/)!=-1?(f=parseInt(255*c[e]/100,10).toString(16),1==f.length&&(f="0"+f)):(f=parseInt(c[e],10).toString(16),1==f.length&&(f="0"+f)),d+=f}return d},a.jqplot.normalize2rgb=function(b,c){if(b.search(/^ *rgba?\(/)!=-1)return b;if(b.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/)!=-1)return a.jqplot.hex2rgb(b,c);throw new Error("Invalid color spec")},a.jqplot.getColorComponents=function(b){b=a.jqplot.colorKeywordMap[b]||b;for(var c=a.jqplot.normalize2rgb(b),d=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/,e=c.match(d),f=[],g=1;g<4;g++)e[g].search(/%/)!=-1?f[g-1]=parseInt(255*e[g]/100,10):f[g-1]=parseInt(e[g],10);return f[3]=parseFloat(e[4])?parseFloat(e[4]):1,f},a.jqplot.colorKeywordMap={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb( 0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb( 0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb( 0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb( 95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(220, 20, 60)",cyan:"rgb( 0, 255, 255)",darkblue:"rgb( 0, 0, 139)",darkcyan:"rgb( 0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgreen:"rgb( 0, 100, 0)",darkgrey:"rgb(169, 169, 169)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb( 85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb( 72, 61, 139)",darkslategray:"rgb( 47, 79, 79)",darkslategrey:"rgb( 47, 79, 79)",darkturquoise:"rgb( 0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb( 0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb( 30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb( 34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb( 0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb( 75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgray:"rgb(211, 211, 211)",lightgreen:"rgb(144, 238, 144)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb( 32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb( 0, 255, 0)",limegreen:"rgb( 50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb( 0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb( 60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb( 0, 250, 154)",mediumturquoise:"rgb( 72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb( 25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb( 0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb( 65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb( 46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb( 0, 255, 127)",steelblue:"rgb( 70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb( 0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb( 64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)"},a.jqplot.AxisLabelRenderer=function(b){a.jqplot.ElemContainer.call(this),this.axis,this.show=!0,this.label="",this.fontFamily=null,this.fontSize=null,this.textColor=null,this._elem,this.escapeHTML=!1,a.extend(!0,this,b)},a.jqplot.AxisLabelRenderer.prototype=new a.jqplot.ElemContainer,a.jqplot.AxisLabelRenderer.prototype.constructor=a.jqplot.AxisLabelRenderer,a.jqplot.AxisLabelRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.AxisLabelRenderer.prototype.draw=function(b,c){return this._elem&&(this._elem.emptyForce(),this._elem=null),this._elem=a('<div style="position:absolute;" class="jqplot-'+this.axis+'-label"></div>'),Number(this.label)&&this._elem.css("white-space","nowrap"),this.escapeHTML?this._elem.text(this.label):this._elem.html(this.label),this.fontFamily&&this._elem.css("font-family",this.fontFamily),this.fontSize&&this._elem.css("font-size",this.fontSize),this.textColor&&this._elem.css("color",this.textColor),this._elem},a.jqplot.AxisLabelRenderer.prototype.pack=function(){},a.jqplot.AxisTickRenderer=function(b){a.jqplot.ElemContainer.call(this),this.mark="outside",this.axis,this.showMark=!0,this.showGridline=!0,this.isMinorTick=!1,this.size=4,this.markSize=6,this.show=!0,this.showLabel=!0,this.label=null,this.value=null,this._styles={},this.formatter=a.jqplot.DefaultTickFormatter,this.prefix="",this.suffix="",this.formatString="",this.fontFamily,this.fontSize,this.textColor,this.escapeHTML=!1,this._elem,this._breakTick=!1,a.extend(!0,this,b)},a.jqplot.AxisTickRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.AxisTickRenderer.prototype=new a.jqplot.ElemContainer,a.jqplot.AxisTickRenderer.prototype.constructor=a.jqplot.AxisTickRenderer,a.jqplot.AxisTickRenderer.prototype.setTick=function(a,b,c){return this.value=a,this.axis=b,c&&(this.isMinorTick=!0),this},a.jqplot.AxisTickRenderer.prototype.draw=function(){null===this.label&&(this.label=this.prefix+this.formatter(this.formatString,this.value)+this.suffix);var b={position:"absolute"};Number(this.label)&&(b.whitSpace="nowrap"),this._elem&&(this._elem.emptyForce(),this._elem=null),this._elem=a(document.createElement("div")),this._elem.addClass("jqplot-"+this.axis+"-tick"),this.escapeHTML?this._elem.text(this.label):this._elem.html(this.label),this._elem.css(b);for(var c in this._styles)this._elem.css(c,this._styles[c]);return this.fontFamily&&this._elem.css("font-family",this.fontFamily),this.fontSize&&this._elem.css("font-size",this.fontSize),this.textColor&&this._elem.css("color",this.textColor),this._breakTick&&this._elem.addClass("jqplot-breakTick"),this._elem},a.jqplot.DefaultTickFormatter=function(b,c){return"number"==typeof c?(b||(b=a.jqplot.config.defaultTickFormatString),a.jqplot.sprintf(b,c)):String(c)},a.jqplot.PercentTickFormatter=function(b,c){return"number"==typeof c?(c*=100,b||(b=a.jqplot.config.defaultTickFormatString),a.jqplot.sprintf(b,c)):String(c)},a.jqplot.AxisTickRenderer.prototype.pack=function(){},a.jqplot.CanvasGridRenderer=function(){this.shadowRenderer=new a.jqplot.ShadowRenderer},a.jqplot.CanvasGridRenderer.prototype.init=function(b){this._ctx,a.extend(!0,this,b);var c={lineJoin:"miter",lineCap:"round",fill:!1,isarc:!1,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.shadowWidth,closePath:!1,strokeStyle:this.shadowColor};this.renderer.shadowRenderer.init(c)},a.jqplot.CanvasGridRenderer.prototype.createElement=function(b){var c;this._elem&&(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==H&&(c=this._elem.get(0),window.G_vmlCanvasManager.uninitElement(c),c=null),this._elem.emptyForce(),this._elem=null),c=b.canvasManager.getCanvas();var d=this._plotDimensions.width,e=this._plotDimensions.height;return c.width=d,c.height=e,this._elem=a(c),this._elem.addClass("jqplot-grid-canvas"),this._elem.css({position:"absolute",left:0,top:0}),c=b.canvasManager.initCanvas(c),this._top=this._offsets.top,this._bottom=e-this._offsets.bottom,this._left=this._offsets.left,this._right=d-this._offsets.right,this._width=this._right-this._left,this._height=this._bottom-this._top,c=null,this._elem},a.jqplot.CanvasGridRenderer.prototype.draw=function(){function b(b,d,e,f,g){c.save(),g=g||{},null!=g.lineWidth&&0==g.lineWidth||(a.extend(!0,c,g),c.beginPath(),c.moveTo(b,d),c.lineTo(e,f),c.stroke(),c.restore())}this._ctx=this._elem.get(0).getContext("2d");var c=this._ctx,d=this._axes;c.save(),c.clearRect(0,0,this._plotDimensions.width,this._plotDimensions.height),c.fillStyle=this.backgroundColor||this.background,c.fillRect(this._left,this._top,this._width,this._height),c.save(),c.lineJoin="miter",c.lineCap="butt",c.lineWidth=this.gridLineWidth,c.strokeStyle=this.gridLineColor;for(var e,f,g,h,i=["xaxis","yaxis","x2axis","y2axis"],j=4;j>0;j--){var k=i[j-1],l=d[k],m=l._ticks,n=m.length;if(l.show){if(l.drawBaseline){var o={};switch(null!==l.baselineWidth&&(o.lineWidth=l.baselineWidth),null!==l.baselineColor&&(o.strokeStyle=l.baselineColor),k){case"xaxis":b(this._left,this._bottom,this._right,this._bottom,o);break;case"yaxis":b(this._left,this._bottom,this._left,this._top,o);break;case"x2axis":b(this._left,this._bottom,this._right,this._bottom,o);break;case"y2axis":b(this._right,this._bottom,this._right,this._top,o)}}for(var p=n;p>0;p--){var q=m[p-1];if(q.show){var r=Math.round(l.u2p(q.value))+.5;switch(k){case"xaxis":if(q.showGridline&&this.drawGridlines&&(!q.isMinorTick&&l.drawMajorGridlines||q.isMinorTick&&l.drawMinorGridlines)&&b(r,this._top,r,this._bottom),q.showMark&&q.mark&&(!q.isMinorTick&&l.drawMajorTickMarks||q.isMinorTick&&l.drawMinorTickMarks)){g=q.markSize,h=q.mark;var r=Math.round(l.u2p(q.value))+.5;switch(h){case"outside":e=this._bottom,f=this._bottom+g;break;case"inside":e=this._bottom-g,f=this._bottom;break;case"cross":e=this._bottom-g,f=this._bottom+g;break;default:e=this._bottom,f=this._bottom+g}this.shadow&&this.renderer.shadowRenderer.draw(c,[[r,e],[r,f]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:.75*this.gridLineWidth,depth:2,fill:!1,closePath:!1}),b(r,e,r,f)}break;case"yaxis":if(q.showGridline&&this.drawGridlines&&(!q.isMinorTick&&l.drawMajorGridlines||q.isMinorTick&&l.drawMinorGridlines)&&b(this._right,r,this._left,r),q.showMark&&q.mark&&(!q.isMinorTick&&l.drawMajorTickMarks||q.isMinorTick&&l.drawMinorTickMarks)){g=q.markSize,h=q.mark;var r=Math.round(l.u2p(q.value))+.5;switch(h){case"outside":e=this._left-g,f=this._left;break;case"inside":e=this._left,f=this._left+g;break;case"cross":e=this._left-g,f=this._left+g;break;default:e=this._left-g,f=this._left}this.shadow&&this.renderer.shadowRenderer.draw(c,[[e,r],[f,r]],{lineCap:"butt",lineWidth:1.5*this.gridLineWidth,offset:.75*this.gridLineWidth,fill:!1,closePath:!1}),b(e,r,f,r,{strokeStyle:l.borderColor})}break;case"x2axis":if(q.showGridline&&this.drawGridlines&&(!q.isMinorTick&&l.drawMajorGridlines||q.isMinorTick&&l.drawMinorGridlines)&&b(r,this._bottom,r,this._top),q.showMark&&q.mark&&(!q.isMinorTick&&l.drawMajorTickMarks||q.isMinorTick&&l.drawMinorTickMarks)){g=q.markSize,h=q.mark;var r=Math.round(l.u2p(q.value))+.5;switch(h){case"outside":e=this._top-g,f=this._top;break;case"inside":e=this._top,f=this._top+g;break;case"cross":e=this._top-g,f=this._top+g;break;default:e=this._top-g,f=this._top}this.shadow&&this.renderer.shadowRenderer.draw(c,[[r,e],[r,f]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:.75*this.gridLineWidth,depth:2,fill:!1,closePath:!1}),b(r,e,r,f)}break;case"y2axis":if(q.showGridline&&this.drawGridlines&&(!q.isMinorTick&&l.drawMajorGridlines||q.isMinorTick&&l.drawMinorGridlines)&&b(this._left,r,this._right,r),q.showMark&&q.mark&&(!q.isMinorTick&&l.drawMajorTickMarks||q.isMinorTick&&l.drawMinorTickMarks)){g=q.markSize,h=q.mark;var r=Math.round(l.u2p(q.value))+.5;switch(h){case"outside":e=this._right,f=this._right+g;break;case"inside":e=this._right-g,f=this._right;break;case"cross":e=this._right-g,f=this._right+g;break;default:e=this._right,f=this._right+g}this.shadow&&this.renderer.shadowRenderer.draw(c,[[e,r],[f,r]],{lineCap:"butt",lineWidth:1.5*this.gridLineWidth,offset:.75*this.gridLineWidth,fill:!1,closePath:!1}),b(e,r,f,r,{strokeStyle:l.borderColor})}}}}q=null}l=null,m=null}i=["y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];for(var j=7;j>0;j--){var l=d[i[j-1]],m=l._ticks;if(l.show){var s=m[l.numberTicks-1],t=m[0],u=l.getLeft(),v=[[u,s.getTop()+s.getHeight()/2],[u,t.getTop()+t.getHeight()/2+1]];this.shadow&&this.renderer.shadowRenderer.draw(c,v,{lineCap:"butt",fill:!1,closePath:!1}),b(v[0][0],v[0][1],v[1][0],v[1][1],{lineCap:"butt",strokeStyle:l.borderColor,lineWidth:l.borderWidth});for(var p=m.length;p>0;p--){var q=m[p-1];g=q.markSize,h=q.mark;var r=Math.round(l.u2p(q.value))+.5;if(q.showMark&&q.mark){switch(h){case"outside":e=u,f=u+g;break;case"inside":e=u-g,f=u;break;case"cross":e=u-g,f=u+g;break;default:e=u,f=u+g}v=[[e,r],[f,r]],this.shadow&&this.renderer.shadowRenderer.draw(c,v,{lineCap:"butt",lineWidth:1.5*this.gridLineWidth,offset:.75*this.gridLineWidth,fill:!1,closePath:!1}),b(e,r,f,r,{strokeStyle:l.borderColor})}q=null}t=null}l=null,m=null}if(c.restore(),this.shadow){var v=[[this._left,this._bottom],[this._right,this._bottom],[this._right,this._top]];this.renderer.shadowRenderer.draw(c,v)}0!=this.borderWidth&&this.drawBorder&&(b(this._left,this._top,this._right,this._top,{lineCap:"round",strokeStyle:d.x2axis.borderColor,lineWidth:d.x2axis.borderWidth}),b(this._right,this._top,this._right,this._bottom,{lineCap:"round",strokeStyle:d.y2axis.borderColor,lineWidth:d.y2axis.borderWidth}),b(this._right,this._bottom,this._left,this._bottom,{lineCap:"round",strokeStyle:d.xaxis.borderColor,lineWidth:d.xaxis.borderWidth}),b(this._left,this._bottom,this._left,this._top,{lineCap:"round",strokeStyle:d.yaxis.borderColor,lineWidth:d.yaxis.borderWidth})),c.restore(),c=null,d=null},a.jqplot.DivTitleRenderer=function(){},a.jqplot.DivTitleRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.DivTitleRenderer.prototype.draw=function(){this._elem&&(this._elem.emptyForce(),this._elem=null);var b=(this.renderer,document.createElement("div"));if(this._elem=a(b),this._elem.addClass("jqplot-title"),this.text){if(this.text){var c;this.color?c=this.color:this.textColor&&(c=this.textColor);var d={position:"absolute",top:"0px",left:"0px"};this._plotWidth&&(d.width=this._plotWidth+"px"),this.fontSize&&(d.fontSize=this.fontSize),"string"==typeof this.textAlign?d.textAlign=this.textAlign:d.textAlign="center",c&&(d.color=c),this.paddingBottom&&(d.paddingBottom=this.paddingBottom),this.fontFamily&&(d.fontFamily=this.fontFamily),this._elem.css(d),this.escapeHtml?this._elem.text(this.text):this._elem.html(this.text)}}else this.show=!1,this._elem.height(0),this._elem.width(0);return b=null,this._elem},a.jqplot.DivTitleRenderer.prototype.pack=function(){};var J=.1;a.jqplot.LinePattern=function(b,c){var d={dotted:[J,a.jqplot.config.dotGapLength],dashed:[a.jqplot.config.dashLength,a.jqplot.config.gapLength],solid:null};if("string"==typeof c)if("."===c[0]||"-"===c[0]){var e=c;c=[];for(var f=0,g=e.length;f<g;f++){if("."===e[f])c.push(J);else{if("-"!==e[f])continue;c.push(a.jqplot.config.dashLength)}c.push(a.jqplot.config.gapLength)}}else c=d[c];if(!c||!c.length)return b;var h=0,i=c[0],j=0,k=0,l=0,m=0,n=function(a,c){b.moveTo(a,c),j=a,k=c,l=a,m=c},o=function(a,d){var e=b.lineWidth,f=a-j,g=d-k,l=Math.sqrt(f*f+g*g);if(l>0&&e>0)for(f/=l,g/=l;;){var m=e*i;if(!(m<l)){j=a,k=d,0==(1&h)?b.lineTo(j,k):b.moveTo(j,k),i-=l/e;break}j+=m*f,k+=m*g,0==(1&h)?b.lineTo(j,k):b.moveTo(j,k),l-=m,h++,h>=c.length&&(h=0),i=c[h]}},p=function(){b.beginPath()},q=function(){o(l,m)};return{moveTo:n,lineTo:o,beginPath:p,closePath:q}},a.jqplot.LineRenderer=function(){this.shapeRenderer=new a.jqplot.ShapeRenderer,this.shadowRenderer=new a.jqplot.ShadowRenderer},a.jqplot.LineRenderer.prototype.init=function(b,c){b=b||{},this._type="line",this.renderer.animation={show:!1,direction:"left",speed:2500,_supported:!0},this.renderer.smooth=!1,this.renderer.tension=null,this.renderer.constrainSmoothing=!0,this.renderer._smoothedData=[],this.renderer._smoothedPlotData=[],this.renderer._hiBandGridData=[],this.renderer._lowBandGridData=[],this.renderer._hiBandSmoothedData=[],this.renderer._lowBandSmoothedData=[],this.renderer.bandData=[],this.renderer.bands={show:!1,hiData:[],lowData:[],color:this.color,showLines:!1,fill:!0,fillColor:null,_min:null,_max:null,interval:"3%"};var d={highlightMouseOver:b.highlightMouseOver,highlightMouseDown:b.highlightMouseDown,highlightColor:b.highlightColor};delete b.highlightMouseOver,delete b.highlightMouseDown,delete b.highlightColor,a.extend(!0,this.renderer,b),this.renderer.options=b,this.renderer.bandData.length>1&&(!b.bands||null==b.bands.show)?this.renderer.bands.show=!0:b.bands&&null==b.bands.show&&null!=b.bands.interval&&(this.renderer.bands.show=!0),this.fill&&(this.renderer.bands.show=!1),this.renderer.bands.show&&this.renderer.initBands.call(this,this.renderer.options,c),this._stack&&(this.renderer.smooth=!1);var e={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:!1,strokeStyle:this.color,fillStyle:this.fillColor,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};this.renderer.shapeRenderer.init(e);var f=b.shadowOffset;null==f&&(f=this.lineWidth>2.5?1.25*(1+.6*(Math.atan(this.lineWidth/2.5)/.785398163-1)):1.25*Math.atan(this.lineWidth/2.5)/.785398163);var g={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:!1,angle:this.shadowAngle,offset:f,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};if(this.renderer.shadowRenderer.init(g),this._areaPoints=[],this._boundingBox=[[],[]],!this.isTrendline&&this.fill||this.renderer.bands.show){if(this.highlightMouseOver=!0,this.highlightMouseDown=!1,this.highlightColor=null,d.highlightMouseDown&&null==d.highlightMouseOver&&(d.highlightMouseOver=!1),a.extend(!0,this,{highlightMouseOver:d.highlightMouseOver,highlightMouseDown:d.highlightMouseDown,highlightColor:d.highlightColor}),!this.highlightColor){var h=this.renderer.bands.show?this.renderer.bands.fillColor:this.fillColor;this.highlightColor=a.jqplot.computeHighlightColors(h)}this.highlighter&&(this.highlighter.show=!1)}!this.isTrendline&&c&&(c.plugins.lineRenderer={},c.postInitHooks.addOnce(l),c.postDrawHooks.addOnce(m),c.eventListenerHooks.addOnce("jqplotMouseMove",p),c.eventListenerHooks.addOnce("jqplotMouseDown",q),c.eventListenerHooks.addOnce("jqplotMouseUp",r),c.eventListenerHooks.addOnce("jqplotClick",s),c.eventListenerHooks.addOnce("jqplotRightClick",t))},a.jqplot.LineRenderer.prototype.initBands=function(b,c){var d=b.bandData||[],e=this.renderer.bands;e.hiData=[],e.lowData=[];var f=this.data;if(e._max=null,e._min=null,2==d.length)if(a.isArray(d[0][0])){for(var g,h=0,i=0,j=0,k=d[0].length;j<k;j++)g=d[0][j],(null!=g[1]&&g[1]>e._max||null==e._max)&&(e._max=g[1]),(null!=g[1]&&g[1]<e._min||null==e._min)&&(e._min=g[1]);for(var j=0,k=d[1].length;j<k;j++)g=d[1][j],(null!=g[1]&&g[1]>e._max||null==e._max)&&(e._max=g[1],i=1),(null!=g[1]&&g[1]<e._min||null==e._min)&&(e._min=g[1],h=1);i===h&&(e.show=!1),e.hiData=d[i],e.lowData=d[h]}else if(d[0].length===f.length&&d[1].length===f.length)for(var l=d[0][0]>d[1][0]?0:1,m=l?0:1,j=0,k=f.length;j<k;j++)e.hiData.push([f[j][0],d[l][j]]),e.lowData.push([f[j][0],d[m][j]]);else e.show=!1;else if(d.length>2&&!a.isArray(d[0][0]))for(var l=d[0][0]>d[0][1]?0:1,m=l?0:1,j=0,k=d.length;j<k;j++)e.hiData.push([f[j][0],d[j][l]]),e.lowData.push([f[j][0],d[j][m]]);else{var n=e.interval,o=null,p=null,q=null,r=null;if(a.isArray(n)?(o=n[0],p=n[1]):o=n,isNaN(o)?"%"===o.charAt(o.length-1)&&(q="multiply",o=parseFloat(o)/100+1):(o=parseFloat(o),q="add"),null!==p&&isNaN(p)?"%"===p.charAt(p.length-1)&&(r="multiply",p=parseFloat(p)/100+1):null!==p&&(p=parseFloat(p),r="add"),null!==o){if(null===p&&(p=-o,r=q,"multiply"===r&&(p+=2)),o<p){var s=o;o=p,p=s,s=q,q=r,r=s}for(var j=0,k=f.length;j<k;j++){switch(q){case"add":e.hiData.push([f[j][0],f[j][1]+o]);break;case"multiply":e.hiData.push([f[j][0],f[j][1]*o])}switch(r){case"add":e.lowData.push([f[j][0],f[j][1]+p]);break;case"multiply":e.lowData.push([f[j][0],f[j][1]*p])}}}else e.show=!1}for(var t=e.hiData,u=e.lowData,j=0,k=t.length;j<k;j++)(null!=t[j][1]&&t[j][1]>e._max||null==e._max)&&(e._max=t[j][1]);for(var j=0,k=u.length;j<k;j++)(null!=u[j][1]&&u[j][1]<e._min||null==e._min)&&(e._min=u[j][1]);if(null===e.fillColor){var v=a.jqplot.getColorComponents(e.color);v[3]=.5*v[3],e.fillColor="rgba("+v[0]+", "+v[1]+", "+v[2]+", "+v[3]+")"}},a.jqplot.LineRenderer.prototype.setGridData=function(a){var b=this._xaxis.series_u2p,c=this._yaxis.series_u2p,d=this._plotData,e=this._prevPlotData;this.gridData=[],this._prevGridData=[],this.renderer._smoothedData=[],this.renderer._smoothedPlotData=[],this.renderer._hiBandGridData=[],this.renderer._lowBandGridData=[],this.renderer._hiBandSmoothedData=[],this.renderer._lowBandSmoothedData=[];for(var f=this.renderer.bands,g=!1,h=0,i=d.length;h<i;h++)null!=d[h][0]&&null!=d[h][1]?this.gridData.push([b.call(this._xaxis,d[h][0]),c.call(this._yaxis,d[h][1])]):null==d[h][0]?(g=!0,this.gridData.push([null,c.call(this._yaxis,d[h][1])])):null==d[h][1]&&(g=!0,this.gridData.push([b.call(this._xaxis,d[h][0]),null])),null!=e[h]&&null!=e[h][0]&&null!=e[h][1]?this._prevGridData.push([b.call(this._xaxis,e[h][0]),c.call(this._yaxis,e[h][1])]):null!=e[h]&&null==e[h][0]?this._prevGridData.push([null,c.call(this._yaxis,e[h][1])]):null!=e[h]&&null!=e[h][0]&&null==e[h][1]&&this._prevGridData.push([b.call(this._xaxis,e[h][0]),null]);if(g&&(this.renderer.smooth=!1,"line"===this._type&&(f.show=!1)),"line"===this._type&&f.show){for(var h=0,i=f.hiData.length;h<i;h++)this.renderer._hiBandGridData.push([b.call(this._xaxis,f.hiData[h][0]),c.call(this._yaxis,f.hiData[h][1])]);for(var h=0,i=f.lowData.length;h<i;h++)this.renderer._lowBandGridData.push([b.call(this._xaxis,f.lowData[h][0]),c.call(this._yaxis,f.lowData[h][1])])}if("line"===this._type&&this.renderer.smooth&&this.gridData.length>2){var l;this.renderer.constrainSmoothing?(l=j.call(this,this.gridData),this.renderer._smoothedData=l[0],this.renderer._smoothedPlotData=l[1],f.show&&(l=j.call(this,this.renderer._hiBandGridData),this.renderer._hiBandSmoothedData=l[0],l=j.call(this,this.renderer._lowBandGridData),this.renderer._lowBandSmoothedData=l[0]),l=null):(l=k.call(this,this.gridData),this.renderer._smoothedData=l[0],this.renderer._smoothedPlotData=l[1],f.show&&(l=k.call(this,this.renderer._hiBandGridData),this.renderer._hiBandSmoothedData=l[0],l=k.call(this,this.renderer._lowBandGridData),this.renderer._lowBandSmoothedData=l[0]),l=null)}},a.jqplot.LineRenderer.prototype.makeGridData=function(a,b){var c=this._xaxis.series_u2p,d=this._yaxis.series_u2p,e=[];this.renderer._smoothedData=[],this.renderer._smoothedPlotData=[],this.renderer._hiBandGridData=[],this.renderer._lowBandGridData=[],this.renderer._hiBandSmoothedData=[],this.renderer._lowBandSmoothedData=[];for(var f=this.renderer.bands,g=!1,h=0;h<a.length;h++)null!=a[h][0]&&null!=a[h][1]?(this.step&&h>0&&e.push([c.call(this._xaxis,a[h][0]),d.call(this._yaxis,a[h-1][1])]),e.push([c.call(this._xaxis,a[h][0]),d.call(this._yaxis,a[h][1])])):null==a[h][0]?(g=!0,e.push([null,d.call(this._yaxis,a[h][1])])):null==a[h][1]&&(g=!0,e.push([c.call(this._xaxis,a[h][0]),null]));if(g&&(this.renderer.smooth=!1,"line"===this._type&&(f.show=!1)),"line"===this._type&&f.show){for(var h=0,i=f.hiData.length;h<i;h++)this.renderer._hiBandGridData.push([c.call(this._xaxis,f.hiData[h][0]),d.call(this._yaxis,f.hiData[h][1])]);for(var h=0,i=f.lowData.length;h<i;h++)this.renderer._lowBandGridData.push([c.call(this._xaxis,f.lowData[h][0]),d.call(this._yaxis,f.lowData[h][1])])}if("line"===this._type&&this.renderer.smooth&&e.length>2){var l;this.renderer.constrainSmoothing?(l=j.call(this,e),this.renderer._smoothedData=l[0],this.renderer._smoothedPlotData=l[1],f.show&&(l=j.call(this,this.renderer._hiBandGridData),this.renderer._hiBandSmoothedData=l[0],l=j.call(this,this.renderer._lowBandGridData),this.renderer._lowBandSmoothedData=l[0]),l=null):(l=k.call(this,e),this.renderer._smoothedData=l[0],this.renderer._smoothedPlotData=l[1],f.show&&(l=k.call(this,this.renderer._hiBandGridData),this.renderer._hiBandSmoothedData=l[0],l=k.call(this,this.renderer._lowBandGridData),this.renderer._lowBandSmoothedData=l[0]),l=null)}return e},a.jqplot.LineRenderer.prototype.draw=function(b,c,d,e){var f,g,h,i,j,k=a.extend(!0,{},d),l=k.shadow!=H?k.shadow:this.shadow,m=k.showLine!=H?k.showLine:this.showLine,n=k.fill!=H?k.fill:this.fill,o=k.fillAndStroke!=H?k.fillAndStroke:this.fillAndStroke;if(b.save(),c.length){if(m)if(n){if(this.fillToZero){var p=this.negativeColor;this.useNegativeColors||(p=k.fillStyle);var q=!1,r=k.fillStyle;if(o)var s=c.slice(0);if(0!=this.index&&this._stack){for(var t=this._prevGridData,f=t.length;f>0;f--)c.push(t[f-1]);l&&this.renderer.shadowRenderer.draw(b,c,k),this._areaPoints=c,this.renderer.shapeRenderer.draw(b,c,k)}else{var u=[],v=this.renderer.smooth?this.renderer._smoothedPlotData:this._plotData;this._areaPoints=[];var w=this._yaxis.series_u2p(this.fillToValue);this._xaxis.series_u2p(this.fillToValue);if(k.closePath=!0,"y"==this.fillAxis){u.push([c[0][0],w]),this._areaPoints.push([c[0][0],w]);for(var f=0;f<c.length-1;f++)if(u.push(c[f]),this._areaPoints.push(c[f]),v[f][1]*v[f+1][1]<=0){v[f][1]<0?(q=!0,k.fillStyle=p):(q=!1,k.fillStyle=r);var x=c[f][0]+(c[f+1][0]-c[f][0])*(w-c[f][1])/(c[f+1][1]-c[f][1]);u.push([x,w]),this._areaPoints.push([x,w]),l&&this.renderer.shadowRenderer.draw(b,u,k),this.renderer.shapeRenderer.draw(b,u,k),u=[[x,w]]}v[c.length-1][1]<0?(q=!0,k.fillStyle=p):(q=!1,k.fillStyle=r),u.push(c[c.length-1]),this._areaPoints.push(c[c.length-1]),u.push([c[c.length-1][0],w]),this._areaPoints.push([c[c.length-1][0],w])}l&&this.renderer.shadowRenderer.draw(b,u,k),this.renderer.shapeRenderer.draw(b,u,k)}}else{if(o)var s=c.slice(0);if(0!=this.index&&this._stack)for(var t=this._prevGridData,f=t.length;f>0;f--)c.push(t[f-1]);else{var y=b.canvas.height;c.unshift([c[0][0],y]);var z=c.length;c.push([c[z-1][0],y])}this._areaPoints=c,l&&this.renderer.shadowRenderer.draw(b,c,k),this.renderer.shapeRenderer.draw(b,c,k)}if(o){var A=a.extend(!0,{},k,{fill:!1,closePath:!1});if(this.renderer.shapeRenderer.draw(b,s,A),this.markerRenderer.show)for(this.renderer.smooth&&(s=this.gridData),f=0;f<s.length;f++){var B=k.markerOptions||{};this.markerOptionsCallback&&(B=a.extend(!0,B,this.markerOptionsCallback(e,this,f,this.data[f],c[f])||{})),this.markerRenderer.draw(s[f][0],s[f][1],b,B)}}}else{if(this.renderer.bands.show){var C,D=a.extend(!0,{},k);this.renderer.bands.showLines&&(C=this.renderer.smooth?this.renderer._hiBandSmoothedData:this.renderer._hiBandGridData,this.renderer.shapeRenderer.draw(b,C,k),C=this.renderer.smooth?this.renderer._lowBandSmoothedData:this.renderer._lowBandGridData,this.renderer.shapeRenderer.draw(b,C,D)),this.renderer.bands.fill&&(C=this.renderer.smooth?this.renderer._hiBandSmoothedData.concat(this.renderer._lowBandSmoothedData.reverse()):this.renderer._hiBandGridData.concat(this.renderer._lowBandGridData.reverse()),this._areaPoints=C,D.closePath=!0,D.fill=!0,D.fillStyle=this.renderer.bands.fillColor,this.renderer.shapeRenderer.draw(b,C,D))}l&&this.renderer.shadowRenderer.draw(b,c,k),this.renderer.shapeRenderer.draw(b,c,k)}var g=i=h=j=null;for(f=0;f<this._areaPoints.length;f++){var E=this._areaPoints[f];(g>E[0]||null==g)&&(g=E[0]),(j<E[1]||null==j)&&(j=E[1]),(i<E[0]||null==i)&&(i=E[0]),(h>E[1]||null==h)&&(h=E[1])}if("line"===this.type&&this.renderer.bands.show&&(j=this._yaxis.series_u2p(this.renderer.bands._min),h=this._yaxis.series_u2p(this.renderer.bands._max)),this._boundingBox=[[g,j],[i,h]],this.markerRenderer.show&&!n)for(this.renderer.smooth&&(c=this.gridData),f=0;f<c.length;f++){var B=k.markerOptions||{};this.markerOptionsCallback&&(B=a.extend(!0,B,this.markerOptionsCallback(e,this,f,this.data[f],c[f])||{})),
7
- null!=c[f][0]&&null!=c[f][1]&&this.markerRenderer.draw(c[f][0],c[f][1],b,B)}}b.restore()},a.jqplot.LineRenderer.prototype.drawShadow=function(a,b,c){},a.jqplot.LinearAxisRenderer=function(){},a.jqplot.LinearAxisRenderer.prototype.init=function(b){this.breakPoints=null,this.breakTickLabel="&asymp;",this.drawBaseline=!0,this.baselineWidth=null,this.baselineColor=null,this.forceTickAt0=!1,this.forceTickAt100=!1,this.tickInset=0,this.minorTicks=0,this.alignTicks=!1,this._autoFormatString="",this._overrideFormatString=!1,this._scalefact=1,a.extend(!0,this,b),this.breakPoints&&(a.isArray(this.breakPoints)?(this.breakPoints.length<2||this.breakPoints[1]<=this.breakPoints[0])&&(this.breakPoints=null):this.breakPoints=null),null!=this.numberTicks&&this.numberTicks<2&&(this.numberTicks=2),this.resetDataBounds()},a.jqplot.LinearAxisRenderer.prototype.draw=function(b,c){if(this.show){this.renderer.createTicks.call(this,c);if(this._elem&&(this._elem.emptyForce(),this._elem=null),this._elem=a(document.createElement("div")),this._elem.addClass("jqplot-axis jqplot-"+this.name),this._elem.css("position","absolute"),"xaxis"==this.name||"x2axis"==this.name?this._elem.width(this._plotDimensions.width):this._elem.height(this._plotDimensions.height),this.labelOptions.axis=this.name,this._label=new this.labelRenderer(this.labelOptions),this._label.show){var d=this._label.draw(b,c);d.appendTo(this._elem),d=null}for(var e,f=this._ticks,g=0;g<f.length;g++)e=f[g],e.show&&e.showLabel&&(!e.isMinorTick||this.showMinorTicks)&&this._elem.append(e.draw(b,c));e=null,f=null}return this._elem},a.jqplot.LinearAxisRenderer.prototype.reset=function(){this.min=this._options.min,this.max=this._options.max,this.tickInterval=this._options.tickInterval,this.numberTicks=this._options.numberTicks,this._autoFormatString="",this._overrideFormatString&&this.tickOptions&&this.tickOptions.formatString&&(this.tickOptions.formatString="")},a.jqplot.LinearAxisRenderer.prototype.set=function(){var b,c=0,d=0,e=0,f=null!=this._label&&this._label.show;if(this.show){for(var g,h=this._ticks,i=0;i<h.length;i++)g=h[i],g._breakTick||!g.show||!g.showLabel||g.isMinorTick&&!this.showMinorTicks||(b="xaxis"==this.name||"x2axis"==this.name?g._elem.outerHeight(!0):g._elem.outerWidth(!0),b>c&&(c=b));g=null,h=null,f&&(d=this._label._elem.outerWidth(!0),e=this._label._elem.outerHeight(!0)),"xaxis"==this.name?(c+=e,this._elem.css({height:c+"px",left:"0px",bottom:"0px"})):"x2axis"==this.name?(c+=e,this._elem.css({height:c+"px",left:"0px",top:"0px"})):"yaxis"==this.name?(c+=d,this._elem.css({width:c+"px",left:"0px",top:"0px"}),f&&this._label.constructor==a.jqplot.AxisLabelRenderer&&this._label._elem.css("width",d+"px")):(c+=d,this._elem.css({width:c+"px",right:"0px",top:"0px"}),f&&this._label.constructor==a.jqplot.AxisLabelRenderer&&this._label._elem.css("width",d+"px"))}},a.jqplot.LinearAxisRenderer.prototype.createTicks=function(b){var c,d,e,f,g=this._ticks,h=this.ticks,i=this.name,j=this._dataBounds,k="x"===this.name.charAt(0)?this._plotDimensions.width:this._plotDimensions.height,l=this.min,m=this.max,n=this.numberTicks,o=this.tickInterval,p=30;if(this._scalefact=(Math.max(k,p+1)-p)/300,h.length){for(f=0;f<h.length;f++){var q=h[f],r=new this.tickRenderer(this.tickOptions);a.isArray(q)?(r.value=q[0],this.breakPoints?q[0]==this.breakPoints[0]?(r.label=this.breakTickLabel,r._breakTick=!0,r.showGridline=!1,r.showMark=!1):q[0]>this.breakPoints[0]&&q[0]<=this.breakPoints[1]?(r.show=!1,r.showGridline=!1,r.label=q[1]):r.label=q[1]:r.label=q[1],r.setTick(q[0],this.name),this._ticks.push(r)):a.isPlainObject(q)?(a.extend(!0,r,q),r.axis=this.name,this._ticks.push(r)):(r.value=q,this.breakPoints&&(q==this.breakPoints[0]?(r.label=this.breakTickLabel,r._breakTick=!0,r.showGridline=!1,r.showMark=!1):q>this.breakPoints[0]&&q<=this.breakPoints[1]&&(r.show=!1,r.showGridline=!1)),r.setTick(q,this.name),this._ticks.push(r))}this.numberTicks=h.length,this.min=this._ticks[0].value,this.max=this._ticks[this.numberTicks-1].value,this.tickInterval=(this.max-this.min)/(this.numberTicks-1)}else{k="xaxis"==i||"x2axis"==i?this._plotDimensions.width:this._plotDimensions.height;var s=this.numberTicks;this.alignTicks&&("x2axis"===this.name&&b.axes.xaxis.show?s=b.axes.xaxis.numberTicks:"y"===this.name.charAt(0)&&"yaxis"!==this.name&&"yMidAxis"!==this.name&&b.axes.yaxis.show&&(s=b.axes.yaxis.numberTicks)),c=null!=this.min?this.min:j.min,d=null!=this.max?this.max:j.max;var t,u,v,w=d-c;if(null!=this.tickOptions&&this.tickOptions.formatString||(this._overrideFormatString=!0),null==this.min||null==this.max&&null==this.tickInterval&&!this.autoscale){this.forceTickAt0&&(c>0&&(c=0),d<0&&(d=0)),this.forceTickAt100&&(c>100&&(c=100),d<100&&(d=100));var x=!1,y=!1;null!=this.min?x=!0:null!=this.max&&(y=!0);var z=a.jqplot.LinearTickGenerator(c,d,this._scalefact,s,x,y),A=null!=this.min?c:c+w*(this.padMin-1),B=null!=this.max?d:d-w*(this.padMax-1);(c<A||d>B)&&(A=null!=this.min?c:c-w*(this.padMin-1),B=null!=this.max?d:d+w*(this.padMax-1),z=a.jqplot.LinearTickGenerator(A,B,this._scalefact,s,x,y)),this.min=z[0],this.max=z[1],this.numberTicks=z[2],this._autoFormatString=z[3],this.tickInterval=z[4]}else{if(c==d){var C=.05;c>0&&(C=Math.max(Math.log(c)/Math.LN10,.05)),c-=C,d+=C}if(this.autoscale&&null==this.min&&null==this.max){for(var D,E,F,G=!1,H=!1,f=0;f<this._series.length;f++){var I=this._series[f],J="x"==I.fillAxis?I._xaxis.name:I._yaxis.name;if(this.name==J){for(var K=I._plotValues[I.fillAxis],L=K[0],M=K[0],N=1;N<K.length;N++)K[N]<L?L=K[N]:K[N]>M&&(M=K[N]);var O=(M-L)/M;I.renderer.constructor==a.jqplot.BarRenderer?L>=0&&(I.fillToZero||O>.1)?G=!0:(G=!1,H=!!(I.fill&&I.fillToZero&&L<0&&M>0)):I.fill?L>=0&&(I.fillToZero||O>.1)?G=!0:L<0&&M>0&&I.fillToZero?(G=!1,H=!0):(G=!1,H=!1):L<0&&(G=!1)}}if(G)this.numberTicks=2+Math.ceil((k-(this.tickSpacing-1))/this.tickSpacing),this.min=0,l=0,E=d/(this.numberTicks-1),v=Math.pow(10,Math.abs(Math.floor(Math.log(E)/Math.LN10))),E/v==parseInt(E/v,10)&&(E+=v),this.tickInterval=Math.ceil(E/v)*v,this.max=this.tickInterval*(this.numberTicks-1);else if(H){this.numberTicks=2+Math.ceil((k-(this.tickSpacing-1))/this.tickSpacing);var P=Math.ceil(Math.abs(c)/w*(this.numberTicks-1)),Q=this.numberTicks-1-P;E=Math.max(Math.abs(c/P),Math.abs(d/Q)),v=Math.pow(10,Math.abs(Math.floor(Math.log(E)/Math.LN10))),this.tickInterval=Math.ceil(E/v)*v,this.max=this.tickInterval*Q,this.min=-this.tickInterval*P}else null==this.numberTicks&&(this.tickInterval?this.numberTicks=3+Math.ceil(w/this.tickInterval):this.numberTicks=2+Math.ceil((k-(this.tickSpacing-1))/this.tickSpacing)),null==this.tickInterval?(E=w/(this.numberTicks-1),v=E<1?Math.pow(10,Math.abs(Math.floor(Math.log(E)/Math.LN10))):1,this.tickInterval=Math.ceil(E*v*this.pad)/v):v=1/this.tickInterval,D=this.tickInterval*(this.numberTicks-1),F=(D-w)/2,null==this.min&&(this.min=Math.floor(v*(c-F))/v),null==this.max&&(this.max=this.min+D);var R,S=a.jqplot.getSignificantFigures(this.tickInterval);if(S.digitsLeft>=S.significantDigits)R="%d";else{var v=Math.max(0,5-S.digitsLeft);v=Math.min(v,S.digitsRight),R="%."+v+"f"}this._autoFormatString=R}else{t=null!=this.min?this.min:c-w*(this.padMin-1),u=null!=this.max?this.max:d+w*(this.padMax-1),w=u-t,null==this.numberTicks&&(null!=this.tickInterval?this.numberTicks=Math.ceil((u-t)/this.tickInterval)+1:k>100?this.numberTicks=parseInt(3+(k-100)/75,10):this.numberTicks=2),null==this.tickInterval&&(this.tickInterval=w/(this.numberTicks-1)),null==this.max&&(u=t+this.tickInterval*(this.numberTicks-1)),null==this.min&&(t=u-this.tickInterval*(this.numberTicks-1));var R,S=a.jqplot.getSignificantFigures(this.tickInterval);if(S.digitsLeft>=S.significantDigits)R="%d";else{var v=Math.max(0,5-S.digitsLeft);v=Math.min(v,S.digitsRight),R="%."+v+"f"}this._autoFormatString=R,this.min=t,this.max=u}if(this.renderer.constructor==a.jqplot.LinearAxisRenderer&&""==this._autoFormatString){w=this.max-this.min;var T=new this.tickRenderer(this.tickOptions),U=T.formatString||a.jqplot.config.defaultTickFormatString,U=U.match(a.jqplot.sprintf.regex)[0],V=0;if(U){if(U.search(/[fFeEgGpP]/)>-1){var W=U.match(/\%\.(\d{0,})?[eEfFgGpP]/);V=W?parseInt(W[1],10):6}else U.search(/[di]/)>-1&&(V=0);var X=Math.pow(10,-V);if(this.tickInterval<X&&null==n&&null==o)if(this.tickInterval=X,null==m&&null==l){this.min=Math.floor(this._dataBounds.min/X)*X,this.min==this._dataBounds.min&&(this.min=this._dataBounds.min-this.tickInterval),this.max=Math.ceil(this._dataBounds.max/X)*X,this.max==this._dataBounds.max&&(this.max=this._dataBounds.max+this.tickInterval);var Y=(this.max-this.min)/this.tickInterval;Y=Y.toFixed(11),Y=Math.ceil(Y),this.numberTicks=Y+1}else if(null==m){var Y=(this._dataBounds.max-this.min)/this.tickInterval;Y=Y.toFixed(11),this.numberTicks=Math.ceil(Y)+2,this.max=this.min+this.tickInterval*(this.numberTicks-1)}else if(null==l){var Y=(this.max-this._dataBounds.min)/this.tickInterval;Y=Y.toFixed(11),this.numberTicks=Math.ceil(Y)+2,this.min=this.max-this.tickInterval*(this.numberTicks-1)}else this.numberTicks=Math.ceil((m-l)/this.tickInterval)+1,this.min=Math.floor(l*Math.pow(10,V))/Math.pow(10,V),this.max=Math.ceil(m*Math.pow(10,V))/Math.pow(10,V),this.numberTicks=Math.ceil((this.max-this.min)/this.tickInterval)+1}}}this._overrideFormatString&&""!=this._autoFormatString&&(this.tickOptions=this.tickOptions||{},this.tickOptions.formatString=this._autoFormatString);for(var r,Z,f=0;f<this.numberTicks;f++){if(e=this.min+f*this.tickInterval,r=new this.tickRenderer(this.tickOptions),r.setTick(e,this.name),this._ticks.push(r),f<this.numberTicks-1)for(var N=0;N<this.minorTicks;N++)e+=this.tickInterval/(this.minorTicks+1),Z=a.extend(!0,{},this.tickOptions,{name:this.name,value:e,label:"",isMinorTick:!0}),r=new this.tickRenderer(Z),this._ticks.push(r);r=null}}this.tickInset&&(this.min=this.min-this.tickInset*this.tickInterval,this.max=this.max+this.tickInset*this.tickInterval),g=null},a.jqplot.LinearAxisRenderer.prototype.resetTickValues=function(b){if(a.isArray(b)&&b.length==this._ticks.length){for(var c,d=0;d<b.length;d++)c=this._ticks[d],c.value=b[d],c.label=c.formatter(c.formatString,b[d]),c.label=c.prefix+c.label,c._elem.html(c.label);c=null,this.min=a.jqplot.arrayMin(b),this.max=a.jqplot.arrayMax(b),this.pack()}},a.jqplot.LinearAxisRenderer.prototype.pack=function(b,c){b=b||{},c=c||this._offsets;var d=this._ticks,e=this.max,f=this.min,g=c.max,h=c.min,i=null!=this._label&&this._label.show;for(var j in b)this._elem.css(j,b[j]);this._offsets=c;var k=g-h,l=e-f;if(this.breakPoints?(l=l-this.breakPoints[1]+this.breakPoints[0],this.p2u=function(a){return(a-h)*l/k+f},this.u2p=function(a){return a>this.breakPoints[0]&&a<this.breakPoints[1]&&(a=this.breakPoints[0]),a<=this.breakPoints[0]?(a-f)*k/l+h:(a-this.breakPoints[1]+this.breakPoints[0]-f)*k/l+h},"x"==this.name.charAt(0)?(this.series_u2p=function(a){return a>this.breakPoints[0]&&a<this.breakPoints[1]&&(a=this.breakPoints[0]),a<=this.breakPoints[0]?(a-f)*k/l:(a-this.breakPoints[1]+this.breakPoints[0]-f)*k/l},this.series_p2u=function(a){return a*l/k+f}):(this.series_u2p=function(a){return a>this.breakPoints[0]&&a<this.breakPoints[1]&&(a=this.breakPoints[0]),a>=this.breakPoints[1]?(a-e)*k/l:(a+this.breakPoints[1]-this.breakPoints[0]-e)*k/l},this.series_p2u=function(a){return a*l/k+e})):(this.p2u=function(a){return(a-h)*l/k+f},this.u2p=function(a){return(a-f)*k/l+h},"xaxis"==this.name||"x2axis"==this.name?(this.series_u2p=function(a){return(a-f)*k/l},this.series_p2u=function(a){return a*l/k+f}):(this.series_u2p=function(a){return(a-e)*k/l},this.series_p2u=function(a){return a*l/k+e})),this.show)if("xaxis"==this.name||"x2axis"==this.name){for(var m=0;m<d.length;m++){var n=d[m];if(n.show&&n.showLabel){var o;if(n.constructor==a.jqplot.CanvasAxisTickRenderer&&n.angle){var p="xaxis"==this.name?1:-1;switch(n.labelPosition){case"auto":o=p*n.angle<0?-n.getWidth()+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2:-n._textRenderer.height*Math.sin(n._textRenderer.angle)/2;break;case"end":o=-n.getWidth()+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break;case"start":o=-n._textRenderer.height*Math.sin(n._textRenderer.angle)/2;break;case"middle":o=-n.getWidth()/2+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break;default:o=-n.getWidth()/2+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2}}else o=-n.getWidth()/2;var q=this.u2p(n.value)+o+"px";n._elem.css("left",q),n.pack()}}if(i){var r=this._label._elem.outerWidth(!0);this._label._elem.css("left",h+k/2-r/2+"px"),"xaxis"==this.name?this._label._elem.css("bottom","0px"):this._label._elem.css("top","0px"),this._label.pack()}}else{for(var m=0;m<d.length;m++){var n=d[m];if(n.show&&n.showLabel){var o;if(n.constructor==a.jqplot.CanvasAxisTickRenderer&&n.angle){var p="yaxis"==this.name?1:-1;switch(n.labelPosition){case"auto":case"end":o=p*n.angle<0?-n._textRenderer.height*Math.cos(-n._textRenderer.angle)/2:-n.getHeight()+n._textRenderer.height*Math.cos(n._textRenderer.angle)/2;break;case"start":o=n.angle>0?-n._textRenderer.height*Math.cos(-n._textRenderer.angle)/2:-n.getHeight()+n._textRenderer.height*Math.cos(n._textRenderer.angle)/2;break;case"middle":o=-n.getHeight()/2;break;default:o=-n.getHeight()/2}}else o=-n.getHeight()/2;var q=this.u2p(n.value)+o+"px";n._elem.css("top",q),n.pack()}}if(i){var s=this._label._elem.outerHeight(!0);this._label._elem.css("top",g-k/2-s/2+"px"),"yaxis"==this.name?this._label._elem.css("left","0px"):this._label._elem.css("right","0px"),this._label.pack()}}d=null};a.jqplot.LinearTickGenerator=function(b,c,d,e,f,g){if(f=null!==f&&f,g=null!==g&&!f&&g,b===c&&(c=c?0:1),d=d||1,c<b){var h=c;c=b,b=h}var i=[],j=x(c-b,d),k=a.jqplot.getSignificantFigures;if(null==e)if(f||g){if(f){i[0]=b,i[2]=Math.ceil((c-b)/j+1),i[1]=b+(i[2]-1)*j;var l=k(b).digitsRight,m=k(j).digitsRight;l<m?i[3]=u(j):i[3]="%."+l+"f",i[4]=j}else if(g){i[1]=c,i[2]=Math.ceil((c-b)/j+1),i[0]=c-(i[2]-1)*j;var n=k(c).digitsRight,m=k(j).digitsRight;n<m?i[3]=u(j):i[3]="%."+n+"f",i[4]=j}}else i[0]=Math.floor(b/j)*j,i[1]=Math.ceil(c/j)*j,i[2]=Math.round((i[1]-i[0])/j+1),i[3]=u(j),i[4]=j;else{var o=[];if(o[0]=Math.floor(b/j)*j,o[1]=Math.ceil(c/j)*j,o[2]=Math.round((o[1]-o[0])/j+1),o[3]=u(j),o[4]=j,o[2]===e)i=o;else{var p=w(o[1]-o[0],e);i[0]=o[0],i[2]=e,i[4]=p,i[3]=u(p),i[1]=i[0]+(i[2]-1)*i[4]}}return i},a.jqplot.LinearTickGenerator.bestLinearInterval=x,a.jqplot.LinearTickGenerator.bestInterval=w,a.jqplot.LinearTickGenerator.bestLinearComponents=y,a.jqplot.LinearTickGenerator.bestConstrainedInterval=v,a.jqplot.MarkerRenderer=function(b){this.show=!0,this.style="filledCircle",this.lineWidth=2,this.size=9,this.color="#666666",this.shadow=!0,this.shadowAngle=45,this.shadowOffset=1,this.shadowDepth=3,this.shadowAlpha="0.07",this.shadowRenderer=new a.jqplot.ShadowRenderer,this.shapeRenderer=new a.jqplot.ShapeRenderer,a.extend(!0,this,b)},a.jqplot.MarkerRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.MarkerRenderer.prototype.drawDiamond=function(b,c,d,e,f){var g;g=null==f||a.isEmptyObject(f)?this:a.extend(!0,{},this,f);var h=1.2,i=this.size/2/h,j=this.size/2*h,k=[[b-i,c],[b,c+j],[b+i,c],[b,c-j]];g.shadow&&this.shadowRenderer.draw(d,k,z(g)),this.shapeRenderer.draw(d,k,A(g))},a.jqplot.MarkerRenderer.prototype.drawPlus=function(b,c,d,e,f){var g=a.extend(!0,{},this,f,{closePath:!1}),h=1,i=g.size/2*h,j=g.size/2*h,k=[[b,c-j],[b,c+j]],l=[[b+i,c],[b-i,c]];g.shadow&&(this.shadowRenderer.draw(d,k,z(g)),this.shadowRenderer.draw(d,l,z(g))),this.shapeRenderer.draw(d,k,g),this.shapeRenderer.draw(d,l,g)},a.jqplot.MarkerRenderer.prototype.drawX=function(b,c,d,e,f){var g=a.extend(!0,{},this,f,{closePath:!1}),h=1,i=g.size/2*h,j=g.size/2*h,k=[[b-i,c-j],[b+i,c+j]],l=[[b-i,c+j],[b+i,c-j]];g.shadow&&(this.shadowRenderer.draw(d,k,z(g)),this.shadowRenderer.draw(d,l,z(g))),this.shapeRenderer.draw(d,k,A(g)),this.shapeRenderer.draw(d,l,A(g))},a.jqplot.MarkerRenderer.prototype.drawDash=function(b,c,d,e,f){var g;g=null==f||a.isEmptyObject(f)?this:a.extend(!0,{},this,f);var h=1,i=this.size/2*h,j=(this.size/2*h,[[b-i,c],[b+i,c]]);g.shadow&&this.shadowRenderer.draw(d,j),this.shapeRenderer.draw(d,j,A(g))},a.jqplot.MarkerRenderer.prototype.drawLine=function(b,c,d,e,f){var g;g=null==f||a.isEmptyObject(f)?this:a.extend(!0,{},this,f);var h=[b,c];g.shadow&&this.shadowRenderer.draw(d,h,z(g)),this.shapeRenderer.draw(d,h,A(g))},a.jqplot.MarkerRenderer.prototype.drawSquare=function(b,c,d,e,f){var g;g=null==f||a.isEmptyObject(f)?this:a.extend(!0,{},this,f);var h=1,i=this.size/2/h,j=this.size/2*h,k=[[b-i,c-j],[b-i,c+j],[b+i,c+j],[b+i,c-j]];g.shadow&&this.shadowRenderer.draw(d,k,z(g)),this.shapeRenderer.draw(d,k,A(g))},a.jqplot.MarkerRenderer.prototype.drawCircle=function(b,c,d,e,f){var g;g=null==f||a.isEmptyObject(f)?this:a.extend(!0,{},this,f);var h=this.size/2,i=2*Math.PI,j=[b,c,h,0,i,!0];g.shadow&&this.shadowRenderer.draw(d,j,z(g)),this.shapeRenderer.draw(d,j,A(g))},a.jqplot.MarkerRenderer.prototype.draw=function(a,b,c,d){if(d=d||{},null==d.show||0!=d.show){d.color&&!d.fillStyle&&(d.fillStyle=d.color),d.color&&!d.strokeStyle&&(d.strokeStyle=d.color);var e=d.style||this.style;switch(e){case"diamond":this.drawDiamond(a,b,c,!1,d);break;case"filledDiamond":this.drawDiamond(a,b,c,!0,d);break;case"circle":this.drawCircle(a,b,c,!1,d);break;case"filledCircle":this.drawCircle(a,b,c,!0,d);break;case"square":this.drawSquare(a,b,c,!1,d);break;case"filledSquare":this.drawSquare(a,b,c,!0,d);break;case"x":this.drawX(a,b,c,!0,d);break;case"plus":this.drawPlus(a,b,c,!0,d);break;case"dash":this.drawDash(a,b,c,!0,d);break;case"line":this.drawLine(a,b,c,!1,d);break;default:this.drawDiamond(a,b,c,!1,d)}}},a.jqplot.ShadowRenderer=function(b){this.angle=45,this.offset=1,this.alpha=.07,this.lineWidth=1.5,this.lineJoin="miter",this.lineCap="round",this.closePath=!1,this.fill=!1,this.depth=3,this.strokeStyle="rgba(0,0,0,0.1)",this.isarc=!1,a.extend(!0,this,b)},a.jqplot.ShadowRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.ShadowRenderer.prototype.draw=function(b,c,d){b.save();var e=null!=d?d:{},f=null!=e.fill?e.fill:this.fill,g=null!=e.fillRect?e.fillRect:this.fillRect,h=null!=e.closePath?e.closePath:this.closePath,i=null!=e.offset?e.offset:this.offset,j=null!=e.alpha?e.alpha:this.alpha,k=null!=e.depth?e.depth:this.depth,l=null!=e.isarc?e.isarc:this.isarc,m=null!=e.linePattern?e.linePattern:this.linePattern;b.lineWidth=null!=e.lineWidth?e.lineWidth:this.lineWidth,b.lineJoin=null!=e.lineJoin?e.lineJoin:this.lineJoin,b.lineCap=null!=e.lineCap?e.lineCap:this.lineCap,b.strokeStyle=e.strokeStyle||this.strokeStyle||"rgba(0,0,0,"+j+")",b.fillStyle=e.fillStyle||this.fillStyle||"rgba(0,0,0,"+j+")";for(var n=0;n<k;n++){var o=a.jqplot.LinePattern(b,m);if(b.translate(Math.cos(this.angle*Math.PI/180)*i,Math.sin(this.angle*Math.PI/180)*i),o.beginPath(),l)b.arc(c[0],c[1],c[2],c[3],c[4],!0);else if(g)g&&b.fillRect(c[0],c[1],c[2],c[3]);else if(c&&c.length)for(var p=!0,q=0;q<c.length;q++)null!=c[q][0]&&null!=c[q][1]?p?(o.moveTo(c[q][0],c[q][1]),p=!1):o.lineTo(c[q][0],c[q][1]):p=!0;h&&o.closePath(),f?b.fill():b.stroke()}b.restore()},a.jqplot.ShapeRenderer=function(b){this.lineWidth=1.5,this.linePattern="solid",this.lineJoin="miter",this.lineCap="round",this.closePath=!1,this.fill=!1,this.isarc=!1,this.fillRect=!1,this.strokeRect=!1,this.clearRect=!1,this.strokeStyle="#999999",this.fillStyle="#999999",a.extend(!0,this,b)},a.jqplot.ShapeRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.ShapeRenderer.prototype.draw=function(b,c,d){b.save();var e=null!=d?d:{},f=null!=e.fill?e.fill:this.fill,g=null!=e.closePath?e.closePath:this.closePath,h=null!=e.fillRect?e.fillRect:this.fillRect,i=null!=e.strokeRect?e.strokeRect:this.strokeRect,j=null!=e.clearRect?e.clearRect:this.clearRect,k=null!=e.isarc?e.isarc:this.isarc,l=null!=e.linePattern?e.linePattern:this.linePattern,m=a.jqplot.LinePattern(b,l);if(b.lineWidth=e.lineWidth||this.lineWidth,b.lineJoin=e.lineJoin||this.lineJoin,b.lineCap=e.lineCap||this.lineCap,b.strokeStyle=e.strokeStyle||e.color||this.strokeStyle,b.fillStyle=e.fillStyle||this.fillStyle,b.beginPath(),k)return b.arc(c[0],c[1],c[2],c[3],c[4],!0),g&&b.closePath(),f?b.fill():b.stroke(),void b.restore();if(j)return b.clearRect(c[0],c[1],c[2],c[3]),void b.restore();if(h||i){if(h&&b.fillRect(c[0],c[1],c[2],c[3]),i)return b.strokeRect(c[0],c[1],c[2],c[3]),void b.restore()}else if(c&&c.length){for(var n=!0,o=0;o<c.length;o++)null!=c[o][0]&&null!=c[o][1]?n?(m.moveTo(c[o][0],c[o][1]),n=!1):m.lineTo(c[o][0],c[o][1]):n=!0;g&&m.closePath(),f?b.fill():b.stroke()}b.restore()},a.jqplot.TableLegendRenderer=function(){},a.jqplot.TableLegendRenderer.prototype.init=function(b){a.extend(!0,this,b)},a.jqplot.TableLegendRenderer.prototype.addrow=function(b,c,d,e){var f,g,h,i,j,k=d?this.rowSpacing+"px":"0px";h=document.createElement("tr"),f=a(h),f.addClass("jqplot-table-legend"),h=null,e?f.prependTo(this._elem):f.appendTo(this._elem),this.showSwatches&&(g=a(document.createElement("td")),g.addClass("jqplot-table-legend jqplot-table-legend-swatch"),g.css({textAlign:"center",paddingTop:k}),i=a(document.createElement("div")),i.addClass("jqplot-table-legend-swatch-outline"),j=a(document.createElement("div")),j.addClass("jqplot-table-legend-swatch"),j.css({backgroundColor:c,borderColor:c}),f.append(g.append(i.append(j)))),this.showLabels&&(g=a(document.createElement("td")),g.addClass("jqplot-table-legend jqplot-table-legend-label"),g.css("paddingTop",k),f.append(g),this.escapeHtml?g.text(b):g.html(b)),g=null,i=null,j=null,f=null,h=null},a.jqplot.TableLegendRenderer.prototype.draw=function(){if(this._elem&&(this._elem.emptyForce(),this._elem=null),this.show){var b=this._series,c=document.createElement("table");this._elem=a(c),this._elem.addClass("jqplot-table-legend");var d={position:"absolute"};this.background&&(d.background=this.background),this.border&&(d.border=this.border),this.fontSize&&(d.fontSize=this.fontSize),this.fontFamily&&(d.fontFamily=this.fontFamily),this.textColor&&(d.textColor=this.textColor),null!=this.marginTop&&(d.marginTop=this.marginTop),null!=this.marginBottom&&(d.marginBottom=this.marginBottom),null!=this.marginLeft&&(d.marginLeft=this.marginLeft),null!=this.marginRight&&(d.marginRight=this.marginRight);for(var e,f=!1,g=!1,h=0;h<b.length;h++)if(e=b[h],(e._stack||e.renderer.constructor==a.jqplot.BezierCurveRenderer)&&(g=!0),e.show&&e.showLabel){var i=this.labels[h]||e.label.toString();if(i){var j=e.color;g&&h<b.length-1?f=!0:g&&h==b.length-1&&(f=!1),this.renderer.addrow.call(this,i,j,f,g),f=!0}for(var k=0;k<a.jqplot.addLegendRowHooks.length;k++){var l=a.jqplot.addLegendRowHooks[k].call(this,e);l&&(this.renderer.addrow.call(this,l.label,l.color,f),f=!0)}i=null}}return this._elem},a.jqplot.TableLegendRenderer.prototype.pack=function(a){if(this.show)if("insideGrid"==this.placement)switch(this.location){case"nw":var b=a.left,c=a.top;this._elem.css("left",b),this._elem.css("top",c);break;case"n":var b=(a.left+(this._plotDimensions.width-a.right))/2-this.getWidth()/2,c=a.top;this._elem.css("left",b),this._elem.css("top",c);break;case"ne":var b=a.right,c=a.top;this._elem.css({right:b,top:c});break;case"e":var b=a.right,c=(a.top+(this._plotDimensions.height-a.bottom))/2-this.getHeight()/2;this._elem.css({right:b,top:c});break;case"se":var b=a.right,c=a.bottom;this._elem.css({right:b,bottom:c});break;case"s":var b=(a.left+(this._plotDimensions.width-a.right))/2-this.getWidth()/2,c=a.bottom;this._elem.css({left:b,bottom:c});break;case"sw":var b=a.left,c=a.bottom;this._elem.css({left:b,bottom:c});break;case"w":var b=a.left,c=(a.top+(this._plotDimensions.height-a.bottom))/2-this.getHeight()/2;this._elem.css({left:b,top:c});break;default:var b=a.right,c=a.bottom;this._elem.css({right:b,bottom:c})}else if("outside"==this.placement)switch(this.location){case"nw":var b=this._plotDimensions.width-a.left,c=a.top;this._elem.css("right",b),this._elem.css("top",c);break;case"n":var b=(a.left+(this._plotDimensions.width-a.right))/2-this.getWidth()/2,c=this._plotDimensions.height-a.top;this._elem.css("left",b),this._elem.css("bottom",c);break;case"ne":var b=this._plotDimensions.width-a.right,c=a.top;this._elem.css({left:b,top:c});break;case"e":var b=this._plotDimensions.width-a.right,c=(a.top+(this._plotDimensions.height-a.bottom))/2-this.getHeight()/2;this._elem.css({left:b,top:c});break;case"se":var b=this._plotDimensions.width-a.right,c=a.bottom;this._elem.css({left:b,bottom:c});break;case"s":var b=(a.left+(this._plotDimensions.width-a.right))/2-this.getWidth()/2,c=this._plotDimensions.height-a.bottom;this._elem.css({left:b,top:c});break;case"sw":var b=this._plotDimensions.width-a.left,c=a.bottom;this._elem.css({right:b,bottom:c});break;case"w":var b=this._plotDimensions.width-a.left,c=(a.top+(this._plotDimensions.height-a.bottom))/2-this.getHeight()/2;this._elem.css({right:b,top:c});break;default:var b=a.right,c=a.bottom;this._elem.css({right:b,bottom:c})}else switch(this.location){case"nw":this._elem.css({left:0,top:a.top});break;case"n":var b=(a.left+(this._plotDimensions.width-a.right))/2-this.getWidth()/2;this._elem.css({left:b,top:a.top});break;case"ne":this._elem.css({right:0,top:a.top});break;case"e":var c=(a.top+(this._plotDimensions.height-a.bottom))/2-this.getHeight()/2;this._elem.css({right:a.right,top:c});break;case"se":this._elem.css({right:a.right,bottom:a.bottom});break;case"s":var b=(a.left+(this._plotDimensions.width-a.right))/2-this.getWidth()/2;this._elem.css({left:b,bottom:a.bottom});break;case"sw":this._elem.css({left:a.left,bottom:a.bottom});break;case"w":var c=(a.top+(this._plotDimensions.height-a.bottom))/2-this.getHeight()/2;this._elem.css({left:a.left,top:c});break;default:this._elem.css({right:a.right,bottom:a.bottom})}},a.jqplot.ThemeEngine=function(){this.themes={},this.activeTheme=null},a.jqplot.ThemeEngine.prototype.init=function(){var b,c,d,e=new a.jqplot.Theme({_name:"Default"});for(b in e.target)"textColor"==b?e.target[b]=this.target.css("color"):e.target[b]=this.target.css(b);if(this.title.show&&this.title._elem)for(b in e.title)"textColor"==b?e.title[b]=this.title._elem.css("color"):e.title[b]=this.title._elem.css(b);for(b in e.grid)e.grid[b]=this.grid[b];if(null==e.grid.backgroundColor&&null!=this.grid.background&&(e.grid.backgroundColor=this.grid.background),this.legend.show&&this.legend._elem)for(b in e.legend)"textColor"==b?e.legend[b]=this.legend._elem.css("color"):e.legend[b]=this.legend._elem.css(b);var f;for(c=0;c<this.series.length;c++){f=this.series[c],f.renderer.constructor==a.jqplot.LineRenderer?e.series.push(new N):f.renderer.constructor==a.jqplot.BarRenderer?e.series.push(new P):f.renderer.constructor==a.jqplot.PieRenderer?e.series.push(new Q):f.renderer.constructor==a.jqplot.DonutRenderer?e.series.push(new R):f.renderer.constructor==a.jqplot.FunnelRenderer?e.series.push(new S):f.renderer.constructor==a.jqplot.MeterGaugeRenderer?e.series.push(new T):e.series.push({});for(b in e.series[c])e.series[c][b]=f[b]}var g,h;for(b in this.axes){if(h=this.axes[b],g=e.axes[b]=new K,g.borderColor=h.borderColor,g.borderWidth=h.borderWidth,h._ticks&&h._ticks[0])for(d in g.ticks)h._ticks[0].hasOwnProperty(d)?g.ticks[d]=h._ticks[0][d]:h._ticks[0]._elem&&(g.ticks[d]=h._ticks[0]._elem.css(d));if(h._label&&h._label.show)for(d in g.label)h._label[d]?g.label[d]=h._label[d]:h._label._elem&&("textColor"==d?g.label[d]=h._label._elem.css("color"):g.label[d]=h._label._elem.css(d))}this.themeEngine._add(e),this.themeEngine.activeTheme=this.themeEngine.themes[e._name]},a.jqplot.ThemeEngine.prototype.get=function(a){return a?this.themes[a]:this.activeTheme},a.jqplot.ThemeEngine.prototype.getThemeNames=function(){var a=[];for(var b in this.themes)a.push(b);return a.sort(B)},a.jqplot.ThemeEngine.prototype.getThemes=function(){var a=[],b=[];for(var c in this.themes)a.push(c);a.sort(B);for(var d=0;d<a.length;d++)b.push(this.themes[a[d]]);return b},a.jqplot.ThemeEngine.prototype.activate=function(b,c){var d=!1;if(!c&&this.activeTheme&&this.activeTheme._name&&(c=this.activeTheme._name),!this.themes.hasOwnProperty(c))throw new Error("No theme of that name");var e=this.themes[c];this.activeTheme=e;var f,g=["xaxis","x2axis","yaxis","y2axis"];for(p=0;p<g.length;p++){var h=g[p];null!=e.axesStyles.borderColor&&(b.axes[h].borderColor=e.axesStyles.borderColor),null!=e.axesStyles.borderWidth&&(b.axes[h].borderWidth=e.axesStyles.borderWidth)}for(var i in b.axes){var j=b.axes[i];if(j.show){var k=e.axes[i]||{},l=e.axesStyles,m=a.jqplot.extend(!0,{},k,l);if(f=null!=e.axesStyles.borderColor?e.axesStyles.borderColor:m.borderColor,null!=m.borderColor&&(j.borderColor=m.borderColor,d=!0),f=null!=e.axesStyles.borderWidth?e.axesStyles.borderWidth:m.borderWidth,null!=m.borderWidth&&(j.borderWidth=m.borderWidth,d=!0),j._ticks&&j._ticks[0])for(var n in m.ticks)f=m.ticks[n],null!=f&&(j.tickOptions[n]=f,j._ticks=[],d=!0);if(j._label&&j._label.show)for(var n in m.label)f=m.label[n],null!=f&&(j.labelOptions[n]=f,d=!0)}}for(var o in e.grid)null!=e.grid[o]&&(b.grid[o]=e.grid[o]);if(d||b.grid.draw(),b.legend.show)for(o in e.legend)null!=e.legend[o]&&(b.legend[o]=e.legend[o]);if(b.title.show)for(o in e.title)null!=e.title[o]&&(b.title[o]=e.title[o]);var p;for(p=0;p<e.series.length;p++){var q={};for(o in e.series[p])f=null!=e.seriesStyles[o]?e.seriesStyles[o]:e.series[p][o],null!=f&&(q[o]=f,"color"==o?(b.series[p].renderer.shapeRenderer.fillStyle=f,b.series[p].renderer.shapeRenderer.strokeStyle=f,b.series[p][o]=f):"lineWidth"==o||"linePattern"==o?(b.series[p].renderer.shapeRenderer[o]=f,b.series[p][o]=f):"markerOptions"==o?(D(b.series[p].markerOptions,f),D(b.series[p].markerRenderer,f)):b.series[p][o]=f,d=!0)}d&&(b.target.empty(),b.draw());for(o in e.target)null!=e.target[o]&&b.target.css(o,e.target[o])},a.jqplot.ThemeEngine.prototype._add=function(a,b){if(b&&(a._name=b),a._name||(a._name=Date.parse(new Date)),this.themes.hasOwnProperty(a._name))throw new Error("jqplot.ThemeEngine Error: Theme already in use");this.themes[a._name]=a},a.jqplot.ThemeEngine.prototype.remove=function(a){return"Default"!=a&&delete this.themes[a]},a.jqplot.ThemeEngine.prototype.newTheme=function(b,c){"object"==typeof b&&(c=c||b,b=null),b=c&&c._name?c._name:b||Date.parse(new Date);var d=this.copy(this.themes.Default._name,b);return a.jqplot.extend(d,c),d},a.jqplot.clone=C,a.jqplot.merge=D,a.jqplot.extend=function(){var b,c=arguments[0]||{},d=1,e=arguments.length,f=!1;for("boolean"==typeof c&&(f=c,c=arguments[1]||{},d=2),"object"!=typeof c&&"[object Function]"===!toString.call(c)&&(c={});d<e;d++)if(null!=(b=arguments[d]))for(var g in b){var h=c[g],i=b[g];c!==i&&(f&&i&&"object"==typeof i&&!i.nodeType?c[g]=a.jqplot.extend(f,h||(null!=i.length?[]:{}),i):i!==H&&(c[g]=i))}return c},a.jqplot.ThemeEngine.prototype.rename=function(a,b){if("Default"==a||"Default"==b)throw new Error("jqplot.ThemeEngine Error: Cannot rename from/to Default");if(this.themes.hasOwnProperty(b))throw new Error("jqplot.ThemeEngine Error: New name already in use.");if(this.themes.hasOwnProperty(a)){var c=this.copy(a,b);return this.remove(a),c}throw new Error("jqplot.ThemeEngine Error: Old name or new name invalid")},a.jqplot.ThemeEngine.prototype.copy=function(b,c,d){if("Default"==c)throw new Error("jqplot.ThemeEngine Error: Cannot copy over Default theme");if(!this.themes.hasOwnProperty(b)){var e="jqplot.ThemeEngine Error: Source name invalid";throw new Error(e)}if(this.themes.hasOwnProperty(c)){var e="jqplot.ThemeEngine Error: Target name invalid";throw new Error(e)}var f=C(this.themes[b]);return f._name=c,a.jqplot.extend(!0,f,d),this._add(f),f},a.jqplot.Theme=function(b,c){"object"==typeof b&&(c=c||b,b=null),b=b||Date.parse(new Date),this._name=b,this.target={backgroundColor:null},this.legend={textColor:null,fontFamily:null,fontSize:null,border:null,background:null},this.title={textColor:null,fontFamily:null,fontSize:null,textAlign:null},this.seriesStyles={},this.series=[],this.grid={drawGridlines:null,gridLineColor:null,gridLineWidth:null,backgroundColor:null,borderColor:null,borderWidth:null,
8
- shadow:null},this.axesStyles={label:{},ticks:{}},this.axes={},"string"==typeof c?this._name=c:"object"==typeof c&&a.jqplot.extend(!0,this,c)};var K=function(){this.borderColor=null,this.borderWidth=null,this.ticks=new L,this.label=new M},L=function(){this.show=null,this.showGridline=null,this.showLabel=null,this.showMark=null,this.size=null,this.textColor=null,this.whiteSpace=null,this.fontSize=null,this.fontFamily=null},M=function(){this.textColor=null,this.whiteSpace=null,this.fontSize=null,this.fontFamily=null,this.fontWeight=null},N=function(){this.color=null,this.lineWidth=null,this.linePattern=null,this.shadow=null,this.fillColor=null,this.showMarker=null,this.markerOptions=new O},O=function(){this.show=null,this.style=null,this.lineWidth=null,this.size=null,this.color=null,this.shadow=null},P=function(){this.color=null,this.seriesColors=null,this.lineWidth=null,this.shadow=null,this.barPadding=null,this.barMargin=null,this.barWidth=null,this.highlightColors=null},Q=function(){this.seriesColors=null,this.padding=null,this.sliceMargin=null,this.fill=null,this.shadow=null,this.startAngle=null,this.lineWidth=null,this.highlightColors=null},R=function(){this.seriesColors=null,this.padding=null,this.sliceMargin=null,this.fill=null,this.shadow=null,this.startAngle=null,this.lineWidth=null,this.innerDiameter=null,this.thickness=null,this.ringMargin=null,this.highlightColors=null},S=function(){this.color=null,this.lineWidth=null,this.shadow=null,this.padding=null,this.sectionMargin=null,this.seriesColors=null,this.highlightColors=null},T=function(){this.padding=null,this.backgroundColor=null,this.ringColor=null,this.tickColor=null,this.ringWidth=null,this.intervalColors=null,this.intervalInnerRadius=null,this.intervalOuterRadius=null,this.hubRadius=null,this.needleThickness=null,this.needlePad=null};a.fn.jqplotChildText=function(){return a(this).contents().filter(function(){return 3==this.nodeType}).text()},a.fn.jqplotGetComputedFontStyle=function(){for(var a=window.getComputedStyle?window.getComputedStyle(this[0],""):this[0].currentStyle,b=a["font-style"]?["font-style","font-weight","font-size","font-family"]:["fontStyle","fontWeight","fontSize","fontFamily"],c=[],d=0;d<b.length;++d){var e=String(a[b[d]]);e&&"normal"!=e&&c.push(e)}return c.join(" ")},a.fn.jqplotToImageCanvas=function(b){function c(b){var c=parseInt(a(b).css("line-height"),10);return isNaN(c)&&(c=1.2*parseInt(a(b).css("font-size"),10)),c}function d(b,d,e,f,g,h){for(var i=c(b),j=a(b).innerWidth(),k=(a(b).innerHeight(),e.split(/\s+/)),l=k.length,m="",n=[],o=g,p=f,q=0;q<l;q++)m+=k[q],d.measureText(m).width>j&&m.length>k[q].length&&(n.push(q),m="",q--);if(0===n.length)"center"===a(b).css("textAlign")&&(p=f+(h-d.measureText(m).width)/2-s),d.fillText(e,p,g);else{m=k.slice(0,n[0]).join(" "),"center"===a(b).css("textAlign")&&(p=f+(h-d.measureText(m).width)/2-s),d.fillText(m,p,o),o+=i;for(var q=1,r=n.length;q<r;q++)m=k.slice(n[q-1],n[q]).join(" "),"center"===a(b).css("textAlign")&&(p=f+(h-d.measureText(m).width)/2-s),d.fillText(m,p,o),o+=i;m=k.slice(n[q-1],k.length).join(" "),"center"===a(b).css("textAlign")&&(p=f+(h-d.measureText(m).width)/2-s),d.fillText(m,p,o)}}function e(b,c,f){var g=b.tagName.toLowerCase(),h=a(b).position(),i=window.getComputedStyle?window.getComputedStyle(b,""):b.currentStyle,j=c+h.left+parseInt(i.marginLeft,10)+parseInt(i.borderLeftWidth,10)+parseInt(i.paddingLeft,10),k=f+h.top+parseInt(i.marginTop,10)+parseInt(i.borderTopWidth,10)+parseInt(i.paddingTop,10),l=m.width;if("div"!=g&&"span"!=g||a(b).hasClass("jqplot-highlighter-tooltip")||a(b).hasClass("jqplot-canvasOverlay-tooltip"))if("table"===g&&a(b).hasClass("jqplot-table-legend")){w.strokeStyle=a(b).css("border-top-color"),w.fillStyle=a(b).css("background-color"),w.fillRect(j,k,a(b).innerWidth(),a(b).innerHeight()),parseInt(a(b).css("border-top-width"),10)>0&&w.strokeRect(j,k,a(b).innerWidth(),a(b).innerHeight()),a(b).find("div.jqplot-table-legend-swatch-outline").each(function(){var b=a(this);w.strokeStyle=b.css("border-top-color");var c=j+b.position().left,d=k+b.position().top;w.strokeRect(c,d,b.innerWidth(),b.innerHeight()),c+=parseInt(b.css("padding-left"),10),d+=parseInt(b.css("padding-top"),10);var e=b.innerHeight()-2*parseInt(b.css("padding-top"),10),f=b.innerWidth()-2*parseInt(b.css("padding-left"),10),g=b.children("div.jqplot-table-legend-swatch");w.fillStyle=g.css("background-color"),w.fillRect(c,d,f,e)}),a(b).find("td.jqplot-table-legend-label").each(function(){var b=a(this),c=j+b.position().left,e=k+b.position().top+parseInt(b.css("padding-top"),10);w.font=b.jqplotGetComputedFontStyle(),w.fillStyle=b.css("color"),d(b,w,b.text(),c,e,l)})}else"canvas"==g&&w.drawImage(b,j,k);else{a(b).children().each(function(){e(this,j,k)});var n=a(b).jqplotChildText();n&&(w.font=a(b).jqplotGetComputedFontStyle(),w.fillStyle=a(b).css("color"),d(b,w,n,j,k,l))}}b=b||{};var f=null==b.x_offset?0:b.x_offset,g=null==b.y_offset?0:b.y_offset,h=null==b.backgroundColor?"rgb(255,255,255)":b.backgroundColor;if(0==a(this).width()||0==a(this).height())return null;if(a.jqplot.use_excanvas)return null;for(var i,j,k,l,m=document.createElement("canvas"),n=a(this).outerHeight(!0),o=a(this).outerWidth(!0),p=a(this).offset(),q=p.left,r=p.top,s=0,t=0,u=["jqplot-table-legend","jqplot-xaxis-tick","jqplot-x2axis-tick","jqplot-yaxis-tick","jqplot-y2axis-tick","jqplot-y3axis-tick","jqplot-y4axis-tick","jqplot-y5axis-tick","jqplot-y6axis-tick","jqplot-y7axis-tick","jqplot-y8axis-tick","jqplot-y9axis-tick","jqplot-xaxis-label","jqplot-x2axis-label","jqplot-yaxis-label","jqplot-y2axis-label","jqplot-y3axis-label","jqplot-y4axis-label","jqplot-y5axis-label","jqplot-y6axis-label","jqplot-y7axis-label","jqplot-y8axis-label","jqplot-y9axis-label"],v=0;v<u.length;v++)a(this).find("."+u[v]).each(function(){i=a(this).offset().top-r,j=a(this).offset().left-q,l=j+a(this).outerWidth(!0)+s,k=i+a(this).outerHeight(!0)+t,j<-s&&(o=o-s-j,s=-j),i<-t&&(n=n-t-i,t=-i),l>o&&(o=l),k>n&&(n=k)});m.width=o+Number(f),m.height=n+Number(g);var w=m.getContext("2d");return w.save(),w.fillStyle=h,w.fillRect(0,0,m.width,m.height),w.restore(),w.translate(s,t),w.textAlign="left",w.textBaseline="top",a(this).children().each(function(){e(this,f,g)}),m},a.fn.jqplotToImageStr=function(b){var c=a(this).jqplotToImageCanvas(b);return c?c.toDataURL("image/png"):null},a.fn.jqplotToImageElem=function(b){var c=document.createElement("img"),d=a(this).jqplotToImageStr(b);return c.src=d,c},a.fn.jqplotToImageElemStr=function(b){var c="<img src="+a(this).jqplotToImageStr(b)+" />";return c},a.fn.jqplotSaveImage=function(){var b=a(this).jqplotToImageStr({});b&&(window.location.href=b.replace("image/png","image/octet-stream"))},a.fn.jqplotViewImage=function(){var b=a(this).jqplotToImageElemStr({});a(this).jqplotToImageStr({});if(b){var c=window.open("");c.document.open("image/png"),c.document.write(b),c.document.close(),c=null}};var U=function(){switch(this.syntax=U.config.syntax,this._type="jsDate",this.proxy=new Date,this.options={},this.locale=U.regional.getLocale(),this.formatString="",this.defaultCentury=U.config.defaultCentury,arguments.length){case 0:break;case 1:if("[object Object]"==F(arguments[0])&&"jsDate"!=arguments[0]._type){var a=this.options=arguments[0];this.syntax=a.syntax||this.syntax,this.defaultCentury=a.defaultCentury||this.defaultCentury,this.proxy=U.createDate(a.date)}else this.proxy=U.createDate(arguments[0]);break;default:for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c]);this.proxy=new Date,this.proxy.setFullYear.apply(this.proxy,b.slice(0,3)),b.slice(3).length&&this.proxy.setHours.apply(this.proxy,b.slice(3))}};U.config={defaultLocale:"en",syntax:"perl",defaultCentury:1900},U.prototype.add=function(a,b){var c=X[b]||X.day;if("number"==typeof c){var d=this.proxy.getTimezoneOffset();this.proxy.setTime(this.proxy.getTime()+c*a),OffsetDiff=d-this.proxy.getTimezoneOffset(),this.proxy.setTime(this.proxy.getTime()-60*OffsetDiff*1e3)}else c.add(this,a);return this},U.prototype.clone=function(){return new U(this.proxy.getTime())},U.prototype.getUtcOffset=function(){return 6e4*this.proxy.getTimezoneOffset()},U.prototype.diff=function(a,b,c){if(a=new U(a),null===a)return null;var d=X[b]||X.day;if("number"==typeof d)var e=60*(a.proxy.getTimezoneOffset()-this.proxy.getTimezoneOffset())*1e3,f=(this.proxy.getTime()-a.proxy.getTime()+e)/d;else var f=d.diff(this.proxy,a.proxy);return c?f:Math[f>0?"floor":"ceil"](f)},U.prototype.getAbbrDayName=function(){return U.regional[this.locale].dayNamesShort[this.proxy.getDay()]},U.prototype.getAbbrMonthName=function(){return U.regional[this.locale].monthNamesShort[this.proxy.getMonth()]},U.prototype.getAMPM=function(){return this.proxy.getHours()>=12?"PM":"AM"},U.prototype.getAmPm=function(){return this.proxy.getHours()>=12?"pm":"am"},U.prototype.getCentury=function(){return parseInt(this.proxy.getFullYear()/100,10)},U.prototype.getDate=function(){return this.proxy.getDate()},U.prototype.getDay=function(){return this.proxy.getDay()},U.prototype.getDayOfWeek=function(){var a=this.proxy.getDay();return 0===a?7:a},U.prototype.getDayOfYear=function(){var a=this.proxy,b=a-new Date(""+a.getFullYear()+"/1/1 GMT");return b+=6e4*a.getTimezoneOffset(),a=null,parseInt(b/6e4/60/24,10)+1},U.prototype.getDayName=function(){return U.regional[this.locale].dayNames[this.proxy.getDay()]},U.prototype.getFullWeekOfYear=function(){var a=this.proxy,b=this.getDayOfYear(),c=6-a.getDay(),d=parseInt((b+c)/7,10);return d},U.prototype.getFullYear=function(){return this.proxy.getFullYear()},U.prototype.getGmtOffset=function(){var a=this.proxy.getTimezoneOffset()/60,b=a<0?"+":"-";return a=Math.abs(a),b+W(Math.floor(a),2)+":"+W(a%1*60,2)},U.prototype.getHours=function(){return this.proxy.getHours()},U.prototype.getHours12=function(){var a=this.proxy.getHours();return a>12?a-12:0==a?12:a},U.prototype.getIsoWeek=function(){var a=this.proxy,b=this.getWeekOfYear(),c=new Date(""+a.getFullYear()+"/1/1").getDay(),d=b+(c>4||c<=1?0:1);return 53==d&&new Date(""+a.getFullYear()+"/12/31").getDay()<4?d=1:0===d&&(a=new U(new Date(""+(a.getFullYear()-1)+"/12/31")),d=a.getIsoWeek()),a=null,d},U.prototype.getMilliseconds=function(){return this.proxy.getMilliseconds()},U.prototype.getMinutes=function(){return this.proxy.getMinutes()},U.prototype.getMonth=function(){return this.proxy.getMonth()},U.prototype.getMonthName=function(){return U.regional[this.locale].monthNames[this.proxy.getMonth()]},U.prototype.getMonthNumber=function(){return this.proxy.getMonth()+1},U.prototype.getSeconds=function(){return this.proxy.getSeconds()},U.prototype.getShortYear=function(){return this.proxy.getYear()%100},U.prototype.getTime=function(){return this.proxy.getTime()},U.prototype.getTimezoneAbbr=function(){return this.proxy.toString().replace(/^.*\(([^)]+)\)$/,"$1")},U.prototype.getTimezoneName=function(){var a=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return a[1]||a[2]||"GMT"+this.getGmtOffset()},U.prototype.getTimezoneOffset=function(){return this.proxy.getTimezoneOffset()},U.prototype.getWeekOfYear=function(){var a=this.getDayOfYear(),b=7-this.getDayOfWeek(),c=parseInt((a+b)/7,10);return c},U.prototype.getUnix=function(){return Math.round(this.proxy.getTime()/1e3,0)},U.prototype.getYear=function(){return this.proxy.getYear()},U.prototype.next=function(a){return a=a||"day",this.clone().add(1,a)},U.prototype.set=function(){switch(arguments.length){case 0:this.proxy=new Date;break;case 1:if("[object Object]"==F(arguments[0])&&"jsDate"!=arguments[0]._type){var a=this.options=arguments[0];this.syntax=a.syntax||this.syntax,this.defaultCentury=a.defaultCentury||this.defaultCentury,this.proxy=U.createDate(a.date)}else this.proxy=U.createDate(arguments[0]);break;default:for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c]);this.proxy=new Date,this.proxy.setFullYear.apply(this.proxy,b.slice(0,3)),b.slice(3).length&&this.proxy.setHours.apply(this.proxy,b.slice(3))}return this},U.prototype.setDate=function(a){return this.proxy.setDate(a),this},U.prototype.setFullYear=function(){return this.proxy.setFullYear.apply(this.proxy,arguments),this},U.prototype.setHours=function(){return this.proxy.setHours.apply(this.proxy,arguments),this},U.prototype.setMilliseconds=function(a){return this.proxy.setMilliseconds(a),this},U.prototype.setMinutes=function(){return this.proxy.setMinutes.apply(this.proxy,arguments),this},U.prototype.setMonth=function(){return this.proxy.setMonth.apply(this.proxy,arguments),this},U.prototype.setSeconds=function(){return this.proxy.setSeconds.apply(this.proxy,arguments),this},U.prototype.setTime=function(a){return this.proxy.setTime(a),this},U.prototype.setYear=function(){return this.proxy.setYear.apply(this.proxy,arguments),this},U.prototype.strftime=function(a){return a=a||this.formatString||U.regional[this.locale].formatString,U.strftime(this,a,this.syntax)},U.prototype.toString=function(){return this.proxy.toString()},U.prototype.toYmdInt=function(){return 1e4*this.proxy.getFullYear()+100*this.getMonthNumber()+this.proxy.getDate()},U.regional={en:{monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],formatString:"%Y-%m-%d %H:%M:%S"},fr:{monthNames:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],monthNamesShort:["Jan","Fév","Mar","Avr","Mai","Jun","Jul","Aoû","Sep","Oct","Nov","Déc"],dayNames:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],dayNamesShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],formatString:"%Y-%m-%d %H:%M:%S"},de:{monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthNamesShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],formatString:"%Y-%m-%d %H:%M:%S"},es:{monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthNamesShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],dayNames:["Domingo","Lunes","Martes","Mi&eacute;rcoles","Jueves","Viernes","S&aacute;bado"],dayNamesShort:["Dom","Lun","Mar","Mi&eacute;","Juv","Vie","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},ru:{monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthNamesShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],dayNames:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],dayNamesShort:["вск","пнд","втр","срд","чтв","птн","сбт"],formatString:"%Y-%m-%d %H:%M:%S"},ar:{monthNames:["كانون الثاني","شباط","آذار","نيسان","آذار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12"],dayNames:["السبت","الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة"],dayNamesShort:["سبت","أحد","اثنين","ثلاثاء","أربعاء","خميس","جمعة"],formatString:"%Y-%m-%d %H:%M:%S"},pt:{monthNames:["Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Ter&ccedil;a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S&aacute;bado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},"pt-BR":{monthNames:["Janeiro","Fevereiro","Mar&ccedil;o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Ter&ccedil;a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S&aacute;bado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","S&aacute;b"],formatString:"%Y-%m-%d %H:%M:%S"},pl:{monthNames:["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],monthNamesShort:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paź","Lis","Gru"],dayNames:["Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],dayNamesShort:["Ni","Pn","Wt","Śr","Cz","Pt","Sb"],formatString:"%Y-%m-%d %H:%M:%S"},nl:{monthNames:["Januari","Februari","Maart","April","Mei","Juni","July","Augustus","September","Oktober","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],dayNames:",".Zaterdag,dayNamesShort:["Zo","Ma","Di","Wo","Do","Vr","Za"],formatString:"%Y-%m-%d %H:%M:%S"},sv:{monthNames:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],monthNamesShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],dayNames:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],dayNamesShort:["sön","mån","tis","ons","tor","fre","lör"],formatString:"%Y-%m-%d %H:%M:%S"},it:{monthNames:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthNamesShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],dayNames:["Domenica","Lunedi","Martedi","Mercoledi","Giovedi","Venerdi","Sabato"],dayNamesShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],formatString:"%d-%m-%Y %H:%M:%S"}},U.regional["en-US"]=U.regional["en-GB"]=U.regional.en,U.regional.getLocale=function(){var a=U.config.defaultLocale;return document&&document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang&&(a=document.getElementsByTagName("html")[0].lang,U.regional.hasOwnProperty(a)||(a=U.config.defaultLocale)),a};var V=864e5,W=function(a,b){a=String(a);var c=b-a.length,d=String(Math.pow(10,c)).slice(1);return d.concat(a)},X={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:V,week:7*V,month:{add:function(a,b){X.year.add(a,Math[b>0?"floor":"ceil"](b/12));var c=a.getMonth()+b%12;12==c?(c=0,a.setYear(a.getFullYear()+1)):c==-1&&(c=11,a.setYear(a.getFullYear()-1)),a.setMonth(c)},diff:function(a,b){var c=a.getFullYear()-b.getFullYear(),d=a.getMonth()-b.getMonth()+12*c,e=a.getDate()-b.getDate();return d+e/30}},year:{add:function(a,b){a.setYear(a.getFullYear()+Math[b>0?"floor":"ceil"](b))},diff:function(a,b){return X.month.diff(a,b)/12}}};for(var Y in X)"s"!=Y.substring(Y.length-1)&&(X[Y+"s"]=X[Y]);var Z=function(a,b,c){if(U.formats[c].shortcuts[b])return U.strftime(a,U.formats[c].shortcuts[b],c);var d=(U.formats[c].codes[b]||"").split("."),e=a["get"+d[0]]?a["get"+d[0]]():"";return d[1]&&(e=W(e,d[1])),e};U.strftime=function(a,b,c,d){var e="perl",f=U.regional.getLocale();c&&U.formats.hasOwnProperty(c)?e=c:c&&U.regional.hasOwnProperty(c)&&(f=c),d&&U.formats.hasOwnProperty(d)?e=d:d&&U.regional.hasOwnProperty(d)&&(f=d),"[object Object]"==F(a)&&"jsDate"==a._type||(a=new U(a),a.locale=f),b||(b=a.formatString||U.regional[f].formatString);for(var g,h=b||"%Y-%m-%d",i="";h.length>0;)(g=h.match(U.formats[e].codes.matcher))?(i+=h.slice(0,g.index),i+=(g[1]||"")+Z(a,g[2],e),h=h.slice(g.index+g[0].length)):(i+=h,h="");return i},U.formats={ISO:"%Y-%m-%dT%H:%M:%S.%N%G",SQL:"%Y-%m-%d %H:%M:%S"},U.formats.perl={codes:{matcher:/()%(#?(%|[a-z]))/i,Y:"FullYear",y:"ShortYear.2",m:"MonthNumber.2","#m":"MonthNumber",B:"MonthName",b:"AbbrMonthName",d:"Date.2","#d":"Date",e:"Date",A:"DayName",a:"AbbrDayName",w:"Day",H:"Hours.2","#H":"Hours",I:"Hours12.2","#I":"Hours12",p:"AMPM",M:"Minutes.2","#M":"Minutes",S:"Seconds.2","#S":"Seconds",s:"Unix",N:"Milliseconds.3","#N":"Milliseconds",O:"TimezoneOffset",Z:"TimezoneName",G:"GmtOffset"},shortcuts:{F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",D:"%m/%d/%y","#c":"%a %b %e %H:%M:%S %Y",v:"%e-%b-%Y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}},U.formats.php={codes:{matcher:/()%((%|[a-z]))/i,a:"AbbrDayName",A:"DayName",d:"Date.2",e:"Date",j:"DayOfYear.3",u:"DayOfWeek",w:"Day",U:"FullWeekOfYear.2",V:"IsoWeek.2",W:"WeekOfYear.2",b:"AbbrMonthName",B:"MonthName",m:"MonthNumber.2",h:"AbbrMonthName",C:"Century.2",y:"ShortYear.2",Y:"FullYear",H:"Hours.2",I:"Hours12.2",l:"Hours12",p:"AMPM",P:"AmPm",M:"Minutes.2",S:"Seconds.2",s:"Unix",O:"TimezoneOffset",z:"GmtOffset",Z:"TimezoneAbbr"},shortcuts:{D:"%m/%d/%y",F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}},U.createDate=function(a){function b(a,b){var c,d,e,f,g=parseFloat(b[1]),h=parseFloat(b[2]),i=parseFloat(b[3]),j=U.config.defaultCentury;return g>31?(d=i,e=h,c=j+g):(d=h,e=g,c=j+i),f=e+"/"+d+"/"+c,a.replace(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})/,f)}if(null==a)return new Date;if(a instanceof Date)return a;if("number"==typeof a)return new Date(a);var c=String(a).replace(/^\s*(.+)\s*$/g,"$1");c=c.replace(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/,"$1/$2/$3"),c=c.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{4})/i,"$1 $2 $3");var d=c.match(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i);if(d&&d.length>3){var e=parseFloat(d[3]),f=U.config.defaultCentury+e;f=String(f),c=c.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i,d[1]+" "+d[2]+" "+f)}d=c.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})[^0-9]/),d&&d.length>3&&(c=b(c,d));var d=c.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})$/);d&&d.length>3&&(c=b(c,d));for(var g,h,i,j=0,k=U.matchers.length,l=c;j<k;){if(h=Date.parse(l),!isNaN(h))return new Date(h);if(g=U.matchers[j],"function"==typeof g){if(i=g.call(U,l),i instanceof Date)return i}else l=c.replace(g[0],g[1]);j++}return NaN},U.daysInMonth=function(a,b){return 2==b?29==new Date(a,1,29).getDate()?29:28:[H,31,H,31,30,31,30,31,31,30,31,30,31][b]},U.matchers=[[/(3[01]|[0-2]\d)\s*\.\s*(1[0-2]|0\d)\s*\.\s*([1-9]\d{3})/,"$2/$1/$3"],[/([1-9]\d{3})\s*-\s*(1[0-2]|0\d)\s*-\s*(3[01]|[0-2]\d)/,"$2/$3/$1"],function(a){var b=a.match(/^(?:(.+)\s+)?([012]?\d)(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d(\.\d*)?))?\s*(am|pm)?\s*$/i);if(b){if(b[1]){var c=this.createDate(b[1]);if(isNaN(c))return}else{var c=new Date;c.setMilliseconds(0)}var d=parseFloat(b[2]);return b[6]&&(d="am"==b[6].toLowerCase()?12==d?0:d:12==d?12:d+12),c.setHours(d,parseInt(b[3]||0,10),parseInt(b[4]||0,10),1e3*(parseFloat(b[5]||0)||0)),c}return a},function(a){var b=a.match(/^(?:(.+))[T|\s+]([012]\d)(?:\:(\d\d))(?:\:(\d\d))(?:\.\d+)([\+\-]\d\d\:\d\d)$/i);if(b){if(b[1]){var c=this.createDate(b[1]);if(isNaN(c))return}else{var c=new Date;c.setMilliseconds(0)}var d=parseFloat(b[2]);return c.setHours(d,parseInt(b[3],10),parseInt(b[4],10),1e3*parseFloat(b[5])),c}return a},function(a){var b=a.match(/^([0-3]?\d)\s*[-\/.\s]{1}\s*([a-zA-Z]{3,9})\s*[-\/.\s]{1}\s*([0-3]?\d)$/);if(b){var c,d,e,f=new Date,g=U.config.defaultCentury,h=parseFloat(b[1]),i=parseFloat(b[3]);h>31?(d=i,c=g+h):(d=h,c=g+i);var e=E(b[2],U.regional[U.regional.getLocale()].monthNamesShort);return e==-1&&(e=E(b[2],U.regional[U.regional.getLocale()].monthNames)),f.setFullYear(c,e,d),f.setHours(0,0,0,0),f}return a}],a.jsDate=U,a.jqplot.sprintf=function(){function b(a,b,c,d){var e=a.length>=b?"":Array(1+b-a.length>>>0).join(c);return d?a+e:e+a}function c(b){for(var c=new String(b),d=10;d>0&&c!=(c=c.replace(/^(\d+)(\d{3})/,"$1"+a.jqplot.sprintf.thousandsSeparator+"$2"));d--);return c}function d(a,c,d,e,f,g){var h=e-a.length;if(h>0){var i=" ";g&&(i="&nbsp;"),a=d||!f?b(a,e,i,d):a.slice(0,c.length)+b("",h,"0",!0)+a.slice(c.length)}return a}function e(a,c,e,f,g,h,i,j){var k=a>>>0;return e=e&&k&&{2:"0b",8:"0",16:"0x"}[c]||"",a=e+b(k.toString(c),h||0,"0",!1),d(a,e,f,g,i,j)}function f(a,b,c,e,f,g){return null!=e&&(a=a.slice(0,e)),d(a,"",b,c,f,g)}var g=arguments,h=0,i=g[h++];return i.replace(a.jqplot.sprintf.regex,function(i,j,k,l,m,n,o){if("%%"==i)return"%";for(var p=!1,q="",r=!1,s=!1,t=!1,u=!1,v=0;k&&v<k.length;v++)switch(k.charAt(v)){case" ":q=" ";break;case"+":q="+";break;case"-":p=!0;break;case"0":r=!0;break;case"#":s=!0;break;case"&":t=!0;break;case"'":u=!0}if(l=l?"*"==l?+g[h++]:"*"==l.charAt(0)?+g[l.slice(1,-1)]:+l:0,l<0&&(l=-l,p=!0),!isFinite(l))throw new Error("$.jqplot.sprintf: (minimum-)width must be finite");n=n?"*"==n?+g[h++]:"*"==n.charAt(0)?+g[n.slice(1,-1)]:+n:"fFeE".indexOf(o)>-1?6:"d"==o?0:void 0;var w=j?g[j.slice(0,-1)]:g[h++];switch(o){case"s":return null==w?"":f(String(w),p,l,n,r,t);case"c":return f(String.fromCharCode(+w),p,l,n,r,t);case"b":return e(w,2,s,p,l,n,r,t);case"o":return e(w,8,s,p,l,n,r,t);case"x":return e(w,16,s,p,l,n,r,t);case"X":return e(w,16,s,p,l,n,r,t).toUpperCase();case"u":return e(w,10,s,p,l,n,r,t);case"i":var x=parseInt(+w,10);if(isNaN(x))return"";var y=x<0?"-":q,z=u?c(String(Math.abs(x))):String(Math.abs(x));return w=y+b(z,n,"0",!1),d(w,y,p,l,r,t);case"d":var x=Math.round(+w);if(isNaN(x))return"";var y=x<0?"-":q,z=u?c(String(Math.abs(x))):String(Math.abs(x));return w=y+b(z,n,"0",!1),d(w,y,p,l,r,t);case"e":case"E":case"f":case"F":case"g":case"G":var x=+w;if(isNaN(x))return"";var y=x<0?"-":q,A=["toExponential","toFixed","toPrecision"]["efg".indexOf(o.toLowerCase())],B=["toString","toUpperCase"]["eEfFgG".indexOf(o)%2],z=Math.abs(x)[A](n),C=z.toString().split(".");C[0]=u?c(C[0]):C[0],z=C.join(a.jqplot.sprintf.decimalMark),w=y+z;var D=d(w,y,p,l,r,t)[B]();return D;case"p":case"P":var x=+w;if(isNaN(x))return"";var y=x<0?"-":q,C=String(Number(Math.abs(x)).toExponential()).split(/e|E/),E=C[0].indexOf(".")!=-1?C[0].length-1:String(x).length,F=C[1]<0?-C[1]-1:0;if(Math.abs(x)<1)w=E+F<=n?y+Math.abs(x).toPrecision(E):E<=n-1?y+Math.abs(x).toExponential(E-1):y+Math.abs(x).toExponential(n-1);else{var G=E<=n?E:n;w=y+Math.abs(x).toPrecision(G)}var B=["toString","toUpperCase"]["pP".indexOf(o)%2];return d(w,y,p,l,r,t)[B]();case"n":return"";default:return i}})},a.jqplot.sprintf.thousandsSeparator=",",a.jqplot.sprintf.decimalMark=".",a.jqplot.sprintf.regex=/%%|%(\d+\$)?([-+#0&\' ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g,a.jqplot.getSignificantFigures=function(a){var b=String(Number(Math.abs(a)).toExponential()).split(/e|E/),c=b[0].indexOf(".")!=-1?b[0].length-1:b[0].length,d=b[1]<0?-b[1]-1:0,e=parseInt(b[1],10),f=e+1>0?e+1:0,g=c<=f?0:c-e-1;return{significantDigits:c,digitsLeft:f,digitsRight:g,zeros:d,exponent:e}},a.jqplot.getPrecision=function(b){return a.jqplot.getSignificantFigures(b).digitsRight};var $=a.uiBackCompat!==!1;a.jqplot.effects={effect:{}};var _="jqplot.storage.";a.extend(a.jqplot.effects,{version:"1.9pre",save:function(a,b){for(var c=0;c<b.length;c++)null!==b[c]&&a.data(_+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)null!==b[c]&&a.css(b[c],a.data(_+b[c]))},setMode:function(a,b){return"toggle"===b&&(b=a.is(":hidden")?"show":"hide"),b},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),float:b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:b.width(),height:b.height()},f=document.activeElement;return b.wrap(d),(b[0]===f||a.contains(b[0],f))&&a(f).focus(),d=b.parent(),"static"===b.css("position")?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),b.css(e),d.css(c).show()},removeWrapper:function(b){var c=document.activeElement;return b.parent().is(".ui-effects-wrapper")&&(b.parent().replaceWith(b),(b[0]===c||a.contains(b[0],c))&&a(c).focus()),b}}),a.fn.extend({jqplotEffect:function(b,c,d,e){function f(b){function c(){a.isFunction(e)&&e.call(d[0]),a.isFunction(b)&&b()}var d=a(this),e=g.complete,f=g.mode;(d.is(":hidden")?"hide"===f:"show"===f)?c():j.call(d[0],g,c)}var g=G.apply(this,arguments),h=g.mode,i=g.queue,j=a.jqplot.effects.effect[g.effect],k=!j&&$&&a.jqplot.effects[g.effect];return a.fx.off||!j&&!k?h?this[h](g.duration,g.complete):this.each(function(){g.complete&&g.complete.call(this)}):j?i===!1?this.each(f):this.queue(i||"fx",f):k.call(this,{options:g,duration:g.duration,callback:g.complete,mode:g.mode})}});var aa=/up|down|vertical/,ba=/up|left|vertical|horizontal/;a.jqplot.effects.effect.blind=function(b,c){var d,e,f,g=a(this),h=["position","top","bottom","left","right","height","width"],i=a.jqplot.effects.setMode(g,b.mode||"hide"),j=b.direction||"up",k=aa.test(j),l=k?"height":"width",m=k?"top":"left",n=ba.test(j),o={},p="show"===i;g.parent().is(".ui-effects-wrapper")?a.jqplot.effects.save(g.parent(),h):a.jqplot.effects.save(g,h),g.show(),f=parseInt(g.css("top"),10),d=a.jqplot.effects.createWrapper(g).css({overflow:"hidden"}),e=k?d[l]()+f:d[l](),o[l]=p?String(e):"0",n||(g.css(k?"bottom":"right",0).css(k?"top":"left","").css({position:"absolute"}),o[m]=p?"0":String(e)),p&&(d.css(l,0),n||d.css(m,e)),d.animate(o,{duration:b.duration,easing:b.easing,queue:!1,complete:function(){"hide"===i&&g.hide(),a.jqplot.effects.restore(g,h),a.jqplot.effects.removeWrapper(g),c()}})}}(jQuery);
 
 
 
 
 
 
 
 
assets/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js DELETED
@@ -1,203 +0,0 @@
1
- /**
2
- * jqPlot
3
- * Pure JavaScript plotting plugin using jQuery
4
- *
5
- * Version: 1.0.9
6
- * Revision: c465c44
7
- *
8
- * Copyright (c) 2009-2016 Chris Leonello
9
- * jqPlot is currently available for use in all personal or commercial projects
10
- * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
11
- * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
12
- * choose the license that best suits your project and use it accordingly.
13
- *
14
- * Although not required, the author would appreciate an email letting him
15
- * know of any substantial use of jqPlot. You can reach the author at:
16
- * chris at jqplot dot com or see http://www.jqplot.com/info.php .
17
- *
18
- * If you are feeling kind and generous, consider supporting the project by
19
- * making a donation at: http://www.jqplot.com/donate.php .
20
- *
21
- * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
22
- *
23
- * version 2007.04.27
24
- * author Ash Searle
25
- * http://hexmen.com/blog/2007/03/printf-sprintf/
26
- * http://hexmen.com/js/sprintf.js
27
- * The author (Ash Searle) has placed this code in the public domain:
28
- * "This code is unrestricted: you are free to use it however you like."
29
- *
30
- */
31
- (function($) {
32
- /**
33
- * Class: $.jqplot.CanvasAxisLabelRenderer
34
- * Renderer to draw axis labels with a canvas element to support advanced
35
- * featrues such as rotated text. This renderer uses a separate rendering engine
36
- * to draw the text on the canvas. Two modes of rendering the text are available.
37
- * If the browser has native font support for canvas fonts (currently Mozila 3.5
38
- * and Safari 4), you can enable text rendering with the canvas fillText method.
39
- * You do so by setting the "enableFontSupport" option to true.
40
- *
41
- * Browsers lacking native font support will have the text drawn on the canvas
42
- * using the Hershey font metrics. Even if the "enableFontSupport" option is true
43
- * non-supporting browsers will still render with the Hershey font.
44
- *
45
- */
46
- $.jqplot.CanvasAxisLabelRenderer = function(options) {
47
- // Group: Properties
48
-
49
- // prop: angle
50
- // angle of text, measured clockwise from x axis.
51
- this.angle = 0;
52
- // name of the axis associated with this tick
53
- this.axis;
54
- // prop: show
55
- // whether or not to show the tick (mark and label).
56
- this.show = true;
57
- // prop: showLabel
58
- // whether or not to show the label.
59
- this.showLabel = true;
60
- // prop: label
61
- // label for the axis.
62
- this.label = '';
63
- // prop: fontFamily
64
- // CSS spec for the font-family css attribute.
65
- // Applies only to browsers supporting native font rendering in the
66
- // canvas tag. Currently Mozilla 3.5 and Safari 4.
67
- this.fontFamily = '"Trebuchet MS", Arial, Helvetica, sans-serif';
68
- // prop: fontSize
69
- // CSS spec for font size.
70
- this.fontSize = '11pt';
71
- // prop: fontWeight
72
- // CSS spec for fontWeight: normal, bold, bolder, lighter or a number 100 - 900
73
- this.fontWeight = 'normal';
74
- // prop: fontStretch
75
- // Multiplier to condense or expand font width.
76
- // Applies only to browsers which don't support canvas native font rendering.
77
- this.fontStretch = 1.0;
78
- // prop: textColor
79
- // css spec for the color attribute.
80
- this.textColor = '#666666';
81
- // prop: enableFontSupport
82
- // true to turn on native canvas font support in Mozilla 3.5+ and Safari 4+.
83
- // If true, label will be drawn with canvas tag native support for fonts.
84
- // If false, label will be drawn with Hershey font metrics.
85
- this.enableFontSupport = true;
86
- // prop: pt2px
87
- // Point to pixel scaling factor, used for computing height of bounding box
88
- // around a label. The labels text renderer has a default setting of 1.4, which
89
- // should be suitable for most fonts. Leave as null to use default. If tops of
90
- // letters appear clipped, increase this. If bounding box seems too big, decrease.
91
- // This is an issue only with the native font renderering capabilities of Mozilla
92
- // 3.5 and Safari 4 since they do not provide a method to determine the font height.
93
- this.pt2px = null;
94
-
95
- this._elem;
96
- this._ctx;
97
- this._plotWidth;
98
- this._plotHeight;
99
- this._plotDimensions = {height:null, width:null};
100
-
101
- $.extend(true, this, options);
102
-
103
- if (options.angle == null && this.axis != 'xaxis' && this.axis != 'x2axis') {
104
- this.angle = -90;
105
- }
106
-
107
- var ropts = {fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily};
108
- if (this.pt2px) {
109
- ropts.pt2px = this.pt2px;
110
- }
111
-
112
- if (this.enableFontSupport) {
113
- if ($.jqplot.support_canvas_text()) {
114
- this._textRenderer = new $.jqplot.CanvasFontRenderer(ropts);
115
- }
116
-
117
- else {
118
- this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts);
119
- }
120
- }
121
- else {
122
- this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts);
123
- }
124
- };
125
-
126
- $.jqplot.CanvasAxisLabelRenderer.prototype.init = function(options) {
127
- $.extend(true, this, options);
128
- this._textRenderer.init({fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily});
129
- };
130
-
131
- // return width along the x axis
132
- // will check first to see if an element exists.
133
- // if not, will return the computed text box width.
134
- $.jqplot.CanvasAxisLabelRenderer.prototype.getWidth = function(ctx) {
135
- if (this._elem) {
136
- return this._elem.outerWidth(true);
137
- }
138
- else {
139
- var tr = this._textRenderer;
140
- var l = tr.getWidth(ctx);
141
- var h = tr.getHeight(ctx);
142
- var w = Math.abs(Math.sin(tr.angle)*h) + Math.abs(Math.cos(tr.angle)*l);
143
- return w;
144
- }
145
- };
146
-
147
- // return height along the y axis.
148
- $.jqplot.CanvasAxisLabelRenderer.prototype.getHeight = function(ctx) {
149
- if (this._elem) {
150
- return this._elem.outerHeight(true);
151
- }
152
- else {
153
- var tr = this._textRenderer;
154
- var l = tr.getWidth(ctx);
155
- var h = tr.getHeight(ctx);
156
- var w = Math.abs(Math.cos(tr.angle)*h) + Math.abs(Math.sin(tr.angle)*l);
157
- return w;
158
- }
159
- };
160
-
161
- $.jqplot.CanvasAxisLabelRenderer.prototype.getAngleRad = function() {
162
- var a = this.angle * Math.PI/180;
163
- return a;
164
- };
165
-
166
- $.jqplot.CanvasAxisLabelRenderer.prototype.draw = function(ctx, plot) {
167
- // Memory Leaks patch
168
- if (this._elem) {
169
- if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
170
- window.G_vmlCanvasManager.uninitElement(this._elem.get(0));
171
- }
172
-
173
- this._elem.emptyForce();
174
- this._elem = null;
175
- }
176
-
177
- // create a canvas here, but can't draw on it untill it is appended
178
- // to dom for IE compatability.
179
- var elem = plot.canvasManager.getCanvas();
180
-
181
- this._textRenderer.setText(this.label, ctx);
182
- var w = this.getWidth(ctx);
183
- var h = this.getHeight(ctx);
184
- elem.width = w;
185
- elem.height = h;
186
- elem.style.width = w;
187
- elem.style.height = h;
188
-
189
- elem = plot.canvasManager.initCanvas(elem);
190
-
191
- this._elem = $(elem);
192
- this._elem.css({ position: 'absolute'});
193
- this._elem.addClass('jqplot-'+this.axis+'-label');
194
-
195
- elem = null;
196
- return this._elem;
197
- };
198
-
199
- $.jqplot.CanvasAxisLabelRenderer.prototype.pack = function() {
200
- this._textRenderer.draw(this._elem.get(0).getContext("2d"), this.label);
201
- };
202
-
203
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js DELETED
@@ -1,4 +0,0 @@
1
- /* jqplot 1.0.9 | (c) 2009-2016 Chris Leonello | jqplot.com
2
- jsDate | (c) 2010-2016 Chris Leonello
3
- */
4
- !function(a){a.jqplot.CanvasAxisLabelRenderer=function(b){this.angle=0,this.axis,this.show=!0,this.showLabel=!0,this.label="",this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif',this.fontSize="11pt",this.fontWeight="normal",this.fontStretch=1,this.textColor="#666666",this.enableFontSupport=!0,this.pt2px=null,this._elem,this._ctx,this._plotWidth,this._plotHeight,this._plotDimensions={height:null,width:null},a.extend(!0,this,b),null==b.angle&&"xaxis"!=this.axis&&"x2axis"!=this.axis&&(this.angle=-90);var c={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};this.pt2px&&(c.pt2px=this.pt2px),this.enableFontSupport&&a.jqplot.support_canvas_text()?this._textRenderer=new a.jqplot.CanvasFontRenderer(c):this._textRenderer=new a.jqplot.CanvasTextRenderer(c)},a.jqplot.CanvasAxisLabelRenderer.prototype.init=function(b){a.extend(!0,this,b),this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})},a.jqplot.CanvasAxisLabelRenderer.prototype.getWidth=function(a){if(this._elem)return this._elem.outerWidth(!0);var b=this._textRenderer,c=b.getWidth(a),d=b.getHeight(a),e=Math.abs(Math.sin(b.angle)*d)+Math.abs(Math.cos(b.angle)*c);return e},a.jqplot.CanvasAxisLabelRenderer.prototype.getHeight=function(a){if(this._elem)return this._elem.outerHeight(!0);var b=this._textRenderer,c=b.getWidth(a),d=b.getHeight(a),e=Math.abs(Math.cos(b.angle)*d)+Math.abs(Math.sin(b.angle)*c);return e},a.jqplot.CanvasAxisLabelRenderer.prototype.getAngleRad=function(){var a=this.angle*Math.PI/180;return a},a.jqplot.CanvasAxisLabelRenderer.prototype.draw=function(b,c){this._elem&&(a.jqplot.use_excanvas&&void 0!==window.G_vmlCanvasManager.uninitElement&&window.G_vmlCanvasManager.uninitElement(this._elem.get(0)),this._elem.emptyForce(),this._elem=null);var d=c.canvasManager.getCanvas();this._textRenderer.setText(this.label,b);var e=this.getWidth(b),f=this.getHeight(b);return d.width=e,d.height=f,d.style.width=e,d.style.height=f,d=c.canvasManager.initCanvas(d),this._elem=a(d),this._elem.css({position:"absolute"}),this._elem.addClass("jqplot-"+this.axis+"-label"),d=null,this._elem},a.jqplot.CanvasAxisLabelRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}}(jQuery);
 
 
 
 
assets/jqplot/plugins/jqplot.canvasAxisTickRenderer.js DELETED
@@ -1,253 +0,0 @@
1
- /**
2
- * jqPlot
3
- * Pure JavaScript plotting plugin using jQuery
4
- *
5
- * Version: 1.0.9
6
- * Revision: c465c44
7
- *
8
- * Copyright (c) 2009-2016 Chris Leonello
9
- * jqPlot is currently available for use in all personal or commercial projects
10
- * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
11
- * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
12
- * choose the license that best suits your project and use it accordingly.
13
- *
14
- * Although not required, the author would appreciate an email letting him
15
- * know of any substantial use of jqPlot. You can reach the author at:
16
- * chris at jqplot dot com or see http://www.jqplot.com/info.php .
17
- *
18
- * If you are feeling kind and generous, consider supporting the project by
19
- * making a donation at: http://www.jqplot.com/donate.php .
20
- *
21
- * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
22
- *
23
- * version 2007.04.27
24
- * author Ash Searle
25
- * http://hexmen.com/blog/2007/03/printf-sprintf/
26
- * http://hexmen.com/js/sprintf.js
27
- * The author (Ash Searle) has placed this code in the public domain:
28
- * "This code is unrestricted: you are free to use it however you like."
29
- *
30
- */
31
- (function($) {
32
- /**
33
- * Class: $.jqplot.CanvasAxisTickRenderer
34
- * Renderer to draw axis ticks with a canvas element to support advanced
35
- * featrues such as rotated text. This renderer uses a separate rendering engine
36
- * to draw the text on the canvas. Two modes of rendering the text are available.
37
- * If the browser has native font support for canvas fonts (currently Mozila 3.5
38
- * and Safari 4), you can enable text rendering with the canvas fillText method.
39
- * You do so by setting the "enableFontSupport" option to true.
40
- *
41
- * Browsers lacking native font support will have the text drawn on the canvas
42
- * using the Hershey font metrics. Even if the "enableFontSupport" option is true
43
- * non-supporting browsers will still render with the Hershey font.
44
- */
45
- $.jqplot.CanvasAxisTickRenderer = function(options) {
46
- // Group: Properties
47
-
48
- // prop: mark
49
- // tick mark on the axis. One of 'inside', 'outside', 'cross', '' or null.
50
- this.mark = 'outside';
51
- // prop: showMark
52
- // whether or not to show the mark on the axis.
53
- this.showMark = true;
54
- // prop: showGridline
55
- // whether or not to draw the gridline on the grid at this tick.
56
- this.showGridline = true;
57
- // prop: isMinorTick
58
- // if this is a minor tick.
59
- this.isMinorTick = false;
60
- // prop: angle
61
- // angle of text, measured clockwise from x axis.
62
- this.angle = 0;
63
- // prop: markSize
64
- // Length of the tick marks in pixels. For 'cross' style, length
65
- // will be stoked above and below axis, so total length will be twice this.
66
- this.markSize = 4;
67
- // prop: show
68
- // whether or not to show the tick (mark and label).
69
- this.show = true;
70
- // prop: showLabel
71
- // whether or not to show the label.
72
- this.showLabel = true;
73
- // prop: labelPosition
74
- // 'auto', 'start', 'middle' or 'end'.
75
- // Whether tick label should be positioned so the start, middle, or end
76
- // of the tick mark.
77
- this.labelPosition = 'auto';
78
- this.label = '';
79
- this.value = null;
80
- this._styles = {};
81
- // prop: formatter
82
- // A class of a formatter for the tick text.
83
- // The default $.jqplot.DefaultTickFormatter uses sprintf.
84
- this.formatter = $.jqplot.DefaultTickFormatter;
85
- // prop: formatString
86
- // string passed to the formatter.
87
- this.formatString = '';
88
- // prop: prefix
89
- // String to prepend to the tick label.
90
- // Prefix is prepended to the formatted tick label.
91
- this.prefix = '';
92
- // prop: fontFamily
93
- // css spec for the font-family css attribute.
94
- this.fontFamily = '"Trebuchet MS", Arial, Helvetica, sans-serif';
95
- // prop: fontSize
96
- // CSS spec for font size.
97
- this.fontSize = '10pt';
98
- // prop: fontWeight
99
- // CSS spec for fontWeight
100
- this.fontWeight = 'normal';
101
- // prop: fontStretch
102
- // Multiplier to condense or expand font width.
103
- // Applies only to browsers which don't support canvas native font rendering.
104
- this.fontStretch = 1.0;
105
- // prop: textColor
106
- // css spec for the color attribute.
107
- this.textColor = '#666666';
108
- // prop: enableFontSupport
109
- // true to turn on native canvas font support in Mozilla 3.5+ and Safari 4+.
110
- // If true, tick label will be drawn with canvas tag native support for fonts.
111
- // If false, tick label will be drawn with Hershey font metrics.
112
- this.enableFontSupport = true;
113
- // prop: pt2px
114
- // Point to pixel scaling factor, used for computing height of bounding box
115
- // around a label. The labels text renderer has a default setting of 1.4, which
116
- // should be suitable for most fonts. Leave as null to use default. If tops of
117
- // letters appear clipped, increase this. If bounding box seems too big, decrease.
118
- // This is an issue only with the native font renderering capabilities of Mozilla
119
- // 3.5 and Safari 4 since they do not provide a method to determine the font height.
120
- this.pt2px = null;
121
-
122
- this._elem;
123
- this._ctx;
124
- this._plotWidth;
125
- this._plotHeight;
126
- this._plotDimensions = {height:null, width:null};
127
-
128
- $.extend(true, this, options);
129
-
130
- var ropts = {fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily};
131
- if (this.pt2px) {
132
- ropts.pt2px = this.pt2px;
133
- }
134
-
135
- if (this.enableFontSupport) {
136
- if ($.jqplot.support_canvas_text()) {
137
- this._textRenderer = new $.jqplot.CanvasFontRenderer(ropts);
138
- }
139
-
140
- else {
141
- this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts);
142
- }
143
- }
144
- else {
145
- this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts);
146
- }
147
- };
148
-
149
- $.jqplot.CanvasAxisTickRenderer.prototype.init = function(options) {
150
- $.extend(true, this, options);
151
- this._textRenderer.init({fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily});
152
- };
153
-
154
- // return width along the x axis
155
- // will check first to see if an element exists.
156
- // if not, will return the computed text box width.
157
- $.jqplot.CanvasAxisTickRenderer.prototype.getWidth = function(ctx) {
158
- if (this._elem) {
159
- return this._elem.outerWidth(true);
160
- }
161
- else {
162
- var tr = this._textRenderer;
163
- var l = tr.getWidth(ctx);
164
- var h = tr.getHeight(ctx);
165
- var w = Math.abs(Math.sin(tr.angle)*h) + Math.abs(Math.cos(tr.angle)*l);
166
- return w;
167
- }
168
- };
169
-
170
- // return height along the y axis.
171
- $.jqplot.CanvasAxisTickRenderer.prototype.getHeight = function(ctx) {
172
- if (this._elem) {
173
- return this._elem.outerHeight(true);
174
- }
175
- else {
176
- var tr = this._textRenderer;
177
- var l = tr.getWidth(ctx);
178
- var h = tr.getHeight(ctx);
179
- var w = Math.abs(Math.cos(tr.angle)*h) + Math.abs(Math.sin(tr.angle)*l);
180
- return w;
181
- }
182
- };
183
-
184
- // return top.
185
- $.jqplot.CanvasAxisTickRenderer.prototype.getTop = function(ctx) {
186
- if (this._elem) {
187
- return this._elem.position().top;
188
- }
189
- else {
190
- return null;
191
- }
192
- };
193
-
194
- $.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad = function() {
195
- var a = this.angle * Math.PI/180;
196
- return a;
197
- };
198
-
199
-
200
- $.jqplot.CanvasAxisTickRenderer.prototype.setTick = function(value, axisName, isMinor) {
201
- this.value = value;
202
- if (isMinor) {
203
- this.isMinorTick = true;
204
- }
205
- return this;
206
- };
207
-
208
- $.jqplot.CanvasAxisTickRenderer.prototype.draw = function(ctx, plot) {
209
- if (!this.label) {
210
- this.label = this.prefix + this.formatter(this.formatString, this.value);
211
- }
212
-
213
- // Memory Leaks patch
214
- if (this._elem) {
215
- if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
216
- window.G_vmlCanvasManager.uninitElement(this._elem.get(0));
217
- }
218
-
219
- this._elem.emptyForce();
220
- this._elem = null;
221
- }
222
-
223
- // create a canvas here, but can't draw on it untill it is appended
224
- // to dom for IE compatability.
225
-
226
- var elem = plot.canvasManager.getCanvas();
227
-
228
- this._textRenderer.setText(this.label, ctx);
229
- var w = this.getWidth(ctx);
230
- var h = this.getHeight(ctx);
231
- // canvases seem to need to have width and heigh attributes directly set.
232
- elem.width = w;
233
- elem.height = h;
234
- elem.style.width = w;
235
- elem.style.height = h;
236
- elem.style.textAlign = 'left';
237
- elem.style.position = 'absolute';
238
-
239
- elem = plot.canvasManager.initCanvas(elem);
240
-
241
- this._elem = $(elem);
242
- this._elem.css(this._styles);
243
- this._elem.addClass('jqplot-'+this.axis+'-tick');
244
-
245
- elem = null;
246
- return this._elem;
247
- };
248
-
249
- $.jqplot.CanvasAxisTickRenderer.prototype.pack = function() {
250
- this._textRenderer.draw(this._elem.get(0).getContext("2d"), this.label);
251
- };
252
-
253
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js DELETED
@@ -1,4 +0,0 @@
1
- /* jqplot 1.0.9 | (c) 2009-2016 Chris Leonello | jqplot.com
2
- jsDate | (c) 2010-2016 Chris Leonello
3
- */
4
- !function(a){a.jqplot.CanvasAxisTickRenderer=function(b){this.mark="outside",this.showMark=!0,this.showGridline=!0,this.isMinorTick=!1,this.angle=0,this.markSize=4,this.show=!0,this.showLabel=!0,this.labelPosition="auto",this.label="",this.value=null,this._styles={},this.formatter=a.jqplot.DefaultTickFormatter,this.formatString="",this.prefix="",this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif',this.fontSize="10pt",this.fontWeight="normal",this.fontStretch=1,this.textColor="#666666",this.enableFontSupport=!0,this.pt2px=null,this._elem,this._ctx,this._plotWidth,this._plotHeight,this._plotDimensions={height:null,width:null},a.extend(!0,this,b);var c={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};this.pt2px&&(c.pt2px=this.pt2px),this.enableFontSupport&&a.jqplot.support_canvas_text()?this._textRenderer=new a.jqplot.CanvasFontRenderer(c):this._textRenderer=new a.jqplot.CanvasTextRenderer(c)},a.jqplot.CanvasAxisTickRenderer.prototype.init=function(b){a.extend(!0,this,b),this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})},a.jqplot.CanvasAxisTickRenderer.prototype.getWidth=function(a){if(this._elem)return this._elem.outerWidth(!0);var b=this._textRenderer,c=b.getWidth(a),d=b.getHeight(a),e=Math.abs(Math.sin(b.angle)*d)+Math.abs(Math.cos(b.angle)*c);return e},a.jqplot.CanvasAxisTickRenderer.prototype.getHeight=function(a){if(this._elem)return this._elem.outerHeight(!0);var b=this._textRenderer,c=b.getWidth(a),d=b.getHeight(a),e=Math.abs(Math.cos(b.angle)*d)+Math.abs(Math.sin(b.angle)*c);return e},a.jqplot.CanvasAxisTickRenderer.prototype.getTop=function(a){return this._elem?this._elem.position().top:null},a.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad=function(){var a=this.angle*Math.PI/180;return a},a.jqplot.CanvasAxisTickRenderer.prototype.setTick=function(a,b,c){return this.value=a,c&&(this.isMinorTick=!0),this},a.jqplot.CanvasAxisTickRenderer.prototype.draw=function(b,c){this.label||(this.label=this.prefix+this.formatter(this.formatString,this.value)),this._elem&&(a.jqplot.use_excanvas&&void 0!==window.G_vmlCanvasManager.uninitElement&&window.G_vmlCanvasManager.uninitElement(this._elem.get(0)),this._elem.emptyForce(),this._elem=null);var d=c.canvasManager.getCanvas();this._textRenderer.setText(this.label,b);var e=this.getWidth(b),f=this.getHeight(b);return d.width=e,d.height=f,d.style.width=e,d.style.height=f,d.style.textAlign="left",d.style.position="absolute",d=c.canvasManager.initCanvas(d),this._elem=a(d),this._elem.css(this._styles),this._elem.addClass("jqplot-"+this.axis+"-tick"),d=null,this._elem},a.jqplot.CanvasAxisTickRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}}(jQuery);
 
 
 
 
assets/jqplot/plugins/jqplot.canvasTextRenderer.js DELETED
@@ -1,449 +0,0 @@
1
- /**
2
- * jqPlot
3
- * Pure JavaScript plotting plugin using jQuery
4
- *
5
- * Version: 1.0.9
6
- * Revision: c465c44
7
- *
8
- * Copyright (c) 2009-2016 Chris Leonello
9
- * jqPlot is currently available for use in all personal or commercial projects
10
- * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
11
- * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
12
- * choose the license that best suits your project and use it accordingly.
13
- *
14
- * Although not required, the author would appreciate an email letting him
15
- * know of any substantial use of jqPlot. You can reach the author at:
16
- * chris at jqplot dot com or see http://www.jqplot.com/info.php .
17
- *
18
- * If you are feeling kind and generous, consider supporting the project by
19
- * making a donation at: http://www.jqplot.com/donate.php .
20
- *
21
- * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
22
- *
23
- * version 2007.04.27
24
- * author Ash Searle
25
- * http://hexmen.com/blog/2007/03/printf-sprintf/
26
- * http://hexmen.com/js/sprintf.js
27
- * The author (Ash Searle) has placed this code in the public domain:
28
- * "This code is unrestricted: you are free to use it however you like."
29
- *
30
- * included jsDate library by Chris Leonello:
31
- *
32
- * Copyright (c) 2010-2015 Chris Leonello
33
- *
34
- * jsDate is currently available for use in all personal or commercial projects
35
- * under both the MIT and GPL version 2.0 licenses. This means that you can
36
- * choose the license that best suits your project and use it accordingly.
37
- *
38
- * jsDate borrows many concepts and ideas from the Date Instance
39
- * Methods by Ken Snyder along with some parts of Ken's actual code.
40
- *
41
- * Ken's original Date Instance Methods and copyright notice:
42
- *
43
- * Ken Snyder (ken d snyder at gmail dot com)
44
- * 2008-09-10
45
- * version 2.0.2 (http://kendsnyder.com/sandbox/date/)
46
- * Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
47
- *
48
- * jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
49
- * Larry has generously given permission to adapt his code for inclusion
50
- * into jqPlot.
51
- *
52
- * Larry's original code can be found here:
53
- *
54
- * https://github.com/lsiden/export-jqplot-to-png
55
- *
56
- *
57
- */
58
-
59
- (function($) {
60
- // This code is a modified version of the canvastext.js code, copyright below:
61
- //
62
- // This code is released to the public domain by Jim Studt, 2007.
63
- // He may keep some sort of up to date copy at http://www.federated.com/~jim/canvastext/
64
- //
65
- $.jqplot.CanvasTextRenderer = function(options){
66
- this.fontStyle = 'normal'; // normal, italic, oblique [not implemented]
67
- this.fontVariant = 'normal'; // normal, small caps [not implemented]
68
- this.fontWeight = 'normal'; // normal, bold, bolder, lighter, 100 - 900
69
- this.fontSize = '10px';
70
- this.fontFamily = 'sans-serif';
71
- this.fontStretch = 1.0;
72
- this.fillStyle = '#666666';
73
- this.angle = 0;
74
- this.textAlign = 'start';
75
- this.textBaseline = 'alphabetic';
76
- this.text;
77
- this.width;
78
- this.height;
79
- this.pt2px = 1.28;
80
-
81
- $.extend(true, this, options);
82
- this.normalizedFontSize = this.normalizeFontSize(this.fontSize);
83
- this.setHeight();
84
- };
85
-
86
- $.jqplot.CanvasTextRenderer.prototype.init = function(options) {
87
- $.extend(true, this, options);
88
- this.normalizedFontSize = this.normalizeFontSize(this.fontSize);
89
- this.setHeight();
90
- };
91
-
92
- // convert css spec into point size
93
- // returns float
94
- $.jqplot.CanvasTextRenderer.prototype.normalizeFontSize = function(sz) {
95
- sz = String(sz);
96
- var n = parseFloat(sz);
97
- if (sz.indexOf('px') > -1) {
98
- return n/this.pt2px;
99
- }
100
- else if (sz.indexOf('pt') > -1) {
101
- return n;
102
- }
103
- else if (sz.indexOf('em') > -1) {
104
- return n*12;
105
- }
106
- else if (sz.indexOf('%') > -1) {
107
- return n*12/100;
108
- }
109
- // default to pixels;
110
- else {
111
- return n/this.pt2px;
112
- }
113
- };
114
-
115
-
116
- $.jqplot.CanvasTextRenderer.prototype.fontWeight2Float = function(w) {
117
- // w = normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
118
- // return values adjusted for Hershey font.
119
- if (Number(w)) {
120
- return w/400;
121
- }
122
- else {
123
- switch (w) {
124
- case 'normal':
125
- return 1;
126
- break;
127
- case 'bold':
128
- return 1.75;
129
- break;
130
- case 'bolder':
131
- return 2.25;
132
- break;
133
- case 'lighter':
134
- return 0.75;
135
- break;
136
- default:
137
- return 1;
138
- break;
139
- }
140
- }
141
- };
142
-
143
- $.jqplot.CanvasTextRenderer.prototype.getText = function() {
144
- return this.text;
145
- };
146
-
147
- $.jqplot.CanvasTextRenderer.prototype.setText = function(t, ctx) {
148
- this.text = t;
149
- this.setWidth(ctx);
150
- return this;
151
- };
152
-
153
- $.jqplot.CanvasTextRenderer.prototype.getWidth = function(ctx) {
154
- return this.width;
155
- };
156
-
157
- $.jqplot.CanvasTextRenderer.prototype.setWidth = function(ctx, w) {
158
- if (!w) {
159
- this.width = this.measure(ctx, this.text);
160
- }
161
- else {
162
- this.width = w;
163
- }
164
- return this;
165
- };
166
-
167
- // return height in pixels.
168
- $.jqplot.CanvasTextRenderer.prototype.getHeight = function(ctx) {
169
- return this.height;
170
- };
171
-
172
- // w - height in pt
173
- // set heigh in px
174
- $.jqplot.CanvasTextRenderer.prototype.setHeight = function(w) {
175
- if (!w) {
176
- //height = this.fontSize /0.75;
177
- this.height = this.normalizedFontSize * this.pt2px;
178
- }
179
- else {
180
- this.height = w;
181
- }
182
- return this;
183
- };
184
-
185
- $.jqplot.CanvasTextRenderer.prototype.letter = function (ch)
186
- {
187
- return this.letters[ch];
188
- };
189
-
190
- $.jqplot.CanvasTextRenderer.prototype.ascent = function()
191
- {
192
- return this.normalizedFontSize;
193
- };
194
-
195
- $.jqplot.CanvasTextRenderer.prototype.descent = function()
196
- {
197
- return 7.0*this.normalizedFontSize/25.0;
198
- };
199
-
200
- $.jqplot.CanvasTextRenderer.prototype.measure = function(ctx, str)
201
- {
202
- var total = 0;
203
- var len = str.length;
204
-
205
- for (var i = 0; i < len; i++) {
206
- var c = this.letter(str.charAt(i));
207
- if (c) {
208
- total += c.width * this.normalizedFontSize / 25.0 * this.fontStretch;
209
- }
210
- }
211
- return total;
212
- };
213
-
214
- $.jqplot.CanvasTextRenderer.prototype.draw = function(ctx,str)
215
- {
216
- var x = 0;
217
- // leave room at bottom for descenders.
218
- var y = this.height*0.72;
219
- var total = 0;
220
- var len = str.length;
221
- var mag = this.normalizedFontSize / 25.0;
222
-
223
- ctx.save();
224
- var tx, ty;
225
-
226
- // 1st quadrant
227
- if ((-Math.PI/2 <= this.angle && this.angle <= 0) || (Math.PI*3/2 <= this.angle && this.angle <= Math.PI*2)) {
228
- tx = 0;
229
- ty = -Math.sin(this.angle) * this.width;
230
- }
231
- // 4th quadrant
232
- else if ((0 < this.angle && this.angle <= Math.PI/2) || (-Math.PI*2 <= this.angle && this.angle <= -Math.PI*3/2)) {
233
- tx = Math.sin(this.angle) * this.height;
234
- ty = 0;
235
- }
236
- // 2nd quadrant
237
- else if ((-Math.PI < this.angle && this.angle < -Math.PI/2) || (Math.PI <= this.angle && this.angle <= Math.PI*3/2)) {
238
- tx = -Math.cos(this.angle) * this.width;
239
- ty = -Math.sin(this.angle) * this.width - Math.cos(this.angle) * this.height;
240
- }
241
- // 3rd quadrant
242
- else if ((-Math.PI*3/2 < this.angle && this.angle < Math.PI) || (Math.PI/2 < this.angle && this.angle < Math.PI)) {
243
- tx = Math.sin(this.angle) * this.height - Math.cos(this.angle)*this.width;
244
- ty = -Math.cos(this.angle) * this.height;
245
- }
246
-
247
- ctx.strokeStyle = this.fillStyle;
248
- ctx.fillStyle = this.fillStyle;
249
- ctx.translate(tx, ty);
250
- ctx.rotate(this.angle);
251
- ctx.lineCap = "round";
252
- // multiplier was 2.0
253
- var fact = (this.normalizedFontSize > 30) ? 2.0 : 2 + (30 - this.normalizedFontSize)/20;
254
- ctx.lineWidth = fact * mag * this.fontWeight2Float(this.fontWeight);
255
-
256
- for ( var i = 0; i < len; i++) {
257
- var c = this.letter( str.charAt(i));
258
- if ( !c) {
259
- continue;
260
- }
261
-
262
- ctx.beginPath();
263
-
264
- var penUp = 1;
265
- var needStroke = 0;
266
- for ( var j = 0; j < c.points.length; j++) {
267
- var a = c.points[j];
268
- if ( a[0] == -1 && a[1] == -1) {
269
- penUp = 1;
270
- continue;
271
- }
272
- if ( penUp) {
273
- ctx.moveTo( x + a[0]*mag*this.fontStretch, y - a[1]*mag);
274
- penUp = false;
275
- } else {
276
- ctx.lineTo( x + a[0]*mag*this.fontStretch, y - a[1]*mag);
277
- }
278
- }
279
- ctx.stroke();
280
- x += c.width*mag*this.fontStretch;
281
- }
282
- ctx.restore();
283
- return total;
284
- };
285
-
286
- $.jqplot.CanvasTextRenderer.prototype.letters = {
287
- ' ': { width: 16, points: [] },
288
- '!': { width: 10, points: [[5,21],[5,7],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]] },
289
- '"': { width: 16, points: [[4,21],[4,14],[-1,-1],[12,21],[12,14]] },
290
- '#': { width: 21, points: [[11,25],[4,-7],[-1,-1],[17,25],[10,-7],[-1,-1],[4,12],[18,12],[-1,-1],[3,6],[17,6]] },
291
- '$': { width: 20, points: [[8,25],[8,-4],[-1,-1],[12,25],[12,-4],[-1,-1],[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]] },
292
- '%': { width: 24, points: [[21,21],[3,0],[-1,-1],[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],[10,20],[13,19],[16,19],[19,20],[21,21],[-1,-1],[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]] },
293
- '&': { width: 26, points: [[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,0],[23,1],[23,2]] },
294
- '\'': { width: 10, points: [[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]] },
295
- '(': { width: 14, points: [[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]] },
296
- ')': { width: 14, points: [[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]] },
297
- '*': { width: 16, points: [[8,21],[8,9],[-1,-1],[3,18],[13,12],[-1,-1],[13,18],[3,12]] },
298
- '+': { width: 26, points: [[13,18],[13,0],[-1,-1],[4,9],[22,9]] },
299
- ',': { width: 10, points: [[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]] },
300
- '-': { width: 18, points: [[6,9],[12,9]] },
301
- '.': { width: 10, points: [[5,2],[4,1],[5,0],[6,1],[5,2]] },
302
- '/': { width: 22, points: [[20,25],[2,-7]] },
303
- '0': { width: 20, points: [[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]] },
304
- '1': { width: 20, points: [[6,17],[8,18],[11,21],[11,0]] },
305
- '2': { width: 20, points: [[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]] },
306
- '3': { width: 20, points: [[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]] },
307
- '4': { width: 20, points: [[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]] },
308
- '5': { width: 20, points: [[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]] },
309
- '6': { width: 20, points: [[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]] },
310
- '7': { width: 20, points: [[17,21],[7,0],[-1,-1],[3,21],[17,21]] },
311
- '8': { width: 20, points: [[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]] },
312
- '9': { width: 20, points: [[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]] },
313
- ':': { width: 10, points: [[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]] },
314
- ';': { width: 10, points: [[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]] },
315
- '<': { width: 24, points: [[20,18],[4,9],[20,0]] },
316
- '=': { width: 26, points: [[4,12],[22,12],[-1,-1],[4,6],[22,6]] },
317
- '>': { width: 24, points: [[4,18],[20,9],[4,0]] },
318
- '?': { width: 18, points: [[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]] },
319
- '@': { width: 27, points: [[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]] },
320
- 'A': { width: 18, points: [[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]] },
321
- 'B': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]] },
322
- 'C': { width: 21, points: [[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]] },
323
- 'D': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]] },
324
- 'E': { width: 19, points: [[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11],[-1,-1],[4,0],[17,0]] },
325
- 'F': { width: 18, points: [[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]] },
326
- 'G': { width: 21, points: [[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]] },
327
- 'H': { width: 22, points: [[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]] },
328
- 'I': { width: 8, points: [[4,21],[4,0]] },
329
- 'J': { width: 16, points: [[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]] },
330
- 'K': { width: 21, points: [[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]] },
331
- 'L': { width: 17, points: [[4,21],[4,0],[-1,-1],[4,0],[16,0]] },
332
- 'M': { width: 24, points: [[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]] },
333
- 'N': { width: 22, points: [[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]] },
334
- 'O': { width: 22, points: [[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]] },
335
- 'P': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]] },
336
- 'Q': { width: 22, points: [[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]] },
337
- 'R': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]] },
338
- 'S': { width: 20, points: [[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]] },
339
- 'T': { width: 16, points: [[8,21],[8,0],[-1,-1],[1,21],[15,21]] },
340
- 'U': { width: 22, points: [[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]] },
341
- 'V': { width: 18, points: [[1,21],[9,0],[-1,-1],[17,21],[9,0]] },
342
- 'W': { width: 24, points: [[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]] },
343
- 'X': { width: 20, points: [[3,21],[17,0],[-1,-1],[17,21],[3,0]] },
344
- 'Y': { width: 18, points: [[1,21],[9,11],[9,0],[-1,-1],[17,21],[9,11]] },
345
- 'Z': { width: 20, points: [[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]] },
346
- '[': { width: 14, points: [[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]] },
347
- '\\': { width: 14, points: [[0,21],[14,-3]] },
348
- ']': { width: 14, points: [[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]] },
349
- '^': { width: 16, points: [[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]] },
350
- '_': { width: 16, points: [[0,-2],[16,-2]] },
351
- '`': { width: 10, points: [[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]] },
352
- 'a': { width: 19, points: [[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] },
353
- 'b': { width: 19, points: [[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]] },
354
- 'c': { width: 18, points: [[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] },
355
- 'd': { width: 19, points: [[15,21],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] },
356
- 'e': { width: 18, points: [[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] },
357
- 'f': { width: 12, points: [[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]] },
358
- 'g': { width: 19, points: [[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] },
359
- 'h': { width: 19, points: [[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]] },
360
- 'i': { width: 8, points: [[3,21],[4,20],[5,21],[4,22],[3,21],[-1,-1],[4,14],[4,0]] },
361
- 'j': { width: 10, points: [[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]] },
362
- 'k': { width: 17, points: [[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]] },
363
- 'l': { width: 8, points: [[4,21],[4,0]] },
364
- 'm': { width: 30, points: [[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]] },
365
- 'n': { width: 19, points: [[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]] },
366
- 'o': { width: 19, points: [[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]] },
367
- 'p': { width: 19, points: [[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]] },
368
- 'q': { width: 19, points: [[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] },
369
- 'r': { width: 13, points: [[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]] },
370
- 's': { width: 17, points: [[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]] },
371
- 't': { width: 12, points: [[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]] },
372
- 'u': { width: 19, points: [[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]] },
373
- 'v': { width: 16, points: [[2,14],[8,0],[-1,-1],[14,14],[8,0]] },
374
- 'w': { width: 22, points: [[3,14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]] },
375
- 'x': { width: 17, points: [[3,14],[14,0],[-1,-1],[14,14],[3,0]] },
376
- 'y': { width: 16, points: [[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]] },
377
- 'z': { width: 17, points: [[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]] },
378
- '{': { width: 14, points: [[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]] },
379
- '|': { width: 8, points: [[4,25],[4,-7]] },
380
- '}': { width: 14, points: [[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]] },
381
- '~': { width: 24, points: [[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]] }
382
- };
383
-
384
- $.jqplot.CanvasFontRenderer = function(options) {
385
- options = options || {};
386
- if (!options.pt2px) {
387
- options.pt2px = 1.5;
388
- }
389
- $.jqplot.CanvasTextRenderer.call(this, options);
390
- };
391
-
392
- $.jqplot.CanvasFontRenderer.prototype = new $.jqplot.CanvasTextRenderer({});
393
- $.jqplot.CanvasFontRenderer.prototype.constructor = $.jqplot.CanvasFontRenderer;
394
-
395
- $.jqplot.CanvasFontRenderer.prototype.measure = function(ctx, str)
396
- {
397
- // var fstyle = this.fontStyle+' '+this.fontVariant+' '+this.fontWeight+' '+this.fontSize+' '+this.fontFamily;
398
- var fstyle = this.fontSize+' '+this.fontFamily;
399
- ctx.save();
400
- ctx.font = fstyle;
401
- var w = ctx.measureText(str).width;
402
- ctx.restore();
403
- return w;
404
- };
405
-
406
- $.jqplot.CanvasFontRenderer.prototype.draw = function(ctx, str)
407
- {
408
- var x = 0;
409
- // leave room at bottom for descenders.
410
- var y = this.height*0.72;
411
- //var y = 12;
412
-
413
- ctx.save();
414
- var tx, ty;
415
-
416
- // 1st quadrant
417
- if ((-Math.PI/2 <= this.angle && this.angle <= 0) || (Math.PI*3/2 <= this.angle && this.angle <= Math.PI*2)) {
418
- tx = 0;
419
- ty = -Math.sin(this.angle) * this.width;
420
- }
421
- // 4th quadrant
422
- else if ((0 < this.angle && this.angle <= Math.PI/2) || (-Math.PI*2 <= this.angle && this.angle <= -Math.PI*3/2)) {
423
- tx = Math.sin(this.angle) * this.height;
424
- ty = 0;
425
- }
426
- // 2nd quadrant
427
- else if ((-Math.PI < this.angle && this.angle < -Math.PI/2) || (Math.PI <= this.angle && this.angle <= Math.PI*3/2)) {
428
- tx = -Math.cos(this.angle) * this.width;
429
- ty = -Math.sin(this.angle) * this.width - Math.cos(this.angle) * this.height;
430
- }
431
- // 3rd quadrant
432
- else if ((-Math.PI*3/2 < this.angle && this.angle < Math.PI) || (Math.PI/2 < this.angle && this.angle < Math.PI)) {
433
- tx = Math.sin(this.angle) * this.height - Math.cos(this.angle)*this.width;
434
- ty = -Math.cos(this.angle) * this.height;
435
- }
436
- ctx.strokeStyle = this.fillStyle;
437
- ctx.fillStyle = this.fillStyle;
438
- // var fstyle = this.fontStyle+' '+this.fontVariant+' '+this.fontWeight+' '+this.fontSize+' '+this.fontFamily;
439
- var fstyle = this.fontSize+' '+this.fontFamily;
440
- ctx.font = fstyle;
441
- ctx.translate(tx, ty);
442
- ctx.rotate(this.angle);
443
- ctx.fillText(str, x, y);
444
- // ctx.strokeText(str, x, y);
445
-
446
- ctx.restore();
447
- };
448
-
449
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/jqplot/plugins/jqplot.canvasTextRenderer.min.js DELETED
@@ -1,4 +0,0 @@
1
- /* jqplot 1.0.9 | (c) 2009-2016 Chris Leonello | jqplot.com
2
- jsDate | (c) 2010-2016 Chris Leonello
3
- */
4
- !function(a){a.jqplot.CanvasTextRenderer=function(b){this.fontStyle="normal",this.fontVariant="normal",this.fontWeight="normal",this.fontSize="10px",this.fontFamily="sans-serif",this.fontStretch=1,this.fillStyle="#666666",this.angle=0,this.textAlign="start",this.textBaseline="alphabetic",this.text,this.width,this.height,this.pt2px=1.28,a.extend(!0,this,b),this.normalizedFontSize=this.normalizeFontSize(this.fontSize),this.setHeight()},a.jqplot.CanvasTextRenderer.prototype.init=function(b){a.extend(!0,this,b),this.normalizedFontSize=this.normalizeFontSize(this.fontSize),this.setHeight()},a.jqplot.CanvasTextRenderer.prototype.normalizeFontSize=function(a){a=String(a);var b=parseFloat(a);return a.indexOf("px")>-1?b/this.pt2px:a.indexOf("pt")>-1?b:a.indexOf("em")>-1?12*b:a.indexOf("%")>-1?12*b/100:b/this.pt2px},a.jqplot.CanvasTextRenderer.prototype.fontWeight2Float=function(a){if(Number(a))return a/400;switch(a){case"normal":return 1;case"bold":return 1.75;case"bolder":return 2.25;case"lighter":return.75;default:return 1}},a.jqplot.CanvasTextRenderer.prototype.getText=function(){return this.text},a.jqplot.CanvasTextRenderer.prototype.setText=function(a,b){return this.text=a,this.setWidth(b),this},a.jqplot.CanvasTextRenderer.prototype.getWidth=function(a){return this.width},a.jqplot.CanvasTextRenderer.prototype.setWidth=function(a,b){return b?this.width=b:this.width=this.measure(a,this.text),this},a.jqplot.CanvasTextRenderer.prototype.getHeight=function(a){return this.height},a.jqplot.CanvasTextRenderer.prototype.setHeight=function(a){return a?this.height=a:this.height=this.normalizedFontSize*this.pt2px,this},a.jqplot.CanvasTextRenderer.prototype.letter=function(a){return this.letters[a]},a.jqplot.CanvasTextRenderer.prototype.ascent=function(){return this.normalizedFontSize},a.jqplot.CanvasTextRenderer.prototype.descent=function(){return 7*this.normalizedFontSize/25},a.jqplot.CanvasTextRenderer.prototype.measure=function(a,b){for(var c=0,d=b.length,e=0;e<d;e++){var f=this.letter(b.charAt(e));f&&(c+=f.width*this.normalizedFontSize/25*this.fontStretch)}return c},a.jqplot.CanvasTextRenderer.prototype.draw=function(a,b){var c=0,d=.72*this.height,e=0,f=b.length,g=this.normalizedFontSize/25;a.save();var h,i;-Math.PI/2<=this.angle&&this.angle<=0||3*Math.PI/2<=this.angle&&this.angle<=2*Math.PI?(h=0,i=-Math.sin(this.angle)*this.width):0<this.angle&&this.angle<=Math.PI/2||2*-Math.PI<=this.angle&&this.angle<=3*-Math.PI/2?(h=Math.sin(this.angle)*this.height,i=0):-Math.PI<this.angle&&this.angle<-Math.PI/2||Math.PI<=this.angle&&this.angle<=3*Math.PI/2?(h=-Math.cos(this.angle)*this.width,i=-Math.sin(this.angle)*this.width-Math.cos(this.angle)*this.height):(3*-Math.PI/2<this.angle&&this.angle<Math.PI||Math.PI/2<this.angle&&this.angle<Math.PI)&&(h=Math.sin(this.angle)*this.height-Math.cos(this.angle)*this.width,i=-Math.cos(this.angle)*this.height),a.strokeStyle=this.fillStyle,a.fillStyle=this.fillStyle,a.translate(h,i),a.rotate(this.angle),a.lineCap="round";var j=this.normalizedFontSize>30?2:2+(30-this.normalizedFontSize)/20;a.lineWidth=j*g*this.fontWeight2Float(this.fontWeight);for(var k=0;k<f;k++){var l=this.letter(b.charAt(k));if(l){a.beginPath();for(var m=1,n=0;n<l.points.length;n++){var o=l.points[n];o[0]!=-1||o[1]!=-1?m?(a.moveTo(c+o[0]*g*this.fontStretch,d-o[1]*g),m=!1):a.lineTo(c+o[0]*g*this.fontStretch,d-o[1]*g):m=1}a.stroke(),c+=l.width*g*this.fontStretch}}return a.restore(),e},a.jqplot.CanvasTextRenderer.prototype.letters={" ":{width:16,points:[]},"!":{width:10,points:[[5,21],[5,7],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},'"':{width:16,points:[[4,21],[4,14],[-1,-1],[12,21],[12,14]]},"#":{width:21,points:[[11,25],[4,-7],[-1,-1],[17,25],[10,-7],[-1,-1],[4,12],[18,12],[-1,-1],[3,6],[17,6]]},$:{width:20,points:[[8,25],[8,-4],[-1,-1],[12,25],[12,-4],[-1,-1],[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},"%":{width:24,points:[[21,21],[3,0],[-1,-1],[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],[10,20],[13,19],[16,19],[19,20],[21,21],[-1,-1],[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]]},"&":{width:26,points:[[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,0],[23,1],[23,2]]},"'":{width:10,points:[[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]]},"(":{width:14,points:[[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]]},")":{width:14,points:[[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]]},"*":{width:16,points:[[8,21],[8,9],[-1,-1],[3,18],[13,12],[-1,-1],[13,18],[3,12]]},"+":{width:26,points:[[13,18],[13,0],[-1,-1],[4,9],[22,9]]},",":{width:10,points:[[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"-":{width:18,points:[[6,9],[12,9]]},".":{width:10,points:[[5,2],[4,1],[5,0],[6,1],[5,2]]},"/":{width:22,points:[[20,25],[2,-7]]},0:{width:20,points:[[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]]},1:{width:20,points:[[6,17],[8,18],[11,21],[11,0]]},2:{width:20,points:[[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]]},3:{width:20,points:[[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},4:{width:20,points:[[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]]},5:{width:20,points:[[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},6:{width:20,points:[[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]]},7:{width:20,points:[[17,21],[7,0],[-1,-1],[3,21],[17,21]]},8:{width:20,points:[[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]]},9:{width:20,points:[[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]]},":":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},";":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"<":{width:24,points:[[20,18],[4,9],[20,0]]},"=":{width:26,points:[[4,12],[22,12],[-1,-1],[4,6],[22,6]]},">":{width:24,points:[[4,18],[20,9],[4,0]]},"?":{width:18,points:[[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]]},"@":{width:27,points:[[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]]},A:{width:18,points:[[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]]},B:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]]},C:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]]},D:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]]},E:{width:19,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11],[-1,-1],[4,0],[17,0]]},F:{width:18,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]]},G:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]]},H:{width:22,points:[[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]]},I:{width:8,points:[[4,21],[4,0]]},J:{width:16,points:[[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]]},K:{width:21,points:[[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]]},L:{width:17,points:[[4,21],[4,0],[-1,-1],[4,0],[16,0]]},M:{width:24,points:[[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]]},N:{width:22,points:[[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]]},O:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]]},P:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]]},Q:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]]},R:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]]},S:{width:20,points:[[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},T:{width:16,points:[[8,21],[8,0],[-1,-1],[1,21],[15,21]]},U:{width:22,points:[[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]]},V:{width:18,points:[[1,21],[9,0],[-1,-1],[17,21],[9,0]]},W:{width:24,points:[[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]]},X:{width:20,points:[[3,21],[17,0],[-1,-1],[17,21],[3,0]]},Y:{width:18,points:[[1,21],[9,11],[9,0],[-1,-1],[17,21],[9,11]]},Z:{width:20,points:[[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]]},"[":{width:14,points:[[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]]},"\\":{width:14,points:[[0,21],[14,-3]]},"]":{width:14,points:[[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]]},"^":{width:16,points:[[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]]},_:{width:16,points:[[0,-2],[16,-2]]},"`":{width:10,points:[[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]]},a:{width:19,points:[[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},b:{width:19,points:[[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},c:{width:18,points:[[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},d:{width:19,points:[[15,21],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},e:{width:18,points:[[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},f:{width:12,points:[[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]]},g:{width:19,points:[[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},h:{width:19,points:[[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},i:{width:8,points:[[3,21],[4,20],[5,21],[4,22],[3,21],[-1,-1],[4,14],[4,0]]},j:{width:10,points:[[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]]},k:{width:17,points:[[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]]},l:{width:8,points:[[4,21],[4,0]]},m:{width:30,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]]},n:{width:19,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},o:{width:19,points:[[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]]},p:{width:19,points:[[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},q:{width:19,points:[[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},r:{width:13,points:[[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]]},s:{width:17,points:[[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]]},t:{width:12,points:[[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]]},u:{width:19,points:[[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]]},v:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0]]},w:{width:22,points:[[3,14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]]},x:{width:17,points:[[3,14],[14,0],[-1,-1],[14,14],[3,0]]},y:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]]},z:{width:17,points:[[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]]},"{":{width:14,points:[[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]]},"|":{width:8,points:[[4,25],[4,-7]]},"}":{width:14,points:[[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]]},"~":{width:24,points:[[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]]}},a.jqplot.CanvasFontRenderer=function(b){b=b||{},b.pt2px||(b.pt2px=1.5),a.jqplot.CanvasTextRenderer.call(this,b)},a.jqplot.CanvasFontRenderer.prototype=new a.jqplot.CanvasTextRenderer({}),a.jqplot.CanvasFontRenderer.prototype.constructor=a.jqplot.CanvasFontRenderer,a.jqplot.CanvasFontRenderer.prototype.measure=function(a,b){var c=this.fontSize+" "+this.fontFamily;a.save(),a.font=c;var d=a.measureText(b).width;return a.restore(),d},a.jqplot.CanvasFontRenderer.prototype.draw=function(a,b){var c=0,d=.72*this.height;a.save();var e,f;-Math.PI/2<=this.angle&&this.angle<=0||3*Math.PI/2<=this.angle&&this.angle<=2*Math.PI?(e=0,f=-Math.sin(this.angle)*this.width):0<this.angle&&this.angle<=Math.PI/2||2*-Math.PI<=this.angle&&this.angle<=3*-Math.PI/2?(e=Math.sin(this.angle)*this.height,f=0):-Math.PI<this.angle&&this.angle<-Math.PI/2||Math.PI<=this.angle&&this.angle<=3*Math.PI/2?(e=-Math.cos(this.angle)*this.width,f=-Math.sin(this.angle)*this.width-Math.cos(this.angle)*this.height):(3*-Math.PI/2<this.angle&&this.angle<Math.PI||Math.PI/2<this.angle&&this.angle<Math.PI)&&(e=Math.sin(this.angle)*this.height-Math.cos(this.angle)*this.width,f=-Math.cos(this.angle)*this.height),a.strokeStyle=this.fillStyle,a.fillStyle=this.fillStyle;var g=this.fontSize+" "+this.fontFamily;a.font=g,a.translate(e,f),a.rotate(this.angle),a.fillText(b,c,d),a.restore()}}(jQuery);
 
 
 
 
assets/jqplot/plugins/jqplot.dateAxisRenderer.js DELETED
@@ -1,741 +0,0 @@
1
- /**
2
- * jqPlot
3
- * Pure JavaScript plotting plugin using jQuery
4
- *
5
- * Version: 1.0.9
6
- * Revision: c465c44
7
- *
8
- * Copyright (c) 2009-2016 Chris Leonello
9
- * jqPlot is currently available for use in all personal or commercial projects
10
- * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
11
- * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
12
- * choose the license that best suits your project and use it accordingly.
13
- *
14
- * Although not required, the author would appreciate an email letting him
15
- * know of any substantial use of jqPlot. You can reach the author at:
16
- * chris at jqplot dot com or see http://www.jqplot.com/info.php .
17
- *
18
- * If you are feeling kind and generous, consider supporting the project by
19
- * making a donation at: http://www.jqplot.com/donate.php .
20
- *
21
- * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
22
- *
23
- * version 2007.04.27
24
- * author Ash Searle
25
- * http://hexmen.com/blog/2007/03/printf-sprintf/
26
- * http://hexmen.com/js/sprintf.js
27
- * The author (Ash Searle) has placed this code in the public domain:
28
- * "This code is unrestricted: you are free to use it however you like."
29
- *
30
- */
31
- (function($) {
32
- /**
33
- * Class: $.jqplot.DateAxisRenderer
34
- * A plugin for a jqPlot to render an axis as a series of date values.
35
- * This renderer has no options beyond those supplied by the <Axis> class.
36
- * It supplies its own tick formatter, so the tickOptions.formatter option
37
- * should not be overridden.
38
- *
39
- * Thanks to Ken Synder for his enhanced Date instance methods which are
40
- * included with this code <http://kendsnyder.com/sandbox/date/>.
41
- *
42
- * To use this renderer, include the plugin in your source
43
- * > <script type="text/javascript" language="javascript" src="plugins/jqplot.dateAxisRenderer.js"></script>
44
- *
45
- * and supply the appropriate options to your plot
46
- *
47
- * > {axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}}}
48
- *
49
- * Dates can be passed into the axis in almost any recognizable value and
50
- * will be parsed. They will be rendered on the axis in the format
51
- * specified by tickOptions.formatString. e.g. tickOptions.formatString = '%Y-%m-%d'.
52
- *
53
- * Accecptable format codes
54
- * are:
55
- *
56
- * > Code Result Description
57
- * > == Years ==
58
- * > %Y 2008 Four-digit year
59
- * > %y 08 Two-digit year
60
- * > == Months ==
61
- * > %m 09 Two-digit month
62
- * > %#m 9 One or two-digit month
63
- * > %B September Full month name
64
- * > %b Sep Abbreviated month name
65
- * > == Days ==
66
- * > %d 05 Two-digit day of month
67
- * > %#d 5 One or two-digit day of month
68
- * > %e 5 One or two-digit day of month
69
- * > %A Sunday Full name of the day of the week
70
- * > %a Sun Abbreviated name of the day of the week
71
- * > %w 0 Number of the day of the week (0 = Sunday, 6 = Saturday)
72
- * > %o th The ordinal suffix string following the day of the month
73
- * > == Hours ==
74
- * > %H 23 Hours in 24-hour format (two digits)
75
- * > %#H 3 Hours in 24-hour integer format (one or two digits)
76
- * > %I 11 Hours in 12-hour format (two digits)
77
- * > %#I 3 Hours in 12-hour integer format (one or two digits)
78
- * > %p PM AM or PM
79
- * > == Minutes ==
80
- * > %M 09 Minutes (two digits)
81
- * > %#M 9 Minutes (one or two digits)
82
- * > == Seconds ==
83
- * > %S 02 Seconds (two digits)
84
- * > %#S 2 Seconds (one or two digits)
85
- * > %s 1206567625723 Unix timestamp (Seconds past 1970-01-01 00:00:00)
86
- * > == Milliseconds ==
87
- * > %N 008 Milliseconds (three digits)
88
- * > %#N 8 Milliseconds (one to three digits)
89
- * > == Timezone ==
90
- * > %O 360 difference in minutes between local time and GMT
91
- * > %Z Mountain Standard Time Name of timezone as reported by browser
92
- * > %G -06:00 Hours and minutes between GMT
93
- * > == Shortcuts ==
94
- * > %F 2008-03-26 %Y-%m-%d
95
- * > %T 05:06:30 %H:%M:%S
96
- * > %X 05:06:30 %H:%M:%S
97
- * > %x 03/26/08 %m/%d/%y
98
- * > %D 03/26/08 %m/%d/%y
99
- * > %#c Wed Mar 26 15:31:00 2008 %a %b %e %H:%M:%S %Y
100
- * > %v 3-Sep-2008 %e-%b-%Y
101
- * > %R 15:31 %H:%M
102
- * > %r 3:31:00 PM %I:%M:%S %p
103
- * > == Characters ==
104
- * > %n \n Newline
105
- * > %t \t Tab
106
- * > %% % Percent Symbol
107
- */
108
- $.jqplot.DateAxisRenderer = function() {
109
- $.jqplot.LinearAxisRenderer.call(this);
110
- this.date = new $.jsDate();
111
- };
112
-
113
- var second = 1000;
114
- var minute = 60 * second;
115
- var hour = 60 * minute;
116
- var day = 24 * hour;
117
- var week = 7 * day;
118
-
119
- // these are less definitive
120
- var month = 30.4368499 * day;
121
- var year = 365.242199 * day;
122
-
123
- var daysInMonths = [31,28,31,30,31,30,31,30,31,30,31,30];
124
- // array of consistent nice intervals. Longer intervals
125
- // will depend on days in month, days in year, etc.
126
- var niceFormatStrings = ['%M:%S.%#N', '%M:%S.%#N', '%M:%S.%#N', '%M:%S', '%M:%S', '%M:%S', '%M:%S', '%H:%M:%S', '%H:%M:%S', '%H:%M', '%H:%M', '%H:%M', '%H:%M', '%H:%M', '%H:%M', '%a %H:%M', '%a %H:%M', '%b %e %H:%M', '%b %e %H:%M', '%b %e %H:%M', '%b %e %H:%M', '%v', '%v', '%v', '%v', '%v', '%v', '%v'];
127
- var niceIntervals = [0.1*second, 0.2*second, 0.5*second, second, 2*second, 5*second, 10*second, 15*second, 30*second, minute, 2*minute, 5*minute, 10*minute, 15*minute, 30*minute, hour, 2*hour, 4*hour, 6*hour, 8*hour, 12*hour, day, 2*day, 3*day, 4*day, 5*day, week, 2*week];
128
-
129
- var niceMonthlyIntervals = [];
130
-
131
- function bestDateInterval(min, max, titarget) {
132
- // iterate through niceIntervals to find one closest to titarget
133
- var badness = Number.MAX_VALUE;
134
- var temp, bestTi, bestfmt;
135
- for (var i=0, l=niceIntervals.length; i < l; i++) {
136
- temp = Math.abs(titarget - niceIntervals[i]);
137
- if (temp < badness) {
138
- badness = temp;
139
- bestTi = niceIntervals[i];
140
- bestfmt = niceFormatStrings[i];
141
- }
142
- }
143
-
144
- return [bestTi, bestfmt];
145
- }
146
-
147
- $.jqplot.DateAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
148
- $.jqplot.DateAxisRenderer.prototype.constructor = $.jqplot.DateAxisRenderer;
149
-
150
- $.jqplot.DateTickFormatter = function(format, val) {
151
- if (!format) {
152
- format = '%Y/%m/%d';
153
- }
154
- return $.jsDate.strftime(val, format);
155
- };
156
-
157
- $.jqplot.DateAxisRenderer.prototype.init = function(options){
158
- // prop: tickRenderer
159
- // A class of a rendering engine for creating the ticks labels displayed on the plot,
160
- // See <$.jqplot.AxisTickRenderer>.
161
- // this.tickRenderer = $.jqplot.AxisTickRenderer;
162
- // this.labelRenderer = $.jqplot.AxisLabelRenderer;
163
- this.tickOptions.formatter = $.jqplot.DateTickFormatter;
164
- // prop: tickInset
165
- // Controls the amount to inset the first and last ticks from
166
- // the edges of the grid, in multiples of the tick interval.
167
- // 0 is no inset, 0.5 is one half a tick interval, 1 is a full
168
- // tick interval, etc.
169
- this.tickInset = 0;
170
- // prop: drawBaseline
171
- // True to draw the axis baseline.
172
- this.drawBaseline = true;
173
- // prop: baselineWidth
174
- // width of the baseline in pixels.
175
- this.baselineWidth = null;
176
- // prop: baselineColor
177
- // CSS color spec for the baseline.
178
- this.baselineColor = null;
179
- this.daTickInterval = null;
180
- this._daTickInterval = null;
181
-
182
- $.extend(true, this, options);
183
-
184
- var db = this._dataBounds,
185
- stats,
186
- sum,
187
- s,
188
- d,
189
- pd,
190
- sd,
191
- intv;
192
-
193
- // Go through all the series attached to this axis and find
194
- // the min/max bounds for this axis.
195
- for (var i=0; i<this._series.length; i++) {
196
- stats = {intervals:[], frequencies:{}, sortedIntervals:[], min:null, max:null, mean:null};
197
- sum = 0;
198
- s = this._series[i];
199
- d = s.data;
200
- pd = s._plotData;
201
- sd = s._stackData;
202
- intv = 0;
203
-
204
- for (var j=0; j<d.length; j++) {
205
- if (this.name == 'xaxis' || this.name == 'x2axis') {
206
- d[j][0] = new $.jsDate(d[j][0]).getTime();
207
- pd[j][0] = new $.jsDate(pd[j][0]).getTime();
208
- sd[j][0] = new $.jsDate(sd[j][0]).getTime();
209
- if ((d[j][0] != null && d[j][0] < db.min) || db.min == null) {
210
- db.min = d[j][0];
211
- }
212
- if ((d[j][0] != null && d[j][0] > db.max) || db.max == null) {
213
- db.max = d[j][0];
214
- }
215
- if (j>0) {
216
- intv = Math.abs(d[j][0] - d[j-1][0]);
217
- stats.intervals.push(intv);
218
- if (stats.frequencies.hasOwnProperty(intv)) {
219
- stats.frequencies[intv] += 1;
220
- }
221
- else {
222
- stats.frequencies[intv] = 1;
223
- }
224
- }
225
- sum += intv;
226
-
227
- }
228
- else {
229
- d[j][1] = new $.jsDate(d[j][1]).getTime();
230
- pd[j][1] = new $.jsDate(pd[j][1]).getTime();
231
- sd[j][1] = new $.jsDate(sd[j][1]).getTime();
232
- if ((d[j][1] != null && d[j][1] < db.min) || db.min == null) {
233
- db.min = d[j][1];
234
- }
235
- if ((d[j][1] != null && d[j][1] > db.max) || db.max == null) {
236
- db.max = d[j][1];
237
- }
238
- if (j>0) {
239
- intv = Math.abs(d[j][1] - d[j-1][1]);
240
- stats.intervals.push(intv);
241
- if (stats.frequencies.hasOwnProperty(intv)) {
242
- stats.frequencies[intv] += 1;
243
- }
244
- else {
245
- stats.frequencies[intv] = 1;
246
- }
247
- }
248
- }
249
- sum += intv;
250
- }
251
-
252
- if (s.renderer.bands) {
253
- if (s.renderer.bands.hiData.length) {
254
- var bd = s.renderer.bands.hiData;
255
- for (var j=0, l=bd.length; j < l; j++) {
256
- if (this.name === 'xaxis' || this.name === 'x2axis') {
257
- bd[j][0] = new $.jsDate(bd[j][0]).getTime();
258
- if ((bd[j][0] != null && bd[j][0] > db.max) || db.max == null) {
259
- db.max = bd[j][0];
260
- }
261
- }
262
- else {
263
- bd[j][1] = new $.jsDate(bd[j][1]).getTime();
264
- if ((bd[j][1] != null && bd[j][1] > db.max) || db.max == null) {
265
- db.max = bd[j][1];
266
- }
267
- }
268
- }
269
- }
270
- if (s.renderer.bands.lowData.length) {
271
- var bd = s.renderer.bands.lowData;
272
- for (var j=0, l=bd.length; j < l; j++) {
273
- if (this.name === 'xaxis' || this.name === 'x2axis') {
274
- bd[j][0] = new $.jsDate(bd[j][0]).getTime();
275
- if ((bd[j][0] != null && bd[j][0] < db.min) || db.min == null) {
276
- db.min = bd[j][0];
277
- }
278
- }
279
- else {
280
- bd[j][1] = new $.jsDate(bd[j][1]).getTime();
281
- if ((bd[j][1] != null && bd[j][1] < db.min) || db.min == null) {
282
- db.min = bd[j][1];
283
- }
284
- }
285
- }
286
- }
287
- }
288
-
289
- var tempf = 0,
290
- tempn=0;
291
- for (var n in stats.frequencies) {
292
- stats.sortedIntervals.push({interval:n, frequency:stats.frequencies[n]});
293
- }
294
- stats.sortedIntervals.sort(function(a, b){
295
- return b.frequency - a.frequency;
296
- });
297
-
298
- stats.min = $.jqplot.arrayMin(stats.intervals);
299
- stats.max = $.jqplot.arrayMax(stats.intervals);
300
- stats.mean = sum/d.length;
301
- this._intervalStats.push(stats);
302
- stats = sum = s = d = pd = sd = null;
303
- }
304
- db = null;
305
-
306
- };
307
-
308
- // called with scope of an axis
309
- $.jqplot.DateAxisRenderer.prototype.reset = function() {
310
- this.min = this._options.min;
311
- this.max = this._options.max;
312
- this.tickInterval = this._options.tickInterval;
313
- this.numberTicks = this._options.numberTicks;
314
- this._autoFormatString = '';
315
- if (this._overrideFormatString && this.tickOptions && this.tickOptions.formatString) {
316
- this.tickOptions.formatString = '';
317
- }
318
- this.daTickInterval = this._daTickInterval;
319
- // this._ticks = this.__ticks;
320
- };
321
-
322
- $.jqplot.DateAxisRenderer.prototype.createTicks = function(plot) {
323
- // we're are operating on an axis here
324
- var ticks = this._ticks;
325
- var userTicks = this.ticks;
326
- var name = this.name;
327
- // databounds were set on axis initialization.
328
- var db = this._dataBounds;
329
- var iv = this._intervalStats;
330
- var dim = (this.name.charAt(0) === 'x') ? this._plotDimensions.width : this._plotDimensions.height;
331
- var interval;
332
- var min, max;
333
- var pos1, pos2;
334
- var tt, i;
335
- var threshold = 30;
336
- var insetMult = 1;
337
- var daTickInterval = null;
338
-
339
- // if user specified a tick interval, convert to usable.
340
- if (this.tickInterval != null)
341
- {
342
- // if interval is a number or can be converted to one, use it.
343
- // Assume it is in SECONDS!!!
344
- if (Number(this.tickInterval)) {
345
- daTickInterval = [Number(this.tickInterval), 'seconds'];
346
- }
347
- // else, parse out something we can build from.
348
- else if (typeof this.tickInterval == "string") {
349
- var parts = this.tickInterval.split(' ');
350
- if (parts.length == 1) {
351
- daTickInterval = [1, parts[0]];
352
- }
353
- else if (parts.length == 2) {
354
- daTickInterval = [parts[0], parts[1]];
355
- }
356
- }
357
- }
358
-
359
- var tickInterval = this.tickInterval;
360
-
361
- // if we already have ticks, use them.
362
- // ticks must be in order of increasing value.
363
-
364
- min = new $.jsDate((this.min != null) ? this.min : db.min).getTime();
365
- max = new $.jsDate((this.max != null) ? this.max : db.max).getTime();
366
-
367
- // see if we're zooming. if we are, don't use the min and max we're given,
368
- // but compute some nice ones. They will be reset later.
369
-
370
- var cursor = plot.plugins.cursor;
371
-
372
- if (cursor && cursor._zoom && cursor._zoom.zooming) {
373
- this.min = null;
374
- this.max = null;
375
- }
376
-
377
- var range = max - min;
378
-
379
- if (this.tickOptions == null || !this.tickOptions.formatString) {
380
- this._overrideFormatString = true;
381
- }
382
-
383
- if (userTicks.length) {
384
- // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
385
- for (i=0; i<userTicks.length; i++){
386
- var ut = userTicks[i];
387
- var t = new this.tickRenderer(this.tickOptions);
388
- if (ut.constructor == Array) {
389
- t.value = new $.jsDate(ut[0]).getTime();
390
- t.label = ut[1];
391
- if (!this.showTicks) {
392
- t.showLabel = false;
393
- t.showMark = false;
394
- }
395
- else if (!this.showTickMarks) {
396
- t.showMark = false;
397
- }
398
- t.setTick(t.value, this.name);
399
- this._ticks.push(t);
400
- }
401
-
402
- else {
403
- t.value = new $.jsDate(ut).getTime();
404
- if (!this.showTicks) {
405
- t.showLabel = false;
406
- t.showMark = false;
407
- }
408
- else if (!this.showTickMarks) {
409
- t.showMark = false;
410
- }
411
- t.setTick(t.value, this.name);
412
- this._ticks.push(t);
413
- }
414
- }
415
- this.numberTicks = userTicks.length;
416
- this.min = this._ticks[0].value;
417
- this.max = this._ticks[this.numberTicks-1].value;
418
- this.daTickInterval = [(this.max - this.min) / (this.numberTicks - 1)/1000, 'seconds'];
419
- }
420
-
421
- ////////
422
- // We don't have any ticks yet, let's make some!
423
- ////////
424
-
425
- // special case when there is only one point, make three tick marks to center the point
426
- else if (this.min == null && this.max == null && db.min == db.max)
427
- {
428
- var onePointOpts = $.extend(true, {}, this.tickOptions, {name: this.name, value: null});
429
- var delta = 300000;
430
- this.min = db.min - delta;
431
- this.max = db.max + delta;
432
- this.numberTicks = 3;
433
-
434
- for(var i=this.min;i<=this.max;i+= delta)
435
- {
436
- onePointOpts.value = i;
437
-
438
- var t = new this.tickRenderer(onePointOpts);
439
-
440
- if (this._overrideFormatString && this._autoFormatString != '') {
441
- t.formatString = this._autoFormatString;
442
- }
443
-
444
- t.showLabel = false;
445
- t.showMark = false;
446
-
447
- this._ticks.push(t);
448
- }
449
-
450
- if(this.showTicks) {
451
- this._ticks[1].showLabel = true;
452
- }
453
- if(this.showTickMarks) {
454
- this._ticks[1].showTickMarks = true;
455
- }
456
- }
457
- // if user specified min and max are null, we set those to make best ticks.
458
- else if (this.min == null && this.max == null) {
459
-
460
- var opts = $.extend(true, {}, this.tickOptions, {name: this.name, value: null});
461
-
462
- // want to find a nice interval
463
- var nttarget,
464
- titarget;
465
-
466
- // if no tickInterval or numberTicks options specified, make a good guess.
467
- if (!this.tickInterval && !this.numberTicks) {
468
- var tdim = Math.max(dim, threshold+1);
469
- // how many ticks to put on the axis?
470
- // date labels tend to be long. If ticks not rotated,
471
- // don't use too many and have a high spacing factor.
472
- // If we are rotating ticks, use a lower factor.
473
- var spacingFactor = 115;
474
- if (this.tickRenderer === $.jqplot.CanvasAxisTickRenderer && this.tickOptions.angle) {
475
- spacingFactor = 115 - 40 * Math.abs(Math.sin(this.tickOptions.angle/180*Math.PI));
476
- }
477
-
478
- nttarget = Math.ceil((tdim-threshold)/spacingFactor + 1);
479
- titarget = (max - min) / (nttarget - 1);
480
- }
481
-
482
- // If tickInterval is specified, we'll try to honor it.
483
- // Not guaranteed to get this interval, but we'll get as close as
484
- // we can.
485
- // tickInterval will be used before numberTicks, that is if
486
- // both are specified, numberTicks will be ignored.
487
- else if (this.tickInterval) {
488
- titarget = new $.jsDate(0).add(daTickInterval[0], daTickInterval[1]).getTime();
489
- }
490
-
491
- // if numberTicks specified, try to honor it.
492
- // Not guaranteed, but will try to get close.
493
- else if (this.numberTicks) {
494
- nttarget = this.numberTicks;
495
- titarget = (max - min) / (nttarget - 1);
496
- }
497
-
498
- // If we can use an interval of 2 weeks or less, pick best one
499
- if (titarget <= 19*day) {
500
- var ret = bestDateInterval(min, max, titarget);
501
- var tempti = ret[0];
502
- this._autoFormatString = ret[1];
503
-
504
- min = new $.jsDate(min);
505
- min = Math.floor((min.getTime() - min.getUtcOffset())/tempti) * tempti + min.getUtcOffset();
506
-
507
- nttarget = Math.ceil((max - min) / tempti) + 1;
508
- this.min = min;
509
- this.max = min + (nttarget - 1) * tempti;
510
-
511
- // if max is less than max, add an interval
512
- if (this.max < max) {
513
- this.max += tempti;
514
- nttarget += 1;
515
- }
516
- this.tickInterval = tempti;
517
- this.numberTicks = nttarget;
518
-
519
- for (var i=0; i<nttarget; i++) {
520
- opts.value = this.min + i * tempti;
521
- t = new this.tickRenderer(opts);
522
-
523
- if (this._overrideFormatString && this._autoFormatString != '') {
524
- t.formatString = this._autoFormatString;
525
- }
526
- if (!this.showTicks) {
527
- t.showLabel = false;
528
- t.showMark = false;
529
- }
530
- else if (!this.showTickMarks) {
531
- t.showMark = false;
532
- }
533
- this._ticks.push(t);
534
- }
535
-
536
- insetMult = this.tickInterval;
537
- }
538
-
539
- // should we use a monthly interval?
540
- else if (titarget <= 9 * month) {
541
-
542
- this._autoFormatString = '%v';
543
-
544
- // how many months in an interval?
545
- var intv = Math.round(titarget/month);
546
- if (intv < 1) {
547
- intv = 1;
548
- }
549
- else if (intv > 6) {
550
- intv = 6;
551
- }
552
-
553
- // figure out the starting month and ending month.
554
- var mstart = new $.jsDate(min).setDate(1).setHours(0,0,0,0);
555
-
556
- // See if max ends exactly on a month
557
- var tempmend = new $.jsDate(max);
558
- var mend = new $.jsDate(max).setDate(1).setHours(0,0,0,0);
559
-
560
- if (tempmend.getTime() !== mend.getTime()) {
561
- mend = mend.add(1, 'month');
562
- }
563
-
564
- var nmonths = mend.diff(mstart, 'month');
565
-
566
- nttarget = Math.ceil(nmonths/intv) + 1;
567
-
568
- this.min = mstart.getTime();
569
- this.max = mstart.clone().add((nttarget - 1) * intv, 'month').getTime();
570
- this.numberTicks = nttarget;
571
-
572
- for (var i=0; i<nttarget; i++) {
573
- if (i === 0) {
574
- opts.value = mstart.getTime();
575
- }
576
- else {
577
- opts.value = mstart.add(intv, 'month').getTime();
578
- }
579
- t = new this.tickRenderer(opts);
580
-
581
- if (this._overrideFormatString && this._autoFormatString != '') {
582
- t.formatString = this._autoFormatString;
583
- }
584
- if (!this.showTicks) {
585
- t.showLabel = false;
586
- t.showMark = false;
587
- }
588
- else if (!this.showTickMarks) {
589
- t.showMark = false;
590
- }
591
- this._ticks.push(t);
592
- }
593
-
594
- insetMult = intv * month;
595
- }
596
-
597
- // use yearly intervals
598
- else {
599
-
600
- this._autoFormatString = '%v';
601
-
602
- // how many years in an interval?
603
- var intv = Math.round(titarget/year);
604
- if (intv < 1) {
605
- intv = 1;
606
- }
607
-
608
- // figure out the starting and ending years.
609
- var mstart = new $.jsDate(min).setMonth(0, 1).setHours(0,0,0,0);
610
- var mend = new $.jsDate(max).add(1, 'year').setMonth(0, 1).setHours(0,0,0,0);
611
-
612
- var nyears = mend.diff(mstart, 'year');
613
-
614
- nttarget = Math.ceil(nyears/intv) + 1;
615
-
616
- this.min = mstart.getTime();
617
- this.max = mstart.clone().add((nttarget - 1) * intv, 'year').getTime();
618
- this.numberTicks = nttarget;
619
-
620
- for (var i=0; i<nttarget; i++) {
621
- if (i === 0) {
622
- opts.value = mstart.getTime();
623
- }
624
- else {
625
- opts.value = mstart.add(intv, 'year').getTime();
626
- }
627
- t = new this.tickRenderer(opts);
628
-
629
- if (this._overrideFormatString && this._autoFormatString != '') {
630
- t.formatString = this._autoFormatString;
631
- }
632
- if (!this.showTicks) {
633
- t.showLabel = false;
634
- t.showMark = false;
635
- }
636
- else if (!this.showTickMarks) {
637
- t.showMark = false;
638
- }
639
- this._ticks.push(t);
640
- }
641
-
642
- insetMult = intv * year;
643
- }
644
- }
645
-
646
- ////////
647
- // Some option(s) specified, work around that.
648
- ////////
649
-
650
- else {
651
- if (name == 'xaxis' || name == 'x2axis') {
652
- dim = this._plotDimensions.width;
653
- }
654
- else {
655
- dim = this._plotDimensions.height;
656
- }
657
-
658
- // if min, max and number of ticks specified, user can't specify interval.
659
- if (this.min != null && this.max != null && this.numberTicks != null) {
660
- this.tickInterval = null;
661
- }
662
-
663
- if (this.tickInterval != null && daTickInterval != null) {
664
- this.daTickInterval = daTickInterval;
665
- }
666
-
667
- // if min and max are same, space them out a bit
668
- if (min == max) {
669
- var adj = 24*60*60*500; // 1/2 day
670
- min -= adj;
671
- max += adj;
672
- }
673
-
674
- range = max - min;
675
-
676
- var optNumTicks = 2 + parseInt(Math.max(0, dim-100)/100, 10);
677
-
678
-
679
- var rmin, rmax;
680
-
681
- rmin = (this.min != null) ? new $.jsDate(this.min).getTime() : min - range/2*(this.padMin - 1);
682
- rmax = (this.max != null) ? new $.jsDate(this.max).getTime() : max + range/2*(this.padMax - 1);
683
- this.min = rmin;
684
- this.max = rmax;
685
- range = this.max - this.min;
686
-
687
- if (this.numberTicks == null){
688
- // if tickInterval is specified by user, we will ignore computed maximum.
689
- // max will be equal or greater to fit even # of ticks.
690
- if (this.daTickInterval != null) {
691
- var nc = new $.jsDate(this.max).diff(this.min, this.daTickInterval[1], true);
692
- this.numberTicks = Math.ceil(nc/this.daTickInterval[0]) +1;
693
- // this.max = new $.jsDate(this.min).add(this.numberTicks-1, this.daTickInterval[1]).getTime();
694
- this.max = new $.jsDate(this.min).add((this.numberTicks-1) * this.daTickInterval[0], this.daTickInterval[1]).getTime();
695
- }
696
- else if (dim > 200) {
697
- this.numberTicks = parseInt(3+(dim-200)/100, 10);
698
- }
699
- else {
700
- this.numberTicks = 2;
701
- }
702
- }
703
-
704
- insetMult = range / (this.numberTicks-1)/1000;
705
-
706
- if (this.daTickInterval == null) {
707
- this.daTickInterval = [insetMult, 'seconds'];
708
- }
709
-
710
-
711
- for (var i=0; i<this.numberTicks; i++){
712
- var min = new $.jsDate(this.min);
713
- tt = min.add(i*this.daTickInterval[0], this.daTickInterval[1]).getTime();
714
- var t = new this.tickRenderer(this.tickOptions);
715
- // var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
716
- if (!this.showTicks) {
717
- t.showLabel = false;
718
- t.showMark = false;
719
- }
720
- else if (!this.showTickMarks) {
721
- t.showMark = false;
722
- }
723
- t.setTick(tt, this.name);
724
- this._ticks.push(t);
725
- }
726
- }
727
-
728
- if (this.tickInset) {
729
- this.min = this.min - this.tickInset * insetMult;
730
- this.max = this.max + this.tickInset * insetMult;
731
- }
732
-
733
- if (this._daTickInterval == null) {
734
- this._daTickInterval = this.daTickInterval;
735
- }
736
-
737
- ticks = null;
738
- };
739
-
740
- })(jQuery);
741
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/jqplot/plugins/jqplot.dateAxisRenderer.min.js DELETED
@@ -1,4 +0,0 @@
1
- /* jqplot 1.0.9 | (c) 2009-2016 Chris Leonello | jqplot.com
2
- jsDate | (c) 2010-2016 Chris Leonello
3
- */
4
- !function(a){function b(a,b,c){for(var d,e,f,g=Number.MAX_VALUE,h=0,i=k.length;h<i;h++)d=Math.abs(c-k[h]),d<g&&(g=d,e=k[h],f=j[h]);return[e,f]}a.jqplot.DateAxisRenderer=function(){a.jqplot.LinearAxisRenderer.call(this),this.date=new a.jsDate};var c=1e3,d=60*c,e=60*d,f=24*e,g=7*f,h=30.4368499*f,i=365.242199*f,j=["%M:%S.%#N","%M:%S.%#N","%M:%S.%#N","%M:%S","%M:%S","%M:%S","%M:%S","%H:%M:%S","%H:%M:%S","%H:%M","%H:%M","%H:%M","%H:%M","%H:%M","%H:%M","%a %H:%M","%a %H:%M","%b %e %H:%M","%b %e %H:%M","%b %e %H:%M","%b %e %H:%M","%v","%v","%v","%v","%v","%v","%v"],k=[.1*c,.2*c,.5*c,c,2*c,5*c,10*c,15*c,30*c,d,2*d,5*d,10*d,15*d,30*d,e,2*e,4*e,6*e,8*e,12*e,f,2*f,3*f,4*f,5*f,g,2*g];a.jqplot.DateAxisRenderer.prototype=new a.jqplot.LinearAxisRenderer,a.jqplot.DateAxisRenderer.prototype.constructor=a.jqplot.DateAxisRenderer,a.jqplot.DateTickFormatter=function(b,c){return b||(b="%Y/%m/%d"),a.jsDate.strftime(c,b)},a.jqplot.DateAxisRenderer.prototype.init=function(b){this.tickOptions.formatter=a.jqplot.DateTickFormatter,this.tickInset=0,this.drawBaseline=!0,this.baselineWidth=null,this.baselineColor=null,this.daTickInterval=null,this._daTickInterval=null,a.extend(!0,this,b);for(var c,d,e,f,g,h,i,j=this._dataBounds,k=0;k<this._series.length;k++){c={intervals:[],frequencies:{},sortedIntervals:[],min:null,max:null,mean:null},d=0,e=this._series[k],f=e.data,g=e._plotData,h=e._stackData,i=0;for(var l=0;l<f.length;l++)"xaxis"==this.name||"x2axis"==this.name?(f[l][0]=new a.jsDate(f[l][0]).getTime(),g[l][0]=new a.jsDate(g[l][0]).getTime(),h[l][0]=new a.jsDate(h[l][0]).getTime(),(null!=f[l][0]&&f[l][0]<j.min||null==j.min)&&(j.min=f[l][0]),(null!=f[l][0]&&f[l][0]>j.max||null==j.max)&&(j.max=f[l][0]),l>0&&(i=Math.abs(f[l][0]-f[l-1][0]),c.intervals.push(i),c.frequencies.hasOwnProperty(i)?c.frequencies[i]+=1:c.frequencies[i]=1),d+=i):(f[l][1]=new a.jsDate(f[l][1]).getTime(),g[l][1]=new a.jsDate(g[l][1]).getTime(),h[l][1]=new a.jsDate(h[l][1]).getTime(),(null!=f[l][1]&&f[l][1]<j.min||null==j.min)&&(j.min=f[l][1]),(null!=f[l][1]&&f[l][1]>j.max||null==j.max)&&(j.max=f[l][1]),l>0&&(i=Math.abs(f[l][1]-f[l-1][1]),c.intervals.push(i),c.frequencies.hasOwnProperty(i)?c.frequencies[i]+=1:c.frequencies[i]=1)),d+=i;if(e.renderer.bands){if(e.renderer.bands.hiData.length)for(var m=e.renderer.bands.hiData,l=0,n=m.length;l<n;l++)"xaxis"===this.name||"x2axis"===this.name?(m[l][0]=new a.jsDate(m[l][0]).getTime(),(null!=m[l][0]&&m[l][0]>j.max||null==j.max)&&(j.max=m[l][0])):(m[l][1]=new a.jsDate(m[l][1]).getTime(),(null!=m[l][1]&&m[l][1]>j.max||null==j.max)&&(j.max=m[l][1]));if(e.renderer.bands.lowData.length)for(var m=e.renderer.bands.lowData,l=0,n=m.length;l<n;l++)"xaxis"===this.name||"x2axis"===this.name?(m[l][0]=new a.jsDate(m[l][0]).getTime(),(null!=m[l][0]&&m[l][0]<j.min||null==j.min)&&(j.min=m[l][0])):(m[l][1]=new a.jsDate(m[l][1]).getTime(),(null!=m[l][1]&&m[l][1]<j.min||null==j.min)&&(j.min=m[l][1]))}for(var o in c.frequencies)c.sortedIntervals.push({interval:o,frequency:c.frequencies[o]});c.sortedIntervals.sort(function(a,b){return b.frequency-a.frequency}),c.min=a.jqplot.arrayMin(c.intervals),c.max=a.jqplot.arrayMax(c.intervals),c.mean=d/f.length,this._intervalStats.push(c),c=d=e=f=g=h=null}j=null},a.jqplot.DateAxisRenderer.prototype.reset=function(){this.min=this._options.min,this.max=this._options.max,this.tickInterval=this._options.tickInterval,this.numberTicks=this._options.numberTicks,this._autoFormatString="",this._overrideFormatString&&this.tickOptions&&this.tickOptions.formatString&&(this.tickOptions.formatString=""),this.daTickInterval=this._daTickInterval},a.jqplot.DateAxisRenderer.prototype.createTicks=function(c){var d,e,g,j,k=this._ticks,l=this.ticks,m=this.name,n=this._dataBounds,o=(this._intervalStats,"x"===this.name.charAt(0)?this._plotDimensions.width:this._plotDimensions.height),p=30,q=1,r=null;if(null!=this.tickInterval)if(Number(this.tickInterval))r=[Number(this.tickInterval),"seconds"];else if("string"==typeof this.tickInterval){var s=this.tickInterval.split(" ");1==s.length?r=[1,s[0]]:2==s.length&&(r=[s[0],s[1]])}this.tickInterval;d=new a.jsDate(null!=this.min?this.min:n.min).getTime(),e=new a.jsDate(null!=this.max?this.max:n.max).getTime();var t=c.plugins.cursor;t&&t._zoom&&t._zoom.zooming&&(this.min=null,this.max=null);var u=e-d;if(null!=this.tickOptions&&this.tickOptions.formatString||(this._overrideFormatString=!0),l.length){for(j=0;j<l.length;j++){var v=l[j],w=new this.tickRenderer(this.tickOptions);v.constructor==Array?(w.value=new a.jsDate(v[0]).getTime(),w.label=v[1],this.showTicks?this.showTickMarks||(w.showMark=!1):(w.showLabel=!1,w.showMark=!1),w.setTick(w.value,this.name),this._ticks.push(w)):(w.value=new a.jsDate(v).getTime(),this.showTicks?this.showTickMarks||(w.showMark=!1):(w.showLabel=!1,w.showMark=!1),w.setTick(w.value,this.name),this._ticks.push(w))}this.numberTicks=l.length,this.min=this._ticks[0].value,this.max=this._ticks[this.numberTicks-1].value,this.daTickInterval=[(this.max-this.min)/(this.numberTicks-1)/1e3,"seconds"]}else if(null==this.min&&null==this.max&&n.min==n.max){var x=a.extend(!0,{},this.tickOptions,{name:this.name,value:null}),y=3e5;this.min=n.min-y,this.max=n.max+y,this.numberTicks=3;for(var j=this.min;j<=this.max;j+=y){x.value=j;var w=new this.tickRenderer(x);this._overrideFormatString&&""!=this._autoFormatString&&(w.formatString=this._autoFormatString),w.showLabel=!1,w.showMark=!1,this._ticks.push(w)}this.showTicks&&(this._ticks[1].showLabel=!0),this.showTickMarks&&(this._ticks[1].showTickMarks=!0)}else if(null==this.min&&null==this.max){var z,A,B=a.extend(!0,{},this.tickOptions,{name:this.name,value:null});if(this.tickInterval||this.numberTicks)this.tickInterval?A=new a.jsDate(0).add(r[0],r[1]).getTime():this.numberTicks&&(z=this.numberTicks,A=(e-d)/(z-1));else{var C=Math.max(o,p+1),D=115;this.tickRenderer===a.jqplot.CanvasAxisTickRenderer&&this.tickOptions.angle&&(D=115-40*Math.abs(Math.sin(this.tickOptions.angle/180*Math.PI))),z=Math.ceil((C-p)/D+1),A=(e-d)/(z-1)}if(A<=19*f){var E=b(d,e,A),F=E[0];this._autoFormatString=E[1],d=new a.jsDate(d),d=Math.floor((d.getTime()-d.getUtcOffset())/F)*F+d.getUtcOffset(),z=Math.ceil((e-d)/F)+1,this.min=d,this.max=d+(z-1)*F,this.max<e&&(this.max+=F,z+=1),this.tickInterval=F,this.numberTicks=z;for(var j=0;j<z;j++)B.value=this.min+j*F,w=new this.tickRenderer(B),this._overrideFormatString&&""!=this._autoFormatString&&(w.formatString=this._autoFormatString),this.showTicks?this.showTickMarks||(w.showMark=!1):(w.showLabel=!1,w.showMark=!1),this._ticks.push(w);q=this.tickInterval}else if(A<=9*h){this._autoFormatString="%v";var G=Math.round(A/h);G<1?G=1:G>6&&(G=6);var H=new a.jsDate(d).setDate(1).setHours(0,0,0,0),I=new a.jsDate(e),J=new a.jsDate(e).setDate(1).setHours(0,0,0,0);I.getTime()!==J.getTime()&&(J=J.add(1,"month"));var K=J.diff(H,"month");z=Math.ceil(K/G)+1,this.min=H.getTime(),this.max=H.clone().add((z-1)*G,"month").getTime(),this.numberTicks=z;for(var j=0;j<z;j++)0===j?B.value=H.getTime():B.value=H.add(G,"month").getTime(),w=new this.tickRenderer(B),this._overrideFormatString&&""!=this._autoFormatString&&(w.formatString=this._autoFormatString),this.showTicks?this.showTickMarks||(w.showMark=!1):(w.showLabel=!1,w.showMark=!1),this._ticks.push(w);q=G*h}else{this._autoFormatString="%v";var G=Math.round(A/i);G<1&&(G=1);var H=new a.jsDate(d).setMonth(0,1).setHours(0,0,0,0),J=new a.jsDate(e).add(1,"year").setMonth(0,1).setHours(0,0,0,0),L=J.diff(H,"year");z=Math.ceil(L/G)+1,this.min=H.getTime(),this.max=H.clone().add((z-1)*G,"year").getTime(),this.numberTicks=z;for(var j=0;j<z;j++)0===j?B.value=H.getTime():B.value=H.add(G,"year").getTime(),w=new this.tickRenderer(B),this._overrideFormatString&&""!=this._autoFormatString&&(w.formatString=this._autoFormatString),this.showTicks?this.showTickMarks||(w.showMark=!1):(w.showLabel=!1,w.showMark=!1),this._ticks.push(w);q=G*i}}else{if(o="xaxis"==m||"x2axis"==m?this._plotDimensions.width:this._plotDimensions.height,null!=this.min&&null!=this.max&&null!=this.numberTicks&&(this.tickInterval=null),null!=this.tickInterval&&null!=r&&(this.daTickInterval=r),d==e){var M=432e5;d-=M,e+=M}u=e-d;var N,O;2+parseInt(Math.max(0,o-100)/100,10);if(N=null!=this.min?new a.jsDate(this.min).getTime():d-u/2*(this.padMin-1),O=null!=this.max?new a.jsDate(this.max).getTime():e+u/2*(this.padMax-1),this.min=N,this.max=O,u=this.max-this.min,null==this.numberTicks)if(null!=this.daTickInterval){var P=new a.jsDate(this.max).diff(this.min,this.daTickInterval[1],!0);this.numberTicks=Math.ceil(P/this.daTickInterval[0])+1,this.max=new a.jsDate(this.min).add((this.numberTicks-1)*this.daTickInterval[0],this.daTickInterval[1]).getTime()}else o>200?this.numberTicks=parseInt(3+(o-200)/100,10):this.numberTicks=2;q=u/(this.numberTicks-1)/1e3,null==this.daTickInterval&&(this.daTickInterval=[q,"seconds"]);for(var j=0;j<this.numberTicks;j++){var d=new a.jsDate(this.min);g=d.add(j*this.daTickInterval[0],this.daTickInterval[1]).getTime();var w=new this.tickRenderer(this.tickOptions);this.showTicks?this.showTickMarks||(w.showMark=!1):(w.showLabel=!1,w.showMark=!1),w.setTick(g,this.name),this._ticks.push(w)}}this.tickInset&&(this.min=this.min-this.tickInset*q,this.max=this.max+this.tickInset*q),null==this._daTickInterval&&(this._daTickInterval=this.daTickInterval),k=null}}(jQuery);
 
 
 
 
assets/jqplot/plugins/jqplot.enhancedLegendRenderer.js DELETED
@@ -1,305 +0,0 @@
1
- /**
2
- * jqPlot
3
- * Pure JavaScript plotting plugin using jQuery
4
- *
5
- * Version: 1.0.9
6
- * Revision: c465c44
7
- *
8
- * Copyright (c) 2009-2016 Chris Leonello
9
- * jqPlot is currently available for use in all personal or commercial projects
10
- * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
11
- * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
12
- * choose the license that best suits your project and use it accordingly.
13
- *
14
- * Although not required, the author would appreciate an email letting him
15
- * know of any substantial use of jqPlot. You can reach the author at:
16
- * chris at jqplot dot com or see http://www.jqplot.com/info.php .
17
- *
18
- * If you are feeling kind and generous, consider supporting the project by
19
- * making a donation at: http://www.jqplot.com/donate.php .
20
- *
21
- * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
22
- *
23
- * version 2007.04.27
24
- * author Ash Searle
25
- * http://hexmen.com/blog/2007/03/printf-sprintf/
26
- * http://hexmen.com/js/sprintf.js
27
- * The author (Ash Searle) has placed this code in the public domain:
28
- * "This code is unrestricted: you are free to use it however you like."
29
- *
30
- */
31
- (function($) {
32
- // class $.jqplot.EnhancedLegendRenderer
33
- // Legend renderer which can specify the number of rows and/or columns in the legend.
34
- $.jqplot.EnhancedLegendRenderer = function(){
35
- $.jqplot.TableLegendRenderer.call(this);
36
- };
37
-
38
- $.jqplot.EnhancedLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
39
- $.jqplot.EnhancedLegendRenderer.prototype.constructor = $.jqplot.EnhancedLegendRenderer;
40
-
41
- // called with scope of legend.
42
- $.jqplot.EnhancedLegendRenderer.prototype.init = function(options) {
43
- // prop: numberRows
44
- // Maximum number of rows in the legend. 0 or null for unlimited.
45
- this.numberRows = null;
46
- // prop: numberColumns
47
- // Maximum number of columns in the legend. 0 or null for unlimited.
48
- this.numberColumns = null;
49
- // prop: seriesToggle
50
- // false to not enable series on/off toggling on the legend.
51
- // true or a fadein/fadeout speed (number of milliseconds or 'fast', 'normal', 'slow')
52
- // to enable show/hide of series on click of legend item.
53
- this.seriesToggle = 'normal';
54
- // prop: seriesToggleReplot
55
- // True to replot the chart after toggling series on/off.
56
- // This will set the series show property to false.
57
- // This allows for rescaling or other maniplation of chart.
58
- // Set to an options object (e.g. {resetAxes: true}) for replot options.
59
- this.seriesToggleReplot = false;
60
- // prop: disableIEFading
61
- // true to toggle series with a show/hide method only and not allow fading in/out.
62
- // This is to overcome poor performance of fade in some versions of IE.
63
- this.disableIEFading = true;
64
- $.extend(true, this, options);
65
-
66
- if (this.seriesToggle) {
67
- $.jqplot.postDrawHooks.push(postDraw);
68
- }
69
- };
70
-
71
- // called with scope of legend
72
- $.jqplot.EnhancedLegendRenderer.prototype.draw = function(offsets, plot) {
73
- var legend = this;
74
- if (this.show) {
75
- var series = this._series;
76
- var s;
77
- var ss = 'position:absolute;';
78
- ss += (this.background) ? 'background:'+this.background+';' : '';
79
- ss += (this.border) ? 'border:'+this.border+';' : '';
80
- ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
81
- ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
82
- ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
83
- ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
84
- ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
85
- ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
86
- ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
87
- this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
88
- if (this.seriesToggle) {
89
- this._elem.css('z-index', '3');
90
- }
91
-
92
- var pad = false,
93
- reverse = false,
94
- nr, nc;
95
- if (this.numberRows) {
96
- nr = this.numberRows;
97
- if (!this.numberColumns){
98
- nc = Math.ceil(series.length/nr);
99
- }
100
- else{
101
- nc = this.numberColumns;
102
- }
103
- }
104
- else if (this.numberColumns) {
105
- nc = this.numberColumns;
106
- nr = Math.ceil(series.length/this.numberColumns);
107
- }
108
- else {
109
- nr = series.length;
110
- nc = 1;
111
- }
112
-
113
- var i, j, tr, td1, td2, lt, rs, div, div0, div1;
114
- var idx = 0;
115
- // check to see if we need to reverse
116
- for (i=series.length-1; i>=0; i--) {
117
- if (nc == 1 && series[i]._stack || series[i].renderer.constructor == $.jqplot.BezierCurveRenderer){
118
- reverse = true;
119
- }
120
- }
121
-
122
- for (i=0; i<nr; i++) {
123
- tr = $(document.createElement('tr'));
124
- tr.addClass('jqplot-table-legend');
125
- if (reverse){
126
- tr.prependTo(this._elem);
127
- }
128
- else{
129
- tr.appendTo(this._elem);
130
- }
131
- for (j=0; j<nc; j++) {
132
- if (idx < series.length && (series[idx].show || series[idx].showLabel)){
133
- s = series[idx];
134
- lt = this.labels[idx] || s.label.toString();
135
- if (lt) {
136
- var color = s.color;
137
- if (!reverse){
138
- if (i>0){
139
- pad = true;
140
- }
141
- else{
142
- pad = false;
143
- }
144
- }
145
- else{
146
- if (i == nr -1){
147
- pad = false;
148
- }
149
- else{
150
- pad = true;
151
- }
152
- }
153
- rs = (pad) ? this.rowSpacing : '0';
154
-
155
- td1 = $(document.createElement('td'));
156
- td1.addClass('jqplot-table-legend jqplot-table-legend-swatch');
157
- td1.css({textAlign: 'center', paddingTop: rs});
158
-
159
- div0 = $(document.createElement('div'));
160
- div0.addClass('jqplot-table-legend-swatch-outline');
161
- div1 = $(document.createElement('div'));
162
- div1.addClass('jqplot-table-legend-swatch');
163
- div1.css({backgroundColor: color, borderColor: color});
164
-
165
- td1.append(div0.append(div1));
166
-
167
- td2 = $(document.createElement('td'));
168
- td2.addClass('jqplot-table-legend jqplot-table-legend-label');
169
- td2.css('paddingTop', rs);
170
-
171
- // td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
172
- // '<div><div class="jqplot-table-legend-swatch" style="background-color:'+color+';border-color:'+color+';"></div>'+
173
- // '</div></td>');
174
- // td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
175
- if (this.escapeHtml){
176
- td2.text(lt);
177
- }
178
- else {
179
- td2.html(lt);
180
- }
181
- if (reverse) {
182
- if (this.showLabels) {td2.prependTo(tr);}
183
- if (this.showSwatches) {td1.prependTo(tr);}
184
- }
185
- else {
186
- if (this.showSwatches) {td1.appendTo(tr);}
187
- if (this.showLabels) {td2.appendTo(tr);}
188
- }
189
-
190
- if (this.seriesToggle) {
191
-
192
- // add an overlay for clicking series on/off
193
- // div0 = $(document.createElement('div'));
194
- // div0.addClass('jqplot-table-legend-overlay');
195
- // div0.css({position:'relative', left:0, top:0, height:'100%', width:'100%'});
196
- // tr.append(div0);
197
-
198
- var speed;
199
- if (typeof(this.seriesToggle) === 'string' || typeof(this.seriesToggle) === 'number') {
200
- if (!$.jqplot.use_excanvas || !this.disableIEFading) {
201
- speed = this.seriesToggle;
202
- }
203
- }
204
- if (this.showSwatches) {
205
- td1.bind('click', {series:s, speed:speed, plot: plot, replot:this.seriesToggleReplot}, handleToggle);
206
- td1.addClass('jqplot-seriesToggle');
207
- }
208
- if (this.showLabels) {
209
- td2.bind('click', {series:s, speed:speed, plot: plot, replot:this.seriesToggleReplot}, handleToggle);
210
- td2.addClass('jqplot-seriesToggle');
211
- }
212
-
213
- // for series that are already hidden, add the hidden class
214
- if (!s.show && s.showLabel) {
215
- td1.addClass('jqplot-series-hidden');
216
- td2.addClass('jqplot-series-hidden');
217
- }
218
- }
219
-
220
- pad = true;
221
- }
222
- }
223
- idx++;
224
- }
225
-
226
- td1 = td2 = div0 = div1 = null;
227
- }
228
- }
229
- return this._elem;
230
- };
231
-
232
- var handleToggle = function (ev) {
233
- var d = ev.data,
234
- s = d.series,
235
- replot = d.replot,
236
- plot = d.plot,
237
- speed = d.speed,
238
- sidx = s.index,
239
- showing = false;
240
-
241
- if (s.canvas._elem.is(':hidden') || !s.show) {
242
- showing = true;
243
- }
244
-
245
- var doLegendToggle = function() {
246
-
247
- if (replot) {
248
- var opts = {};
249
-
250
- if ($.isPlainObject(replot)) {
251
- $.extend(true, opts, replot);
252
- }
253
-
254
- plot.replot(opts);
255
- // if showing, there was no canvas element to fade in, so hide here
256
- // and then do a fade in.
257
- if (showing && speed) {
258
- var s = plot.series[sidx];
259
-
260
- if (s.shadowCanvas._elem) {
261
- s.shadowCanvas._elem.hide().fadeIn(speed);
262
- }
263
- s.canvas._elem.hide().fadeIn(speed);
264
- s.canvas._elem.nextAll('.jqplot-point-label.jqplot-series-'+s.index).hide().fadeIn(speed);
265
- }
266
-
267
- }
268
-
269
- else {
270
- var s = plot.series[sidx];
271
-
272
- if (s.canvas._elem.is(':hidden') || !s.show) {
273
- // Not sure if there is a better way to check for showSwatches and showLabels === true.
274
- // Test for "undefined" since default values for both showSwatches and showLables is true.
275
- if (typeof plot.options.legend.showSwatches === 'undefined' || plot.options.legend.showSwatches === true) {
276
- plot.legend._elem.find('td').eq(sidx * 2).addClass('jqplot-series-hidden');
277
- }
278
- if (typeof plot.options.legend.showLabels === 'undefined' || plot.options.legend.showLabels === true) {
279
- plot.legend._elem.find('td').eq((sidx * 2) + 1).addClass('jqplot-series-hidden');
280
- }
281
- }
282
- else {
283
- if (typeof plot.options.legend.showSwatches === 'undefined' || plot.options.legend.showSwatches === true) {
284
- plot.legend._elem.find('td').eq(sidx * 2).removeClass('jqplot-series-hidden');
285
- }
286
- if (typeof plot.options.legend.showLabels === 'undefined' || plot.options.legend.showLabels === true) {
287
- plot.legend._elem.find('td').eq((sidx * 2) + 1).removeClass('jqplot-series-hidden');
288
- }
289
- }
290
-
291
- }
292
-
293
- };
294
-
295
- s.toggleDisplay(ev, doLegendToggle);
296
- };
297
-
298
- // called with scope of plot.
299
- var postDraw = function () {
300
- if (this.legend.renderer.constructor == $.jqplot.EnhancedLegendRenderer && this.legend.seriesToggle){
301
- var e = this.legend._elem.detach();
302
- this.eventCanvas._elem.after(e);
303
- }
304
- };
305
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/jqplot/plugins/jqplot.enhancedLegendRenderer.min.js DELETED
@@ -1,4 +0,0 @@
1
- /* jqplot 1.0.9 | (c) 2009-2016 Chris Leonello | jqplot.com
2
- jsDate | (c) 2010-2016 Chris Leonello
3
- */
4
- !function(a){a.jqplot.EnhancedLegendRenderer=function(){a.jqplot.TableLegendRenderer.call(this)},a.jqplot.EnhancedLegendRenderer.prototype=new a.jqplot.TableLegendRenderer,a.jqplot.EnhancedLegendRenderer.prototype.constructor=a.jqplot.EnhancedLegendRenderer,a.jqplot.EnhancedLegendRenderer.prototype.init=function(b){this.numberRows=null,this.numberColumns=null,this.seriesToggle="normal",this.seriesToggleReplot=!1,this.disableIEFading=!0,a.extend(!0,this,b),this.seriesToggle&&a.jqplot.postDrawHooks.push(c)},a.jqplot.EnhancedLegendRenderer.prototype.draw=function(c,d){if(this.show){var e,f=this._series,g="position:absolute;";g+=this.background?"background:"+this.background+";":"",g+=this.border?"border:"+this.border+";":"",g+=this.fontSize?"font-size:"+this.fontSize+";":"",g+=this.fontFamily?"font-family:"+this.fontFamily+";":"",g+=this.textColor?"color:"+this.textColor+";":"",g+=null!=this.marginTop?"margin-top:"+this.marginTop+";":"",g+=null!=this.marginBottom?"margin-bottom:"+this.marginBottom+";":"",g+=null!=this.marginLeft?"margin-left:"+this.marginLeft+";":"",g+=null!=this.marginRight?"margin-right:"+this.marginRight+";":"",this._elem=a('<table class="jqplot-table-legend" style="'+g+'"></table>'),this.seriesToggle&&this._elem.css("z-index","3");var h,i,j=!1,k=!1;this.numberRows?(h=this.numberRows,i=this.numberColumns?this.numberColumns:Math.ceil(f.length/h)):this.numberColumns?(i=this.numberColumns,h=Math.ceil(f.length/this.numberColumns)):(h=f.length,i=1);var l,m,n,o,p,q,r,s,t,u=0;for(l=f.length-1;l>=0;l--)(1==i&&f[l]._stack||f[l].renderer.constructor==a.jqplot.BezierCurveRenderer)&&(k=!0);for(l=0;l<h;l++){for(n=a(document.createElement("tr")),n.addClass("jqplot-table-legend"),k?n.prependTo(this._elem):n.appendTo(this._elem),m=0;m<i;m++){if(u<f.length&&(f[u].show||f[u].showLabel)&&(e=f[u],q=this.labels[u]||e.label.toString())){var v=e.color;if(j=k?l!=h-1:l>0,r=j?this.rowSpacing:"0",o=a(document.createElement("td")),o.addClass("jqplot-table-legend jqplot-table-legend-swatch"),o.css({textAlign:"center",paddingTop:r}),s=a(document.createElement("div")),s.addClass("jqplot-table-legend-swatch-outline"),t=a(document.createElement("div")),t.addClass("jqplot-table-legend-swatch"),t.css({backgroundColor:v,borderColor:v}),o.append(s.append(t)),p=a(document.createElement("td")),p.addClass("jqplot-table-legend jqplot-table-legend-label"),p.css("paddingTop",r),this.escapeHtml?p.text(q):p.html(q),k?(this.showLabels&&p.prependTo(n),this.showSwatches&&o.prependTo(n)):(this.showSwatches&&o.appendTo(n),this.showLabels&&p.appendTo(n)),this.seriesToggle){var w;"string"!=typeof this.seriesToggle&&"number"!=typeof this.seriesToggle||a.jqplot.use_excanvas&&this.disableIEFading||(w=this.seriesToggle),this.showSwatches&&(o.bind("click",{series:e,speed:w,plot:d,replot:this.seriesToggleReplot},b),o.addClass("jqplot-seriesToggle")),this.showLabels&&(p.bind("click",{series:e,speed:w,plot:d,replot:this.seriesToggleReplot},b),p.addClass("jqplot-seriesToggle")),!e.show&&e.showLabel&&(o.addClass("jqplot-series-hidden"),p.addClass("jqplot-series-hidden"))}j=!0}u++}o=p=s=t=null}}return this._elem};var b=function(b){var c=b.data,d=c.series,e=c.replot,f=c.plot,g=c.speed,h=d.index,i=!1;!d.canvas._elem.is(":hidden")&&d.show||(i=!0);var j=function(){if(e){var b={};if(a.isPlainObject(e)&&a.extend(!0,b,e),f.replot(b),i&&g){var c=f.series[h];c.shadowCanvas._elem&&c.shadowCanvas._elem.hide().fadeIn(g),c.canvas._elem.hide().fadeIn(g),c.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+c.index).hide().fadeIn(g)}}else{var c=f.series[h];c.canvas._elem.is(":hidden")||!c.show?("undefined"!=typeof f.options.legend.showSwatches&&f.options.legend.showSwatches!==!0||f.legend._elem.find("td").eq(2*h).addClass("jqplot-series-hidden"),"undefined"!=typeof f.options.legend.showLabels&&f.options.legend.showLabels!==!0||f.legend._elem.find("td").eq(2*h+1).addClass("jqplot-series-hidden")):("undefined"!=typeof f.options.legend.showSwatches&&f.options.legend.showSwatches!==!0||f.legend._elem.find("td").eq(2*h).removeClass("jqplot-series-hidden"),"undefined"!=typeof f.options.legend.showLabels&&f.options.legend.showLabels!==!0||f.legend._elem.find("td").eq(2*h+1).removeClass("jqplot-series-hidden"))}};d.toggleDisplay(b,j)},c=function(){if(this.legend.renderer.constructor==a.jqplot.EnhancedLegendRenderer&&this.legend.seriesToggle){var b=this.legend._elem.detach();this.eventCanvas._elem.after(b)}}}(jQuery);
 
 
 
 
assets/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js DELETED
@@ -1,261 +0,0 @@
1
- /**
2
- * jqPlot
3
- * Pure JavaScript plotting plugin using jQuery
4
- *
5
- * Version: 1.0.9
6
- * Revision: c465c44
7
- *
8
- * Copyright (c) 2009-2016 Chris Leonello
9
- * jqPlot is currently available for use in all personal or commercial projects
10
- * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
11
- * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
12
- * choose the license that best suits your project and use it accordingly.
13
- *
14
- * Although not required, the author would appreciate an email letting him
15
- * know of any substantial use of jqPlot. You can reach the author at:
16
- * chris at jqplot dot com or see http://www.jqplot.com/info.php .
17
- *
18
- * If you are feeling kind and generous, consider supporting the project by
19
- * making a donation at: http://www.jqplot.com/donate.php .
20
- *
21
- * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
22
- *
23
- * version 2007.04.27
24
- * author Ash Searle
25
- * http://hexmen.com/blog/2007/03/printf-sprintf/
26
- * http://hexmen.com/js/sprintf.js
27
- * The author (Ash Searle) has placed this code in the public domain:
28
- * "This code is unrestricted: you are free to use it however you like."
29
- *
30
- */
31
- (function($) {
32
- // class $.jqplot.EnhancedPieLegendRenderer
33
- // Legend renderer which can specify the number of rows and/or columns in the legend
34
- // Similar to EnhancedLegendRenderer, but for pie charts
35
- $.jqplot.EnhancedPieLegendRenderer = function(){
36
- $.jqplot.TableLegendRenderer.call(this);
37
- };
38
-
39
- $.jqplot.EnhancedPieLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
40
- $.jqplot.EnhancedPieLegendRenderer.prototype.constructor = $.jqplot.EnhancedPieLegendRenderer;
41
-
42
- // called with scope of legend.
43
- $.jqplot.EnhancedPieLegendRenderer.prototype.init = function(options) {
44
- // prop: numberRows
45
- // Maximum number of rows in the legend. 0 or null for unlimited.
46
- this.numberRows = null;
47
- // prop: numberColumns
48
- // Maximum number of columns in the legend. 0 or null for unlimited.
49
- this.numberColumns = null;
50
- // prop: seriesToggle
51
- // false to not enable series on/off toggling on the legend.
52
- // true or a fadein/fadeout speed (number of milliseconds or 'fast', 'normal', 'slow')
53
- // to enable show/hide of series on click of legend item.
54
- this.seriesToggle = 'normal';
55
- // prop: seriesToggleReplot
56
- // True to replot the chart after toggling series on/off.
57
- // This will set the series show property to false.
58
- // This allows for rescaling or other maniplation of chart.
59
- // Set to an options object (e.g. {resetAxes: true}) for replot options.
60
- this.seriesToggleReplot = false;
61
- // prop: disableIEFading
62
- // true to toggle series with a show/hide method only and not allow fading in/out.
63
- // This is to overcome poor performance of fade in some versions of IE.
64
- this.disableIEFading = true;
65
- // prop: toolTips
66
- // optional array of toolTip text corresponding to each pie slice
67
- this.toolTips = [];
68
- $.extend(true, this, options);
69
-
70
- if (this.seriesToggle) {
71
- $.jqplot.postDrawHooks.push(postDraw);
72
- }
73
- };
74
-
75
- // called with scope of legend
76
- $.jqplot.EnhancedPieLegendRenderer.prototype.draw = function(offsets, plot) {
77
- var legend = this;
78
- if (this.show) {
79
- var series = this._series;
80
- var s;
81
- var ss = 'position:absolute;';
82
- ss += (this.background) ? 'background:'+this.background+';' : '';
83
- ss += (this.border) ? 'border:'+this.border+';' : '';
84
- ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
85
- ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
86
- ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
87
- ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
88
- ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
89
- ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
90
- ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
91
- this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
92
- if (this.seriesToggle) {
93
- this._elem.css('z-index', '3');
94
- }
95
-
96
- var pad = false,
97
- reverse = false,
98
- nr, nc;
99
- var s = series[0];
100
- var slen = s.data.length;
101
- var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors);
102
-
103
- if (this.numberRows) {
104
- nr = this.numberRows;
105
- if (!this.numberColumns){
106
- nc = Math.ceil(slen/nr);
107
- }
108
- else{
109
- nc = this.numberColumns;
110
- }
111
- }
112
- else if (this.numberColumns) {
113
- nc = this.numberColumns;
114
- nr = Math.ceil(slen/this.numberColumns);
115
- }
116
- else {
117
- nr = slen;
118
- nc = 1;
119
- }
120
-
121
- var i, j, tr, td1, td2, lt, rs, div, div0, div1;
122
- var idx = 0;
123
- // check to see if we need to reverse
124
- for (i=series.length-1; i>=0; i--) {
125
- if (nc == 1 && series[i]._stack || series[i].renderer.constructor == $.jqplot.BezierCurveRenderer){
126
- reverse = true;
127
- }
128
- }
129
-
130
- for (i=0; i<nr; i++) {
131
- tr = $(document.createElement('tr'));
132
- tr.addClass('jqplot-table-legend');
133
- if (reverse){
134
- tr.prependTo(this._elem);
135
- }
136
- else{
137
- tr.appendTo(this._elem);
138
- }
139
- for (j=0; j<nc; j++) {
140
- if (idx < slen){
141
- lt = this.labels[idx] || s.data[idx][0].toString();
142
- tt = this.toolTips[idx];
143
- if (lt) {
144
- var color = colorGenerator.next();
145
- if (!reverse){
146
- if (i>0){
147
- pad = true;
148
- }
149
- else{
150
- pad = false;
151
- }
152
- }
153
- else{
154
- if (i == nr -1){
155
- pad = false;
156
- }
157
- else{
158
- pad = true;
159
- }
160
- }
161
- rs = (pad) ? this.rowSpacing : '0';
162
-
163
- td1 = $(document.createElement('td'));
164
- td1.addClass('jqplot-table-legend jqplot-table-legend-swatch');
165
- td1.css({textAlign: 'center', paddingTop: rs});
166
-
167
- div0 = $(document.createElement('div'));
168
- div0.addClass('jqplot-table-legend-swatch-outline');
169
- if (tt !== undefined) {
170
- div0.attr("title", tt);
171
- }
172
-
173
- div1 = $(document.createElement('div'));
174
- div1.addClass('jqplot-table-legend-swatch');
175
- div1.css({backgroundColor: color, borderColor: color});
176
-
177
- td1.append(div0.append(div1));
178
-
179
- td2 = $(document.createElement('td'));
180
- td2.addClass('jqplot-table-legend jqplot-table-legend-label');
181
- td2.css('paddingTop', rs);
182
- if (tt !== undefined) {
183
- td2.attr("title", tt);
184
- }
185
-
186
- if (this.escapeHtml){
187
- td2.text(lt);
188
- }
189
- else {
190
- td2.html(lt);
191
- }
192
- if (reverse) {
193
- if (this.showLabels) {td2.prependTo(tr);}
194
- if (this.showSwatches) {td1.prependTo(tr);}
195
- }
196
- else {
197
- if (this.showSwatches) {td1.appendTo(tr);}
198
- if (this.showLabels) {td2.appendTo(tr);}
199
- }
200
-
201
- if (this.seriesToggle) {
202
-
203
- var speed;
204
- if (typeof(this.seriesToggle) === 'string' || typeof(this.seriesToggle) === 'number') {
205
- if (!$.jqplot.use_excanvas || !this.disableIEFading) {
206
- speed = this.seriesToggle;
207
- }
208
- }
209
- if (this.showSwatches) {
210
- td1.bind('click', {series:s, index:idx, speed:speed, plot: plot, replot:this.seriesToggleReplot}, handleToggle);
211
- td1.addClass('jqplot-seriesToggle');
212
- }
213
- if (this.showLabels) {
214
- td2.bind('click', {series:s, index:idx, speed:speed, plot: plot, replot:this.seriesToggleReplot}, handleToggle);
215
- td2.addClass('jqplot-seriesToggle');
216
- }
217
-
218
- // for slices that are already hidden, add the hidden class
219
- if (s.showSlice[idx] === false && s.showLabel) {
220
- td1.addClass('jqplot-series-hidden');
221
- td2.addClass('jqplot-series-hidden');
222
- }
223
- }
224
-
225
- pad = true;
226
- }
227
- }
228
- idx++;
229
- }
230
-
231
- td1 = td2 = div0 = div1 = null;
232
- }
233
- }
234
- return this._elem;
235
- };
236
-
237
- var handleToggle = function (ev) {
238
- var d = ev.data,
239
- replot = d.replot,
240
- plot = d.plot,
241
- idx = d.index;
242
-
243
- d.series.showSlice[idx] = (d.series.showSlice[idx] === false) ? true : false;
244
-
245
- var opts = {};
246
-
247
- if ($.isPlainObject(replot)) {
248
- $.extend(true, opts, replot);
249
- }
250
-
251
- plot.replot(opts);
252
- };
253
-
254
- // called with scope of plot.
255
- var postDraw = function () {
256
- if (this.legend.renderer.constructor == $.jqplot.EnhancedPieLegendRenderer && this.legend.seriesToggle) {
257
- var e = this.legend._elem.detach();
258
- this.eventCanvas._elem.after(e);
259
- }
260
- };
261
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/jqplot/plugins/jqplot.enhancedPieLegendRenderer.min.js DELETED
@@ -1,4 +0,0 @@
1
- /* jqplot 1.0.9 | (c) 2009-2016 Chris Leonello | jqplot.com
2
- jsDate | (c) 2010-2016 Chris Leonello
3
- */
4
- !function(a){a.jqplot.EnhancedPieLegendRenderer=function(){a.jqplot.TableLegendRenderer.call(this)},a.jqplot.EnhancedPieLegendRenderer.prototype=new a.jqplot.TableLegendRenderer,a.jqplot.EnhancedPieLegendRenderer.prototype.constructor=a.jqplot.EnhancedPieLegendRenderer,a.jqplot.EnhancedPieLegendRenderer.prototype.init=function(b){this.numberRows=null,this.numberColumns=null,this.seriesToggle="normal",this.seriesToggleReplot=!1,this.disableIEFading=!0,this.toolTips=[],a.extend(!0,this,b),this.seriesToggle&&a.jqplot.postDrawHooks.push(c)},a.jqplot.EnhancedPieLegendRenderer.prototype.draw=function(c,d){if(this.show){var e,f=this._series,g="position:absolute;";g+=this.background?"background:"+this.background+";":"",g+=this.border?"border:"+this.border+";":"",g+=this.fontSize?"font-size:"+this.fontSize+";":"",g+=this.fontFamily?"font-family:"+this.fontFamily+";":"",g+=this.textColor?"color:"+this.textColor+";":"",g+=null!=this.marginTop?"margin-top:"+this.marginTop+";":"",g+=null!=this.marginBottom?"margin-bottom:"+this.marginBottom+";":"",g+=null!=this.marginLeft?"margin-left:"+this.marginLeft+";":"",g+=null!=this.marginRight?"margin-right:"+this.marginRight+";":"",this._elem=a('<table class="jqplot-table-legend" style="'+g+'"></table>'),this.seriesToggle&&this._elem.css("z-index","3");var h,i,j=!1,k=!1,e=f[0],l=e.data.length,m=new a.jqplot.ColorGenerator(e.seriesColors);this.numberRows?(h=this.numberRows,i=this.numberColumns?this.numberColumns:Math.ceil(l/h)):this.numberColumns?(i=this.numberColumns,h=Math.ceil(l/this.numberColumns)):(h=l,i=1);var n,o,p,q,r,s,t,u,v,w=0;for(n=f.length-1;n>=0;n--)(1==i&&f[n]._stack||f[n].renderer.constructor==a.jqplot.BezierCurveRenderer)&&(k=!0);for(n=0;n<h;n++){for(p=a(document.createElement("tr")),p.addClass("jqplot-table-legend"),k?p.prependTo(this._elem):p.appendTo(this._elem),o=0;o<i;o++){if(w<l&&(s=this.labels[w]||e.data[w][0].toString(),tt=this.toolTips[w],s)){var x=m.next();if(j=k?n!=h-1:n>0,t=j?this.rowSpacing:"0",q=a(document.createElement("td")),q.addClass("jqplot-table-legend jqplot-table-legend-swatch"),q.css({textAlign:"center",paddingTop:t}),u=a(document.createElement("div")),u.addClass("jqplot-table-legend-swatch-outline"),void 0!==tt&&u.attr("title",tt),v=a(document.createElement("div")),v.addClass("jqplot-table-legend-swatch"),v.css({backgroundColor:x,borderColor:x}),q.append(u.append(v)),r=a(document.createElement("td")),r.addClass("jqplot-table-legend jqplot-table-legend-label"),r.css("paddingTop",t),void 0!==tt&&r.attr("title",tt),this.escapeHtml?r.text(s):r.html(s),k?(this.showLabels&&r.prependTo(p),this.showSwatches&&q.prependTo(p)):(this.showSwatches&&q.appendTo(p),this.showLabels&&r.appendTo(p)),this.seriesToggle){var y;"string"!=typeof this.seriesToggle&&"number"!=typeof this.seriesToggle||a.jqplot.use_excanvas&&this.disableIEFading||(y=this.seriesToggle),this.showSwatches&&(q.bind("click",{series:e,index:w,speed:y,plot:d,replot:this.seriesToggleReplot},b),q.addClass("jqplot-seriesToggle")),this.showLabels&&(r.bind("click",{series:e,index:w,speed:y,plot:d,replot:this.seriesToggleReplot},b),r.addClass("jqplot-seriesToggle")),e.showSlice[w]===!1&&e.showLabel&&(q.addClass("jqplot-series-hidden"),r.addClass("jqplot-series-hidden"))}j=!0}w++}q=r=u=v=null}}return this._elem};var b=function(b){var c=b.data,d=c.replot,e=c.plot,f=c.index;c.series.showSlice[f]=c.series.showSlice[f]===!1;var g={};a.isPlainObject(d)&&a.extend(!0,g,d),e.replot(g)},c=function(){if(this.legend.renderer.constructor==a.jqplot.EnhancedPieLegendRenderer&&this.legend.seriesToggle){var b=this.legend._elem.detach();this.eventCanvas._elem.after(b)}}}(jQuery);
 
 
 
 
assets/jqplot/plugins/jqplot.highlighter.js DELETED
@@ -1,484 +0,0 @@
1
- /**
2
- * jqPlot
3
- * Pure JavaScript plotting plugin using jQuery
4
- *
5
- * Version: 1.0.9
6
- * Revision: c465c44
7
- *
8
- * Copyright (c) 2009-2016 Chris Leonello
9
- * jqPlot is currently available for use in all personal or commercial projects
10
- * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
11
- * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
12
- * choose the license that best suits your project and use it accordingly.
13
- *
14
- * Although not required, the author would appreciate an email letting him
15
- * know of any substantial use of jqPlot. You can reach the author at:
16
- * chris at jqplot dot com or see http://www.jqplot.com/info.php .
17
- *
18
- * If you are feeling kind and generous, consider supporting the project by
19
- * making a donation at: http://www.jqplot.com/donate.php .
20
- *
21
- * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
22
- *
23
- * version 2007.04.27
24
- * author Ash Searle
25
- * http://hexmen.com/blog/2007/03/printf-sprintf/
26
- * http://hexmen.com/js/sprintf.js
27
- * The author (Ash Searle) has placed this code in the public domain:
28
- * "This code is unrestricted: you are free to use it however you like."
29
- *
30
- */
31
- (function($) {
32
- $.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMove]);
33
-
34
- /**
35
- * Class: $.jqplot.Highlighter
36
- * Plugin which will highlight data points when they are moused over.
37
- *
38
- * To use this plugin, include the js
39
- * file in your source:
40
- *
41
- * > <script type="text/javascript" src="plugins/jqplot.highlighter.js"></script>
42
- *
43
- * A tooltip providing information about the data point is enabled by default.
44
- * To disable the tooltip, set "showTooltip" to false.
45
- *
46
- * You can control what data is displayed in the tooltip with various
47
- * options. The "tooltipAxes" option controls whether the x, y or both
48
- * data values are displayed.
49
- *
50
- * Some chart types (e.g. hi-low-close) have more than one y value per
51
- * data point. To display the additional values in the tooltip, set the
52
- * "yvalues" option to the desired number of y values present (3 for a hlc chart).
53
- *
54
- * By default, data values will be formatted with the same formatting
55
- * specifiers as used to format the axis ticks. A custom format code
56
- * can be supplied with the tooltipFormatString option. This will apply
57
- * to all values in the tooltip.
58
- *
59
- * For more complete control, the "formatString" option can be set. This
60
- * Allows conplete control over tooltip formatting. Values are passed to
61
- * the format string in an order determined by the "tooltipAxes" and "yvalues"
62
- * options. So, if you have a hi-low-close chart and you just want to display
63
- * the hi-low-close values in the tooltip, you could set a formatString like:
64
- *
65
- * > highlighter: {
66
- * > tooltipAxes: 'y',
67
- * > yvalues: 3,
68
- * > formatString:'<table class="jqplot-highlighter">
69
- * > <tr><td>hi:</td><td>%s</td></tr>
70
- * > <tr><td>low:</td><td>%s</td></tr>
71
- * > <tr><td>close:</td><td>%s</td></tr></table>'
72
- * > }
73
- *
74
- */
75
- $.jqplot.Highlighter = function(options) {
76
- // Group: Properties
77
- //
78
- //prop: show
79
- // true to show the highlight.
80
- this.show = $.jqplot.config.enablePlugins;
81
- // prop: markerRenderer
82
- // Renderer used to draw the marker of the highlighted point.
83
- // Renderer will assimilate attributes from the data point being highlighted,
84
- // so no attributes need set on the renderer directly.
85
- // Default is to turn off shadow drawing on the highlighted point.
86
- this.markerRenderer = new $.jqplot.MarkerRenderer({shadow:false});
87
- // prop: showMarker
88
- // true to show the marker
89
- this.showMarker = true;
90
- // prop: lineWidthAdjust
91
- // Pixels to add to the lineWidth of the highlight.
92
- this.lineWidthAdjust = 2.5;
93
- // prop: sizeAdjust
94
- // Pixels to add to the overall size of the highlight.
95
- this.sizeAdjust = 5;
96
- // prop: showTooltip
97
- // Show a tooltip with data point values.
98
- this.showTooltip = true;
99
- // prop: tooltipLocation
100
- // Where to position tooltip, 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'
101
- this.tooltipLocation = 'nw';
102
- // prop: fadeTooltip
103
- // true = fade in/out tooltip, flase = show/hide tooltip
104
- this.fadeTooltip = true;
105
- // prop: tooltipFadeSpeed
106
- // 'slow', 'def', 'fast', or number of milliseconds.
107
- this.tooltipFadeSpeed = "fast";
108
- // prop: tooltipOffset
109
- // Pixel offset of tooltip from the highlight.
110
- this.tooltipOffset = 2;
111
- // prop: tooltipAxes
112
- // Which axes to display in tooltip, 'x', 'y' or 'both', 'xy' or 'yx'
113
- // 'both' and 'xy' are equivalent, 'yx' reverses order of labels.
114
- this.tooltipAxes = 'both';
115
- // prop; tooltipSeparator
116
- // String to use to separate x and y axes in tooltip.
117
- this.tooltipSeparator = ', ';
118
- // prop; tooltipContentEditor
119
- // Function used to edit/augment/replace the formatted tooltip contents.
120
- // Called as str = tooltipContentEditor(str, seriesIndex, pointIndex)
121
- // where str is the generated tooltip html and seriesIndex and pointIndex identify
122
- // the data point being highlighted. Should return the html for the tooltip contents.
123
- this.tooltipContentEditor = null;
124
- // prop: useAxesFormatters
125
- // Use the x and y axes formatters to format the text in the tooltip.
126
- this.useAxesFormatters = true;
127
- // prop: tooltipFormatString
128
- // sprintf format string for the tooltip.
129
- // Uses Ash Searle's javascript sprintf implementation
130
- // found here: http://hexmen.com/blog/2007/03/printf-sprintf/
131
- // See http://perldoc.perl.org/functions/sprintf.html for reference.
132
- // Additional "p" and "P" format specifiers added by Chris Leonello.
133
- this.tooltipFormatString = '%.5P';
134
- // prop: formatString
135
- // alternative to tooltipFormatString
136
- // will format the whole tooltip text, populating with x, y values as
137
- // indicated by tooltipAxes option. So, you could have a tooltip like:
138
- // 'Date: %s, number of cats: %d' to format the whole tooltip at one go.
139
- // If useAxesFormatters is true, values will be formatted according to
140
- // Axes formatters and you can populate your tooltip string with
141
- // %s placeholders.
142
- this.formatString = null;
143
- // prop: yvalues
144
- // Number of y values to expect in the data point array.
145
- // Typically this is 1. Certain plots, like OHLC, will
146
- // have more y values in each data point array.
147
- this.yvalues = 1;
148
- // prop: bringSeriesToFront
149
- // This option requires jQuery 1.4+
150
- // True to bring the series of the highlighted point to the front
151
- // of other series.
152
- this.bringSeriesToFront = false;
153
- this._tooltipElem;
154
- this.isHighlighting = false;
155
- this.currentNeighbor = null;
156
-
157
- $.extend(true, this, options);
158
- };
159
-
160
- var locations = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w'];
161
- var locationIndicies = {'nw':0, 'n':1, 'ne':2, 'e':3, 'se':4, 's':5, 'sw':6, 'w':7};
162
- var oppositeLocations = ['se', 's', 'sw', 'w', 'nw', 'n', 'ne', 'e'];
163
-
164
- // axis.renderer.tickrenderer.formatter
165
-
166
- // called with scope of plot
167
- $.jqplot.Highlighter.init = function (target, data, opts){
168
- var options = opts || {};
169
- // add a highlighter attribute to the plot
170
- this.plugins.highlighter = new $.jqplot.Highlighter(options.highlighter);
171
- };
172
-
173
- // called within scope of series
174
- $.jqplot.Highlighter.parseOptions = function (defaults, options) {
175
- // Add a showHighlight option to the series
176
- // and set it to true by default.
177
- this.showHighlight = true;
178
- };
179
-
180
- // called within context of plot
181
- // create a canvas which we can draw on.
182
- // insert it before the eventCanvas, so eventCanvas will still capture events.
183
- $.jqplot.Highlighter.postPlotDraw = function() {
184
- // Memory Leaks patch
185
- if (this.plugins.highlighter && this.plugins.highlighter.highlightCanvas) {
186
- this.plugins.highlighter.highlightCanvas.resetCanvas();
187
- this.plugins.highlighter.highlightCanvas = null;
188
- }
189
-
190
- if (this.plugins.highlighter && this.plugins.highlighter._tooltipElem) {
191
- this.plugins.highlighter._tooltipElem.emptyForce();
192
- this.plugins.highlighter._tooltipElem = null;
193
- }
194
-
195
- this.plugins.highlighter.highlightCanvas = new $.jqplot.GenericCanvas();
196
-
197
- this.eventCanvas._elem.before(this.plugins.highlighter.highlightCanvas.createElement(this._gridPadding, 'jqplot-highlight-canvas', this._plotDimensions, this));
198
- this.plugins.highlighter.highlightCanvas.setContext();
199
-
200
- var elem = document.createElement('div');
201
- this.plugins.highlighter._tooltipElem = $(elem);
202
- elem = null;
203
- this.plugins.highlighter._tooltipElem.addClass('jqplot-highlighter-tooltip');
204
- this.plugins.highlighter._tooltipElem.css({position:'absolute', display:'none'});
205
-
206
- this.eventCanvas._elem.before(this.plugins.highlighter._tooltipElem);
207
- };
208
-
209
- $.jqplot.preInitHooks.push($.jqplot.Highlighter.init);
210
- $.jqplot.preParseSeriesOptionsHooks.push($.jqplot.Highlighter.parseOptions);
211
- $.jqplot.postDrawHooks.push($.jqplot.Highlighter.postPlotDraw);
212
-
213
- function draw(plot, neighbor) {
214
- var hl = plot.plugins.highlighter;
215
- var s = plot.series[neighbor.seriesIndex];
216
- var smr = s.markerRenderer;
217
- var mr = hl.markerRenderer;
218
- mr.style = smr.style;
219
- mr.lineWidth = smr.lineWidth + hl.lineWidthAdjust;
220
- mr.size = smr.size + hl.sizeAdjust;
221
- var rgba = $.jqplot.getColorComponents(smr.color);
222
- var newrgb = [rgba[0], rgba[1], rgba[2]];
223
- var alpha = (rgba[3] >= 0.6) ? rgba[3]*0.6 : rgba[3]*(2-rgba[3]);
224
- mr.color = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+alpha+')';
225
- mr.init();
226
- var x_pos = s.gridData[neighbor.pointIndex][0];
227
- var y_pos = s.gridData[neighbor.pointIndex][1];
228
- // Adjusting with s._barNudge
229
- if (s.renderer.constructor == $.jqplot.BarRenderer) {
230
- if (s.barDirection == "vertical") {
231
- x_pos += s._barNudge;
232
- }
233
- else {
234
- y_pos -= s._barNudge;
235
- }
236
- }
237
- mr.draw(x_pos, y_pos, hl.highlightCanvas._ctx);
238
- }
239
-
240
- function showTooltip(plot, series, neighbor) {
241
- // neighbor looks like: {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}
242
- // gridData should be x,y pixel coords on the grid.
243
- // add the plot._gridPadding to that to get x,y in the target.
244
- var hl = plot.plugins.highlighter;
245
- var elem = hl._tooltipElem;
246
- var serieshl = series.highlighter || {};
247
-
248
- var opts = $.extend(true, {}, hl, serieshl);
249
-
250
- if (opts.useAxesFormatters) {
251
- var xf = series._xaxis._ticks[0].formatter;
252
- var yf = series._yaxis._ticks[0].formatter;
253
- var xfstr = series._xaxis._ticks[0].formatString;
254
- var yfstr = series._yaxis._ticks[0].formatString;
255
- var str;
256
- var xstr = xf(xfstr, neighbor.data[0]);
257
- var ystrs = [];
258
- for (var i=1; i<opts.yvalues+1; i++) {
259
- ystrs.push(yf(yfstr, neighbor.data[i]));
260
- }
261
- if (typeof opts.formatString === 'string') {
262
- switch (opts.tooltipAxes) {
263
- case 'both':
264
- case 'xy':
265
- ystrs.unshift(xstr);
266
- ystrs.unshift(opts.formatString);
267
- str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
268
- break;
269
- case 'yx':
270
- ystrs.push(xstr);
271
- ystrs.unshift(opts.formatString);
272
- str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
273
- break;
274
- case 'x':
275
- str = $.jqplot.sprintf.apply($.jqplot.sprintf, [opts.formatString, xstr]);
276
- break;
277
- case 'y':
278
- ystrs.unshift(opts.formatString);
279
- str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
280
- break;
281
- default: // same as xy
282
- ystrs.unshift(xstr);
283
- ystrs.unshift(opts.formatString);
284
- str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
285
- break;
286
- }
287
- }
288
- else {
289
- switch (opts.tooltipAxes) {
290
- case 'both':
291
- case 'xy':
292
- str = xstr;
293
- for (var i=0; i<ystrs.length; i++) {
294
- str += opts.tooltipSeparator + ystrs[i];
295
- }
296
- break;
297
- case 'yx':
298
- str = '';
299
- for (var i=0; i<ystrs.length; i++) {
300
- str += ystrs[i] + opts.tooltipSeparator;
301
- }
302
- str += xstr;
303
- break;
304
- case 'x':
305
- str = xstr;
306
- break;
307
- case 'y':
308
- str = ystrs.join(opts.tooltipSeparator);
309
- break;
310
- default: // same as 'xy'
311
- str = xstr;
312
- for (var i=0; i<ystrs.length; i++) {
313
- str += opts.tooltipSeparator + ystrs[i];
314
- }
315
- break;
316
-
317
- }
318
- }
319
- }
320
- else {
321
- var str;
322
- if (typeof opts.formatString === 'string') {
323
- str = $.jqplot.sprintf.apply($.jqplot.sprintf, [opts.formatString].concat(neighbor.data));
324
- }
325
-
326
- else {
327
- if (opts.tooltipAxes == 'both' || opts.tooltipAxes == 'xy') {
328
- str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[0]) + opts.tooltipSeparator + $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[1]);
329
- }
330
- else if (opts.tooltipAxes == 'yx') {
331
- str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[1]) + opts.tooltipSeparator + $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[0]);
332
- }
333
- else if (opts.tooltipAxes == 'x') {
334
- str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[0]);
335
- }
336
- else if (opts.tooltipAxes == 'y') {
337
- str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[1]);
338
- }
339
- }
340
- }
341
- if ($.isFunction(opts.tooltipContentEditor)) {
342
- // args str, seriesIndex, pointIndex are essential so the hook can look up
343
- // extra data for the point.
344
- str = opts.tooltipContentEditor(str, neighbor.seriesIndex, neighbor.pointIndex, plot);
345
- }
346
- elem.html(str);
347
- var gridpos = {x:neighbor.gridData[0], y:neighbor.gridData[1]};
348
- var ms = 0;
349
- var fact = 0.707;
350
- if (series.markerRenderer.show == true) {
351
- ms = (series.markerRenderer.size + opts.sizeAdjust)/2;
352
- }
353
-
354
- var loc = locations;
355
- if (series.fillToZero && series.fill && neighbor.data[1] < 0) {
356
- loc = oppositeLocations;
357
- }
358
-
359
- switch (loc[locationIndicies[opts.tooltipLocation]]) {
360
- case 'nw':
361
- var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - fact * ms;
362
- var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - fact * ms;
363
- break;
364
- case 'n':
365
- var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
366
- var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - ms;
367
- break;
368
- case 'ne':
369
- var x = gridpos.x + plot._gridPadding.left + opts.tooltipOffset + fact * ms;
370
- var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - fact * ms;
371
- break;
372
- case 'e':
373
- var x = gridpos.x + plot._gridPadding.left + opts.tooltipOffset + ms;
374
- var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
375
- break;
376
- case 'se':
377
- var x = gridpos.x + plot._gridPadding.left + opts.tooltipOffset + fact * ms;
378
- var y = gridpos.y + plot._gridPadding.top + opts.tooltipOffset + fact * ms;
379
- break;
380
- case 's':
381
- var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
382
- var y = gridpos.y + plot._gridPadding.top + opts.tooltipOffset + ms;
383
- break;
384
- case 'sw':
385
- var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - fact * ms;
386
- var y = gridpos.y + plot._gridPadding.top + opts.tooltipOffset + fact * ms;
387
- break;
388
- case 'w':
389
- var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - ms;
390
- var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
391
- break;
392
- default: // same as 'nw'
393
- var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - fact * ms;
394
- var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - fact * ms;
395
- break;
396
- }
397
- if (series.renderer.constructor == $.jqplot.BarRenderer) {
398
- if (series.barDirection == 'vertical') {
399
- x += series._barNudge;
400
- }
401
- else {
402
- y -= series._barNudge;
403
- }
404
- }
405
- elem.css('left', x);
406
- elem.css('top', y);
407
- if (opts.fadeTooltip) {
408
- // Fix for stacked up animations. Thnanks Trevor!
409
- elem.stop(true,true).fadeIn(opts.tooltipFadeSpeed);
410
- }
411
- else {
412
- elem.show();
413
- }
414
- elem = null;
415
-
416
- }
417
-
418
- function handleMove(ev, gridpos, datapos, neighbor, plot) {
419
- var hl = plot.plugins.highlighter;
420
- var c = plot.plugins.cursor;
421
- if (hl.show) {
422
- if (neighbor == null && hl.isHighlighting) {
423
- var evt = jQuery.Event('jqplotHighlighterUnhighlight');
424
- plot.target.trigger(evt);
425
-
426
- var ctx = hl.highlightCanvas._ctx;
427
- ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
428
- if (hl.fadeTooltip) {
429
- hl._tooltipElem.fadeOut(hl.tooltipFadeSpeed);
430
- }
431
- else {
432
- hl._tooltipElem.hide();
433
- }
434
- if (hl.bringSeriesToFront) {
435
- plot.restorePreviousSeriesOrder();
436
- }
437
- hl.isHighlighting = false;
438
- hl.currentNeighbor = null;
439
- ctx = null;
440
- }
441
- else if (neighbor != null && plot.series[neighbor.seriesIndex].showHighlight && !hl.isHighlighting) {
442
- var evt = jQuery.Event('jqplotHighlighterHighlight');
443
- evt.which = ev.which;
444
- evt.pageX = ev.pageX;
445
- evt.pageY = ev.pageY;
446
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data, plot];
447
- plot.target.trigger(evt, ins);
448
-
449
- hl.isHighlighting = true;
450
- hl.currentNeighbor = neighbor;
451
- if (hl.showMarker) {
452
- draw(plot, neighbor);
453
- }
454
- if (plot.series[neighbor.seriesIndex].show && hl.showTooltip && (!c || !c._zoom.started)) {
455
- showTooltip(plot, plot.series[neighbor.seriesIndex], neighbor);
456
- }
457
- if (hl.bringSeriesToFront) {
458
- plot.moveSeriesToFront(neighbor.seriesIndex);
459
- }
460
- }
461
- // check to see if we're highlighting the wrong point.
462
- else if (neighbor != null && hl.isHighlighting && hl.currentNeighbor != neighbor) {
463
- // highlighting the wrong point.
464
-
465
- // if new series allows highlighting, highlight new point.
466
- if (plot.series[neighbor.seriesIndex].showHighlight) {
467
- var ctx = hl.highlightCanvas._ctx;
468
- ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
469
- hl.isHighlighting = true;
470
- hl.currentNeighbor = neighbor;
471
- if (hl.showMarker) {
472
- draw(plot, neighbor);
473
- }
474
- if (plot.series[neighbor.seriesIndex].show && hl.showTooltip && (!c || !c._zoom.started)) {
475
- showTooltip(plot, plot.series[neighbor.seriesIndex], neighbor);
476
- }
477
- if (hl.bringSeriesToFront) {
478
- plot.moveSeriesToFront(neighbor.seriesIndex);
479
- }
480
- }
481
- }
482
- }
483
- }
484
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/jqplot/plugins/jqplot.highlighter.min.js DELETED
@@ -1,4 +0,0 @@
1
- /* jqplot 1.0.9 | (c) 2009-2016 Chris Leonello | jqplot.com
2
- jsDate | (c) 2010-2016 Chris Leonello
3
- */
4
- !function(a){function b(b,c){var d=b.plugins.highlighter,e=b.series[c.seriesIndex],f=e.markerRenderer,g=d.markerRenderer;g.style=f.style,g.lineWidth=f.lineWidth+d.lineWidthAdjust,g.size=f.size+d.sizeAdjust;var h=a.jqplot.getColorComponents(f.color),i=[h[0],h[1],h[2]],j=h[3]>=.6?.6*h[3]:h[3]*(2-h[3]);g.color="rgba("+i[0]+","+i[1]+","+i[2]+","+j+")",g.init();var k=e.gridData[c.pointIndex][0],l=e.gridData[c.pointIndex][1];e.renderer.constructor==a.jqplot.BarRenderer&&("vertical"==e.barDirection?k+=e._barNudge:l-=e._barNudge),g.draw(k,l,d.highlightCanvas._ctx)}function c(b,c,d){var h=b.plugins.highlighter,i=h._tooltipElem,j=c.highlighter||{},k=a.extend(!0,{},h,j);if(k.useAxesFormatters){for(var l,m=c._xaxis._ticks[0].formatter,n=c._yaxis._ticks[0].formatter,o=c._xaxis._ticks[0].formatString,p=c._yaxis._ticks[0].formatString,q=m(o,d.data[0]),r=[],s=1;s<k.yvalues+1;s++)r.push(n(p,d.data[s]));if("string"==typeof k.formatString)switch(k.tooltipAxes){case"both":case"xy":r.unshift(q),r.unshift(k.formatString),l=a.jqplot.sprintf.apply(a.jqplot.sprintf,r);break;case"yx":r.push(q),r.unshift(k.formatString),l=a.jqplot.sprintf.apply(a.jqplot.sprintf,r);break;case"x":l=a.jqplot.sprintf.apply(a.jqplot.sprintf,[k.formatString,q]);break;case"y":r.unshift(k.formatString),l=a.jqplot.sprintf.apply(a.jqplot.sprintf,r);break;default:r.unshift(q),r.unshift(k.formatString),l=a.jqplot.sprintf.apply(a.jqplot.sprintf,r)}else switch(k.tooltipAxes){case"both":case"xy":l=q;for(var s=0;s<r.length;s++)l+=k.tooltipSeparator+r[s];break;case"yx":l="";for(var s=0;s<r.length;s++)l+=r[s]+k.tooltipSeparator;l+=q;break;case"x":l=q;break;case"y":l=r.join(k.tooltipSeparator);break;default:l=q;for(var s=0;s<r.length;s++)l+=k.tooltipSeparator+r[s]}}else{var l;"string"==typeof k.formatString?l=a.jqplot.sprintf.apply(a.jqplot.sprintf,[k.formatString].concat(d.data)):"both"==k.tooltipAxes||"xy"==k.tooltipAxes?l=a.jqplot.sprintf(k.tooltipFormatString,d.data[0])+k.tooltipSeparator+a.jqplot.sprintf(k.tooltipFormatString,d.data[1]):"yx"==k.tooltipAxes?l=a.jqplot.sprintf(k.tooltipFormatString,d.data[1])+k.tooltipSeparator+a.jqplot.sprintf(k.tooltipFormatString,d.data[0]):"x"==k.tooltipAxes?l=a.jqplot.sprintf(k.tooltipFormatString,d.data[0]):"y"==k.tooltipAxes&&(l=a.jqplot.sprintf(k.tooltipFormatString,d.data[1]))}a.isFunction(k.tooltipContentEditor)&&(l=k.tooltipContentEditor(l,d.seriesIndex,d.pointIndex,b)),i.html(l);var t={x:d.gridData[0],y:d.gridData[1]},u=0,v=.707;1==c.markerRenderer.show&&(u=(c.markerRenderer.size+k.sizeAdjust)/2);var w=e;switch(c.fillToZero&&c.fill&&d.data[1]<0&&(w=g),w[f[k.tooltipLocation]]){case"nw":var x=t.x+b._gridPadding.left-i.outerWidth(!0)-k.tooltipOffset-v*u,y=t.y+b._gridPadding.top-k.tooltipOffset-i.outerHeight(!0)-v*u;break;case"n":var x=t.x+b._gridPadding.left-i.outerWidth(!0)/2,y=t.y+b._gridPadding.top-k.tooltipOffset-i.outerHeight(!0)-u;break;case"ne":var x=t.x+b._gridPadding.left+k.tooltipOffset+v*u,y=t.y+b._gridPadding.top-k.tooltipOffset-i.outerHeight(!0)-v*u;break;case"e":var x=t.x+b._gridPadding.left+k.tooltipOffset+u,y=t.y+b._gridPadding.top-i.outerHeight(!0)/2;break;case"se":var x=t.x+b._gridPadding.left+k.tooltipOffset+v*u,y=t.y+b._gridPadding.top+k.tooltipOffset+v*u;break;case"s":var x=t.x+b._gridPadding.left-i.outerWidth(!0)/2,y=t.y+b._gridPadding.top+k.tooltipOffset+u;break;case"sw":var x=t.x+b._gridPadding.left-i.outerWidth(!0)-k.tooltipOffset-v*u,y=t.y+b._gridPadding.top+k.tooltipOffset+v*u;break;case"w":var x=t.x+b._gridPadding.left-i.outerWidth(!0)-k.tooltipOffset-u,y=t.y+b._gridPadding.top-i.outerHeight(!0)/2;break;default:var x=t.x+b._gridPadding.left-i.outerWidth(!0)-k.tooltipOffset-v*u,y=t.y+b._gridPadding.top-k.tooltipOffset-i.outerHeight(!0)-v*u}c.renderer.constructor==a.jqplot.BarRenderer&&("vertical"==c.barDirection?x+=c._barNudge:y-=c._barNudge),i.css("left",x),i.css("top",y),k.fadeTooltip?i.stop(!0,!0).fadeIn(k.tooltipFadeSpeed):i.show(),i=null}function d(a,d,e,f,g){var h=g.plugins.highlighter,i=g.plugins.cursor;if(h.show)if(null==f&&h.isHighlighting){var j=jQuery.Event("jqplotHighlighterUnhighlight");g.target.trigger(j);var k=h.highlightCanvas._ctx;k.clearRect(0,0,k.canvas.width,k.canvas.height),h.fadeTooltip?h._tooltipElem.fadeOut(h.tooltipFadeSpeed):h._tooltipElem.hide(),h.bringSeriesToFront&&g.restorePreviousSeriesOrder(),h.isHighlighting=!1,h.currentNeighbor=null,k=null}else if(null!=f&&g.series[f.seriesIndex].showHighlight&&!h.isHighlighting){var j=jQuery.Event("jqplotHighlighterHighlight");j.which=a.which,j.pageX=a.pageX,j.pageY=a.pageY;var l=[f.seriesIndex,f.pointIndex,f.data,g];g.target.trigger(j,l),h.isHighlighting=!0,h.currentNeighbor=f,h.showMarker&&b(g,f),!g.series[f.seriesIndex].show||!h.showTooltip||i&&i._zoom.started||c(g,g.series[f.seriesIndex],f),h.bringSeriesToFront&&g.moveSeriesToFront(f.seriesIndex)}else if(null!=f&&h.isHighlighting&&h.currentNeighbor!=f&&g.series[f.seriesIndex].showHighlight){var k=h.highlightCanvas._ctx;k.clearRect(0,0,k.canvas.width,k.canvas.height),h.isHighlighting=!0,h.currentNeighbor=f,h.showMarker&&b(g,f),!g.series[f.seriesIndex].show||!h.showTooltip||i&&i._zoom.started||c(g,g.series[f.seriesIndex],f),h.bringSeriesToFront&&g.moveSeriesToFront(f.seriesIndex)}}a.jqplot.eventListenerHooks.push(["jqplotMouseMove",d]),a.jqplot.Highlighter=function(b){this.show=a.jqplot.config.enablePlugins,this.markerRenderer=new a.jqplot.MarkerRenderer({shadow:!1}),this.showMarker=!0,this.lineWidthAdjust=2.5,this.sizeAdjust=5,this.showTooltip=!0,this.tooltipLocation="nw",this.fadeTooltip=!0,this.tooltipFadeSpeed="fast",this.tooltipOffset=2,this.tooltipAxes="both",this.tooltipSeparator=", ",this.tooltipContentEditor=null,this.useAxesFormatters=!0,this.tooltipFormatString="%.5P",this.formatString=null,this.yvalues=1,this.bringSeriesToFront=!1,this._tooltipElem,this.isHighlighting=!1,this.currentNeighbor=null,a.extend(!0,this,b)};var e=["nw","n","ne","e","se","s","sw","w"],f={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7},g=["se","s","sw","w","nw","n","ne","e"];a.jqplot.Highlighter.init=function(b,c,d){var e=d||{};this.plugins.highlighter=new a.jqplot.Highlighter(e.highlighter)},a.jqplot.Highlighter.parseOptions=function(a,b){this.showHighlight=!0},a.jqplot.Highlighter.postPlotDraw=function(){this.plugins.highlighter&&this.plugins.highlighter.highlightCanvas&&(this.plugins.highlighter.highlightCanvas.resetCanvas(),this.plugins.highlighter.highlightCanvas=null),this.plugins.highlighter&&this.plugins.highlighter._tooltipElem&&(this.plugins.highlighter._tooltipElem.emptyForce(),this.plugins.highlighter._tooltipElem=null),this.plugins.highlighter.highlightCanvas=new a.jqplot.GenericCanvas,this.eventCanvas._elem.before(this.plugins.highlighter.highlightCanvas.createElement(this._gridPadding,"jqplot-highlight-canvas",this._plotDimensions,this)),this.plugins.highlighter.highlightCanvas.setContext();var b=document.createElement("div");this.plugins.highlighter._tooltipElem=a(b),b=null,this.plugins.highlighter._tooltipElem.addClass("jqplot-highlighter-tooltip"),this.plugins.highlighter._tooltipElem.css({position:"absolute",display:"none"}),this.eventCanvas._elem.before(this.plugins.highlighter._tooltipElem)},a.jqplot.preInitHooks.push(a.jqplot.Highlighter.init),a.jqplot.preParseSeriesOptionsHooks.push(a.jqplot.Highlighter.parseOptions),a.jqplot.postDrawHooks.push(a.jqplot.Highlighter.postPlotDraw)}(jQuery);
 
 
 
 
assets/jqplot/plugins/jqplot.pieRenderer.js DELETED
@@ -1,946 +0,0 @@
1
- /**
2
- * jqPlot
3
- * Pure JavaScript plotting plugin using jQuery
4
- *
5
- * Version: 1.0.9
6
- * Revision: c465c44
7
- *
8
- * Copyright (c) 2009-2016 Chris Leonello
9
- * jqPlot is currently available for use in all personal or commercial projects
10
- * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
11
- * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
12
- * choose the license that best suits your project and use it accordingly.
13
- *
14
- * Although not required, the author would appreciate an email letting him
15
- * know of any substantial use of jqPlot. You can reach the author at:
16
- * chris at jqplot dot com or see http://www.jqplot.com/info.php .
17
- *
18
- * If you are feeling kind and generous, consider supporting the project by
19
- * making a donation at: http://www.jqplot.com/donate.php .
20
- *
21
- * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
22
- *
23
- * version 2007.04.27
24
- * author Ash Searle
25
- * http://hexmen.com/blog/2007/03/printf-sprintf/
26
- * http://hexmen.com/js/sprintf.js
27
- * The author (Ash Searle) has placed this code in the public domain:
28
- * "This code is unrestricted: you are free to use it however you like."
29
- *
30
- */
31
- (function($) {
32
- /**
33
- * Class: $.jqplot.PieRenderer
34
- * Plugin renderer to draw a pie chart.
35
- * x values, if present, will be used as slice labels.
36
- * y values give slice size.
37
- *
38
- * To use this renderer, you need to include the
39
- * pie renderer plugin, for example:
40
- *
41
- * > <script type="text/javascript" src="plugins/jqplot.pieRenderer.js"></script>
42
- *
43
- * Properties described here are passed into the $.jqplot function
44
- * as options on the series renderer. For example:
45
- *
46
- * > plot2 = $.jqplot('chart2', [s1, s2], {
47
- * > seriesDefaults: {
48
- * > renderer:$.jqplot.PieRenderer,
49
- * > rendererOptions:{
50
- * > sliceMargin: 2,
51
- * > startAngle: -90
52
- * > }
53
- * > }
54
- * > });
55
- *
56
- * A pie plot will trigger events on the plot target
57
- * according to user interaction. All events return the event object,
58
- * the series index, the point (slice) index, and the point data for
59
- * the appropriate slice.
60
- *
61
- * 'jqplotDataMouseOver' - triggered when user mouseing over a slice.
62
- * 'jqplotDataHighlight' - triggered the first time user mouses over a slice,
63
- * if highlighting is enabled.
64
- * 'jqplotDataUnhighlight' - triggered when a user moves the mouse out of
65
- * a highlighted slice.
66
- * 'jqplotLegendHighlight' - triggered the first time user mouses over a legend,
67
- * if highlighting is enabled.
68
- * 'jqplotLegendUnhighlight' - triggered when a user moves the mouse out of
69
- * a highlighted legend.
70
- * 'jqplotDataClick' - triggered when the user clicks on a slice.
71
- * 'jqplotDataRightClick' - tiggered when the user right clicks on a slice if
72
- * the "captureRightClick" option is set to true on the plot.
73
- */
74
- $.jqplot.PieRenderer = function(){
75
- $.jqplot.LineRenderer.call(this);
76
- };
77
-
78
- $.jqplot.PieRenderer.prototype = new $.jqplot.LineRenderer();
79
- $.jqplot.PieRenderer.prototype.constructor = $.jqplot.PieRenderer;
80
-
81
- // called with scope of a series
82
- $.jqplot.PieRenderer.prototype.init = function(options, plot) {
83
- // Group: Properties
84
- //
85
- // prop: diameter
86
- // Outer diameter of the pie, auto computed by default
87
- this.diameter = null;
88
- // prop: padding
89
- // padding between the pie and plot edges, legend, etc.
90
- this.padding = 20;
91
- // prop: sliceMargin
92
- // angular spacing between pie slices in degrees.
93
- this.sliceMargin = 0;
94
- // prop: fill
95
- // true or false, whether to fil the slices.
96
- this.fill = true;
97
- // prop: shadowOffset
98
- // offset of the shadow from the slice and offset of
99
- // each succesive stroke of the shadow from the last.
100
- this.shadowOffset = 2;
101
- // prop: shadowAlpha
102
- // transparency of the shadow (0 = transparent, 1 = opaque)
103
- this.shadowAlpha = 0.07;
104
- // prop: shadowDepth
105
- // number of strokes to apply to the shadow,
106
- // each stroke offset shadowOffset from the last.
107
- this.shadowDepth = 5;
108
- // prop: highlightMouseOver
109
- // True to highlight slice when moused over.
110
- // This must be false to enable highlightMouseDown to highlight when clicking on a slice.
111
- this.highlightMouseOver = true;
112
- // prop: highlightMouseDown
113
- // True to highlight when a mouse button is pressed over a slice.
114
- // This will be disabled if highlightMouseOver is true.
115
- this.highlightMouseDown = false;
116
- // prop: highlightColors
117
- // an array of colors to use when highlighting a slice.
118
- this.highlightColors = [];
119
- // prop: dataLabels
120
- // Either 'label', 'value', 'percent' or an array of labels to place on the pie slices.
121
- // Defaults to percentage of each pie slice.
122
- this.dataLabels = 'percent';
123
- // prop: showDataLabels
124
- // true to show data labels on slices.
125
- this.showDataLabels = false;
126
- // prop: dataLabelFormatString
127
- // Format string for data labels. If none, '%s' is used for "label" and for arrays, '%d' for value and '%d%%' for percentage.
128
- this.dataLabelFormatString = null;
129
- // prop: dataLabelThreshold
130
- // Threshhold in percentage (0-100) of pie area, below which no label will be displayed.
131
- // This applies to all label types, not just to percentage labels.
132
- this.dataLabelThreshold = 3;
133
- // prop: dataLabelPositionFactor
134
- // A Multiplier (0-1) of the pie radius which controls position of label on slice.
135
- // Increasing will slide label toward edge of pie, decreasing will slide label toward center of pie.
136
- this.dataLabelPositionFactor = 0.52;
137
- // prop: dataLabelNudge
138
- // Number of pixels to slide the label away from (+) or toward (-) the center of the pie.
139
- this.dataLabelNudge = 2;
140
- // prop: dataLabelCenterOn
141
- // True to center the data label at its position.
142
- // False to set the inside facing edge of the label at its position.
143
- this.dataLabelCenterOn = true;
144
- // prop: startAngle
145
- // Angle to start drawing pie in degrees.
146
- // According to orientation of canvas coordinate system:
147
- // 0 = on the positive x axis
148
- // -90 = on the positive y axis.
149
- // 90 = on the negaive y axis.
150
- // 180 or - 180 = on the negative x axis.
151
- this.startAngle = 0;
152
- this.tickRenderer = $.jqplot.PieTickRenderer;
153
- // prop: showSlice
154
- // Array for whether the pie chart slice for a data element should be displayed.
155
- // Containsg true or false for each data element. If not specified, defaults to true.
156
- this.showSlice = [];
157
- // Used as check for conditions where pie shouldn't be drawn.
158
- this._drawData = true;
159
- this._type = 'pie';
160
-
161
- // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
162
- if (options.highlightMouseDown && options.highlightMouseOver == null) {
163
- options.highlightMouseOver = false;
164
- }
165
-
166
- $.extend(true, this, options);
167
-
168
- if (this.sliceMargin < 0) {
169
- this.sliceMargin = 0;
170
- }
171
-
172
- this._diameter = null;
173
- this._radius = null;
174
- // array of [start,end] angles arrays, one for each slice. In radians.
175
- this._sliceAngles = [];
176
- // index of the currenty highlighted point, if any
177
- this._highlightedPoint = null;
178
-
179
- // set highlight colors if none provided
180
- if (this.highlightColors.length == 0) {
181
- for (var i=0; i<this.seriesColors.length; i++){
182
- var rgba = $.jqplot.getColorComponents(this.seriesColors[i]);
183
- var newrgb = [rgba[0], rgba[1], rgba[2]];
184
- var sum = newrgb[0] + newrgb[1] + newrgb[2];
185
- for (var j=0; j<3; j++) {
186
- // when darkening, lowest color component can be is 60.
187
- newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
188
- newrgb[j] = parseInt(newrgb[j], 10);
189
- }
190
- this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
191
- }
192
- }
193
-
194
- this.highlightColorGenerator = new $.jqplot.ColorGenerator(this.highlightColors);
195
-
196
- plot.postParseOptionsHooks.addOnce(postParseOptions);
197
- plot.postInitHooks.addOnce(postInit);
198
- plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
199
- plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
200
- plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
201
- plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
202
- plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
203
- plot.postDrawHooks.addOnce(postPlotDraw);
204
- };
205
-
206
- $.jqplot.PieRenderer.prototype.setGridData = function(plot) {
207
- // set gridData property. This will hold angle in radians of each data point.
208
- var stack = [];
209
- var td = [];
210
- var sa = this.startAngle/180*Math.PI;
211
- var tot = 0;
212
- // don't know if we have any valid data yet, so set plot to not draw.
213
- this._drawData = false;
214
- for (var i=0; i<this.data.length; i++){
215
- if (this.data[i][1] != 0) {
216
- // we have data, O.K. to draw.
217
- this._drawData = true;
218
- if (this.showSlice[i] === undefined) {
219
- this.showSlice[i] = true;
220
- }
221
- }
222
- stack.push(this.data[i][1]);
223
- td.push([this.data[i][0]]);
224
- if (i>0) {
225
- stack[i] += stack[i-1];
226
- }
227
- tot += this.data[i][1];
228
- }
229
- var fact = Math.PI*2/stack[stack.length - 1];
230
-
231
- for (var i=0; i<stack.length; i++) {
232
- td[i][1] = stack[i] * fact;
233
- td[i][2] = this.data[i][1]/tot;
234
- }
235
- this.gridData = td;
236
- };
237
-
238
- $.jqplot.PieRenderer.prototype.makeGridData = function(data, plot) {
239
- var stack = [];
240
- var td = [];
241
- var tot = 0;
242
- var sa = this.startAngle/180*Math.PI;
243
- // don't know if we have any valid data yet, so set plot to not draw.
244
- this._drawData = false;
245
- for (var i=0; i<data.length; i++){
246
- if (this.data[i][1] != 0) {
247
- // we have data, O.K. to draw.
248
- this._drawData = true;
249
- }
250
- stack.push(data[i][1]);
251
- td.push([data[i][0]]);
252
- if (i>0) {
253
- stack[i] += stack[i-1];
254
- }
255
- tot += data[i][1];
256
- }
257
- var fact = Math.PI*2/stack[stack.length - 1];
258
-
259
- for (var i=0; i<stack.length; i++) {
260
- td[i][1] = stack[i] * fact;
261
- td[i][2] = data[i][1]/tot;
262
- }
263
- return td;
264
- };
265
-
266
- function calcRadiusAdjustment(ang) {
267
- return Math.sin((ang - (ang-Math.PI) / 8 / Math.PI )/2.0);
268
- }
269
-
270
- function calcRPrime(ang1, ang2, sliceMargin, fill, lineWidth) {
271
- var rprime = 0;
272
- var ang = ang2 - ang1;
273
- var absang = Math.abs(ang);
274
- var sm = sliceMargin;
275
- if (fill == false) {
276
- sm += lineWidth;
277
- }
278
-
279
- if (sm > 0 && absang > 0.01 && absang < 6.282) {
280
- rprime = parseFloat(sm) / 2.0 / calcRadiusAdjustment(ang);
281
- }
282
-
283
- return rprime;
284
- }
285
-
286
- $.jqplot.PieRenderer.prototype.drawSlice = function (ctx, ang1, ang2, color, isShadow) {
287
- if (this._drawData) {
288
- var r = this._radius;
289
- var fill = this.fill;
290
- var lineWidth = this.lineWidth;
291
- var sm = this.sliceMargin;
292
- if (this.fill == false) {
293
- sm += this.lineWidth;
294
- }
295
- ctx.save();
296
- ctx.translate(this._center[0], this._center[1]);
297
-
298
- var rprime = calcRPrime(ang1, ang2, this.sliceMargin, this.fill, this.lineWidth);
299
-
300
- var transx = rprime * Math.cos((ang1 + ang2) / 2.0);
301
- var transy = rprime * Math.sin((ang1 + ang2) / 2.0);
302
-
303
- if ((ang2 - ang1) <= Math.PI) {
304
- r -= rprime;
305
- }
306
- else {
307
- r += rprime;
308
- }
309
-
310
- ctx.translate(transx, transy);
311
-
312
- if (isShadow) {
313
- for (var i=0, l=this.shadowDepth; i<l; i++) {
314
- ctx.save();
315
- ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
316
- doDraw(r);
317
- }
318
- for (var i=0, l=this.shadowDepth; i<l; i++) {
319
- ctx.restore();
320
- }
321
- }
322
-
323
- else {
324
- doDraw(r);
325
- }
326
- ctx.restore();
327
- }
328
-
329
- function doDraw (rad) {
330
- // Fix for IE and Chrome that can't seem to draw circles correctly.
331
- // ang2 should always be <= 2 pi since that is the way the data is converted.
332
- // 2Pi = 6.2831853, Pi = 3.1415927
333
- if (ang2 > 6.282 + this.startAngle) {
334
- ang2 = 6.282 + this.startAngle;
335
- if (ang1 > ang2) {
336
- ang1 = 6.281 + this.startAngle;
337
- }
338
- }
339
- // Fix for IE, where it can't seem to handle 0 degree angles. Also avoids
340
- // ugly line on unfilled pies.
341
- if (ang1 >= ang2) {
342
- return;
343
- }
344
-
345
- ctx.beginPath();
346
- ctx.fillStyle = color;
347
- ctx.strokeStyle = color;
348
- ctx.lineWidth = lineWidth;
349
- ctx.arc(0, 0, rad, ang1, ang2, false);
350
- ctx.lineTo(0,0);
351
- ctx.closePath();
352
-
353
- if (fill) {
354
- ctx.fill();
355
- }
356
- else {
357
- ctx.stroke();
358
- }
359
- }
360
- };
361
-
362
- // called with scope of series
363
- $.jqplot.PieRenderer.prototype.draw = function (ctx, gd, options, plot) {
364
- var i;
365
- var opts = (options != undefined) ? options : {};
366
- // offset and direction of offset due to legend placement
367
- var offx = 0;
368
- var offy = 0;
369
- var trans = 1;
370
- var colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors);
371
- var sliceColor;
372
-
373
- if (options.legendInfo && options.legendInfo.placement == 'insideGrid') {
374
- var li = options.legendInfo;
375
- switch (li.location) {
376
- case 'nw':
377
- offx = li.width + li.xoffset;
378
- break;
379
- case 'w':
380
- offx = li.width + li.xoffset;
381
- break;
382
- case 'sw':
383
- offx = li.width + li.xoffset;
384
- break;
385
- case 'ne':
386
- offx = li.width + li.xoffset;
387
- trans = -1;
388
- break;
389
- case 'e':
390
- offx = li.width + li.xoffset;
391
- trans = -1;
392
- break;
393
- case 'se':
394
- offx = li.width + li.xoffset;
395
- trans = -1;
396
- break;
397
- case 'n':
398
- offy = li.height + li.yoffset;
399
- break;
400
- case 's':
401
- offy = li.height + li.yoffset;
402
- trans = -1;
403
- break;
404
- default:
405
- break;
406
- }
407
- }
408
-
409
- var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
410
- var fill = (opts.fill != undefined) ? opts.fill : this.fill;
411
-
412
- //see http://stackoverflow.com/questions/20221461/hidpi-retina-plot-drawing
413
- var cw = parseInt(ctx.canvas.style.width);
414
- var ch = parseInt(ctx.canvas.style.height);
415
- //
416
-
417
- var w = cw - offx - 2 * this.padding;
418
- var h = ch - offy - 2 * this.padding;
419
- var mindim = Math.min(w,h);
420
- var d = mindim;
421
-
422
- // Fixes issue #272. Thanks hugwijst!
423
- // reset slice angles array.
424
- this._sliceAngles = [];
425
-
426
- var sm = this.sliceMargin;
427
- if (this.fill == false) {
428
- sm += this.lineWidth;
429
- }
430
-
431
- var rprime;
432
- var maxrprime = 0;
433
-
434
- var ang, ang1, ang2, shadowColor;
435
- var sa = this.startAngle / 180 * Math.PI;
436
-
437
- // have to pre-draw shadows, so loop throgh here and calculate some values also.
438
- for (var i=0, l=gd.length; i<l; i++) {
439
- ang1 = (i == 0) ? sa : gd[i-1][1] + sa;
440
- ang2 = gd[i][1] + sa;
441
-
442
- this._sliceAngles.push([ang1, ang2]);
443
-
444
- rprime = calcRPrime(ang1, ang2, this.sliceMargin, this.fill, this.lineWidth);
445
-
446
- if (Math.abs(ang2-ang1) > Math.PI) {
447
- maxrprime = Math.max(rprime, maxrprime);
448
- }
449
- }
450
-
451
- if (this.diameter != null && this.diameter > 0) {
452
- this._diameter = this.diameter - 2*maxrprime;
453
- }
454
- else {
455
- this._diameter = d - 2*maxrprime;
456
- }
457
-
458
- // Need to check for undersized pie. This can happen if
459
- // plot area too small and legend is too big.
460
- if (this._diameter < 6) {
461
- $.jqplot.log('Diameter of pie too small, not rendering.');
462
- return;
463
- }
464
-
465
- var r = this._radius = this._diameter/2;
466
-
467
- this._center = [(cw - trans * offx)/2 + trans * offx + maxrprime * Math.cos(sa), (ch - trans*offy)/2 + trans * offy + maxrprime * Math.sin(sa)];
468
-
469
- if (this.shadow) {
470
- for (var i=0, l=gd.length; i<l; i++) {
471
- shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
472
- this.renderer.drawSlice.call (this, ctx, this._sliceAngles[i][0], this._sliceAngles[i][1], shadowColor, true);
473
- }
474
- }
475
-
476
- for (var i=0; i<gd.length; i++) {
477
-
478
- sliceColor = colorGenerator.next();
479
-
480
- if (this.showSlice[i]) {
481
- this.renderer.drawSlice.call (this, ctx, this._sliceAngles[i][0], this._sliceAngles[i][1], sliceColor, false);
482
-
483
- if (this.showDataLabels && gd[i][2]*100 >= this.dataLabelThreshold) {
484
- var fstr, avgang = (this._sliceAngles[i][0] + this._sliceAngles[i][1])/2, label;
485
-
486
- if (this.dataLabels == 'label') {
487
- fstr = this.dataLabelFormatString || '%s';
488
- label = $.jqplot.sprintf(fstr, gd[i][0]);
489
- }
490
- else if (this.dataLabels == 'value') {
491
- fstr = this.dataLabelFormatString || '%d';
492
- label = $.jqplot.sprintf(fstr, this.data[i][1]);
493
- }
494
- else if (this.dataLabels == 'percent') {
495
- fstr = this.dataLabelFormatString || '%d%%';
496
- label = $.jqplot.sprintf(fstr, gd[i][2]*100);
497
- }
498
- else if (this.dataLabels.constructor == Array) {
499
- fstr = this.dataLabelFormatString || '%s';
500
- label = $.jqplot.sprintf(fstr, this.dataLabels[i]);
501
- }
502
-
503
- var fact = (this._radius ) * this.dataLabelPositionFactor + this.sliceMargin + this.dataLabelNudge;
504
-
505
- var x = this._center[0] + Math.cos(avgang) * fact + this.canvas._offsets.left;
506
- var y = this._center[1] + Math.sin(avgang) * fact + this.canvas._offsets.top;
507
-
508
- var labelelem = $('<div class="jqplot-pie-series jqplot-data-label" style="position:absolute;">' + label + '</div>').insertBefore(plot.eventCanvas._elem);
509
- if (this.dataLabelCenterOn) {
510
- x -= labelelem.width()/2;
511
- y -= labelelem.height()/2;
512
- }
513
- else {
514
- x -= labelelem.width() * Math.sin(avgang/2);
515
- y -= labelelem.height()/2;
516
- }
517
- x = Math.round(x);
518
- y = Math.round(y);
519
- labelelem.css({left: x, top: y});
520
- }
521
- }
522
- }
523
- };
524
-
525
- $.jqplot.PieAxisRenderer = function() {
526
- $.jqplot.LinearAxisRenderer.call(this);
527
- };
528
-
529
- $.jqplot.PieAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
530
- $.jqplot.PieAxisRenderer.prototype.constructor = $.jqplot.PieAxisRenderer;
531
-
532
-
533
- // There are no traditional axes on a pie chart. We just need to provide
534
- // dummy objects with properties so the plot will render.
535
- // called with scope of axis object.
536
- $.jqplot.PieAxisRenderer.prototype.init = function(options){
537
- //
538
- this.tickRenderer = $.jqplot.PieTickRenderer;
539
- $.extend(true, this, options);
540
- // I don't think I'm going to need _dataBounds here.
541
- // have to go Axis scaling in a way to fit chart onto plot area
542
- // and provide u2p and p2u functionality for mouse cursor, etc.
543
- // for convienence set _dataBounds to 0 and 100 and
544
- // set min/max to 0 and 100.
545
- this._dataBounds = {min:0, max:100};
546
- this.min = 0;
547
- this.max = 100;
548
- this.showTicks = false;
549
- this.ticks = [];
550
- this.showMark = false;
551
- this.show = false;
552
- };
553
-
554
-
555
-
556
-
557
- $.jqplot.PieLegendRenderer = function(){
558
- $.jqplot.TableLegendRenderer.call(this);
559
- };
560
-
561
- $.jqplot.PieLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
562
- $.jqplot.PieLegendRenderer.prototype.constructor = $.jqplot.PieLegendRenderer;
563
-
564
- /**
565
- * Class: $.jqplot.PieLegendRenderer
566
- * Legend Renderer specific to pie plots. Set by default
567
- * when user creates a pie plot.
568
- */
569
- $.jqplot.PieLegendRenderer.prototype.init = function(options) {
570
- // Group: Properties
571
- //
572
- // prop: numberRows
573
- // Maximum number of rows in the legend. 0 or null for unlimited.
574
- this.numberRows = null;
575
- // prop: numberColumns
576
- // Maximum number of columns in the legend. 0 or null for unlimited.
577
- this.numberColumns = null;
578
- // prop: width
579
- // Fixed with of legend. 0 or null for auto size
580
- this.width = null;
581
- $.extend(true, this, options);
582
- };
583
-
584
- // called with context of legend
585
- $.jqplot.PieLegendRenderer.prototype.draw = function() {
586
- var legend = this;
587
- if (this.show) {
588
- var series = this._series;
589
-
590
-
591
- this._elem = $(document.createElement('table'));
592
- this._elem.addClass('jqplot-table-legend');
593
-
594
- var ss = {position:'absolute'};
595
- if (this.background) {
596
- ss['background'] = this.background;
597
- }
598
- if (this.border) {
599
- ss['border'] = this.border;
600
- }
601
- if (this.fontSize) {
602
- ss['fontSize'] = this.fontSize;
603
- }
604
- if (this.fontFamily) {
605
- ss['fontFamily'] = this.fontFamily;
606
- }
607
- if (this.textColor) {
608
- ss['textColor'] = this.textColor;
609
- }
610
- if (this.marginTop != null) {
611
- ss['marginTop'] = this.marginTop;
612
- }
613
- if (this.marginBottom != null) {
614
- ss['marginBottom'] = this.marginBottom;
615
- }
616
- if (this.marginLeft != null) {
617
- ss['marginLeft'] = this.marginLeft;
618
- }
619
- if (this.marginRight != null) {
620
- ss['marginRight'] = this.marginRight;
621
- }
622
-
623
- this._elem.css(ss);
624
-
625
- // Pie charts legends don't go by number of series, but by number of data points
626
- // in the series. Refactor things here for that.
627
-
628
- var pad = false,
629
- reverse = false,
630
- nr,
631
- nc;
632
- var s = series[0];
633
- var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors);
634
-
635
- if (s.show) {
636
- var pd = s.data;
637
- if (this.numberRows) {
638
- nr = this.numberRows;
639
- if (!this.numberColumns){
640
- nc = Math.ceil(pd.length/nr);
641
- }
642
- else{
643
- nc = this.numberColumns;
644
- }
645
- }
646
- else if (this.numberColumns) {
647
- nc = this.numberColumns;
648
- nr = Math.ceil(pd.length/this.numberColumns);
649
- }
650
- else {
651
- nr = pd.length;
652
- nc = 1;
653
- }
654
-
655
- var i, j;
656
- var tr, td1, td2;
657
- var lt, tt, rs, color;
658
- var idx = 0;
659
- var div0, div1;
660
-
661
- for (i=0; i<nr; i++) {
662
- tr = $(document.createElement('tr'));
663
- tr.addClass('jqplot-table-legend');
664
-
665
- if (reverse){
666
- tr.prependTo(this._elem);
667
- }
668
-
669
- else{
670
- tr.appendTo(this._elem);
671
- }
672
-
673
- for (j=0; j<nc; j++) {
674
- if (idx < pd.length) {
675
- tt = '';
676
- if (this.labels[idx]) {
677
- lt = this.labels[idx];
678
- }
679
- else {
680
- if (typeof pd[idx][0] === 'object') {
681
- lt = pd[idx][0][0].toString();
682
- tt = pd[idx][0][1].toString();
683
- }
684
- else {
685
- lt = pd[idx][0].toString();
686
- }
687
- }
688
- //lt = this.labels[idx] || pd[idx][0].toString();
689
- color = colorGenerator.next();
690
- if (!reverse){
691
- if (i>0){
692
- pad = true;
693
- }
694
- else{
695
- pad = false;
696
- }
697
- }
698
- else{
699
- if (i == nr -1){
700
- pad = false;
701
- }
702
- else{
703
- pad = true;
704
- }
705
- }
706
- rs = (pad) ? this.rowSpacing : '0';
707
-
708
-
709
-
710
- td1 = $(document.createElement('td'));
711
- td1.addClass('jqplot-table-legend jqplot-table-legend-swatch');
712
- td1.css({textAlign: 'center', paddingTop: rs});
713
-
714
- div0 = $(document.createElement('div'));
715
- div0.addClass('jqplot-table-legend-swatch-outline');
716
- if (tt !== '') {
717
- div0.attr("title", tt);
718
- }
719
- div1 = $(document.createElement('div'));
720
- div1.addClass('jqplot-table-legend-swatch');
721
- div1.css({backgroundColor: color, borderColor: color});
722
- td1.append(div0.append(div1));
723
-
724
- td2 = $(document.createElement('td'));
725
- td2.addClass('jqplot-table-legend jqplot-table-legend-label');
726
- td2.css('paddingTop', rs);
727
-
728
- if (this.escapeHtml){
729
- td2.text(lt);
730
- }
731
- else {
732
- td2.html('<a title="' + tt + '">' + lt + "</a>");
733
- }
734
- if (reverse) {
735
- td2.prependTo(tr);
736
- td1.prependTo(tr);
737
- }
738
- else {
739
- td1.appendTo(tr);
740
- td2.appendTo(tr);
741
- }
742
- pad = true;
743
- }
744
- idx++;
745
- }
746
- }
747
- }
748
- }
749
- return this._elem;
750
- };
751
-
752
- $.jqplot.PieRenderer.prototype.handleMove = function(ev, gridpos, datapos, neighbor, plot) {
753
- if (neighbor) {
754
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
755
- plot.target.trigger('jqplotDataMouseOver', ins);
756
- if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.pieRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
757
- plot.target.trigger('jqplotDataHighlight', ins);
758
- highlight (plot, ins[0], ins[1]);
759
- }
760
- }
761
- else if (neighbor == null) {
762
- unhighlight (plot);
763
- }
764
- };
765
-
766
-
767
- // this.eventCanvas._elem.bind($.jqplot.eventListenerHooks[i][0], {plot:this}, $.jqplot.eventListenerHooks[i][1]);
768
-
769
- // setup default renderers for axes and legend so user doesn't have to
770
- // called with scope of plot
771
- function preInit(target, data, options) {
772
- options = options || {};
773
- options.axesDefaults = options.axesDefaults || {};
774
- options.legend = options.legend || {};
775
- options.seriesDefaults = options.seriesDefaults || {};
776
- // only set these if there is a pie series
777
- var setopts = false;
778
- if (options.seriesDefaults.renderer == $.jqplot.PieRenderer) {
779
- setopts = true;
780
- }
781
- else if (options.series) {
782
- for (var i=0; i < options.series.length; i++) {
783
- if (options.series[i].renderer == $.jqplot.PieRenderer) {
784
- setopts = true;
785
- }
786
- }
787
- }
788
-
789
- if (setopts) {
790
- options.axesDefaults.renderer = $.jqplot.PieAxisRenderer;
791
- options.legend.renderer = options.legend.renderer || $.jqplot.PieLegendRenderer;
792
- options.legend.preDraw = true;
793
- options.seriesDefaults.pointLabels = {show: false};
794
- }
795
- }
796
-
797
- function postInit(target, data, options) {
798
- for (var i=0; i<this.series.length; i++) {
799
- if (this.series[i].renderer.constructor == $.jqplot.PieRenderer) {
800
- // don't allow mouseover and mousedown at same time.
801
- if (this.series[i].highlightMouseOver) {
802
- this.series[i].highlightMouseDown = false;
803
- }
804
- }
805
- }
806
- }
807
-
808
- // called with scope of plot
809
- function postParseOptions(options) {
810
- for (var i=0; i<this.series.length; i++) {
811
- this.series[i].seriesColors = this.seriesColors;
812
- this.series[i].colorGenerator = $.jqplot.colorGenerator;
813
- }
814
- }
815
-
816
- function highlight (plot, sidx, pidx) {
817
- if (plot.series[sidx].showSlice[pidx]) {
818
- var s = plot.series[sidx];
819
- var canvas = plot.plugins.pieRenderer.highlightCanvas;
820
- canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
821
- s._highlightedPoint = pidx;
822
- plot.plugins.pieRenderer.highlightedSeriesIndex = sidx;
823
- s.renderer.drawSlice.call(s, canvas._ctx, s._sliceAngles[pidx][0], s._sliceAngles[pidx][1], s.highlightColorGenerator.get(pidx), false);
824
- }
825
- }
826
-
827
- function unhighlight (plot) {
828
- var canvas = plot.plugins.pieRenderer.highlightCanvas;
829
- canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
830
- for (var i=0; i<plot.series.length; i++) {
831
- plot.series[i]._highlightedPoint = null;
832
- }
833
- plot.plugins.pieRenderer.highlightedSeriesIndex = null;
834
- plot.target.trigger('jqplotDataUnhighlight');
835
- }
836
-
837
- function handleMove(ev, gridpos, datapos, neighbor, plot) {
838
- if (neighbor) {
839
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
840
- var evt1 = jQuery.Event('jqplotDataMouseOver');
841
- evt1.pageX = ev.pageX;
842
- evt1.pageY = ev.pageY;
843
- plot.target.trigger(evt1, ins);
844
- if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.pieRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
845
- var evt = jQuery.Event('jqplotDataHighlight');
846
- evt.which = ev.which;
847
- evt.pageX = ev.pageX;
848
- evt.pageY = ev.pageY;
849
- plot.target.trigger(evt, ins);
850
- highlight (plot, ins[0], ins[1]);
851
- }
852
- }
853
- else if (neighbor == null) {
854
- unhighlight (plot);
855
- }
856
- }
857
-
858
- function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
859
- if (neighbor) {
860
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
861
- if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.pieRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
862
- var evt = jQuery.Event('jqplotDataHighlight');
863
- evt.which = ev.which;
864
- evt.pageX = ev.pageX;
865
- evt.pageY = ev.pageY;
866
- plot.target.trigger(evt, ins);
867
- highlight (plot, ins[0], ins[1]);
868
- }
869
- }
870
- else if (neighbor == null) {
871
- unhighlight (plot);
872
- }
873
- }
874
-
875
- function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
876
- var idx = plot.plugins.pieRenderer.highlightedSeriesIndex;
877
- if (idx != null && plot.series[idx].highlightMouseDown) {
878
- unhighlight(plot);
879
- }
880
- }
881
-
882
- function handleClick(ev, gridpos, datapos, neighbor, plot) {
883
- if (neighbor) {
884
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
885
- var evt = jQuery.Event('jqplotDataClick');
886
- evt.which = ev.which;
887
- evt.pageX = ev.pageX;
888
- evt.pageY = ev.pageY;
889
- plot.target.trigger(evt, ins);
890
- }
891
- }
892
-
893
- function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
894
- if (neighbor) {
895
- var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
896
- var idx = plot.plugins.pieRenderer.highlightedSeriesIndex;
897
- if (idx != null && plot.series[idx].highlightMouseDown) {
898
- unhighlight(plot);
899
- }
900
- var evt = jQuery.Event('jqplotDataRightClick');
901
- evt.which = ev.which;
902
- evt.pageX = ev.pageX;
903
- evt.pageY = ev.pageY;
904
- plot.target.trigger(evt, ins);
905
- }
906
- }
907
-
908
- // called within context of plot
909
- // create a canvas which we can draw on.
910
- // insert it before the eventCanvas, so eventCanvas will still capture events.
911
- function postPlotDraw() {
912
- // Memory Leaks patch
913
- if (this.plugins.pieRenderer && this.plugins.pieRenderer.highlightCanvas) {
914
- this.plugins.pieRenderer.highlightCanvas.resetCanvas();
915
- this.plugins.pieRenderer.highlightCanvas = null;
916
- }
917
-
918
- this.plugins.pieRenderer = {highlightedSeriesIndex:null};
919
- this.plugins.pieRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
920
-
921
- // do we have any data labels? if so, put highlight canvas before those
922
- var labels = $(this.targetId+' .jqplot-data-label');
923
- if (labels.length) {
924
- $(labels[0]).before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this));
925
- }
926
- // else put highlight canvas before event canvas.
927
- else {
928
- this.eventCanvas._elem.before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this));
929
- }
930
-
931
- var hctx = this.plugins.pieRenderer.highlightCanvas.setContext();
932
- this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
933
- }
934
-
935
- $.jqplot.preInitHooks.push(preInit);
936
-
937
- $.jqplot.PieTickRenderer = function() {
938
- $.jqplot.AxisTickRenderer.call(this);
939
- };
940
-
941
- $.jqplot.PieTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
942
- $.jqplot.PieTickRenderer.prototype.constructor = $.jqplot.PieTickRenderer;
943
-
944
- })(jQuery);
945
-
946
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/jqplot/plugins/jqplot.pieRenderer.min.js DELETED
@@ -1,4 +0,0 @@
1
- /* jqplot 1.0.9 | (c) 2009-2016 Chris Leonello | jqplot.com
2
- jsDate | (c) 2010-2016 Chris Leonello
3
- */
4
- !function(a){function b(a){return Math.sin((a-(a-Math.PI)/8/Math.PI)/2)}function c(a,c,d,e,f){var g=0,h=c-a,i=Math.abs(h),j=d;return 0==e&&(j+=f),j>0&&i>.01&&i<6.282&&(g=parseFloat(j)/2/b(h)),g}function d(b,c,d){d=d||{},d.axesDefaults=d.axesDefaults||{},d.legend=d.legend||{},d.seriesDefaults=d.seriesDefaults||{};var e=!1;if(d.seriesDefaults.renderer==a.jqplot.PieRenderer)e=!0;else if(d.series)for(var f=0;f<d.series.length;f++)d.series[f].renderer==a.jqplot.PieRenderer&&(e=!0);e&&(d.axesDefaults.renderer=a.jqplot.PieAxisRenderer,d.legend.renderer=d.legend.renderer||a.jqplot.PieLegendRenderer,d.legend.preDraw=!0,d.seriesDefaults.pointLabels={show:!1})}function e(b,c,d){for(var e=0;e<this.series.length;e++)this.series[e].renderer.constructor==a.jqplot.PieRenderer&&this.series[e].highlightMouseOver&&(this.series[e].highlightMouseDown=!1)}function f(b){for(var c=0;c<this.series.length;c++)this.series[c].seriesColors=this.seriesColors,this.series[c].colorGenerator=a.jqplot.colorGenerator}function g(a,b,c){if(a.series[b].showSlice[c]){var d=a.series[b],e=a.plugins.pieRenderer.highlightCanvas;e._ctx.clearRect(0,0,e._ctx.canvas.width,e._ctx.canvas.height),d._highlightedPoint=c,a.plugins.pieRenderer.highlightedSeriesIndex=b,d.renderer.drawSlice.call(d,e._ctx,d._sliceAngles[c][0],d._sliceAngles[c][1],d.highlightColorGenerator.get(c),!1)}}function h(a){var b=a.plugins.pieRenderer.highlightCanvas;b._ctx.clearRect(0,0,b._ctx.canvas.width,b._ctx.canvas.height);for(var c=0;c<a.series.length;c++)a.series[c]._highlightedPoint=null;a.plugins.pieRenderer.highlightedSeriesIndex=null,a.target.trigger("jqplotDataUnhighlight")}function i(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data],i=jQuery.Event("jqplotDataMouseOver");if(i.pageX=a.pageX,i.pageY=a.pageY,e.target.trigger(i,f),e.series[f[0]].highlightMouseOver&&(f[0]!=e.plugins.pieRenderer.highlightedSeriesIndex||f[1]!=e.series[f[0]]._highlightedPoint)){var j=jQuery.Event("jqplotDataHighlight");j.which=a.which,j.pageX=a.pageX,j.pageY=a.pageY,e.target.trigger(j,f),g(e,f[0],f[1])}}else null==d&&h(e)}function j(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data];if(e.series[f[0]].highlightMouseDown&&(f[0]!=e.plugins.pieRenderer.highlightedSeriesIndex||f[1]!=e.series[f[0]]._highlightedPoint)){var i=jQuery.Event("jqplotDataHighlight");i.which=a.which,i.pageX=a.pageX,i.pageY=a.pageY,e.target.trigger(i,f),g(e,f[0],f[1])}}else null==d&&h(e)}function k(a,b,c,d,e){var f=e.plugins.pieRenderer.highlightedSeriesIndex;null!=f&&e.series[f].highlightMouseDown&&h(e)}function l(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data],g=jQuery.Event("jqplotDataClick");g.which=a.which,g.pageX=a.pageX,g.pageY=a.pageY,e.target.trigger(g,f)}}function m(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data],g=e.plugins.pieRenderer.highlightedSeriesIndex;null!=g&&e.series[g].highlightMouseDown&&h(e);var i=jQuery.Event("jqplotDataRightClick");i.which=a.which,i.pageX=a.pageX,i.pageY=a.pageY,e.target.trigger(i,f)}}function n(){this.plugins.pieRenderer&&this.plugins.pieRenderer.highlightCanvas&&(this.plugins.pieRenderer.highlightCanvas.resetCanvas(),this.plugins.pieRenderer.highlightCanvas=null),this.plugins.pieRenderer={highlightedSeriesIndex:null},this.plugins.pieRenderer.highlightCanvas=new a.jqplot.GenericCanvas;var b=a(this.targetId+" .jqplot-data-label");b.length?a(b[0]).before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-pieRenderer-highlight-canvas",this._plotDimensions,this)):this.eventCanvas._elem.before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-pieRenderer-highlight-canvas",this._plotDimensions,this));this.plugins.pieRenderer.highlightCanvas.setContext();this.eventCanvas._elem.bind("mouseleave",{plot:this},function(a){h(a.data.plot)})}a.jqplot.PieRenderer=function(){a.jqplot.LineRenderer.call(this)},a.jqplot.PieRenderer.prototype=new a.jqplot.LineRenderer,a.jqplot.PieRenderer.prototype.constructor=a.jqplot.PieRenderer,a.jqplot.PieRenderer.prototype.init=function(b,c){if(this.diameter=null,this.padding=20,this.sliceMargin=0,this.fill=!0,this.shadowOffset=2,this.shadowAlpha=.07,this.shadowDepth=5,this.highlightMouseOver=!0,this.highlightMouseDown=!1,this.highlightColors=[],this.dataLabels="percent",this.showDataLabels=!1,this.dataLabelFormatString=null,this.dataLabelThreshold=3,this.dataLabelPositionFactor=.52,this.dataLabelNudge=2,this.dataLabelCenterOn=!0,this.startAngle=0,this.tickRenderer=a.jqplot.PieTickRenderer,this.showSlice=[],this._drawData=!0,this._type="pie",b.highlightMouseDown&&null==b.highlightMouseOver&&(b.highlightMouseOver=!1),a.extend(!0,this,b),this.sliceMargin<0&&(this.sliceMargin=0),this._diameter=null,this._radius=null,this._sliceAngles=[],this._highlightedPoint=null,0==this.highlightColors.length)for(var d=0;d<this.seriesColors.length;d++){for(var g=a.jqplot.getColorComponents(this.seriesColors[d]),h=[g[0],g[1],g[2]],o=h[0]+h[1]+h[2],p=0;p<3;p++)h[p]=o>570?.8*h[p]:h[p]+.3*(255-h[p]),h[p]=parseInt(h[p],10);this.highlightColors.push("rgb("+h[0]+","+h[1]+","+h[2]+")")}this.highlightColorGenerator=new a.jqplot.ColorGenerator(this.highlightColors),c.postParseOptionsHooks.addOnce(f),c.postInitHooks.addOnce(e),c.eventListenerHooks.addOnce("jqplotMouseMove",i),c.eventListenerHooks.addOnce("jqplotMouseDown",j),c.eventListenerHooks.addOnce("jqplotMouseUp",k),c.eventListenerHooks.addOnce("jqplotClick",l),c.eventListenerHooks.addOnce("jqplotRightClick",m),c.postDrawHooks.addOnce(n)},a.jqplot.PieRenderer.prototype.setGridData=function(a){var b=[],c=[],d=(this.startAngle/180*Math.PI,0);this._drawData=!1;for(var e=0;e<this.data.length;e++)0!=this.data[e][1]&&(this._drawData=!0,void 0===this.showSlice[e]&&(this.showSlice[e]=!0)),b.push(this.data[e][1]),c.push([this.data[e][0]]),e>0&&(b[e]+=b[e-1]),d+=this.data[e][1];for(var f=2*Math.PI/b[b.length-1],e=0;e<b.length;e++)c[e][1]=b[e]*f,c[e][2]=this.data[e][1]/d;this.gridData=c},a.jqplot.PieRenderer.prototype.makeGridData=function(a,b){var c=[],d=[],e=0;this.startAngle/180*Math.PI;this._drawData=!1;for(var f=0;f<a.length;f++)0!=this.data[f][1]&&(this._drawData=!0),c.push(a[f][1]),d.push([a[f][0]]),f>0&&(c[f]+=c[f-1]),e+=a[f][1];for(var g=2*Math.PI/c[c.length-1],f=0;f<c.length;f++)d[f][1]=c[f]*g,d[f][2]=a[f][1]/e;return d},a.jqplot.PieRenderer.prototype.drawSlice=function(a,b,d,e,f){function g(c){d>6.282+this.startAngle&&(d=6.282+this.startAngle,b>d&&(b=6.281+this.startAngle)),b>=d||(a.beginPath(),a.fillStyle=e,a.strokeStyle=e,a.lineWidth=j,a.arc(0,0,c,b,d,!1),a.lineTo(0,0),a.closePath(),i?a.fill():a.stroke())}if(this._drawData){var h=this._radius,i=this.fill,j=this.lineWidth,k=this.sliceMargin;0==this.fill&&(k+=this.lineWidth),a.save(),a.translate(this._center[0],this._center[1]);var l=c(b,d,this.sliceMargin,this.fill,this.lineWidth),m=l*Math.cos((b+d)/2),n=l*Math.sin((b+d)/2);if(d-b<=Math.PI?h-=l:h+=l,a.translate(m,n),f){for(var o=0,p=this.shadowDepth;o<p;o++)a.save(),a.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI),this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI)),g(h);for(var o=0,p=this.shadowDepth;o<p;o++)a.restore()}else g(h);a.restore()}},a.jqplot.PieRenderer.prototype.draw=function(b,d,e,f){var g,h,i=void 0!=e?e:{},j=0,k=0,l=1,m=new a.jqplot.ColorGenerator(this.seriesColors);if(e.legendInfo&&"insideGrid"==e.legendInfo.placement){var n=e.legendInfo;switch(n.location){case"nw":j=n.width+n.xoffset;break;case"w":j=n.width+n.xoffset;break;case"sw":j=n.width+n.xoffset;break;case"ne":j=n.width+n.xoffset,l=-1;break;case"e":j=n.width+n.xoffset,l=-1;break;case"se":j=n.width+n.xoffset,l=-1;break;case"n":k=n.height+n.yoffset;break;case"s":k=n.height+n.yoffset,l=-1}}var o=(void 0!=i.shadow?i.shadow:this.shadow,void 0!=i.fill?i.fill:this.fill,parseInt(b.canvas.style.width)),p=parseInt(b.canvas.style.height),q=o-j-2*this.padding,r=p-k-2*this.padding,s=Math.min(q,r),t=s;this._sliceAngles=[];var u=this.sliceMargin;0==this.fill&&(u+=this.lineWidth);for(var v,w,x,y,z=0,A=this.startAngle/180*Math.PI,g=0,B=d.length;g<B;g++)w=0==g?A:d[g-1][1]+A,x=d[g][1]+A,this._sliceAngles.push([w,x]),v=c(w,x,this.sliceMargin,this.fill,this.lineWidth),Math.abs(x-w)>Math.PI&&(z=Math.max(v,z));if(null!=this.diameter&&this.diameter>0?this._diameter=this.diameter-2*z:this._diameter=t-2*z,this._diameter<6)return void a.jqplot.log("Diameter of pie too small, not rendering.");this._radius=this._diameter/2;if(this._center=[(o-l*j)/2+l*j+z*Math.cos(A),(p-l*k)/2+l*k+z*Math.sin(A)],this.shadow)for(var g=0,B=d.length;g<B;g++)y="rgba(0,0,0,"+this.shadowAlpha+")",this.renderer.drawSlice.call(this,b,this._sliceAngles[g][0],this._sliceAngles[g][1],y,!0);for(var g=0;g<d.length;g++)if(h=m.next(),this.showSlice[g]&&(this.renderer.drawSlice.call(this,b,this._sliceAngles[g][0],this._sliceAngles[g][1],h,!1),this.showDataLabels&&100*d[g][2]>=this.dataLabelThreshold)){var C,D,E=(this._sliceAngles[g][0]+this._sliceAngles[g][1])/2;"label"==this.dataLabels?(C=this.dataLabelFormatString||"%s",D=a.jqplot.sprintf(C,d[g][0])):"value"==this.dataLabels?(C=this.dataLabelFormatString||"%d",D=a.jqplot.sprintf(C,this.data[g][1])):"percent"==this.dataLabels?(C=this.dataLabelFormatString||"%d%%",D=a.jqplot.sprintf(C,100*d[g][2])):this.dataLabels.constructor==Array&&(C=this.dataLabelFormatString||"%s",D=a.jqplot.sprintf(C,this.dataLabels[g]));var F=this._radius*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge,G=this._center[0]+Math.cos(E)*F+this.canvas._offsets.left,H=this._center[1]+Math.sin(E)*F+this.canvas._offsets.top,I=a('<div class="jqplot-pie-series jqplot-data-label" style="position:absolute;">'+D+"</div>").insertBefore(f.eventCanvas._elem);this.dataLabelCenterOn?(G-=I.width()/2,H-=I.height()/2):(G-=I.width()*Math.sin(E/2),H-=I.height()/2),G=Math.round(G),H=Math.round(H),I.css({left:G,top:H})}},a.jqplot.PieAxisRenderer=function(){a.jqplot.LinearAxisRenderer.call(this)},a.jqplot.PieAxisRenderer.prototype=new a.jqplot.LinearAxisRenderer,a.jqplot.PieAxisRenderer.prototype.constructor=a.jqplot.PieAxisRenderer,a.jqplot.PieAxisRenderer.prototype.init=function(b){this.tickRenderer=a.jqplot.PieTickRenderer,a.extend(!0,this,b),this._dataBounds={min:0,max:100},this.min=0,this.max=100,this.showTicks=!1,this.ticks=[],this.showMark=!1,this.show=!1},a.jqplot.PieLegendRenderer=function(){a.jqplot.TableLegendRenderer.call(this)},a.jqplot.PieLegendRenderer.prototype=new a.jqplot.TableLegendRenderer,a.jqplot.PieLegendRenderer.prototype.constructor=a.jqplot.PieLegendRenderer,a.jqplot.PieLegendRenderer.prototype.init=function(b){this.numberRows=null,this.numberColumns=null,this.width=null,a.extend(!0,this,b)},a.jqplot.PieLegendRenderer.prototype.draw=function(){if(this.show){var b=this._series;this._elem=a(document.createElement("table")),this._elem.addClass("jqplot-table-legend");var c={position:"absolute"};this.background&&(c.background=this.background),this.border&&(c.border=this.border),this.fontSize&&(c.fontSize=this.fontSize),this.fontFamily&&(c.fontFamily=this.fontFamily),this.textColor&&(c.textColor=this.textColor),null!=this.marginTop&&(c.marginTop=this.marginTop),null!=this.marginBottom&&(c.marginBottom=this.marginBottom),null!=this.marginLeft&&(c.marginLeft=this.marginLeft),null!=this.marginRight&&(c.marginRight=this.marginRight),this._elem.css(c);var d,e,f=!1,g=!1,h=b[0],i=new a.jqplot.ColorGenerator(h.seriesColors);if(h.show){var j=h.data;this.numberRows?(d=this.numberRows,e=this.numberColumns?this.numberColumns:Math.ceil(j.length/d)):this.numberColumns?(e=this.numberColumns,d=Math.ceil(j.length/this.numberColumns)):(d=j.length,e=1);var k,l,m,n,o,p,q,r,s,t,u,v=0;for(k=0;k<d;k++)for(m=a(document.createElement("tr")),m.addClass("jqplot-table-legend"),g?m.prependTo(this._elem):m.appendTo(this._elem),l=0;l<e;l++)v<j.length&&(q="",this.labels[v]?p=this.labels[v]:"object"==typeof j[v][0]?(p=j[v][0][0].toString(),q=j[v][0][1].toString()):p=j[v][0].toString(),s=i.next(),f=g?k!=d-1:k>0,r=f?this.rowSpacing:"0",n=a(document.createElement("td")),n.addClass("jqplot-table-legend jqplot-table-legend-swatch"),n.css({textAlign:"center",paddingTop:r}),t=a(document.createElement("div")),t.addClass("jqplot-table-legend-swatch-outline"),""!==q&&t.attr("title",q),u=a(document.createElement("div")),u.addClass("jqplot-table-legend-swatch"),u.css({backgroundColor:s,borderColor:s}),n.append(t.append(u)),o=a(document.createElement("td")),o.addClass("jqplot-table-legend jqplot-table-legend-label"),o.css("paddingTop",r),this.escapeHtml?o.text(p):o.html('<a title="'+q+'">'+p+"</a>"),g?(o.prependTo(m),n.prependTo(m)):(n.appendTo(m),o.appendTo(m)),f=!0),v++}}return this._elem},a.jqplot.PieRenderer.prototype.handleMove=function(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data];e.target.trigger("jqplotDataMouseOver",f),!e.series[f[0]].highlightMouseOver||f[0]==e.plugins.pieRenderer.highlightedSeriesIndex&&f[1]==e.series[f[0]]._highlightedPoint||(e.target.trigger("jqplotDataHighlight",f),g(e,f[0],f[1]))}else null==d&&h(e)},a.jqplot.preInitHooks.push(d),a.jqplot.PieTickRenderer=function(){a.jqplot.AxisTickRenderer.call(this)},a.jqplot.PieTickRenderer.prototype=new a.jqplot.AxisTickRenderer,a.jqplot.PieTickRenderer.prototype.constructor=a.jqplot.PieTickRenderer}(jQuery);
 
 
 
 
assets/js/Chart.bundle.min.js ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * Chart.js
3
+ * http://chartjs.org/
4
+ * Version: 2.7.0
5
+ *
6
+ * Copyright 2017 Nick Downie
7
+ * Released under the MIT license
8
+ * https://github.com/chartjs/Chart.js/blob/master/LICENSE.md
9
+ */
10
+ !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Chart=t()}}(function(){return function t(e,n,i){function a(o,s){if(!n[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(r)return r(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var d=n[o]={exports:{}};e[o][0].call(d.exports,function(t){var n=e[o][1][t];return a(n||t)},d,d.exports,t,e,n,i)}return n[o].exports}for(var r="function"==typeof require&&require,o=0;o<i.length;o++)a(i[o]);return a}({1:[function(t,e,n){function i(t){if(t){var e=/^#([a-fA-F0-9]{3})$/i,n=/^#([a-fA-F0-9]{6})$/i,i=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,a=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,r=/(\w+)/,o=[0,0,0],s=1,l=t.match(e);if(l){l=l[1];for(d=0;d<o.length;d++)o[d]=parseInt(l[d]+l[d],16)}else if(l=t.match(n)){l=l[1];for(d=0;d<o.length;d++)o[d]=parseInt(l.slice(2*d,2*d+2),16)}else if(l=t.match(i)){for(d=0;d<o.length;d++)o[d]=parseInt(l[d+1]);s=parseFloat(l[4])}else if(l=t.match(a)){for(d=0;d<o.length;d++)o[d]=Math.round(2.55*parseFloat(l[d+1]));s=parseFloat(l[4])}else if(l=t.match(r)){if("transparent"==l[1])return[0,0,0,0];if(!(o=c[l[1]]))return}for(var d=0;d<o.length;d++)o[d]=u(o[d],0,255);return s=s||0==s?u(s,0,1):1,o[3]=s,o}}function a(t){if(t){var e=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=t.match(e);if(n){var i=parseFloat(n[4]);return[u(parseInt(n[1]),0,360),u(parseFloat(n[2]),0,100),u(parseFloat(n[3]),0,100),u(isNaN(i)?1:i,0,1)]}}}function r(t){if(t){var e=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,n=t.match(e);if(n){var i=parseFloat(n[4]);return[u(parseInt(n[1]),0,360),u(parseFloat(n[2]),0,100),u(parseFloat(n[3]),0,100),u(isNaN(i)?1:i,0,1)]}}}function o(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function s(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function l(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function u(t,e,n){return Math.min(Math.max(e,t),n)}function d(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}var c=t(5);e.exports={getRgba:i,getHsla:a,getRgb:function(t){var e=i(t);return e&&e.slice(0,3)},getHsl:function(t){var e=a(t);return e&&e.slice(0,3)},getHwb:r,getAlpha:function(t){var e=i(t);return e?e[3]:(e=a(t))?e[3]:(e=r(t))?e[3]:void 0},hexString:function(t){return"#"+d(t[0])+d(t[1])+d(t[2])},rgbString:function(t,e){return e<1||t[3]&&t[3]<1?o(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"},rgbaString:o,percentString:function(t,e){return e<1||t[3]&&t[3]<1?s(t,e):"rgb("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%)"},percentaString:s,hslString:function(t,e){return e<1||t[3]&&t[3]<1?l(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"},hslaString:l,hwbString:function(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"},keyword:function(t){return h[t.slice(0,3)]}};var h={};for(var f in c)h[c[f]]=f},{5:5}],2:[function(t,e,n){var i=t(4),a=t(1),r=function(t){if(t instanceof r)return t;if(!(this instanceof r))return new r(t);this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};var e;"string"==typeof t?(e=a.getRgba(t))?this.setValues("rgb",e):(e=a.getHsla(t))?this.setValues("hsl",e):(e=a.getHwb(t))&&this.setValues("hwb",e):"object"==typeof t&&(void 0!==(e=t).r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e))};r.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t=(t%=360)<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return a.hexString(this.values.rgb)},rgbString:function(){return a.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return a.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return a.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return a.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return a.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return a.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return a.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,n=(e[0]+t)%360;return e[0]=n<0?360+n:n,this.setValues("hsl",e),this},mix:function(t,e){var n=this,i=t,a=void 0===e?.5:e,r=2*a-1,o=n.alpha()-i.alpha(),s=((r*o==-1?r:(r+o)/(1+r*o))+1)/2,l=1-s;return this.rgb(s*n.red()+l*i.red(),s*n.green()+l*i.green(),s*n.blue()+l*i.blue()).alpha(n.alpha()*a+i.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var t,e,n=new r,i=this.values,a=n.values;for(var o in i)i.hasOwnProperty(o)&&(t=i[o],"[object Array]"===(e={}.toString.call(t))?a[o]=t.slice(0):"[object Number]"===e?a[o]=t:console.error("unexpected color value:",t));return n}},r.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},r.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},r.prototype.getValues=function(t){for(var e=this.values,n={},i=0;i<t.length;i++)n[t.charAt(i)]=e[t][i];return 1!==e.alpha&&(n.a=e.alpha),n},r.prototype.setValues=function(t,e){var n,a=this.values,r=this.spaces,o=this.maxes,s=1;if(this.valid=!0,"alpha"===t)s=e;else if(e.length)a[t]=e.slice(0,t.length),s=e[t.length];else if(void 0!==e[t.charAt(0)]){for(n=0;n<t.length;n++)a[t][n]=e[t.charAt(n)];s=e.a}else if(void 0!==e[r[t][0]]){var l=r[t];for(n=0;n<t.length;n++)a[t][n]=e[l[n]];s=e.alpha}if(a.alpha=Math.max(0,Math.min(1,void 0===s?a.alpha:s)),"alpha"===t)return!1;var u;for(n=0;n<t.length;n++)u=Math.max(0,Math.min(o[t][n],a[t][n])),a[t][n]=Math.round(u);for(var d in r)d!==t&&(a[d]=i[t][d](a[t]));return!0},r.prototype.setSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n),this)},r.prototype.setChannel=function(t,e,n){var i=this.values[t];return void 0===n?i[e]:n===i[e]?this:(i[e]=n,this.setValues(t,i),this)},"undefined"!=typeof window&&(window.Color=r),e.exports=r},{1:1,4:4}],3:[function(t,e,n){function i(t){var e,n,i,a=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(a,r,o),l=Math.max(a,r,o),u=l-s;return l==s?e=0:a==l?e=(r-o)/u:r==l?e=2+(o-a)/u:o==l&&(e=4+(a-r)/u),(e=Math.min(60*e,360))<0&&(e+=360),i=(s+l)/2,n=l==s?0:i<=.5?u/(l+s):u/(2-l-s),[e,100*n,100*i]}function a(t){var e,n,i,a=t[0],r=t[1],o=t[2],s=Math.min(a,r,o),l=Math.max(a,r,o),u=l-s;return n=0==l?0:u/l*1e3/10,l==s?e=0:a==l?e=(r-o)/u:r==l?e=2+(o-a)/u:o==l&&(e=4+(a-r)/u),(e=Math.min(60*e,360))<0&&(e+=360),i=l/255*1e3/10,[e,n,i]}function o(t){var e=t[0],n=t[1],a=t[2];return[i(t)[0],100*(1/255*Math.min(e,Math.min(n,a))),100*(a=1-1/255*Math.max(e,Math.max(n,a)))]}function s(t){var e,n,i,a,r=t[0]/255,o=t[1]/255,s=t[2]/255;return a=Math.min(1-r,1-o,1-s),e=(1-r-a)/(1-a)||0,n=(1-o-a)/(1-a)||0,i=(1-s-a)/(1-a)||0,[100*e,100*n,100*i,100*a]}function l(t){return S[JSON.stringify(t)]}function u(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]}function d(t){var e,n,i,a=u(t),r=a[0],o=a[1],s=a[2];return r/=95.047,o/=100,s/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,e=116*o-16,n=500*(r-o),i=200*(o-s),[e,n,i]}function c(t){var e,n,i,a,r,o=t[0]/360,s=t[1]/100,l=t[2]/100;if(0==s)return r=255*l,[r,r,r];e=2*l-(n=l<.5?l*(1+s):l+s-l*s),a=[0,0,0];for(var u=0;u<3;u++)(i=o+1/3*-(u-1))<0&&i++,i>1&&i--,r=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,a[u]=255*r;return a}function h(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,a=Math.floor(e)%6,r=e-Math.floor(e),o=255*i*(1-n),s=255*i*(1-n*r),l=255*i*(1-n*(1-r)),i=255*i;switch(a){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}}function f(t){var e,n,i,a,o=t[0]/360,s=t[1]/100,l=t[2]/100,u=s+l;switch(u>1&&(s/=u,l/=u),e=Math.floor(6*o),n=1-l,i=6*o-e,0!=(1&e)&&(i=1-i),a=s+i*(n-s),e){default:case 6:case 0:r=n,g=a,b=s;break;case 1:r=a,g=n,b=s;break;case 2:r=s,g=n,b=a;break;case 3:r=s,g=a,b=n;break;case 4:r=a,g=s,b=n;break;case 5:r=n,g=s,b=a}return[255*r,255*g,255*b]}function m(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100,s=t[3]/100;return e=1-Math.min(1,a*(1-s)+s),n=1-Math.min(1,r*(1-s)+s),i=1-Math.min(1,o*(1-s)+s),[255*e,255*n,255*i]}function p(t){var e,n,i,a=t[0]/100,r=t[1]/100,o=t[2]/100;return e=3.2406*a+-1.5372*r+-.4986*o,n=-.9689*a+1.8758*r+.0415*o,i=.0557*a+-.204*r+1.057*o,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,e=Math.min(Math.max(0,e),1),n=Math.min(Math.max(0,n),1),i=Math.min(Math.max(0,i),1),[255*e,255*n,255*i]}function v(t){var e,n,i,a=t[0],r=t[1],o=t[2];return a/=95.047,r/=100,o/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,e=116*r-16,n=500*(a-r),i=200*(r-o),[e,n,i]}function y(t){var e,n,i,a,r=t[0],o=t[1],s=t[2];return r<=8?a=(n=100*r/903.3)/100*7.787+16/116:(n=100*Math.pow((r+16)/116,3),a=Math.pow(n/100,1/3)),e=e/95.047<=.008856?e=95.047*(o/500+a-16/116)/7.787:95.047*Math.pow(o/500+a,3),i=i/108.883<=.008859?i=108.883*(a-s/200-16/116)/7.787:108.883*Math.pow(a-s/200,3),[e,n,i]}function x(t){var e,n,i,a=t[0],r=t[1],o=t[2];return e=Math.atan2(o,r),(n=360*e/2/Math.PI)<0&&(n+=360),i=Math.sqrt(r*r+o*o),[a,i,n]}function _(t){return p(y(t))}function k(t){var e,n,i,a=t[0],r=t[1];return i=t[2]/360*2*Math.PI,e=r*Math.cos(i),n=r*Math.sin(i),[a,e,n]}function w(t){return M[t]}e.exports={rgb2hsl:i,rgb2hsv:a,rgb2hwb:o,rgb2cmyk:s,rgb2keyword:l,rgb2xyz:u,rgb2lab:d,rgb2lch:function(t){return x(d(t))},hsl2rgb:c,hsl2hsv:function(t){var e,n,i=t[0],a=t[1]/100,r=t[2]/100;return 0===r?[0,0,0]:(r*=2,a*=r<=1?r:2-r,n=(r+a)/2,e=2*a/(r+a),[i,100*e,100*n])},hsl2hwb:function(t){return o(c(t))},hsl2cmyk:function(t){return s(c(t))},hsl2keyword:function(t){return l(c(t))},hsv2rgb:h,hsv2hsl:function(t){var e,n,i=t[0],a=t[1]/100,r=t[2]/100;return n=(2-a)*r,e=a*r,e/=n<=1?n:2-n,e=e||0,n/=2,[i,100*e,100*n]},hsv2hwb:function(t){return o(h(t))},hsv2cmyk:function(t){return s(h(t))},hsv2keyword:function(t){return l(h(t))},hwb2rgb:f,hwb2hsl:function(t){return i(f(t))},hwb2hsv:function(t){return a(f(t))},hwb2cmyk:function(t){return s(f(t))},hwb2keyword:function(t){return l(f(t))},cmyk2rgb:m,cmyk2hsl:function(t){return i(m(t))},cmyk2hsv:function(t){return a(m(t))},cmyk2hwb:function(t){return o(m(t))},cmyk2keyword:function(t){return l(m(t))},keyword2rgb:w,keyword2hsl:function(t){return i(w(t))},keyword2hsv:function(t){return a(w(t))},keyword2hwb:function(t){return o(w(t))},keyword2cmyk:function(t){return s(w(t))},keyword2lab:function(t){return d(w(t))},keyword2xyz:function(t){return u(w(t))},xyz2rgb:p,xyz2lab:v,xyz2lch:function(t){return x(v(t))},lab2xyz:y,lab2rgb:_,lab2lch:x,lch2lab:k,lch2xyz:function(t){return y(k(t))},lch2rgb:function(t){return _(k(t))}};var M={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},S={};for(var D in M)S[JSON.stringify(M[D])]=D},{}],4:[function(t,e,n){var i=t(3),a=function(){return new u};for(var r in i){a[r+"Raw"]=function(t){return function(e){return"number"==typeof e&&(e=Array.prototype.slice.call(arguments)),i[t](e)}}(r);var o=/(\w+)2(\w+)/.exec(r),s=o[1],l=o[2];(a[s]=a[s]||{})[l]=a[r]=function(t){return function(e){"number"==typeof e&&(e=Array.prototype.slice.call(arguments));var n=i[t](e);if("string"==typeof n||void 0===n)return n;for(var a=0;a<n.length;a++)n[a]=Math.round(n[a]);return n}}(r)}var u=function(){this.convs={}};u.prototype.routeSpace=function(t,e){var n=e[0];return void 0===n?this.getValues(t):("number"==typeof n&&(n=Array.prototype.slice.call(e)),this.setValues(t,n))},u.prototype.setValues=function(t,e){return this.space=t,this.convs={},this.convs[t]=e,this},u.prototype.getValues=function(t){var e=this.convs[t];if(!e){var n=this.space,i=this.convs[n];e=a[n][t](i),this.convs[t]=e}return e},["rgb","hsl","hsv","cmyk","keyword"].forEach(function(t){u.prototype[t]=function(e){return this.routeSpace(t,arguments)}}),e.exports=a},{3:3}],5:[function(t,e,n){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},{}],6:[function(t,e,n){!function(t,i){"object"==typeof n&&void 0!==e?e.exports=i():t.moment=i()}(this,function(){"use strict";function n(){return xe.apply(null,arguments)}function i(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function a(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function r(t){var e;for(e in t)return!1;return!0}function o(t){return void 0===t}function s(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function l(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function u(t,e){var n,i=[];for(n=0;n<t.length;++n)i.push(e(t[n],n));return i}function d(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function c(t,e){for(var n in e)d(e,n)&&(t[n]=e[n]);return d(e,"toString")&&(t.toString=e.toString),d(e,"valueOf")&&(t.valueOf=e.valueOf),t}function h(t,e,n,i){return Yt(t,e,n,i,!0).utc()}function f(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function g(t){return null==t._pf&&(t._pf=f()),t._pf}function m(t){if(null==t._isValid){var e=g(t),n=ke.call(e.parsedDateParts,function(t){return null!=t}),i=!isNaN(t._d.getTime())&&e.overflow<0&&!e.empty&&!e.invalidMonth&&!e.invalidWeekday&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n);if(t._strict&&(i=i&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return i;t._isValid=i}return t._isValid}function p(t){var e=h(NaN);return null!=t?c(g(e),t):g(e).userInvalidated=!0,e}function v(t,e){var n,i,a;if(o(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),o(e._i)||(t._i=e._i),o(e._f)||(t._f=e._f),o(e._l)||(t._l=e._l),o(e._strict)||(t._strict=e._strict),o(e._tzm)||(t._tzm=e._tzm),o(e._isUTC)||(t._isUTC=e._isUTC),o(e._offset)||(t._offset=e._offset),o(e._pf)||(t._pf=g(e)),o(e._locale)||(t._locale=e._locale),we.length>0)for(n=0;n<we.length;n++)o(a=e[i=we[n]])||(t[i]=a);return t}function y(t){v(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===Me&&(Me=!0,n.updateOffset(this),Me=!1)}function b(t){return t instanceof y||null!=t&&null!=t._isAMomentObject}function x(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function _(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=x(e)),n}function k(t,e,n){var i,a=Math.min(t.length,e.length),r=Math.abs(t.length-e.length),o=0;for(i=0;i<a;i++)(n&&t[i]!==e[i]||!n&&_(t[i])!==_(e[i]))&&o++;return o+r}function w(t){!1===n.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function M(t,e){var i=!0;return c(function(){if(null!=n.deprecationHandler&&n.deprecationHandler(null,t),i){for(var a,r=[],o=0;o<arguments.length;o++){if(a="","object"==typeof arguments[o]){a+="\n["+o+"] ";for(var s in arguments[0])a+=s+": "+arguments[0][s]+", ";a=a.slice(0,-2)}else a=arguments[o];r.push(a)}w(t+"\nArguments: "+Array.prototype.slice.call(r).join("")+"\n"+(new Error).stack),i=!1}return e.apply(this,arguments)},e)}function S(t,e){null!=n.deprecationHandler&&n.deprecationHandler(t,e),Se[t]||(w(e),Se[t]=!0)}function D(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function C(t,e){var n,i=c({},t);for(n in e)d(e,n)&&(a(t[n])&&a(e[n])?(i[n]={},c(i[n],t[n]),c(i[n],e[n])):null!=e[n]?i[n]=e[n]:delete i[n]);for(n in t)d(t,n)&&!d(e,n)&&a(t[n])&&(i[n]=c({},i[n]));return i}function P(t){null!=t&&this.set(t)}function T(t,e){var n=t.toLowerCase();Fe[n]=Fe[n+"s"]=Fe[e]=t}function I(t){return"string"==typeof t?Fe[t]||Fe[t.toLowerCase()]:void 0}function A(t){var e,n,i={};for(n in t)d(t,n)&&(e=I(n))&&(i[e]=t[n]);return i}function O(t,e){Re[t]=e}function F(t){var e=[];for(var n in t)e.push({unit:n,priority:Re[n]});return e.sort(function(t,e){return t.priority-e.priority}),e}function R(t,e){return function(i){return null!=i?(W(this,t,i),n.updateOffset(this,e),this):L(this,t)}}function L(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function W(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function Y(t,e,n){var i=""+Math.abs(t),a=e-i.length;return(t>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+i}function N(t,e,n,i){var a=i;"string"==typeof i&&(a=function(){return this[i]()}),t&&(Ne[t]=a),e&&(Ne[e[0]]=function(){return Y(a.apply(this,arguments),e[1],e[2])}),n&&(Ne[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),t)})}function z(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function B(t){var e,n,i=t.match(Le);for(e=0,n=i.length;e<n;e++)Ne[i[e]]?i[e]=Ne[i[e]]:i[e]=z(i[e]);return function(e){var a,r="";for(a=0;a<n;a++)r+=D(i[a])?i[a].call(e,t):i[a];return r}}function V(t,e){return t.isValid()?(e=H(e,t.localeData()),Ye[e]=Ye[e]||B(e),Ye[e](t)):t.localeData().invalidDate()}function H(t,e){var n=5;for(We.lastIndex=0;n>=0&&We.test(t);)t=t.replace(We,function(t){return e.longDateFormat(t)||t}),We.lastIndex=0,n-=1;return t}function E(t,e,n){nn[t]=D(e)?e:function(t,i){return t&&n?n:e}}function j(t,e){return d(nn,t)?nn[t](e._strict,e._locale):new RegExp(U(t))}function U(t){return q(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,a){return e||n||i||a}))}function q(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function G(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),s(e)&&(i=function(t,n){n[e]=_(t)}),n=0;n<t.length;n++)an[t[n]]=i}function Z(t,e){G(t,function(t,n,i,a){i._w=i._w||{},e(t,i._w,i,a)})}function X(t,e,n){null!=e&&d(an,t)&&an[t](e,n._a,n,t)}function J(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}function K(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)r=h([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===e?-1!==(a=gn.call(this._shortMonthsParse,o))?a:null:-1!==(a=gn.call(this._longMonthsParse,o))?a:null:"MMM"===e?-1!==(a=gn.call(this._shortMonthsParse,o))?a:-1!==(a=gn.call(this._longMonthsParse,o))?a:null:-1!==(a=gn.call(this._longMonthsParse,o))?a:-1!==(a=gn.call(this._shortMonthsParse,o))?a:null}function Q(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=_(e);else if(e=t.localeData().monthsParse(e),!s(e))return t;return n=Math.min(t.date(),J(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function $(t){return null!=t?(Q(this,t),n.updateOffset(this,!0),this):L(this,"Month")}function tt(){function t(t,e){return e.length-t.length}var e,n,i=[],a=[],r=[];for(e=0;e<12;e++)n=h([2e3,e]),i.push(this.monthsShort(n,"")),a.push(this.months(n,"")),r.push(this.months(n,"")),r.push(this.monthsShort(n,""));for(i.sort(t),a.sort(t),r.sort(t),e=0;e<12;e++)i[e]=q(i[e]),a[e]=q(a[e]);for(e=0;e<24;e++)r[e]=q(r[e]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function et(t){return nt(t)?366:365}function nt(t){return t%4==0&&t%100!=0||t%400==0}function it(t,e,n,i,a,r,o){var s=new Date(t,e,n,i,a,r,o);return t<100&&t>=0&&isFinite(s.getFullYear())&&s.setFullYear(t),s}function at(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function rt(t,e,n){var i=7+e-n;return-((7+at(t,0,i).getUTCDay()-e)%7)+i-1}function ot(t,e,n,i,a){var r,o,s=1+7*(e-1)+(7+n-i)%7+rt(t,i,a);return s<=0?o=et(r=t-1)+s:s>et(t)?(r=t+1,o=s-et(t)):(r=t,o=s),{year:r,dayOfYear:o}}function st(t,e,n){var i,a,r=rt(t.year(),e,n),o=Math.floor((t.dayOfYear()-r-1)/7)+1;return o<1?i=o+lt(a=t.year()-1,e,n):o>lt(t.year(),e,n)?(i=o-lt(t.year(),e,n),a=t.year()+1):(a=t.year(),i=o),{week:i,year:a}}function lt(t,e,n){var i=rt(t,e,n),a=rt(t+1,e,n);return(et(t)-i+a)/7}function ut(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function dt(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function ct(t,e,n){var i,a,r,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)r=h([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(a=gn.call(this._weekdaysParse,o))?a:null:"ddd"===e?-1!==(a=gn.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=gn.call(this._minWeekdaysParse,o))?a:null:"dddd"===e?-1!==(a=gn.call(this._weekdaysParse,o))?a:-1!==(a=gn.call(this._shortWeekdaysParse,o))?a:-1!==(a=gn.call(this._minWeekdaysParse,o))?a:null:"ddd"===e?-1!==(a=gn.call(this._shortWeekdaysParse,o))?a:-1!==(a=gn.call(this._weekdaysParse,o))?a:-1!==(a=gn.call(this._minWeekdaysParse,o))?a:null:-1!==(a=gn.call(this._minWeekdaysParse,o))?a:-1!==(a=gn.call(this._weekdaysParse,o))?a:-1!==(a=gn.call(this._shortWeekdaysParse,o))?a:null}function ht(){function t(t,e){return e.length-t.length}var e,n,i,a,r,o=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=h([2e3,1]).day(e),i=this.weekdaysMin(n,""),a=this.weekdaysShort(n,""),r=this.weekdays(n,""),o.push(i),s.push(a),l.push(r),u.push(i),u.push(a),u.push(r);for(o.sort(t),s.sort(t),l.sort(t),u.sort(t),e=0;e<7;e++)s[e]=q(s[e]),l[e]=q(l[e]),u[e]=q(u[e]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function ft(){return this.hours()%12||12}function gt(t,e){N(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function mt(t,e){return e._meridiemParse}function pt(t){return t?t.toLowerCase().replace("_","-"):t}function vt(t){for(var e,n,i,a,r=0;r<t.length;){for(e=(a=pt(t[r]).split("-")).length,n=(n=pt(t[r+1]))?n.split("-"):null;e>0;){if(i=yt(a.slice(0,e).join("-")))return i;if(n&&n.length>=e&&k(a,n,!0)>=e-1)break;e--}r++}return null}function yt(n){var i=null;if(!On[n]&&void 0!==e&&e&&e.exports)try{i=Pn._abbr,t("./locale/"+n),bt(i)}catch(t){}return On[n]}function bt(t,e){var n;return t&&(n=o(e)?_t(t):xt(t,e))&&(Pn=n),Pn._abbr}function xt(t,e){if(null!==e){var n=An;if(e.abbr=t,null!=On[t])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=On[t]._config;else if(null!=e.parentLocale){if(null==On[e.parentLocale])return Fn[e.parentLocale]||(Fn[e.parentLocale]=[]),Fn[e.parentLocale].push({name:t,config:e}),null;n=On[e.parentLocale]._config}return On[t]=new P(C(n,e)),Fn[t]&&Fn[t].forEach(function(t){xt(t.name,t.config)}),bt(t),On[t]}return delete On[t],null}function _t(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Pn;if(!i(t)){if(e=yt(t))return e;t=[t]}return vt(t)}function kt(t){var e,n=t._a;return n&&-2===g(t).overflow&&(e=n[on]<0||n[on]>11?on:n[sn]<1||n[sn]>J(n[rn],n[on])?sn:n[ln]<0||n[ln]>24||24===n[ln]&&(0!==n[un]||0!==n[dn]||0!==n[cn])?ln:n[un]<0||n[un]>59?un:n[dn]<0||n[dn]>59?dn:n[cn]<0||n[cn]>999?cn:-1,g(t)._overflowDayOfYear&&(e<rn||e>sn)&&(e=sn),g(t)._overflowWeeks&&-1===e&&(e=hn),g(t)._overflowWeekday&&-1===e&&(e=fn),g(t).overflow=e),t}function wt(t){var e,n,i,a,r,o,s=t._i,l=Rn.exec(s)||Ln.exec(s);if(l){for(g(t).iso=!0,e=0,n=Yn.length;e<n;e++)if(Yn[e][1].exec(l[1])){a=Yn[e][0],i=!1!==Yn[e][2];break}if(null==a)return void(t._isValid=!1);if(l[3]){for(e=0,n=Nn.length;e<n;e++)if(Nn[e][1].exec(l[3])){r=(l[2]||" ")+Nn[e][0];break}if(null==r)return void(t._isValid=!1)}if(!i&&null!=r)return void(t._isValid=!1);if(l[4]){if(!Wn.exec(l[4]))return void(t._isValid=!1);o="Z"}t._f=a+(r||"")+(o||""),It(t)}else t._isValid=!1}function Mt(t){var e,n,i,a,r,o,s,l,u={" GMT":" +0000"," EDT":" -0400"," EST":" -0500"," CDT":" -0500"," CST":" -0600"," MDT":" -0600"," MST":" -0700"," PDT":" -0700"," PST":" -0800"};if(e=t._i.replace(/\([^\)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s|\s$/g,""),n=Bn.exec(e)){if(i=n[1]?"ddd"+(5===n[1].length?", ":" "):"",a="D MMM "+(n[2].length>10?"YYYY ":"YY "),r="HH:mm"+(n[4]?":ss":""),n[1]){var d=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][new Date(n[2]).getDay()];if(n[1].substr(0,3)!==d)return g(t).weekdayMismatch=!0,void(t._isValid=!1)}switch(n[5].length){case 2:s=0===l?" +0000":((l="YXWVUTSRQPONZABCDEFGHIKLM".indexOf(n[5][1].toUpperCase())-12)<0?" -":" +")+(""+l).replace(/^-?/,"0").match(/..$/)[0]+"00";break;case 4:s=u[n[5]];break;default:s=u[" GMT"]}n[5]=s,t._i=n.splice(1).join(""),o=" ZZ",t._f=i+a+r+o,It(t),g(t).rfc2822=!0}else t._isValid=!1}function St(t){var e=zn.exec(t._i);null===e?(wt(t),!1===t._isValid&&(delete t._isValid,Mt(t),!1===t._isValid&&(delete t._isValid,n.createFromInputFallback(t)))):t._d=new Date(+e[1])}function Dt(t,e,n){return null!=t?t:null!=e?e:n}function Ct(t){var e=new Date(n.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Pt(t){var e,n,i,a,r=[];if(!t._d){for(i=Ct(t),t._w&&null==t._a[sn]&&null==t._a[on]&&Tt(t),null!=t._dayOfYear&&(a=Dt(t._a[rn],i[rn]),(t._dayOfYear>et(a)||0===t._dayOfYear)&&(g(t)._overflowDayOfYear=!0),n=at(a,0,t._dayOfYear),t._a[on]=n.getUTCMonth(),t._a[sn]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[ln]&&0===t._a[un]&&0===t._a[dn]&&0===t._a[cn]&&(t._nextDay=!0,t._a[ln]=0),t._d=(t._useUTC?at:it).apply(null,r),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ln]=24)}}function Tt(t){var e,n,i,a,r,o,s,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)r=1,o=4,n=Dt(e.GG,t._a[rn],st(Nt(),1,4).year),i=Dt(e.W,1),((a=Dt(e.E,1))<1||a>7)&&(l=!0);else{r=t._locale._week.dow,o=t._locale._week.doy;var u=st(Nt(),r,o);n=Dt(e.gg,t._a[rn],u.year),i=Dt(e.w,u.week),null!=e.d?((a=e.d)<0||a>6)&&(l=!0):null!=e.e?(a=e.e+r,(e.e<0||e.e>6)&&(l=!0)):a=r}i<1||i>lt(n,r,o)?g(t)._overflowWeeks=!0:null!=l?g(t)._overflowWeekday=!0:(s=ot(n,i,a,r,o),t._a[rn]=s.year,t._dayOfYear=s.dayOfYear)}function It(t){if(t._f!==n.ISO_8601)if(t._f!==n.RFC_2822){t._a=[],g(t).empty=!0;var e,i,a,r,o,s=""+t._i,l=s.length,u=0;for(a=H(t._f,t._locale).match(Le)||[],e=0;e<a.length;e++)r=a[e],(i=(s.match(j(r,t))||[])[0])&&((o=s.substr(0,s.indexOf(i))).length>0&&g(t).unusedInput.push(o),s=s.slice(s.indexOf(i)+i.length),u+=i.length),Ne[r]?(i?g(t).empty=!1:g(t).unusedTokens.push(r),X(r,i,t)):t._strict&&!i&&g(t).unusedTokens.push(r);g(t).charsLeftOver=l-u,s.length>0&&g(t).unusedInput.push(s),t._a[ln]<=12&&!0===g(t).bigHour&&t._a[ln]>0&&(g(t).bigHour=void 0),g(t).parsedDateParts=t._a.slice(0),g(t).meridiem=t._meridiem,t._a[ln]=At(t._locale,t._a[ln],t._meridiem),Pt(t),kt(t)}else Mt(t);else wt(t)}function At(t,e,n){var i;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0),e):e}function Ot(t){var e,n,i,a,r;if(0===t._f.length)return g(t).invalidFormat=!0,void(t._d=new Date(NaN));for(a=0;a<t._f.length;a++)r=0,e=v({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[a],It(e),m(e)&&(r+=g(e).charsLeftOver,r+=10*g(e).unusedTokens.length,g(e).score=r,(null==i||r<i)&&(i=r,n=e));c(t,n||e)}function Ft(t){if(!t._d){var e=A(t._i);t._a=u([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Pt(t)}}function Rt(t){var e=new y(kt(Lt(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Lt(t){var e=t._i,n=t._f;return t._locale=t._locale||_t(t._l),null===e||void 0===n&&""===e?p({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),b(e)?new y(kt(e)):(l(e)?t._d=e:i(n)?Ot(t):n?It(t):Wt(t),m(t)||(t._d=null),t))}function Wt(t){var e=t._i;o(e)?t._d=new Date(n.now()):l(e)?t._d=new Date(e.valueOf()):"string"==typeof e?St(t):i(e)?(t._a=u(e.slice(0),function(t){return parseInt(t,10)}),Pt(t)):a(e)?Ft(t):s(e)?t._d=new Date(e):n.createFromInputFallback(t)}function Yt(t,e,n,o,s){var l={};return!0!==n&&!1!==n||(o=n,n=void 0),(a(t)&&r(t)||i(t)&&0===t.length)&&(t=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=s,l._l=n,l._i=t,l._f=e,l._strict=o,Rt(l)}function Nt(t,e,n,i){return Yt(t,e,n,i,!1)}function zt(t,e){var n,a;if(1===e.length&&i(e[0])&&(e=e[0]),!e.length)return Nt();for(n=e[0],a=1;a<e.length;++a)e[a].isValid()&&!e[a][t](n)||(n=e[a]);return n}function Bt(t){for(var e in t)if(-1===En.indexOf(e)||null!=t[e]&&isNaN(t[e]))return!1;for(var n=!1,i=0;i<En.length;++i)if(t[En[i]]){if(n)return!1;parseFloat(t[En[i]])!==_(t[En[i]])&&(n=!0)}return!0}function Vt(t){var e=A(t),n=e.year||0,i=e.quarter||0,a=e.month||0,r=e.week||0,o=e.day||0,s=e.hour||0,l=e.minute||0,u=e.second||0,d=e.millisecond||0;this._isValid=Bt(e),this._milliseconds=+d+1e3*u+6e4*l+1e3*s*60*60,this._days=+o+7*r,this._months=+a+3*i+12*n,this._data={},this._locale=_t(),this._bubble()}function Ht(t){return t instanceof Vt}function Et(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function jt(t,e){N(t,0,0,function(){var t=this.utcOffset(),n="+";return t<0&&(t=-t,n="-"),n+Y(~~(t/60),2)+e+Y(~~t%60,2)})}function Ut(t,e){var n=(e||"").match(t);if(null===n)return null;var i=((n[n.length-1]||[])+"").match(jn)||["-",0,0],a=60*i[1]+_(i[2]);return 0===a?0:"+"===i[0]?a:-a}function qt(t,e){var i,a;return e._isUTC?(i=e.clone(),a=(b(t)||l(t)?t.valueOf():Nt(t).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+a),n.updateOffset(i,!1),i):Nt(t).local()}function Gt(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Zt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Xt(t,e){var n,i,a,r=t,o=null;return Ht(t)?r={ms:t._milliseconds,d:t._days,M:t._months}:s(t)?(r={},e?r[e]=t:r.milliseconds=t):(o=Un.exec(t))?(n="-"===o[1]?-1:1,r={y:0,d:_(o[sn])*n,h:_(o[ln])*n,m:_(o[un])*n,s:_(o[dn])*n,ms:_(Et(1e3*o[cn]))*n}):(o=qn.exec(t))?(n="-"===o[1]?-1:1,r={y:Jt(o[2],n),M:Jt(o[3],n),w:Jt(o[4],n),d:Jt(o[5],n),h:Jt(o[6],n),m:Jt(o[7],n),s:Jt(o[8],n)}):null==r?r={}:"object"==typeof r&&("from"in r||"to"in r)&&(a=Qt(Nt(r.from),Nt(r.to)),(r={}).ms=a.milliseconds,r.M=a.months),i=new Vt(r),Ht(t)&&d(t,"_locale")&&(i._locale=t._locale),i}function Jt(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Kt(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Qt(t,e){var n;return t.isValid()&&e.isValid()?(e=qt(e,t),t.isBefore(e)?n=Kt(t,e):((n=Kt(e,t)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function $t(t,e){return function(n,i){var a,r;return null===i||isNaN(+i)||(S(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),n="string"==typeof n?+n:n,a=Xt(n,i),te(this,a,t),this}}function te(t,e,i,a){var r=e._milliseconds,o=Et(e._days),s=Et(e._months);t.isValid()&&(a=null==a||a,r&&t._d.setTime(t._d.valueOf()+r*i),o&&W(t,"Date",L(t,"Date")+o*i),s&&Q(t,L(t,"Month")+s*i),a&&n.updateOffset(t,o||s))}function ee(t,e){var n,i=12*(e.year()-t.year())+(e.month()-t.month()),a=t.clone().add(i,"months");return n=e-a<0?(e-a)/(a-t.clone().add(i-1,"months")):(e-a)/(t.clone().add(i+1,"months")-a),-(i+n)||0}function ne(t){var e;return void 0===t?this._locale._abbr:(null!=(e=_t(t))&&(this._locale=e),this)}function ie(){return this._locale}function ae(t,e){N(0,[t,t.length],0,e)}function re(t,e,n,i,a){var r;return null==t?st(this,i,a).year:(r=lt(t,i,a),e>r&&(e=r),oe.call(this,t,e,n,i,a))}function oe(t,e,n,i,a){var r=ot(t,e,n,i,a),o=at(r.year,0,r.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function se(t){return t}function le(t,e,n,i){var a=_t(),r=h().set(i,e);return a[n](r,t)}function ue(t,e,n){if(s(t)&&(e=t,t=void 0),t=t||"",null!=e)return le(t,e,n,"month");var i,a=[];for(i=0;i<12;i++)a[i]=le(t,i,n,"month");return a}function de(t,e,n,i){"boolean"==typeof t?(s(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,s(e)&&(n=e,e=void 0),e=e||"");var a=_t(),r=t?a._week.dow:0;if(null!=n)return le(e,(n+r)%7,i,"day");var o,l=[];for(o=0;o<7;o++)l[o]=le(e,(o+r)%7,i,"day");return l}function ce(t,e,n,i){var a=Xt(e,n);return t._milliseconds+=i*a._milliseconds,t._days+=i*a._days,t._months+=i*a._months,t._bubble()}function he(t){return t<0?Math.floor(t):Math.ceil(t)}function fe(t){return 4800*t/146097}function ge(t){return 146097*t/4800}function me(t){return function(){return this.as(t)}}function pe(t){return function(){return this.isValid()?this._data[t]:NaN}}function ve(t,e,n,i,a){return a.relativeTime(e||1,!!n,t,i)}function ye(t,e,n){var i=Xt(t).abs(),a=bi(i.as("s")),r=bi(i.as("m")),o=bi(i.as("h")),s=bi(i.as("d")),l=bi(i.as("M")),u=bi(i.as("y")),d=a<=xi.ss&&["s",a]||a<xi.s&&["ss",a]||r<=1&&["m"]||r<xi.m&&["mm",r]||o<=1&&["h"]||o<xi.h&&["hh",o]||s<=1&&["d"]||s<xi.d&&["dd",s]||l<=1&&["M"]||l<xi.M&&["MM",l]||u<=1&&["y"]||["yy",u];return d[2]=e,d[3]=+t>0,d[4]=n,ve.apply(null,d)}function be(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n,i=_i(this._milliseconds)/1e3,a=_i(this._days),r=_i(this._months);e=x((t=x(i/60))/60),i%=60,t%=60;var o=n=x(r/12),s=r%=12,l=a,u=e,d=t,c=i,h=this.asSeconds();return h?(h<0?"-":"")+"P"+(o?o+"Y":"")+(s?s+"M":"")+(l?l+"D":"")+(u||d||c?"T":"")+(u?u+"H":"")+(d?d+"M":"")+(c?c+"S":""):"P0D"}var xe,_e,ke=_e=Array.prototype.some?Array.prototype.some:function(t){for(var e=Object(this),n=e.length>>>0,i=0;i<n;i++)if(i in e&&t.call(this,e[i],i,e))return!0;return!1},we=n.momentProperties=[],Me=!1,Se={};n.suppressDeprecationWarnings=!1,n.deprecationHandler=null;var De,Ce,Pe=De=Object.keys?Object.keys:function(t){var e,n=[];for(e in t)d(t,e)&&n.push(e);return n},Te={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Ie={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Ae=/\d{1,2}/,Oe={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Fe={},Re={},Le=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,We=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ye={},Ne={},ze=/\d/,Be=/\d\d/,Ve=/\d{3}/,He=/\d{4}/,Ee=/[+-]?\d{6}/,je=/\d\d?/,Ue=/\d\d\d\d?/,qe=/\d\d\d\d\d\d?/,Ge=/\d{1,3}/,Ze=/\d{1,4}/,Xe=/[+-]?\d{1,6}/,Je=/\d+/,Ke=/[+-]?\d+/,Qe=/Z|[+-]\d\d:?\d\d/gi,$e=/Z|[+-]\d\d(?::?\d\d)?/gi,tn=/[+-]?\d+(\.\d{1,3})?/,en=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,nn={},an={},rn=0,on=1,sn=2,ln=3,un=4,dn=5,cn=6,hn=7,fn=8,gn=Ce=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};N("M",["MM",2],"Mo",function(){return this.month()+1}),N("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),N("MMMM",0,0,function(t){return this.localeData().months(this,t)}),T("month","M"),O("month",8),E("M",je),E("MM",je,Be),E("MMM",function(t,e){return e.monthsShortRegex(t)}),E("MMMM",function(t,e){return e.monthsRegex(t)}),G(["M","MM"],function(t,e){e[on]=_(t)-1}),G(["MMM","MMMM"],function(t,e,n,i){var a=n._locale.monthsParse(t,i,n._strict);null!=a?e[on]=a:g(n).invalidMonth=t});var mn=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,pn="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),vn="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),yn=en,bn=en;N("Y",0,0,function(){var t=this.year();return t<=9999?""+t:"+"+t}),N(0,["YY",2],0,function(){return this.year()%100}),N(0,["YYYY",4],0,"year"),N(0,["YYYYY",5],0,"year"),N(0,["YYYYYY",6,!0],0,"year"),T("year","y"),O("year",1),E("Y",Ke),E("YY",je,Be),E("YYYY",Ze,He),E("YYYYY",Xe,Ee),E("YYYYYY",Xe,Ee),G(["YYYYY","YYYYYY"],rn),G("YYYY",function(t,e){e[rn]=2===t.length?n.parseTwoDigitYear(t):_(t)}),G("YY",function(t,e){e[rn]=n.parseTwoDigitYear(t)}),G("Y",function(t,e){e[rn]=parseInt(t,10)}),n.parseTwoDigitYear=function(t){return _(t)+(_(t)>68?1900:2e3)};var xn=R("FullYear",!0);N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),T("week","w"),T("isoWeek","W"),O("week",5),O("isoWeek",5),E("w",je),E("ww",je,Be),E("W",je),E("WW",je,Be),Z(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=_(t)});var _n={dow:0,doy:6};N("d",0,"do","day"),N("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),N("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),N("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),T("day","d"),T("weekday","e"),T("isoWeekday","E"),O("day",11),O("weekday",11),O("isoWeekday",11),E("d",je),E("e",je),E("E",je),E("dd",function(t,e){return e.weekdaysMinRegex(t)}),E("ddd",function(t,e){return e.weekdaysShortRegex(t)}),E("dddd",function(t,e){return e.weekdaysRegex(t)}),Z(["dd","ddd","dddd"],function(t,e,n,i){var a=n._locale.weekdaysParse(t,i,n._strict);null!=a?e.d=a:g(n).invalidWeekday=t}),Z(["d","e","E"],function(t,e,n,i){e[i]=_(t)});var kn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),wn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Mn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Sn=en,Dn=en,Cn=en;N("H",["HH",2],0,"hour"),N("h",["hh",2],0,ft),N("k",["kk",2],0,function(){return this.hours()||24}),N("hmm",0,0,function(){return""+ft.apply(this)+Y(this.minutes(),2)}),N("hmmss",0,0,function(){return""+ft.apply(this)+Y(this.minutes(),2)+Y(this.seconds(),2)}),N("Hmm",0,0,function(){return""+this.hours()+Y(this.minutes(),2)}),N("Hmmss",0,0,function(){return""+this.hours()+Y(this.minutes(),2)+Y(this.seconds(),2)}),gt("a",!0),gt("A",!1),T("hour","h"),O("hour",13),E("a",mt),E("A",mt),E("H",je),E("h",je),E("k",je),E("HH",je,Be),E("hh",je,Be),E("kk",je,Be),E("hmm",Ue),E("hmmss",qe),E("Hmm",Ue),E("Hmmss",qe),G(["H","HH"],ln),G(["k","kk"],function(t,e,n){var i=_(t);e[ln]=24===i?0:i}),G(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),G(["h","hh"],function(t,e,n){e[ln]=_(t),g(n).bigHour=!0}),G("hmm",function(t,e,n){var i=t.length-2;e[ln]=_(t.substr(0,i)),e[un]=_(t.substr(i)),g(n).bigHour=!0}),G("hmmss",function(t,e,n){var i=t.length-4,a=t.length-2;e[ln]=_(t.substr(0,i)),e[un]=_(t.substr(i,2)),e[dn]=_(t.substr(a)),g(n).bigHour=!0}),G("Hmm",function(t,e,n){var i=t.length-2;e[ln]=_(t.substr(0,i)),e[un]=_(t.substr(i))}),G("Hmmss",function(t,e,n){var i=t.length-4,a=t.length-2;e[ln]=_(t.substr(0,i)),e[un]=_(t.substr(i,2)),e[dn]=_(t.substr(a))});var Pn,Tn=/[ap]\.?m?\.?/i,In=R("Hours",!0),An={calendar:Te,longDateFormat:Ie,invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:Ae,relativeTime:Oe,months:pn,monthsShort:vn,week:_n,weekdays:kn,weekdaysMin:Mn,weekdaysShort:wn,meridiemParse:Tn},On={},Fn={},Rn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ln=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Wn=/Z|[+-]\d\d(?::?\d\d)?/,Yn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Nn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],zn=/^\/?Date\((\-?\d+)/i,Bn=/^((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d?\d\s(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(?:\d\d)?\d\d\s)(\d\d:\d\d)(\:\d\d)?(\s(?:UT|GMT|[ECMP][SD]T|[A-IK-Za-ik-z]|[+-]\d{4}))$/;n.createFromInputFallback=M("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),n.ISO_8601=function(){},n.RFC_2822=function(){};var Vn=M("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Nt.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:p()}),Hn=M("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=Nt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:p()}),En=["year","quarter","month","week","day","hour","minute","second","millisecond"];jt("Z",":"),jt("ZZ",""),E("Z",$e),E("ZZ",$e),G(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Ut($e,t)});var jn=/([\+\-]|\d\d)/gi;n.updateOffset=function(){};var Un=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,qn=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;Xt.fn=Vt.prototype,Xt.invalid=function(){return Xt(NaN)};var Gn=$t(1,"add"),Zn=$t(-1,"subtract");n.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",n.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Xn=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});N(0,["gg",2],0,function(){return this.weekYear()%100}),N(0,["GG",2],0,function(){return this.isoWeekYear()%100}),ae("gggg","weekYear"),ae("ggggg","weekYear"),ae("GGGG","isoWeekYear"),ae("GGGGG","isoWeekYear"),T("weekYear","gg"),T("isoWeekYear","GG"),O("weekYear",1),O("isoWeekYear",1),E("G",Ke),E("g",Ke),E("GG",je,Be),E("gg",je,Be),E("GGGG",Ze,He),E("gggg",Ze,He),E("GGGGG",Xe,Ee),E("ggggg",Xe,Ee),Z(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=_(t)}),Z(["gg","GG"],function(t,e,i,a){e[a]=n.parseTwoDigitYear(t)}),N("Q",0,"Qo","quarter"),T("quarter","Q"),O("quarter",7),E("Q",ze),G("Q",function(t,e){e[on]=3*(_(t)-1)}),N("D",["DD",2],"Do","date"),T("date","D"),O("date",9),E("D",je),E("DD",je,Be),E("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),G(["D","DD"],sn),G("Do",function(t,e){e[sn]=_(t.match(je)[0],10)});var Jn=R("Date",!0);N("DDD",["DDDD",3],"DDDo","dayOfYear"),T("dayOfYear","DDD"),O("dayOfYear",4),E("DDD",Ge),E("DDDD",Ve),G(["DDD","DDDD"],function(t,e,n){n._dayOfYear=_(t)}),N("m",["mm",2],0,"minute"),T("minute","m"),O("minute",14),E("m",je),E("mm",je,Be),G(["m","mm"],un);var Kn=R("Minutes",!1);N("s",["ss",2],0,"second"),T("second","s"),O("second",15),E("s",je),E("ss",je,Be),G(["s","ss"],dn);var Qn=R("Seconds",!1);N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return 10*this.millisecond()}),N(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),N(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),N(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),N(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),N(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),T("millisecond","ms"),O("millisecond",16),E("S",Ge,ze),E("SS",Ge,Be),E("SSS",Ge,Ve);var $n;for($n="SSSS";$n.length<=9;$n+="S")E($n,Je);for($n="S";$n.length<=9;$n+="S")G($n,function(t,e){e[cn]=_(1e3*("0."+t))});var ti=R("Milliseconds",!1);N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var ei=y.prototype;ei.add=Gn,ei.calendar=function(t,e){var i=t||Nt(),a=qt(i,this).startOf("day"),r=n.calendarFormat(this,a)||"sameElse",o=e&&(D(e[r])?e[r].call(this,i):e[r]);return this.format(o||this.localeData().calendar(r,this,Nt(i)))},ei.clone=function(){return new y(this)},ei.diff=function(t,e,n){var i,a,r,o;return this.isValid()&&(i=qt(t,this)).isValid()?(a=6e4*(i.utcOffset()-this.utcOffset()),"year"===(e=I(e))||"month"===e||"quarter"===e?(o=ee(this,i),"quarter"===e?o/=3:"year"===e&&(o/=12)):(r=this-i,o="second"===e?r/1e3:"minute"===e?r/6e4:"hour"===e?r/36e5:"day"===e?(r-a)/864e5:"week"===e?(r-a)/6048e5:r),n?o:x(o)):NaN},ei.endOf=function(t){return void 0===(t=I(t))||"millisecond"===t?this:("date"===t&&(t="day"),this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms"))},ei.format=function(t){t||(t=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var e=V(this,t);return this.localeData().postformat(e)},ei.from=function(t,e){return this.isValid()&&(b(t)&&t.isValid()||Nt(t).isValid())?Xt({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},ei.fromNow=function(t){return this.from(Nt(),t)},ei.to=function(t,e){return this.isValid()&&(b(t)&&t.isValid()||Nt(t).isValid())?Xt({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},ei.toNow=function(t){return this.to(Nt(),t)},ei.get=function(t){return t=I(t),D(this[t])?this[t]():this},ei.invalidAt=function(){return g(this).overflow},ei.isAfter=function(t,e){var n=b(t)?t:Nt(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=I(o(e)?"millisecond":e))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf())},ei.isBefore=function(t,e){var n=b(t)?t:Nt(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=I(o(e)?"millisecond":e))?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf())},ei.isBetween=function(t,e,n,i){return("("===(i=i||"()")[0]?this.isAfter(t,n):!this.isBefore(t,n))&&(")"===i[1]?this.isBefore(e,n):!this.isAfter(e,n))},ei.isSame=function(t,e){var n,i=b(t)?t:Nt(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=I(e||"millisecond"))?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf()))},ei.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},ei.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},ei.isValid=function(){return m(this)},ei.lang=Xn,ei.locale=ne,ei.localeData=ie,ei.max=Hn,ei.min=Vn,ei.parsingFlags=function(){return c({},g(this))},ei.set=function(t,e){if("object"==typeof t)for(var n=F(t=A(t)),i=0;i<n.length;i++)this[n[i].unit](t[n[i].unit]);else if(t=I(t),D(this[t]))return this[t](e);return this},ei.startOf=function(t){switch(t=I(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this},ei.subtract=Zn,ei.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},ei.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},ei.toDate=function(){return new Date(this.valueOf())},ei.toISOString=function(){if(!this.isValid())return null;var t=this.clone().utc();return t.year()<0||t.year()>9999?V(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):D(Date.prototype.toISOString)?this.toDate().toISOString():V(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},ei.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var n="["+t+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",a=e+'[")]';return this.format(n+i+"-MM-DD[T]HH:mm:ss.SSS"+a)},ei.toJSON=function(){return this.isValid()?this.toISOString():null},ei.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},ei.unix=function(){return Math.floor(this.valueOf()/1e3)},ei.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},ei.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},ei.year=xn,ei.isLeapYear=function(){return nt(this.year())},ei.weekYear=function(t){return re.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},ei.isoWeekYear=function(t){return re.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},ei.quarter=ei.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},ei.month=$,ei.daysInMonth=function(){return J(this.year(),this.month())},ei.week=ei.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},ei.isoWeek=ei.isoWeeks=function(t){var e=st(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},ei.weeksInYear=function(){var t=this.localeData()._week;return lt(this.year(),t.dow,t.doy)},ei.isoWeeksInYear=function(){return lt(this.year(),1,4)},ei.date=Jn,ei.day=ei.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=ut(t,this.localeData()),this.add(t-e,"d")):e},ei.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},ei.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=dt(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},ei.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},ei.hour=ei.hours=In,ei.minute=ei.minutes=Kn,ei.second=ei.seconds=Qn,ei.millisecond=ei.milliseconds=ti,ei.utcOffset=function(t,e,i){var a,r=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Ut($e,t)))return this}else Math.abs(t)<16&&!i&&(t*=60);return!this._isUTC&&e&&(a=Gt(this)),this._offset=t,this._isUTC=!0,null!=a&&this.add(a,"m"),r!==t&&(!e||this._changeInProgress?te(this,Xt(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,n.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?r:Gt(this)},ei.utc=function(t){return this.utcOffset(0,t)},ei.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Gt(this),"m")),this},ei.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Ut(Qe,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},ei.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Nt(t).utcOffset():0,(this.utcOffset()-t)%60==0)},ei.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ei.isLocal=function(){return!!this.isValid()&&!this._isUTC},ei.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ei.isUtc=Zt,ei.isUTC=Zt,ei.zoneAbbr=function(){return this._isUTC?"UTC":""},ei.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ei.dates=M("dates accessor is deprecated. Use date instead.",Jn),ei.months=M("months accessor is deprecated. Use month instead",$),ei.years=M("years accessor is deprecated. Use year instead",xn),ei.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}),ei.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var t={};if(v(t,this),(t=Lt(t))._a){var e=t._isUTC?h(t._a):Nt(t._a);this._isDSTShifted=this.isValid()&&k(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var ni=P.prototype;ni.calendar=function(t,e,n){var i=this._calendar[t]||this._calendar.sameElse;return D(i)?i.call(e,n):i},ni.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])},ni.invalidDate=function(){return this._invalidDate},ni.ordinal=function(t){return this._ordinal.replace("%d",t)},ni.preparse=se,ni.postformat=se,ni.relativeTime=function(t,e,n,i){var a=this._relativeTime[n];return D(a)?a(t,e,n,i):a.replace(/%d/i,t)},ni.pastFuture=function(t,e){var n=this._relativeTime[t>0?"future":"past"];return D(n)?n(e):n.replace(/%s/i,e)},ni.set=function(t){var e,n;for(n in t)D(e=t[n])?this[n]=e:this["_"+n]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},ni.months=function(t,e){return t?i(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||mn).test(e)?"format":"standalone"][t.month()]:i(this._months)?this._months:this._months.standalone},ni.monthsShort=function(t,e){return t?i(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[mn.test(e)?"format":"standalone"][t.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},ni.monthsParse=function(t,e,n){var i,a,r;if(this._monthsParseExact)return K.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(a=h([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(r="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}},ni.monthsRegex=function(t){return this._monthsParseExact?(d(this,"_monthsRegex")||tt.call(this),t?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=bn),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},ni.monthsShortRegex=function(t){return this._monthsParseExact?(d(this,"_monthsRegex")||tt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=yn),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},ni.week=function(t){return st(t,this._week.dow,this._week.doy).week},ni.firstDayOfYear=function(){return this._week.doy},ni.firstDayOfWeek=function(){return this._week.dow},ni.weekdays=function(t,e){return t?i(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]:i(this._weekdays)?this._weekdays:this._weekdays.standalone},ni.weekdaysMin=function(t){return t?this._weekdaysMin[t.day()]:this._weekdaysMin},ni.weekdaysShort=function(t){return t?this._weekdaysShort[t.day()]:this._weekdaysShort},ni.weekdaysParse=function(t,e,n){var i,a,r;if(this._weekdaysParseExact)return ct.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(a=h([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(a,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(a,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(a,"").replace(".",".?")+"$","i")),this._weekdaysParse[i]||(r="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[i]=new RegExp(r.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}},ni.weekdaysRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||ht.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=Sn),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},ni.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||ht.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Dn),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},ni.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||ht.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Cn),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},ni.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},ni.meridiem=function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},bt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===_(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),n.lang=M("moment.lang is deprecated. Use moment.locale instead.",bt),n.langData=M("moment.langData is deprecated. Use moment.localeData instead.",_t);var ii=Math.abs,ai=me("ms"),ri=me("s"),oi=me("m"),si=me("h"),li=me("d"),ui=me("w"),di=me("M"),ci=me("y"),hi=pe("milliseconds"),fi=pe("seconds"),gi=pe("minutes"),mi=pe("hours"),pi=pe("days"),vi=pe("months"),yi=pe("years"),bi=Math.round,xi={ss:44,s:45,m:45,h:22,d:26,M:11},_i=Math.abs,ki=Vt.prototype;return ki.isValid=function(){return this._isValid},ki.abs=function(){var t=this._data;return this._milliseconds=ii(this._milliseconds),this._days=ii(this._days),this._months=ii(this._months),t.milliseconds=ii(t.milliseconds),t.seconds=ii(t.seconds),t.minutes=ii(t.minutes),t.hours=ii(t.hours),t.months=ii(t.months),t.years=ii(t.years),this},ki.add=function(t,e){return ce(this,t,e,1)},ki.subtract=function(t,e){return ce(this,t,e,-1)},ki.as=function(t){if(!this.isValid())return NaN;var e,n,i=this._milliseconds;if("month"===(t=I(t))||"year"===t)return e=this._days+i/864e5,n=this._months+fe(e),"month"===t?n:n/12;switch(e=this._days+Math.round(ge(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}},ki.asMilliseconds=ai,ki.asSeconds=ri,ki.asMinutes=oi,ki.asHours=si,ki.asDays=li,ki.asWeeks=ui,ki.asMonths=di,ki.asYears=ci,ki.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*_(this._months/12):NaN},ki._bubble=function(){var t,e,n,i,a,r=this._milliseconds,o=this._days,s=this._months,l=this._data;return r>=0&&o>=0&&s>=0||r<=0&&o<=0&&s<=0||(r+=864e5*he(ge(s)+o),o=0,s=0),l.milliseconds=r%1e3,t=x(r/1e3),l.seconds=t%60,e=x(t/60),l.minutes=e%60,n=x(e/60),l.hours=n%24,o+=x(n/24),a=x(fe(o)),s+=a,o-=he(ge(a)),i=x(s/12),s%=12,l.days=o,l.months=s,l.years=i,this},ki.get=function(t){return t=I(t),this.isValid()?this[t+"s"]():NaN},ki.milliseconds=hi,ki.seconds=fi,ki.minutes=gi,ki.hours=mi,ki.days=pi,ki.weeks=function(){return x(this.days()/7)},ki.months=vi,ki.years=yi,ki.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),n=ye(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)},ki.toISOString=be,ki.toString=be,ki.toJSON=be,ki.locale=ne,ki.localeData=ie,ki.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",be),ki.lang=Xn,N("X",0,0,"unix"),N("x",0,0,"valueOf"),E("x",Ke),E("X",tn),G("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),G("x",function(t,e,n){n._d=new Date(_(t))}),n.version="2.18.1",function(t){xe=t}(Nt),n.fn=ei,n.min=function(){return zt("isBefore",[].slice.call(arguments,0))},n.max=function(){return zt("isAfter",[].slice.call(arguments,0))},n.now=function(){return Date.now?Date.now():+new Date},n.utc=h,n.unix=function(t){return Nt(1e3*t)},n.months=function(t,e){return ue(t,e,"months")},n.isDate=l,n.locale=bt,n.invalid=p,n.duration=Xt,n.isMoment=b,n.weekdays=function(t,e,n){return de(t,e,n,"weekdays")},n.parseZone=function(){return Nt.apply(null,arguments).parseZone()},n.localeData=_t,n.isDuration=Ht,n.monthsShort=function(t,e){return ue(t,e,"monthsShort")},n.weekdaysMin=function(t,e,n){return de(t,e,n,"weekdaysMin")},n.defineLocale=xt,n.updateLocale=function(t,e){if(null!=e){var n,i=An;null!=On[t]&&(i=On[t]._config),(n=new P(e=C(i,e))).parentLocale=On[t],On[t]=n,bt(t)}else null!=On[t]&&(null!=On[t].parentLocale?On[t]=On[t].parentLocale:null!=On[t]&&delete On[t]);return On[t]},n.locales=function(){return Pe(On)},n.weekdaysShort=function(t,e,n){return de(t,e,n,"weekdaysShort")},n.normalizeUnits=I,n.relativeTimeRounding=function(t){return void 0===t?bi:"function"==typeof t&&(bi=t,!0)},n.relativeTimeThreshold=function(t,e){return void 0!==xi[t]&&(void 0===e?xi[t]:(xi[t]=e,"s"===t&&(xi.ss=e-1),!0))},n.calendarFormat=function(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},n.prototype=ei,n})},{}],7:[function(t,e,n){var i=t(29)();i.helpers=t(45),t(27)(i),i.defaults=t(25),i.Element=t(26),i.elements=t(40),i.Interaction=t(28),i.platform=t(48),t(31)(i),t(22)(i),t(23)(i),t(24)(i),t(30)(i),t(33)(i),t(32)(i),t(35)(i),t(54)(i),t(52)(i),t(53)(i),t(55)(i),t(56)(i),t(57)(i),t(15)(i),t(16)(i),t(17)(i),t(18)(i),t(19)(i),t(20)(i),t(21)(i),t(8)(i),t(9)(i),t(10)(i),t(11)(i),t(12)(i),t(13)(i),t(14)(i);var a=[];a.push(t(49)(i),t(50)(i),t(51)(i)),i.plugins.register(a),i.platform.initialize(),e.exports=i,"undefined"!=typeof window&&(window.Chart=i),i.canvasHelpers=i.helpers.canvas},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:21,22:22,23:23,24:24,25:25,26:26,27:27,28:28,29:29,30:30,31:31,32:32,33:33,35:35,40:40,45:45,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,8:8,9:9}],8:[function(t,e,n){"use strict";e.exports=function(t){t.Bar=function(e,n){return n.type="bar",new t(e,n)}}},{}],9:[function(t,e,n){"use strict";e.exports=function(t){t.Bubble=function(e,n){return n.type="bubble",new t(e,n)}}},{}],10:[function(t,e,n){"use strict";e.exports=function(t){t.Doughnut=function(e,n){return n.type="doughnut",new t(e,n)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t){t.Line=function(e,n){return n.type="line",new t(e,n)}}},{}],12:[function(t,e,n){"use strict";e.exports=function(t){t.PolarArea=function(e,n){return n.type="polarArea",new t(e,n)}}},{}],13:[function(t,e,n){"use strict";e.exports=function(t){t.Radar=function(e,n){return n.type="radar",new t(e,n)}}},{}],14:[function(t,e,n){"use strict";e.exports=function(t){t.Scatter=function(e,n){return n.type="scatter",new t(e,n)}}},{}],15:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),i._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{position:"left",type:"category",categoryPercentage:.8,barPercentage:.9,offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{callbacks:{title:function(t,e){var n="";return t.length>0&&(t[0].yLabel?n=t[0].yLabel:e.labels.length>0&&t[0].index<e.labels.length&&(n=e.labels[t[0].index])),n},label:function(t,e){return(e.datasets[t.datasetIndex].label||"")+": "+t.xLabel}},mode:"index",axis:"y"}}),e.exports=function(t){t.controllers.bar=t.DatasetController.extend({dataElementType:a.Rectangle,initialize:function(){var e,n=this;t.DatasetController.prototype.initialize.apply(n,arguments),(e=n.getMeta()).stack=n.getDataset().stack,e.bar=!0},update:function(t){var e,n,i=this,a=i.getMeta().data;for(i._ruler=i.getRuler(),e=0,n=a.length;e<n;++e)i.updateElement(a[e],e,t)},updateElement:function(t,e,n){var i=this,a=i.chart,o=i.getMeta(),s=i.getDataset(),l=t.custom||{},u=a.options.elements.rectangle;t._xScale=i.getScaleForId(o.xAxisID),t._yScale=i.getScaleForId(o.yAxisID),t._datasetIndex=i.index,t._index=e,t._model={datasetLabel:s.label,label:a.data.labels[e],borderSkipped:l.borderSkipped?l.borderSkipped:u.borderSkipped,backgroundColor:l.backgroundColor?l.backgroundColor:r.valueAtIndexOrDefault(s.backgroundColor,e,u.backgroundColor),borderColor:l.borderColor?l.borderColor:r.valueAtIndexOrDefault(s.borderColor,e,u.borderColor),borderWidth:l.borderWidth?l.borderWidth:r.valueAtIndexOrDefault(s.borderWidth,e,u.borderWidth)},i.updateElementGeometry(t,e,n),t.pivot()},updateElementGeometry:function(t,e,n){var i=this,a=t._model,r=i.getValueScale(),o=r.getBasePixel(),s=r.isHorizontal(),l=i._ruler||i.getRuler(),u=i.calculateBarValuePixels(i.index,e),d=i.calculateBarIndexPixels(i.index,e,l);a.horizontal=s,a.base=n?o:u.base,a.x=s?n?o:u.head:d.center,a.y=s?d.center:n?o:u.head,a.height=s?d.size:void 0,a.width=s?void 0:d.size},getValueScaleId:function(){return this.getMeta().yAxisID},getIndexScaleId:function(){return this.getMeta().xAxisID},getValueScale:function(){return this.getScaleForId(this.getValueScaleId())},getIndexScale:function(){return this.getScaleForId(this.getIndexScaleId())},getStackCount:function(t){var e,n,i=this,a=i.chart,r=i.getIndexScale().options.stacked,o=void 0===t?a.data.datasets.length:t+1,s=[];for(e=0;e<o;++e)(n=a.getDatasetMeta(e)).bar&&a.isDatasetVisible(e)&&(!1===r||!0===r&&-1===s.indexOf(n.stack)||void 0===r&&(void 0===n.stack||-1===s.indexOf(n.stack)))&&s.push(n.stack);return s.length},getStackIndex:function(t){return this.getStackCount(t)-1},getRuler:function(){var t,e,n=this,i=n.getIndexScale(),a=n.getStackCount(),r=n.index,o=[],s=i.isHorizontal(),l=s?i.left:i.top,u=l+(s?i.width:i.height);for(t=0,e=n.getMeta().data.length;t<e;++t)o.push(i.getPixelForValue(null,t,r));return{pixels:o,start:l,end:u,stackCount:a,scale:i}},calculateBarValuePixels:function(t,e){var n,i,a,r,o,s,l=this,u=l.chart,d=l.getMeta(),c=l.getValueScale(),h=u.data.datasets,f=c.getRightValue(h[t].data[e]),g=c.options.stacked,m=d.stack,p=0;if(g||void 0===g&&void 0!==m)for(n=0;n<t;++n)(i=u.getDatasetMeta(n)).bar&&i.stack===m&&i.controller.getValueScaleId()===c.id&&u.isDatasetVisible(n)&&(a=c.getRightValue(h[n].data[e]),(f<0&&a<0||f>=0&&a>0)&&(p+=a));return r=c.getPixelForValue(p),o=c.getPixelForValue(p+f),s=(o-r)/2,{size:s,base:r,head:o,center:o+s/2}},calculateBarIndexPixels:function(t,e,n){var i,a,o,s,l,u,d=this,c=n.scale.options,h=d.getStackIndex(t),f=n.pixels,g=f[e],m=f.length,p=n.start,v=n.end;return 1===m?(i=g>p?g-p:v-g,a=g<v?v-g:g-p):(e>0&&(i=(g-f[e-1])/2,e===m-1&&(a=i)),e<m-1&&(a=(f[e+1]-g)/2,0===e&&(i=a))),o=i*c.categoryPercentage,s=a*c.categoryPercentage,l=(o+s)/n.stackCount,u=l*c.barPercentage,u=Math.min(r.valueOrDefault(c.barThickness,u),r.valueOrDefault(c.maxBarThickness,1/0)),g-=o,g+=l*h,g+=(l-u)/2,{size:u,base:g,head:g+u,center:g+u/2}},draw:function(){var t=this,e=t.chart,n=t.getValueScale(),i=t.getMeta().data,a=t.getDataset(),o=i.length,s=0;for(r.canvas.clipArea(e.ctx,e.chartArea);s<o;++s)isNaN(n.getRightValue(a.data[s]))||i[s].draw();r.canvas.unclipArea(e.ctx)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model;a.backgroundColor=i.hoverBackgroundColor?i.hoverBackgroundColor:r.valueAtIndexOrDefault(e.hoverBackgroundColor,n,r.getHoverColor(a.backgroundColor)),a.borderColor=i.hoverBorderColor?i.hoverBorderColor:r.valueAtIndexOrDefault(e.hoverBorderColor,n,r.getHoverColor(a.borderColor)),a.borderWidth=i.hoverBorderWidth?i.hoverBorderWidth:r.valueAtIndexOrDefault(e.hoverBorderWidth,n,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model,o=this.chart.options.elements.rectangle;a.backgroundColor=i.backgroundColor?i.backgroundColor:r.valueAtIndexOrDefault(e.backgroundColor,n,o.backgroundColor),a.borderColor=i.borderColor?i.borderColor:r.valueAtIndexOrDefault(e.borderColor,n,o.borderColor),a.borderWidth=i.borderWidth?i.borderWidth:r.valueAtIndexOrDefault(e.borderWidth,n,o.borderWidth)}}),t.controllers.horizontalBar=t.controllers.bar.extend({getValueScaleId:function(){return this.getMeta().xAxisID},getIndexScaleId:function(){return this.getMeta().yAxisID}})}},{25:25,40:40,45:45}],16:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.datasets[t.datasetIndex].label||"",i=e.datasets[t.datasetIndex].data[t.index];return n+": ("+t.xLabel+", "+t.yLabel+", "+i.r+")"}}}}),e.exports=function(t){t.controllers.bubble=t.DatasetController.extend({dataElementType:a.Point,update:function(t){var e=this,n=e.getMeta().data;r.each(n,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){var i=this,a=i.getMeta(),r=t.custom||{},o=i.getScaleForId(a.xAxisID),s=i.getScaleForId(a.yAxisID),l=i._resolveElementOptions(t,e),u=i.getDataset().data[e],d=i.index,c=n?o.getPixelForDecimal(.5):o.getPixelForValue("object"==typeof u?u:NaN,e,d),h=n?s.getBasePixel():s.getPixelForValue(u,e,d);t._xScale=o,t._yScale=s,t._options=l,t._datasetIndex=d,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,radius:n?0:l.radius,skip:r.skip||isNaN(c)||isNaN(h),x:c,y:h},t.pivot()},setHoverStyle:function(t){var e=t._model,n=t._options;e.backgroundColor=r.valueOrDefault(n.hoverBackgroundColor,r.getHoverColor(n.backgroundColor)),e.borderColor=r.valueOrDefault(n.hoverBorderColor,r.getHoverColor(n.borderColor)),e.borderWidth=r.valueOrDefault(n.hoverBorderWidth,n.borderWidth),e.radius=n.radius+n.hoverRadius},removeHoverStyle:function(t){var e=t._model,n=t._options;e.backgroundColor=n.backgroundColor,e.borderColor=n.borderColor,e.borderWidth=n.borderWidth,e.radius=n.radius},_resolveElementOptions:function(t,e){var n,i,a,o=this,s=o.chart,l=s.data.datasets[o.index],u=t.custom||{},d=s.options.elements.point,c=r.options.resolve,h=l.data[e],f={},g={chart:s,dataIndex:e,dataset:l,datasetIndex:o.index},m=["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle"];for(n=0,i=m.length;n<i;++n)f[a=m[n]]=c([u[a],l[a],d[a]],g,e);return f.radius=c([u.radius,h?h.r:void 0,l.radius,d.radius],g,e),f}})}},{25:25,40:40,45:45}],17:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var r=0;r<i[0].data.length;++r)e.push('<li><span style="background-color:'+i[0].backgroundColor[r]+'"></span>'),a[r]&&e.push(a[r]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),o=e.datasets[0],s=a.data[i],l=s&&s.custom||{},u=r.valueAtIndexOrDefault,d=t.options.elements.arc;return{text:n,fillStyle:l.backgroundColor?l.backgroundColor:u(o.backgroundColor,i,d.backgroundColor),strokeStyle:l.borderColor?l.borderColor:u(o.borderColor,i,d.borderColor),lineWidth:l.borderWidth?l.borderWidth:u(o.borderWidth,i,d.borderWidth),hidden:isNaN(o.data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r]&&(a.data[r].hidden=!a.data[r].hidden);o.update()}},cutoutPercentage:50,rotation:-.5*Math.PI,circumference:2*Math.PI,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var n=e.labels[t.index],i=": "+e.datasets[t.datasetIndex].data[t.index];return r.isArray(n)?(n=n.slice())[0]+=i:n+=i,n}}}}),i._set("pie",r.clone(i.doughnut)),i._set("pie",{cutoutPercentage:0}),e.exports=function(t){t.controllers.doughnut=t.controllers.pie=t.DatasetController.extend({dataElementType:a.Arc,linkScales:r.noop,getRingIndex:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&++e;return e},update:function(t){var e=this,n=e.chart,i=n.chartArea,a=n.options,o=a.elements.arc,s=i.right-i.left-o.borderWidth,l=i.bottom-i.top-o.borderWidth,u=Math.min(s,l),d={x:0,y:0},c=e.getMeta(),h=a.cutoutPercentage,f=a.circumference;if(f<2*Math.PI){var g=a.rotation%(2*Math.PI),m=(g+=2*Math.PI*(g>=Math.PI?-1:g<-Math.PI?1:0))+f,p={x:Math.cos(g),y:Math.sin(g)},v={x:Math.cos(m),y:Math.sin(m)},y=g<=0&&m>=0||g<=2*Math.PI&&2*Math.PI<=m,b=g<=.5*Math.PI&&.5*Math.PI<=m||g<=2.5*Math.PI&&2.5*Math.PI<=m,x=g<=-Math.PI&&-Math.PI<=m||g<=Math.PI&&Math.PI<=m,_=g<=.5*-Math.PI&&.5*-Math.PI<=m||g<=1.5*Math.PI&&1.5*Math.PI<=m,k=h/100,w={x:x?-1:Math.min(p.x*(p.x<0?1:k),v.x*(v.x<0?1:k)),y:_?-1:Math.min(p.y*(p.y<0?1:k),v.y*(v.y<0?1:k))},M={x:y?1:Math.max(p.x*(p.x>0?1:k),v.x*(v.x>0?1:k)),y:b?1:Math.max(p.y*(p.y>0?1:k),v.y*(v.y>0?1:k))},S={width:.5*(M.x-w.x),height:.5*(M.y-w.y)};u=Math.min(s/S.width,l/S.height),d={x:-.5*(M.x+w.x),y:-.5*(M.y+w.y)}}n.borderWidth=e.getMaxBorderWidth(c.data),n.outerRadius=Math.max((u-n.borderWidth)/2,0),n.innerRadius=Math.max(h?n.outerRadius/100*h:0,0),n.radiusLength=(n.outerRadius-n.innerRadius)/n.getVisibleDatasetCount(),n.offsetX=d.x*n.outerRadius,n.offsetY=d.y*n.outerRadius,c.total=e.calculateTotal(),e.outerRadius=n.outerRadius-n.radiusLength*e.getRingIndex(e.index),e.innerRadius=Math.max(e.outerRadius-n.radiusLength,0),r.each(c.data,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){var i=this,a=i.chart,o=a.chartArea,s=a.options,l=s.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,c=s.rotation,h=s.rotation,f=i.getDataset(),g=n&&l.animateRotate?0:t.hidden?0:i.calculateCircumference(f.data[e])*(s.circumference/(2*Math.PI)),m=n&&l.animateScale?0:i.innerRadius,p=n&&l.animateScale?0:i.outerRadius,v=r.valueAtIndexOrDefault;r.extend(t,{_datasetIndex:i.index,_index:e,_model:{x:u+a.offsetX,y:d+a.offsetY,startAngle:c,endAngle:h,circumference:g,outerRadius:p,innerRadius:m,label:v(f.label,e,a.data.labels[e])}});var y=t._model;this.removeHoverStyle(t),n&&l.animateRotate||(y.startAngle=0===e?s.rotation:i.getMeta().data[e-1]._model.endAngle,y.endAngle=y.startAngle+y.circumference),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},calculateTotal:function(){var t,e=this.getDataset(),n=this.getMeta(),i=0;return r.each(n.data,function(n,a){t=e.data[a],isNaN(t)||n.hidden||(i+=Math.abs(t))}),i},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?2*Math.PI*(t/e):0},getMaxBorderWidth:function(t){for(var e,n,i=0,a=this.index,r=t.length,o=0;o<r;o++)e=t[o]._model?t[o]._model.borderWidth:0,i=(n=t[o]._chart?t[o]._chart.config.data.datasets[a].hoverBorderWidth:0)>(i=e>i?e:i)?n:i;return i}})}},{25:25,40:40,45:45}],18:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}}),e.exports=function(t){function e(t,e){return r.valueOrDefault(t.showLine,e.showLines)}t.controllers.line=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,update:function(t){var n,i,a,o=this,s=o.getMeta(),l=s.dataset,u=s.data||[],d=o.chart.options,c=d.elements.line,h=o.getScaleForId(s.yAxisID),f=o.getDataset(),g=e(f,d);for(g&&(a=l.custom||{},void 0!==f.tension&&void 0===f.lineTension&&(f.lineTension=f.tension),l._scale=h,l._datasetIndex=o.index,l._children=u,l._model={spanGaps:f.spanGaps?f.spanGaps:d.spanGaps,tension:a.tension?a.tension:r.valueOrDefault(f.lineTension,c.tension),backgroundColor:a.backgroundColor?a.backgroundColor:f.backgroundColor||c.backgroundColor,borderWidth:a.borderWidth?a.borderWidth:f.borderWidth||c.borderWidth,borderColor:a.borderColor?a.borderColor:f.borderColor||c.borderColor,borderCapStyle:a.borderCapStyle?a.borderCapStyle:f.borderCapStyle||c.borderCapStyle,borderDash:a.borderDash?a.borderDash:f.borderDash||c.borderDash,borderDashOffset:a.borderDashOffset?a.borderDashOffset:f.borderDashOffset||c.borderDashOffset,borderJoinStyle:a.borderJoinStyle?a.borderJoinStyle:f.borderJoinStyle||c.borderJoinStyle,fill:a.fill?a.fill:void 0!==f.fill?f.fill:c.fill,steppedLine:a.steppedLine?a.steppedLine:r.valueOrDefault(f.steppedLine,c.stepped),cubicInterpolationMode:a.cubicInterpolationMode?a.cubicInterpolationMode:r.valueOrDefault(f.cubicInterpolationMode,c.cubicInterpolationMode)},l.pivot()),n=0,i=u.length;n<i;++n)o.updateElement(u[n],n,t);for(g&&0!==l._model.tension&&o.updateBezierControlPoints(),n=0,i=u.length;n<i;++n)u[n].pivot()},getPointBackgroundColor:function(t,e){var n=this.chart.options.elements.point.backgroundColor,i=this.getDataset(),a=t.custom||{};return a.backgroundColor?n=a.backgroundColor:i.pointBackgroundColor?n=r.valueAtIndexOrDefault(i.pointBackgroundColor,e,n):i.backgroundColor&&(n=i.backgroundColor),n},getPointBorderColor:function(t,e){var n=this.chart.options.elements.point.borderColor,i=this.getDataset(),a=t.custom||{};return a.borderColor?n=a.borderColor:i.pointBorderColor?n=r.valueAtIndexOrDefault(i.pointBorderColor,e,n):i.borderColor&&(n=i.borderColor),n},getPointBorderWidth:function(t,e){var n=this.chart.options.elements.point.borderWidth,i=this.getDataset(),a=t.custom||{};return isNaN(a.borderWidth)?!isNaN(i.pointBorderWidth)||r.isArray(i.pointBorderWidth)?n=r.valueAtIndexOrDefault(i.pointBorderWidth,e,n):isNaN(i.borderWidth)||(n=i.borderWidth):n=a.borderWidth,n},updateElement:function(t,e,n){var i,a,o=this,s=o.getMeta(),l=t.custom||{},u=o.getDataset(),d=o.index,c=u.data[e],h=o.getScaleForId(s.yAxisID),f=o.getScaleForId(s.xAxisID),g=o.chart.options.elements.point;void 0!==u.radius&&void 0===u.pointRadius&&(u.pointRadius=u.radius),void 0!==u.hitRadius&&void 0===u.pointHitRadius&&(u.pointHitRadius=u.hitRadius),i=f.getPixelForValue("object"==typeof c?c:NaN,e,d),a=n?h.getBasePixel():o.calculatePointY(c,e,d),t._xScale=f,t._yScale=h,t._datasetIndex=d,t._index=e,t._model={x:i,y:a,skip:l.skip||isNaN(i)||isNaN(a),radius:l.radius||r.valueAtIndexOrDefault(u.pointRadius,e,g.radius),pointStyle:l.pointStyle||r.valueAtIndexOrDefault(u.pointStyle,e,g.pointStyle),backgroundColor:o.getPointBackgroundColor(t,e),borderColor:o.getPointBorderColor(t,e),borderWidth:o.getPointBorderWidth(t,e),tension:s.dataset._model?s.dataset._model.tension:0,steppedLine:!!s.dataset._model&&s.dataset._model.steppedLine,hitRadius:l.hitRadius||r.valueAtIndexOrDefault(u.pointHitRadius,e,g.hitRadius)}},calculatePointY:function(t,e,n){var i,a,r,o=this,s=o.chart,l=o.getMeta(),u=o.getScaleForId(l.yAxisID),d=0,c=0;if(u.options.stacked){for(i=0;i<n;i++)if(a=s.data.datasets[i],"line"===(r=s.getDatasetMeta(i)).type&&r.yAxisID===u.id&&s.isDatasetVisible(i)){var h=Number(u.getRightValue(a.data[e]));h<0?c+=h||0:d+=h||0}var f=Number(u.getRightValue(t));return f<0?u.getPixelForValue(c+f):u.getPixelForValue(d+f)}return u.getPixelForValue(t)},updateBezierControlPoints:function(){function t(t,e,n){return Math.max(Math.min(t,n),e)}var e,n,i,a,o=this,s=o.getMeta(),l=o.chart.chartArea,u=s.data||[];if(s.dataset._model.spanGaps&&(u=u.filter(function(t){return!t._model.skip})),"monotone"===s.dataset._model.cubicInterpolationMode)r.splineCurveMonotone(u);else for(e=0,n=u.length;e<n;++e)i=u[e]._model,a=r.splineCurve(r.previousItem(u,e)._model,i,r.nextItem(u,e)._model,s.dataset._model.tension),i.controlPointPreviousX=a.previous.x,i.controlPointPreviousY=a.previous.y,i.controlPointNextX=a.next.x,i.controlPointNextY=a.next.y;if(o.chart.options.elements.line.capBezierPoints)for(e=0,n=u.length;e<n;++e)(i=u[e]._model).controlPointPreviousX=t(i.controlPointPreviousX,l.left,l.right),i.controlPointPreviousY=t(i.controlPointPreviousY,l.top,l.bottom),i.controlPointNextX=t(i.controlPointNextX,l.left,l.right),i.controlPointNextY=t(i.controlPointNextY,l.top,l.bottom)},draw:function(){var t=this,n=t.chart,i=t.getMeta(),a=i.data||[],o=n.chartArea,s=a.length,l=0;for(r.canvas.clipArea(n.ctx,o),e(t.getDataset(),n.options)&&i.dataset.draw(),r.canvas.unclipArea(n.ctx);l<s;++l)a[l].draw(o)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,i=t.custom||{},a=t._model;a.radius=i.hoverRadius||r.valueAtIndexOrDefault(e.pointHoverRadius,n,this.chart.options.elements.point.hoverRadius),a.backgroundColor=i.hoverBackgroundColor||r.valueAtIndexOrDefault(e.pointHoverBackgroundColor,n,r.getHoverColor(a.backgroundColor)),a.borderColor=i.hoverBorderColor||r.valueAtIndexOrDefault(e.pointHoverBorderColor,n,r.getHoverColor(a.borderColor)),a.borderWidth=i.hoverBorderWidth||r.valueAtIndexOrDefault(e.pointHoverBorderWidth,n,a.borderWidth)},removeHoverStyle:function(t){var e=this,n=e.chart.data.datasets[t._datasetIndex],i=t._index,a=t.custom||{},o=t._model;void 0!==n.radius&&void 0===n.pointRadius&&(n.pointRadius=n.radius),o.radius=a.radius||r.valueAtIndexOrDefault(n.pointRadius,i,e.chart.options.elements.point.radius),o.backgroundColor=e.getPointBackgroundColor(t,i),o.borderColor=e.getPointBorderColor(t,i),o.borderWidth=e.getPointBorderWidth(t,i)}})}},{25:25,40:40,45:45}],19:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e=[];e.push('<ul class="'+t.id+'-legend">');var n=t.data,i=n.datasets,a=n.labels;if(i.length)for(var r=0;r<i[0].data.length;++r)e.push('<li><span style="background-color:'+i[0].backgroundColor[r]+'"></span>'),a[r]&&e.push(a[r]),e.push("</li>");return e.push("</ul>"),e.join("")},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(n,i){var a=t.getDatasetMeta(0),o=e.datasets[0],s=a.data[i].custom||{},l=r.valueAtIndexOrDefault,u=t.options.elements.arc;return{text:n,fillStyle:s.backgroundColor?s.backgroundColor:l(o.backgroundColor,i,u.backgroundColor),strokeStyle:s.borderColor?s.borderColor:l(o.borderColor,i,u.borderColor),lineWidth:s.borderWidth?s.borderWidth:l(o.borderWidth,i,u.borderWidth),hidden:isNaN(o.data[i])||a.data[i].hidden,index:i}}):[]}},onClick:function(t,e){var n,i,a,r=e.index,o=this.chart;for(n=0,i=(o.data.datasets||[]).length;n<i;++n)(a=o.getDatasetMeta(n)).data[r].hidden=!a.data[r].hidden;o.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}}),e.exports=function(t){t.controllers.polarArea=t.DatasetController.extend({dataElementType:a.Arc,linkScales:r.noop,update:function(t){var e=this,n=e.chart,i=n.chartArea,a=e.getMeta(),o=n.options,s=o.elements.arc,l=Math.min(i.right-i.left,i.bottom-i.top);n.outerRadius=Math.max((l-s.borderWidth/2)/2,0),n.innerRadius=Math.max(o.cutoutPercentage?n.outerRadius/100*o.cutoutPercentage:1,0),n.radiusLength=(n.outerRadius-n.innerRadius)/n.getVisibleDatasetCount(),e.outerRadius=n.outerRadius-n.radiusLength*e.index,e.innerRadius=e.outerRadius-n.radiusLength,a.count=e.countVisibleElements(),r.each(a.data,function(n,i){e.updateElement(n,i,t)})},updateElement:function(t,e,n){for(var i=this,a=i.chart,o=i.getDataset(),s=a.options,l=s.animation,u=a.scale,d=a.data.labels,c=i.calculateCircumference(o.data[e]),h=u.xCenter,f=u.yCenter,g=0,m=i.getMeta(),p=0;p<e;++p)isNaN(o.data[p])||m.data[p].hidden||++g;var v=s.startAngle,y=t.hidden?0:u.getDistanceFromCenterForValue(o.data[e]),b=v+c*g,x=b+(t.hidden?0:c),_=l.animateScale?0:u.getDistanceFromCenterForValue(o.data[e]);r.extend(t,{_datasetIndex:i.index,_index:e,_scale:u,_model:{x:h,y:f,innerRadius:0,outerRadius:n?_:y,startAngle:n&&l.animateRotate?v:b,endAngle:n&&l.animateRotate?v:x,label:r.valueAtIndexOrDefault(d,e,d[e])}}),i.removeHoverStyle(t),t.pivot()},removeHoverStyle:function(e){t.DatasetController.prototype.removeHoverStyle.call(this,e,this.chart.options.elements.arc)},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),n=0;return r.each(e.data,function(e,i){isNaN(t.data[i])||e.hidden||n++}),n},calculateCircumference:function(t){var e=this.getMeta().count;return e>0&&!isNaN(t)?2*Math.PI/e:0}})}},{25:25,40:40,45:45}],20:[function(t,e,n){"use strict";var i=t(25),a=t(40),r=t(45);i._set("radar",{scale:{type:"radialLinear"},elements:{line:{tension:0}}}),e.exports=function(t){t.controllers.radar=t.DatasetController.extend({datasetElementType:a.Line,dataElementType:a.Point,linkScales:r.noop,update:function(t){var e=this,n=e.getMeta(),i=n.dataset,a=n.data,o=i.custom||{},s=e.getDataset(),l=e.chart.options.elements.line,u=e.chart.scale;void 0!==s.tension&&void 0===s.lineTension&&(s.lineTension=s.tension),r.extend(n.dataset,{_datasetIndex:e.index,_scale:u,_children:a,_loop:!0,_model:{tension:o.tension?o.tension:r.valueOrDefault(s.lineTension,l.tension),backgroundColor:o.backgroundColor?o.backgroundColor:s.backgroundColor||l.backgroundColor,borderWidth:o.borderWidth?o.borderWidth:s.borderWidth||l.borderWidth,borderColor:o.borderColor?o.borderColor:s.borderColor||l.borderColor,fill:o.fill?o.fill:void 0!==s.fill?s.fill:l.fill,borderCapStyle:o.borderCapStyle?o.borderCapStyle:s.borderCapStyle||l.borderCapStyle,borderDash:o.borderDash?o.borderDash:s.borderDash||l.borderDash,borderDashOffset:o.borderDashOffset?o.borderDashOffset:s.borderDashOffset||l.borderDashOffset,borderJoinStyle:o.borderJoinStyle?o.borderJoinStyle:s.borderJoinStyle||l.borderJoinStyle}}),n.dataset.pivot(),r.each(a,function(n,i){e.updateElement(n,i,t)},e),e.updateBezierControlPoints()},updateElement:function(t,e,n){var i=this,a=t.custom||{},o=i.getDataset(),s=i.chart.scale,l=i.chart.options.elements.point,u=s.getPointPositionForValue(e,o.data[e]);void 0!==o.radius&&void 0===o.pointRadius&&(o.pointRadius=o.radius),void 0!==o.hitRadius&&void 0===o.pointHitRadius&&(o.pointHitRadius=o.hitRadius),r.extend(t,{_datasetIndex:i.index,_index:e,_scale:s,_model:{x:n?s.xCenter:u.x,y:n?s.yCenter:u.y,tension:a.tension?a.tension:r.valueOrDefault(o.lineTension,i.chart.options.elements.line.tension),radius:a.radius?a.radius:r.valueAtIndexOrDefault(o.pointRadius,e,l.radius),backgroundColor:a.backgroundColor?a.backgroundColor:r.valueAtIndexOrDefault(o.pointBackgroundColor,e,l.backgroundColor),borderColor:a.borderColor?a.borderColor:r.valueAtIndexOrDefault(o.pointBorderColor,e,l.borderColor),borderWidth:a.borderWidth?a.borderWidth:r.valueAtIndexOrDefault(o.pointBorderWidth,e,l.borderWidth),pointStyle:a.pointStyle?a.pointStyle:r.valueAtIndexOrDefault(o.pointStyle,e,l.pointStyle),hitRadius:a.hitRadius?a.hitRadius:r.valueAtIndexOrDefault(o.pointHitRadius,e,l.hitRadius)}}),t._model.skip=a.skip?a.skip:isNaN(t._model.x)||isNaN(t._model.y)},updateBezierControlPoints:function(){var t=this.chart.chartArea,e=this.getMeta();r.each(e.data,function(n,i){var a=n._model,o=r.splineCurve(r.previousItem(e.data,i,!0)._model,a,r.nextItem(e.data,i,!0)._model,a.tension);a.controlPointPreviousX=Math.max(Math.min(o.previous.x,t.right),t.left),a.controlPointPreviousY=Math.max(Math.min(o.previous.y,t.bottom),t.top),a.controlPointNextX=Math.max(Math.min(o.next.x,t.right),t.left),a.controlPointNextY=Math.max(Math.min(o.next.y,t.bottom),t.top),n.pivot()})},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},i=t._index,a=t._model;a.radius=n.hoverRadius?n.hoverRadius:r.valueAtIndexOrDefault(e.pointHoverRadius,i,this.chart.options.elements.point.hoverRadius),a.backgroundColor=n.hoverBackgroundColor?n.hoverBackgroundColor:r.valueAtIndexOrDefault(e.pointHoverBackgroundColor,i,r.getHoverColor(a.backgroundColor)),a.borderColor=n.hoverBorderColor?n.hoverBorderColor:r.valueAtIndexOrDefault(e.pointHoverBorderColor,i,r.getHoverColor(a.borderColor)),a.borderWidth=n.hoverBorderWidth?n.hoverBorderWidth:r.valueAtIndexOrDefault(e.pointHoverBorderWidth,i,a.borderWidth)},removeHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t.custom||{},i=t._index,a=t._model,o=this.chart.options.elements.point;a.radius=n.radius?n.radius:r.valueAtIndexOrDefault(e.pointRadius,i,o.radius),a.backgroundColor=n.backgroundColor?n.backgroundColor:r.valueAtIndexOrDefault(e.pointBackgroundColor,i,o.backgroundColor),a.borderColor=n.borderColor?n.borderColor:r.valueAtIndexOrDefault(e.pointBorderColor,i,o.borderColor),a.borderWidth=n.borderWidth?n.borderWidth:r.valueAtIndexOrDefault(e.pointBorderWidth,i,o.borderWidth)}})}},{25:25,40:40,45:45}],21:[function(t,e,n){"use strict";t(25)._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},showLines:!1,tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),e.exports=function(t){t.controllers.scatter=t.controllers.line}},{25:25}],22:[function(t,e,n){"use strict";var i=t(25),a=t(26),r=t(45);i._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:r.noop,onComplete:r.noop}}),e.exports=function(t){t.Animation=a.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),t.animationService={frameDuration:17,animations:[],dropFrames:0,request:null,addAnimation:function(t,e,n,i){var a,r,o=this.animations;for(e.chart=t,i||(t.animating=!0),a=0,r=o.length;a<r;++a)if(o[a].chart===t)return void(o[a]=e);o.push(e),1===o.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=r.findIndex(this.animations,function(e){return e.chart===t});-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=r.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){var t=this,e=Date.now(),n=0;t.dropFrames>1&&(n=Math.floor(t.dropFrames),t.dropFrames=t.dropFrames%1),t.advance(1+n);var i=Date.now();t.dropFrames+=(i-e)/t.frameDuration,t.animations.length>0&&t.requestAnimationFrame()},advance:function(t){for(var e,n,i=this.animations,a=0;a<i.length;)n=(e=i[a]).chart,e.currentStep=(e.currentStep||0)+t,e.currentStep=Math.min(e.currentStep,e.numSteps),r.callback(e.render,[n,e],n),r.callback(e.onAnimationProgress,[e],n),e.currentStep>=e.numSteps?(r.callback(e.onAnimationComplete,[e],n),n.animating=!1,i.splice(a,1)):++a}},Object.defineProperty(t.Animation.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(t.Animation.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}})}},{25:25,26:26,45:45}],23:[function(t,e,n){"use strict";var i=t(25),a=t(45),r=t(28),o=t(48);e.exports=function(t){function e(t){var e=(t=t||{}).data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=a.configMerge(i.global,i[t.type],t.options||{}),t}function n(t){var e=t.options;e.scale?t.scale.options=e.scale:e.scales&&e.scales.xAxes.concat(e.scales.yAxes).forEach(function(e){t.scales[e.id].options=e}),t.tooltip._options=e.tooltips}function s(t){return"top"===t||"bottom"===t}var l=t.plugins;t.types={},t.instances={},t.controllers={},a.extend(t.prototype,{construct:function(n,i){var r=this;i=e(i);var s=o.acquireContext(n,i),l=s&&s.canvas,u=l&&l.height,d=l&&l.width;r.id=a.uid(),r.ctx=s,r.canvas=l,r.config=i,r.width=d,r.height=u,r.aspectRatio=u?d/u:null,r.options=i.options,r._bufferedRender=!1,r.chart=r,r.controller=r,t.instances[r.id]=r,Object.defineProperty(r,"data",{get:function(){return r.config.data},set:function(t){r.config.data=t}}),s&&l?(r.initialize(),r.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return l.notify(t,"beforeInit"),a.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.ensureScalesHaveIDs(),t.buildScales(),t.initToolTip(),l.notify(t,"afterInit"),t},clear:function(){return a.canvas.clear(this),this},stop:function(){return t.animationService.cancelAnimation(this),this},resize:function(t){var e=this,n=e.options,i=e.canvas,r=n.maintainAspectRatio&&e.aspectRatio||null,o=Math.max(0,Math.floor(a.getMaximumWidth(i))),s=Math.max(0,Math.floor(r?o/r:a.getMaximumHeight(i)));if((e.width!==o||e.height!==s)&&(i.width=e.width=o,i.height=e.height=s,i.style.width=o+"px",i.style.height=s+"px",a.retinaScale(e,n.devicePixelRatio),!t)){var u={width:o,height:s};l.notify(e,"resize",[u]),e.options.onResize&&e.options.onResize(e,u),e.stop(),e.update(e.options.responsiveAnimationDuration)}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},n=t.scale;a.each(e.xAxes,function(t,e){t.id=t.id||"x-axis-"+e}),a.each(e.yAxes,function(t,e){t.id=t.id||"y-axis-"+e}),n&&(n.id=n.id||"scale")},buildScales:function(){var e=this,n=e.options,i=e.scales={},r=[];n.scales&&(r=r.concat((n.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(n.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),n.scale&&r.push({options:n.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),a.each(r,function(n){var r=n.options,o=a.valueOrDefault(r.type,n.dtype),l=t.scaleService.getScaleConstructor(o);if(l){s(r.position)!==s(n.dposition)&&(r.position=n.dposition);var u=new l({id:r.id,options:r,ctx:e.ctx,chart:e});i[u.id]=u,u.mergeTicksOptions(),n.isDefault&&(e.scale=u)}}),t.scaleService.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e=this,n=[],i=[];return a.each(e.data.datasets,function(a,r){var o=e.getDatasetMeta(r),s=a.type||e.config.type;if(o.type&&o.type!==s&&(e.destroyDatasetMeta(r),o=e.getDatasetMeta(r)),o.type=s,n.push(o.type),o.controller)o.controller.updateIndex(r);else{var l=t.controllers[o.type];if(void 0===l)throw new Error('"'+o.type+'" is not a chart type.');o.controller=new l(e,r),i.push(o.controller)}},e),i},resetElements:function(){var t=this;a.each(t.data.datasets,function(e,n){t.getDatasetMeta(n).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),n(e),!1!==l.notify(e,"beforeUpdate")){e.tooltip._data=e.data;var i=e.buildOrUpdateControllers();a.each(e.data.datasets,function(t,n){e.getDatasetMeta(n).controller.buildOrUpdateElements()},e),e.updateLayout(),a.each(i,function(t){t.reset()}),e.updateDatasets(),l.notify(e,"afterUpdate"),e._bufferedRender?e._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:e.render(t)}},updateLayout:function(){var e=this;!1!==l.notify(e,"beforeLayout")&&(t.layoutService.update(this,this.width,this.height),l.notify(e,"afterScaleUpdate"),l.notify(e,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==l.notify(t,"beforeDatasetsUpdate")){for(var e=0,n=t.data.datasets.length;e<n;++e)t.updateDataset(e);l.notify(t,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this,n=e.getDatasetMeta(t),i={meta:n,index:t};!1!==l.notify(e,"beforeDatasetUpdate",[i])&&(n.controller.update(),l.notify(e,"afterDatasetUpdate",[i]))},render:function(e){var n=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var i=e.duration,r=e.lazy;if(!1!==l.notify(n,"beforeRender")){var o=n.options.animation,s=function(t){l.notify(n,"afterRender"),a.callback(o&&o.onComplete,[t],n)};if(o&&(void 0!==i&&0!==i||void 0===i&&0!==o.duration)){var u=new t.Animation({numSteps:(i||o.duration)/16.66,easing:e.easing||o.easing,render:function(t,e){var n=a.easing.effects[e.easing],i=e.currentStep,r=i/e.numSteps;t.draw(n(r),r,i)},onAnimationProgress:o.onProgress,onAnimationComplete:s});t.animationService.addAnimation(n,u,i,r)}else n.draw(),s(new t.Animation({numSteps:0,chart:n}));return n}},draw:function(t){var e=this;e.clear(),a.isNullOrUndef(t)&&(t=1),e.transition(t),!1!==l.notify(e,"beforeDraw",[t])&&(a.each(e.boxes,function(t){t.draw(e.chartArea)},e),e.scale&&e.scale.draw(),e.drawDatasets(t),e.tooltip.draw(),l.notify(e,"afterDraw",[t]))},transition:function(t){for(var e=this,n=0,i=(e.data.datasets||[]).length;n<i;++n)e.isDatasetVisible(n)&&e.getDatasetMeta(n).controller.transition(t);e.tooltip.transition(t)},drawDatasets:function(t){var e=this;if(!1!==l.notify(e,"beforeDatasetsDraw",[t])){for(var n=(e.data.datasets||[]).length-1;n>=0;--n)e.isDatasetVisible(n)&&e.drawDataset(n,t);l.notify(e,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var n=this,i=n.getDatasetMeta(t),a={meta:i,index:t,easingValue:e};!1!==l.notify(n,"beforeDatasetDraw",[a])&&(i.controller.draw(e),l.notify(n,"afterDatasetDraw",[a]))},getElementAtEvent:function(t){return r.modes.single(this,t)},getElementsAtEvent:function(t){return r.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return r.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,n){var i=r.modes[e];return"function"==typeof i?i(this,t,n):[]},getDatasetAtEvent:function(t){return r.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,n=e.data.datasets[t];n._meta||(n._meta={});var i=n._meta[e.id];return i||(i=n._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null}),i},getVisibleDatasetCount:function(){for(var t=0,e=0,n=this.data.datasets.length;e<n;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,n=this.data.datasets[t],i=n._meta&&n._meta[e];i&&(i.controller.destroy(),delete n._meta[e])},destroy:function(){var e,n,i=this,r=i.canvas;for(i.stop(),e=0,n=i.data.datasets.length;e<n;++e)i.destroyDatasetMeta(e);r&&(i.unbindEvents(),a.canvas.clear(i),o.releaseContext(i.ctx),i.canvas=null,i.ctx=null),l.notify(i,"destroy"),delete t.instances[i.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new t.Tooltip({_chart:e,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var t=this,e=t._listeners={},n=function(){t.eventHandler.apply(t,arguments)};a.each(t.options.events,function(i){o.addEventListener(t,i,n),e[i]=n}),t.options.responsive&&(n=function(){t.resize()},o.addEventListener(t,"resize",n),e.resize=n)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,a.each(e,function(e,n){o.removeEventListener(t,n,e)}))},updateHoverStyle:function(t,e,n){var i,a,r,o=n?"setHoverStyle":"removeHoverStyle";for(a=0,r=t.length;a<r;++a)(i=t[a])&&this.getDatasetMeta(i._datasetIndex).controller[o](i)},eventHandler:function(t){var e=this,n=e.tooltip;if(!1!==l.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var i=e.handleEvent(t);i|=n&&n.handleEvent(t),l.notify(e,"afterEvent",[t]);var a=e._bufferedRequest;return a?e.render(a):i&&!e.animating&&(e.stop(),e.render(e.options.hover.animationDuration,!0)),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e=this,n=e.options||{},i=n.hover,r=!1;return e.lastActive=e.lastActive||[],"mouseout"===t.type?e.active=[]:e.active=e.getElementsAtEventForMode(t,i.mode,i),a.callback(n.onHover||n.hover.onHover,[t.native,e.active],e),"mouseup"!==t.type&&"click"!==t.type||n.onClick&&n.onClick.call(e,t.native,e.active),e.lastActive.length&&e.updateHoverStyle(e.lastActive,i.mode,!1),e.active.length&&i.mode&&e.updateHoverStyle(e.active,i.mode,!0),r=!a.arrayEquals(e.active,e.lastActive),e.lastActive=e.active,r}}),t.Controller=t}},{25:25,28:28,45:45,48:48}],24:[function(t,e,n){"use strict";var i=t(45);e.exports=function(t){function e(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),a.forEach(function(e){var n="onData"+e.charAt(0).toUpperCase()+e.slice(1),a=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),r=a.apply(this,e);return i.each(t._chartjs.listeners,function(t){"function"==typeof t[n]&&t[n].apply(t,e)}),r}})}))}function n(t,e){var n=t._chartjs;if(n){var i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(a.forEach(function(e){delete t[e]}),delete t._chartjs)}}var a=["push","pop","shift","splice","unshift"];t.DatasetController=function(t,e){this.initialize(t,e)},i.extend(t.DatasetController.prototype,{datasetElementType:null,dataElementType:null,initialize:function(t,e){var n=this;n.chart=t,n.index=e,n.linkScales(),n.addElements()},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),n=t.getDataset();null===e.xAxisID&&(e.xAxisID=n.xAxisID||t.chart.options.scales.xAxes[0].id),null===e.yAxisID&&(e.yAxisID=n.yAxisID||t.chart.options.scales.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},reset:function(){this.update(!0)},destroy:function(){this._data&&n(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,n=e.dataElementType;return n&&new n({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,n=this,i=n.getMeta(),a=n.getDataset().data||[],r=i.data;for(t=0,e=a.length;t<e;++t)r[t]=r[t]||n.createMetaData(t);i.dataset=i.dataset||n.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t=this,i=t.getDataset(),a=i.data||(i.data=[]);t._data!==a&&(t._data&&n(t._data,t),e(a,t),t._data=a),t.resyncElements()},update:i.noop,transition:function(t){for(var e=this.getMeta(),n=e.data||[],i=n.length,a=0;a<i;++a)n[a].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],n=e.length,i=0;for(t.dataset&&t.dataset.draw();i<n;++i)e[i].draw()},removeHoverStyle:function(t,e){var n=this.chart.data.datasets[t._datasetIndex],a=t._index,r=t.custom||{},o=i.valueAtIndexOrDefault,s=t._model;s.backgroundColor=r.backgroundColor?r.backgroundColor:o(n.backgroundColor,a,e.backgroundColor),s.borderColor=r.borderColor?r.borderColor:o(n.borderColor,a,e.borderColor),s.borderWidth=r.borderWidth?r.borderWidth:o(n.borderWidth,a,e.borderWidth)},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],n=t._index,a=t.custom||{},r=i.valueAtIndexOrDefault,o=i.getHoverColor,s=t._model;s.backgroundColor=a.hoverBackgroundColor?a.hoverBackgroundColor:r(e.hoverBackgroundColor,n,o(s.backgroundColor)),s.borderColor=a.hoverBorderColor?a.hoverBorderColor:r(e.hoverBorderColor,n,o(s.borderColor)),s.borderWidth=a.hoverBorderWidth?a.hoverBorderWidth:r(e.hoverBorderWidth,n,s.borderWidth)},resyncElements:function(){var t=this,e=t.getMeta(),n=t.getDataset().data,i=e.data.length,a=n.length;a<i?e.data.splice(a,i-a):a>i&&t.insertElements(i,a-i)},insertElements:function(t,e){for(var n=0;n<e;++n)this.addElementAndReset(t+n)},onDataPush:function(){this.insertElements(this.getDataset().data.length-1,arguments.length)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),t.DatasetController.extend=i.inherits}},{45:45}],25:[function(t,e,n){"use strict";var i=t(45);e.exports={_set:function(t,e){return i.merge(this[t]||(this[t]={}),e)}}},{45:45}],26:[function(t,e,n){"use strict";function i(t,e,n,i){var r,o,s,l,u,d,c,h,f,g=Object.keys(n);for(r=0,o=g.length;r<o;++r)if(s=g[r],d=n[s],e.hasOwnProperty(s)||(e[s]=d),(l=e[s])!==d&&"_"!==s[0]){if(t.hasOwnProperty(s)||(t[s]=l),u=t[s],(c=typeof d)===typeof u)if("string"===c){if((h=a(u)).valid&&(f=a(d)).valid){e[s]=f.mix(h,i).rgbString();continue}}else if("number"===c&&isFinite(u)&&isFinite(d)){e[s]=u+(d-u)*i;continue}e[s]=d}}var a=t(2),r=t(45),o=function(t){r.extend(this,t),this.initialize.apply(this,arguments)};r.extend(o.prototype,{initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=r.clone(t._model)),t._start={},t},transition:function(t){var e=this,n=e._model,a=e._start,r=e._view;return n&&1!==t?(r||(r=e._view={}),a||(a=e._start={}),i(a,r,n,t),e):(e._view=n,e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return r.isNumber(this._model.x)&&r.isNumber(this._model.y)}}),o.extend=r.inherits,e.exports=o},{2:2,45:45}],27:[function(t,e,n){"use strict";var i=t(2),a=t(25),r=t(45);e.exports=function(t){function e(t,e,n){var i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}function n(t){return void 0!==t&&null!==t&&"none"!==t}function o(t,i,a){var r=document.defaultView,o=t.parentNode,s=r.getComputedStyle(t)[i],l=r.getComputedStyle(o)[i],u=n(s),d=n(l),c=Number.POSITIVE_INFINITY;return u||d?Math.min(u?e(s,t,a):c,d?e(l,o,a):c):"none"}r.extend=function(t){for(var e=1,n=arguments.length;e<n;e++)r.each(arguments[e],function(e,n){t[n]=e});return t},r.configMerge=function(){return r.merge(r.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,n,i,a){var o=n[e]||{},s=i[e];"scales"===e?n[e]=r.scaleMerge(o,s):"scale"===e?n[e]=r.merge(o,[t.scaleService.getScaleDefaults(s.type),s]):r._merger(e,n,i,a)}})},r.scaleMerge=function(){return r.merge(r.clone(arguments[0]),[].slice.call(arguments,1),{merger:function(e,n,i,a){if("xAxes"===e||"yAxes"===e){var o,s,l,u=i[e].length;for(n[e]||(n[e]=[]),o=0;o<u;++o)l=i[e][o],s=r.valueOrDefault(l.type,"xAxes"===e?"category":"linear"),o>=n[e].length&&n[e].push({}),!n[e][o].type||l.type&&l.type!==n[e][o].type?r.merge(n[e][o],[t.scaleService.getScaleDefaults(s),l]):r.merge(n[e][o],l)}else r._merger(e,n,i,a)}})},r.where=function(t,e){if(r.isArray(t)&&Array.prototype.filter)return t.filter(e);var n=[];return r.each(t,function(t){e(t)&&n.push(t)}),n},r.findIndex=Array.prototype.findIndex?function(t,e,n){return t.findIndex(e,n)}:function(t,e,n){n=void 0===n?t:n;for(var i=0,a=t.length;i<a;++i)if(e.call(n,t[i],i,t))return i;return-1},r.findNextWhere=function(t,e,n){r.isNullOrUndef(n)&&(n=-1);for(var i=n+1;i<t.length;i++){var a=t[i];if(e(a))return a}},r.findPreviousWhere=function(t,e,n){r.isNullOrUndef(n)&&(n=t.length);for(var i=n-1;i>=0;i--){var a=t[i];if(e(a))return a}},r.inherits=function(t){var e=this,n=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},i=function(){this.constructor=n};return i.prototype=e.prototype,n.prototype=new i,n.extend=r.inherits,t&&r.extend(n.prototype,t),n.__super__=e.prototype,n},r.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},r.almostEquals=function(t,e,n){return Math.abs(t-e)<n},r.almostWhole=function(t,e){var n=Math.round(t);return n-e<t&&n+e>t},r.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},r.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},r.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return 0==(t=+t)||isNaN(t)?t:t>0?1:-1},r.log10=Math.log10?function(t){return Math.log10(t)}:function(t){return Math.log(t)/Math.LN10},r.toRadians=function(t){return t*(Math.PI/180)},r.toDegrees=function(t){return t*(180/Math.PI)},r.getAngleFromPoint=function(t,e){var n=e.x-t.x,i=e.y-t.y,a=Math.sqrt(n*n+i*i),r=Math.atan2(i,n);return r<-.5*Math.PI&&(r+=2*Math.PI),{angle:r,distance:a}},r.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},r.aliasPixel=function(t){return t%2==0?0:.5},r.splineCurve=function(t,e,n,i){var a=t.skip?e:t,r=e,o=n.skip?e:n,s=Math.sqrt(Math.pow(r.x-a.x,2)+Math.pow(r.y-a.y,2)),l=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),u=s/(s+l),d=l/(s+l),c=i*(u=isNaN(u)?0:u),h=i*(d=isNaN(d)?0:d);return{previous:{x:r.x-c*(o.x-a.x),y:r.y-c*(o.y-a.y)},next:{x:r.x+h*(o.x-a.x),y:r.y+h*(o.y-a.y)}}},r.EPSILON=Number.EPSILON||1e-14,r.splineCurveMonotone=function(t){var e,n,i,a,o=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),s=o.length;for(e=0;e<s;++e)if(!(i=o[e]).model.skip){if(n=e>0?o[e-1]:null,(a=e<s-1?o[e+1]:null)&&!a.model.skip){var l=a.model.x-i.model.x;i.deltaK=0!==l?(a.model.y-i.model.y)/l:0}!n||n.model.skip?i.mK=i.deltaK:!a||a.model.skip?i.mK=n.deltaK:this.sign(n.deltaK)!==this.sign(i.deltaK)?i.mK=0:i.mK=(n.deltaK+i.deltaK)/2}var u,d,c,h;for(e=0;e<s-1;++e)i=o[e],a=o[e+1],i.model.skip||a.model.skip||(r.almostEquals(i.deltaK,0,this.EPSILON)?i.mK=a.mK=0:(u=i.mK/i.deltaK,d=a.mK/i.deltaK,(h=Math.pow(u,2)+Math.pow(d,2))<=9||(c=3/Math.sqrt(h),i.mK=u*c*i.deltaK,a.mK=d*c*i.deltaK)));var f;for(e=0;e<s;++e)(i=o[e]).model.skip||(n=e>0?o[e-1]:null,a=e<s-1?o[e+1]:null,n&&!n.model.skip&&(f=(i.model.x-n.model.x)/3,i.model.controlPointPreviousX=i.model.x-f,i.model.controlPointPreviousY=i.model.y-f*i.mK),a&&!a.model.skip&&(f=(a.model.x-i.model.x)/3,i.model.controlPointNextX=i.model.x+f,i.model.controlPointNextY=i.model.y+f*i.mK))},r.nextItem=function(t,e,n){return n?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},r.previousItem=function(t,e,n){return n?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},r.niceNum=function(t,e){var n=Math.floor(r.log10(t)),i=t/Math.pow(10,n);return(e?i<1.5?1:i<3?2:i<7?5:10:i<=1?1:i<=2?2:i<=5?5:10)*Math.pow(10,n)},r.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},r.getRelativePosition=function(t,e){var n,i,a=t.originalEvent||t,o=t.currentTarget||t.srcElement,s=o.getBoundingClientRect(),l=a.touches;l&&l.length>0?(n=l[0].clientX,i=l[0].clientY):(n=a.clientX,i=a.clientY);var u=parseFloat(r.getStyle(o,"padding-left")),d=parseFloat(r.getStyle(o,"padding-top")),c=parseFloat(r.getStyle(o,"padding-right")),h=parseFloat(r.getStyle(o,"padding-bottom")),f=s.right-s.left-u-c,g=s.bottom-s.top-d-h;return n=Math.round((n-s.left-u)/f*o.width/e.currentDevicePixelRatio),i=Math.round((i-s.top-d)/g*o.height/e.currentDevicePixelRatio),{x:n,y:i}},r.getConstraintWidth=function(t){return o(t,"max-width","clientWidth")},r.getConstraintHeight=function(t){return o(t,"max-height","clientHeight")},r.getMaximumWidth=function(t){var e=t.parentNode;if(!e)return t.clientWidth;var n=parseInt(r.getStyle(e,"padding-left"),10),i=parseInt(r.getStyle(e,"padding-right"),10),a=e.clientWidth-n-i,o=r.getConstraintWidth(t);return isNaN(o)?a:Math.min(a,o)},r.getMaximumHeight=function(t){var e=t.parentNode;if(!e)return t.clientHeight;var n=parseInt(r.getStyle(e,"padding-top"),10),i=parseInt(r.getStyle(e,"padding-bottom"),10),a=e.clientHeight-n-i,o=r.getConstraintHeight(t);return isNaN(o)?a:Math.min(a,o)},r.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},r.retinaScale=function(t,e){var n=t.currentDevicePixelRatio=e||window.devicePixelRatio||1;if(1!==n){var i=t.canvas,a=t.height,r=t.width;i.height=a*n,i.width=r*n,t.ctx.scale(n,n),i.style.height=a+"px",i.style.width=r+"px"}},r.fontString=function(t,e,n){return e+" "+t+"px "+n},r.longestText=function(t,e,n,i){var a=(i=i||{}).data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(a=i.data={},o=i.garbageCollect=[],i.font=e),t.font=e;var s=0;r.each(n,function(e){void 0!==e&&null!==e&&!0!==r.isArray(e)?s=r.measureText(t,a,o,s,e):r.isArray(e)&&r.each(e,function(e){void 0===e||null===e||r.isArray(e)||(s=r.measureText(t,a,o,s,e))})});var l=o.length/2;if(l>n.length){for(var u=0;u<l;u++)delete a[o[u]];o.splice(0,l)}return s},r.measureText=function(t,e,n,i,a){var r=e[a];return r||(r=e[a]=t.measureText(a).width,n.push(a)),r>i&&(i=r),i},r.numberOfLabelLines=function(t){var e=1;return r.each(t,function(t){r.isArray(t)&&t.length>e&&(e=t.length)}),e},r.color=i?function(t){return t instanceof CanvasGradient&&(t=a.global.defaultColor),i(t)}:function(t){return console.error("Color.js not found!"),t},r.getHoverColor=function(t){return t instanceof CanvasPattern?t:r.color(t).saturate(.5).darken(.1).rgbString()}}},{2:2,25:25,45:45}],28:[function(t,e,n){"use strict";function i(t,e){return t.native?{x:t.x,y:t.y}:u.getRelativePosition(t,e)}function a(t,e){var n,i,a,r,o;for(i=0,r=t.data.datasets.length;i<r;++i)if(t.isDatasetVisible(i))for(a=0,o=(n=t.getDatasetMeta(i)).data.length;a<o;++a){var s=n.data[a];s._view.skip||e(s)}}function r(t,e){var n=[];return a(t,function(t){t.inRange(e.x,e.y)&&n.push(t)}),n}function o(t,e,n,i){var r=Number.POSITIVE_INFINITY,o=[];return a(t,function(t){if(!n||t.inRange(e.x,e.y)){var a=t.getCenterPoint(),s=i(e,a);s<r?(o=[t],r=s):s===r&&o.push(t)}}),o}function s(t){var e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){var a=e?Math.abs(t.x-i.x):0,r=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(r,2))}}function l(t,e,n){var a=i(e,t);n.axis=n.axis||"x";var l=s(n.axis),u=n.intersect?r(t,a):o(t,a,!1,l),d=[];return u.length?(t.data.datasets.forEach(function(e,n){if(t.isDatasetVisible(n)){var i=t.getDatasetMeta(n).data[u[0]._index];i&&!i._view.skip&&d.push(i)}}),d):[]}var u=t(45);e.exports={modes:{single:function(t,e){var n=i(e,t),r=[];return a(t,function(t){if(t.inRange(n.x,n.y))return r.push(t),r}),r.slice(0,1)},label:l,index:l,dataset:function(t,e,n){var a=i(e,t);n.axis=n.axis||"xy";var l=s(n.axis),u=n.intersect?r(t,a):o(t,a,!1,l);return u.length>0&&(u=t.getDatasetMeta(u[0]._datasetIndex).data),u},"x-axis":function(t,e){return l(t,e,{intersect:!0})},point:function(t,e){return r(t,i(e,t))},nearest:function(t,e,n){var a=i(e,t);n.axis=n.axis||"xy";var r=s(n.axis),l=o(t,a,n.intersect,r);return l.length>1&&l.sort(function(t,e){var n=t.getArea()-e.getArea();return 0===n&&(n=t._datasetIndex-e._datasetIndex),n}),l.slice(0,1)},x:function(t,e,n){var r=i(e,t),o=[],s=!1;return a(t,function(t){t.inXRange(r.x)&&o.push(t),t.inRange(r.x,r.y)&&(s=!0)}),n.intersect&&!s&&(o=[]),o},y:function(t,e,n){var r=i(e,t),o=[],s=!1;return a(t,function(t){t.inYRange(r.y)&&o.push(t),t.inRange(r.x,r.y)&&(s=!0)}),n.intersect&&!s&&(o=[]),o}}}},{45:45}],29:[function(t,e,n){"use strict";t(25)._set("global",{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",showLines:!0,elements:{},layout:{padding:{top:0,right:0,bottom:0,left:0}}}),e.exports=function(){var t=function(t,e){return this.construct(t,e),this};return t.Chart=t,t}},{25:25}],30:[function(t,e,n){"use strict";var i=t(45);e.exports=function(t){function e(t,e){return i.where(t,function(t){return t.position===e})}function n(t,e){t.forEach(function(t,e){return t._tmpIndex_=e,t}),t.sort(function(t,n){var i=e?n:t,a=e?t:n;return i.weight===a.weight?i._tmpIndex_-a._tmpIndex_:i.weight-a.weight}),t.forEach(function(t){delete t._tmpIndex_})}t.layoutService={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,t.boxes.push(e)},removeBox:function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure:function(t,e,n){for(var i,a=["fullWidth","position","weight"],r=a.length,o=0;o<r;++o)i=a[o],n.hasOwnProperty(i)&&(e[i]=n[i])},update:function(t,a,r){function o(t){var e=i.findNextWhere(D,function(e){return e.box===t});if(e)if(t.isHorizontal()){var n={left:Math.max(A,C),right:Math.max(O,P),top:0,bottom:0};t.update(t.fullWidth?b:M,x/2,n)}else t.update(e.minSize.width,S)}function s(t){t.isHorizontal()?(t.left=t.fullWidth?d:A,t.right=t.fullWidth?a-c:A+M,t.top=B,t.bottom=B+t.height,B=t.bottom):(t.left=z,t.right=z+t.width,t.top=F,t.bottom=F+S,z=t.right)}if(t){var l=t.options.layout||{},u=i.options.toPadding(l.padding),d=u.left,c=u.right,h=u.top,f=u.bottom,g=e(t.boxes,"left"),m=e(t.boxes,"right"),p=e(t.boxes,"top"),v=e(t.boxes,"bottom"),y=e(t.boxes,"chartArea");n(g,!0),n(m,!1),n(p,!0),n(v,!1);var b=a-d-c,x=r-h-f,_=x/2,k=(a-b/2)/(g.length+m.length),w=(r-_)/(p.length+v.length),M=b,S=x,D=[];i.each(g.concat(m,p,v),function(t){var e,n=t.isHorizontal();n?(e=t.update(t.fullWidth?b:M,w),S-=e.height):(e=t.update(k,_),M-=e.width),D.push({horizontal:n,minSize:e,box:t})});var C=0,P=0,T=0,I=0;i.each(p.concat(v),function(t){if(t.getPadding){var e=t.getPadding();C=Math.max(C,e.left),P=Math.max(P,e.right)}}),i.each(g.concat(m),function(t){if(t.getPadding){var e=t.getPadding();T=Math.max(T,e.top),I=Math.max(I,e.bottom)}});var A=d,O=c,F=h,R=f;i.each(g.concat(m),o),i.each(g,function(t){A+=t.width}),i.each(m,function(t){O+=t.width}),i.each(p.concat(v),o),i.each(p,function(t){F+=t.height}),i.each(v,function(t){R+=t.height}),i.each(g.concat(m),function(t){var e=i.findNextWhere(D,function(e){return e.box===t}),n={left:0,right:0,top:F,bottom:R};e&&t.update(e.minSize.width,S,n)}),A=d,O=c,F=h,R=f,i.each(g,function(t){A+=t.width}),i.each(m,function(t){O+=t.width}),i.each(p,function(t){F+=t.height}),i.each(v,function(t){R+=t.height});var L=Math.max(C-A,0);A+=L,O+=Math.max(P-O,0);var W=Math.max(T-F,0);F+=W,R+=Math.max(I-R,0);var Y=r-F-R,N=a-A-O;N===M&&Y===S||(i.each(g,function(t){t.height=Y}),i.each(m,function(t){t.height=Y}),i.each(p,function(t){t.fullWidth||(t.width=N)}),i.each(v,function(t){t.fullWidth||(t.width=N)}),S=Y,M=N);var z=d+L,B=h+W;i.each(g.concat(p),s),z+=M,B+=S,i.each(m,s),i.each(v,s),t.chartArea={left:A,top:F,right:A+M,bottom:F+S},i.each(y,function(e){e.left=t.chartArea.left,e.top=t.chartArea.top,e.right=t.chartArea.right,e.bottom=t.chartArea.bottom,e.update(M,S)})}}}}},{45:45}],31:[function(t,e,n){"use strict";var i=t(25),a=t(26),r=t(45);i._set("global",{plugins:{}}),e.exports=function(t){t.plugins={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach(function(t){-1===e.indexOf(t)&&e.push(t)}),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach(function(t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,n){var i,a,r,o,s,l=this.descriptors(t),u=l.length;for(i=0;i<u;++i)if(a=l[i],r=a.plugin,"function"==typeof(s=r[e])&&((o=[t].concat(n||[])).push(a.options),!1===s.apply(r,o)))return!1;return!0},descriptors:function(t){var e=t._plugins||(t._plugins={});if(e.id===this._cacheId)return e.descriptors;var n=[],a=[],o=t&&t.config||{},s=o.options&&o.options.plugins||{};return this._plugins.concat(o.plugins||[]).forEach(function(t){if(-1===n.indexOf(t)){var e=t.id,o=s[e];!1!==o&&(!0===o&&(o=r.clone(i.global.plugins[e])),n.push(t),a.push({plugin:t,options:o||{}}))}}),e.descriptors=a,e.id=this._cacheId,a}},t.pluginService=t.plugins,t.PluginBase=a.extend({})}},{25:25,26:26,45:45}],32:[function(t,e,n){"use strict";function i(t){var e,n,i=[];for(e=0,n=t.length;e<n;++e)i.push(t[e].label);return i}function a(t,e,n){var i=t.getPixelForTick(e);return n&&(i-=0===e?(t.getPixelForTick(1)-i)/2:(i-t.getPixelForTick(e-1))/2),i}var r=t(25),o=t(26),s=t(45),l=t(34);r._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0, 0, 0, 0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",lineHeight:1.2,padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:l.formatters.values,minor:{},major:{}}}),e.exports=function(t){function e(t,e,n){return s.isArray(e)?s.longestText(t,n,e):t.measureText(e).width}function n(t){var e=s.valueOrDefault,n=r.global,i=e(t.fontSize,n.defaultFontSize),a=e(t.fontStyle,n.defaultFontStyle),o=e(t.fontFamily,n.defaultFontFamily);return{size:i,style:a,family:o,font:s.fontString(i,a,o)}}function l(t){return s.options.toLineHeight(s.valueOrDefault(t.lineHeight,1.2),s.valueOrDefault(t.fontSize,r.global.defaultFontSize))}t.Scale=o.extend({getPadding:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}},getTicks:function(){return this._ticks},mergeTicksOptions:function(){var t=this.options.ticks;!1===t.minor&&(t.minor={display:!1}),!1===t.major&&(t.major={display:!1});for(var e in t)"major"!==e&&"minor"!==e&&(void 0===t.minor[e]&&(t.minor[e]=t[e]),void 0===t.major[e]&&(t.major[e]=t[e]))},beforeUpdate:function(){s.callback(this.options.beforeUpdate,[this])},update:function(t,e,n){var i,a,r,o,l,u,d=this;for(d.beforeUpdate(),d.maxWidth=t,d.maxHeight=e,d.margins=s.extend({left:0,right:0,top:0,bottom:0},n),d.longestTextCache=d.longestTextCache||{},d.beforeSetDimensions(),d.setDimensions(),d.afterSetDimensions(),d.beforeDataLimits(),d.determineDataLimits(),d.afterDataLimits(),d.beforeBuildTicks(),l=d.buildTicks()||[],d.afterBuildTicks(),d.beforeTickToLabelConversion(),r=d.convertTicksToLabels(l)||d.ticks,d.afterTickToLabelConversion(),d.ticks=r,i=0,a=r.length;i<a;++i)o=r[i],(u=l[i])?u.label=o:l.push(u={label:o,major:!1});return d._ticks=l,d.beforeCalculateTickRotation(),d.calculateTickRotation(),d.afterCalculateTickRotation(),d.beforeFit(),d.fit(),d.afterFit(),d.afterUpdate(),d.minSize},afterUpdate:function(){s.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){s.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0},afterSetDimensions:function(){s.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){s.callback(this.options.beforeDataLimits,[this])},determineDataLimits:s.noop,afterDataLimits:function(){s.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){s.callback(this.options.beforeBuildTicks,[this])},buildTicks:s.noop,afterBuildTicks:function(){s.callback(this.options.afterBuildTicks,[this])},beforeTickToLabelConversion:function(){s.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this,e=t.options.ticks;t.ticks=t.ticks.map(e.userCallback||e.callback,this)},afterTickToLabelConversion:function(){s.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){s.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t=this,e=t.ctx,a=t.options.ticks,r=i(t._ticks),o=n(a);e.font=o.font;var l=a.minRotation||0;if(r.length&&t.options.display&&t.isHorizontal())for(var u,d=s.longestText(e,o.font,r,t.longestTextCache),c=d,h=t.getPixelForTick(1)-t.getPixelForTick(0)-6;c>h&&l<a.maxRotation;){var f=s.toRadians(l);if(u=Math.cos(f),Math.sin(f)*d>t.maxHeight){l--;break}l++,c=u*d}t.labelRotation=l},afterCalculateTickRotation:function(){s.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){s.callback(this.options.beforeFit,[this])},fit:function(){var t=this,a=t.minSize={width:0,height:0},r=i(t._ticks),o=t.options,u=o.ticks,d=o.scaleLabel,c=o.gridLines,h=o.display,f=t.isHorizontal(),g=n(u),m=o.gridLines.tickMarkLength;if(a.width=f?t.isFullWidth()?t.maxWidth-t.margins.left-t.margins.right:t.maxWidth:h&&c.drawTicks?m:0,a.height=f?h&&c.drawTicks?m:0:t.maxHeight,d.display&&h){var p=l(d)+s.options.toPadding(d.padding).height;f?a.height+=p:a.width+=p}if(u.display&&h){var v=s.longestText(t.ctx,g.font,r,t.longestTextCache),y=s.numberOfLabelLines(r),b=.5*g.size,x=t.options.ticks.padding;if(f){t.longestLabelWidth=v;var _=s.toRadians(t.labelRotation),k=Math.cos(_),w=Math.sin(_)*v+g.size*y+b*(y-1)+b;a.height=Math.min(t.maxHeight,a.height+w+x),t.ctx.font=g.font;var M=e(t.ctx,r[0],g.font),S=e(t.ctx,r[r.length-1],g.font);0!==t.labelRotation?(t.paddingLeft="bottom"===o.position?k*M+3:k*b+3,t.paddingRight="bottom"===o.position?k*b+3:k*S+3):(t.paddingLeft=M/2+3,t.paddingRight=S/2+3)}else u.mirror?v=0:v+=x+b,a.width=Math.min(t.maxWidth,a.width+v),t.paddingTop=g.size/2,t.paddingBottom=g.size/2}t.handleMargins(),t.width=a.width,t.height=a.height},handleMargins:function(){var t=this;t.margins&&(t.paddingLeft=Math.max(t.paddingLeft-t.margins.left,0),t.paddingTop=Math.max(t.paddingTop-t.margins.top,0),t.paddingRight=Math.max(t.paddingRight-t.margins.right,0),t.paddingBottom=Math.max(t.paddingBottom-t.margins.bottom,0))},afterFit:function(){s.callback(this.options.afterFit,[this])},isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(s.isNullOrUndef(t))return NaN;if("number"==typeof t&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},getLabelForIndex:s.noop,getPixelForValue:s.noop,getValueForPixel:s.noop,getPixelForTick:function(t){var e=this,n=e.options.offset;if(e.isHorizontal()){var i=(e.width-(e.paddingLeft+e.paddingRight))/Math.max(e._ticks.length-(n?0:1),1),a=i*t+e.paddingLeft;n&&(a+=i/2);var r=e.left+Math.round(a);return r+=e.isFullWidth()?e.margins.left:0}var o=e.height-(e.paddingTop+e.paddingBottom);return e.top+t*(o/(e._ticks.length-1))},getPixelForDecimal:function(t){var e=this;if(e.isHorizontal()){var n=(e.width-(e.paddingLeft+e.paddingRight))*t+e.paddingLeft,i=e.left+Math.round(n);return i+=e.isFullWidth()?e.margins.left:0}return e.top+t*e.height},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,n=t.max;return t.beginAtZero?0:e<0&&n<0?n:e>0&&n>0?e:0},_autoSkip:function(t){var e,n,i,a,r=this,o=r.isHorizontal(),l=r.options.ticks.minor,u=t.length,d=s.toRadians(r.labelRotation),c=Math.cos(d),h=r.longestLabelWidth*c,f=[];for(l.maxTicksLimit&&(a=l.maxTicksLimit),o&&(e=!1,(h+l.autoSkipPadding)*u>r.width-(r.paddingLeft+r.paddingRight)&&(e=1+Math.floor((h+l.autoSkipPadding)*u/(r.width-(r.paddingLeft+r.paddingRight)))),a&&u>a&&(e=Math.max(e,Math.floor(u/a)))),n=0;n<u;n++)i=t[n],((e>1&&n%e>0||n%e==0&&n+e>=u)&&n!==u-1||s.isNullOrUndef(i.label))&&delete i.label,f.push(i);return f},draw:function(t){var e=this,i=e.options;if(i.display){var o=e.ctx,u=r.global,d=i.ticks.minor,c=i.ticks.major||d,h=i.gridLines,f=i.scaleLabel,g=0!==e.labelRotation,m=e.isHorizontal(),p=d.autoSkip?e._autoSkip(e.getTicks()):e.getTicks(),v=s.valueOrDefault(d.fontColor,u.defaultFontColor),y=n(d),b=s.valueOrDefault(c.fontColor,u.defaultFontColor),x=n(c),_=h.drawTicks?h.tickMarkLength:0,k=s.valueOrDefault(f.fontColor,u.defaultFontColor),w=n(f),M=s.options.toPadding(f.padding),S=s.toRadians(e.labelRotation),D=[],C="right"===i.position?e.left:e.right-_,P="right"===i.position?e.left+_:e.right,T="bottom"===i.position?e.top:e.bottom-_,I="bottom"===i.position?e.top+_:e.bottom;if(s.each(p,function(n,r){if(void 0!==n.label){var o,l,c,f,v=n.label;r===e.zeroLineIndex&&i.offset===h.offsetGridLines?(o=h.zeroLineWidth,l=h.zeroLineColor,c=h.zeroLineBorderDash,f=h.zeroLineBorderDashOffset):(o=s.valueAtIndexOrDefault(h.lineWidth,r),l=s.valueAtIndexOrDefault(h.color,r),c=s.valueOrDefault(h.borderDash,u.borderDash),f=s.valueOrDefault(h.borderDashOffset,u.borderDashOffset));var y,b,x,k,w,M,A,O,F,R,L="middle",W="middle",Y=d.padding;if(m){var N=_+Y;"bottom"===i.position?(W=g?"middle":"top",L=g?"right":"center",R=e.top+N):(W=g?"middle":"bottom",L=g?"left":"center",R=e.bottom-N);var z=a(e,r,h.offsetGridLines&&p.length>1);z<e.left&&(l="rgba(0,0,0,0)"),z+=s.aliasPixel(o),F=e.getPixelForTick(r)+d.labelOffset,y=x=w=A=z,b=T,k=I,M=t.top,O=t.bottom}else{var B,V="left"===i.position;d.mirror?(L=V?"left":"right",B=Y):(L=V?"right":"left",B=_+Y),F=V?e.right-B:e.left+B;var H=a(e,r,h.offsetGridLines&&p.length>1);H<e.top&&(l="rgba(0,0,0,0)"),H+=s.aliasPixel(o),R=e.getPixelForTick(r)+d.labelOffset,y=C,x=P,w=t.left,A=t.right,b=k=M=O=H}D.push({tx1:y,ty1:b,tx2:x,ty2:k,x1:w,y1:M,x2:A,y2:O,labelX:F,labelY:R,glWidth:o,glColor:l,glBorderDash:c,glBorderDashOffset:f,rotation:-1*S,label:v,major:n.major,textBaseline:W,textAlign:L})}}),s.each(D,function(t){if(h.display&&(o.save(),o.lineWidth=t.glWidth,o.strokeStyle=t.glColor,o.setLineDash&&(o.setLineDash(t.glBorderDash),o.lineDashOffset=t.glBorderDashOffset),o.beginPath(),h.drawTicks&&(o.moveTo(t.tx1,t.ty1),o.lineTo(t.tx2,t.ty2)),h.drawOnChartArea&&(o.moveTo(t.x1,t.y1),o.lineTo(t.x2,t.y2)),o.stroke(),o.restore()),d.display){o.save(),o.translate(t.labelX,t.labelY),o.rotate(t.rotation),o.font=t.major?x.font:y.font,o.fillStyle=t.major?b:v,o.textBaseline=t.textBaseline,o.textAlign=t.textAlign;var e=t.label;if(s.isArray(e))for(var n=0,i=0;n<e.length;++n)o.fillText(""+e[n],0,i),i+=1.5*y.size;else o.fillText(e,0,0);o.restore()}}),f.display){var A,O,F=0,R=l(f)/2;if(m)A=e.left+(e.right-e.left)/2,O="bottom"===i.position?e.bottom-R-M.bottom:e.top+R+M.top;else{var L="left"===i.position;A=L?e.left+R+M.top:e.right-R-M.top,O=e.top+(e.bottom-e.top)/2,F=L?-.5*Math.PI:.5*Math.PI}o.save(),o.translate(A,O),o.rotate(F),o.textAlign="center",o.textBaseline="middle",o.fillStyle=k,o.font=w.font,o.fillText(f.labelString,0,0),o.restore()}if(h.drawBorder){o.lineWidth=s.valueAtIndexOrDefault(h.lineWidth,0),o.strokeStyle=s.valueAtIndexOrDefault(h.color,0);var W=e.left,Y=e.right,N=e.top,z=e.bottom,B=s.aliasPixel(o.lineWidth);m?(N=z="top"===i.position?e.bottom:e.top,N+=B,z+=B):(W=Y="left"===i.position?e.right:e.left,W+=B,Y+=B),o.beginPath(),o.moveTo(W,N),o.lineTo(Y,z),o.stroke()}}}})}},{25:25,26:26,34:34,45:45}],33:[function(t,e,n){"use strict";var i=t(25),a=t(45);e.exports=function(t){t.scaleService={constructors:{},defaults:{},registerScaleType:function(t,e,n){this.constructors[t]=e,this.defaults[t]=a.clone(n)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?a.merge({},[i.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){var n=this;n.defaults.hasOwnProperty(t)&&(n.defaults[t]=a.extend(n.defaults[t],e))},addScalesToLayout:function(e){a.each(e.scales,function(n){n.fullWidth=n.options.fullWidth,n.position=n.options.position,n.weight=n.options.weight,t.layoutService.addBox(e,n)})}}}},{25:25,45:45}],34:[function(t,e,n){"use strict";var i=t(45);e.exports={generators:{linear:function(t,e){var n,a=[];if(t.stepSize&&t.stepSize>0)n=t.stepSize;else{var r=i.niceNum(e.max-e.min,!1);n=i.niceNum(r/(t.maxTicks-1),!0)}var o=Math.floor(e.min/n)*n,s=Math.ceil(e.max/n)*n;t.min&&t.max&&t.stepSize&&i.almostWhole((t.max-t.min)/t.stepSize,n/1e3)&&(o=t.min,s=t.max);var l=(s-o)/n;l=i.almostEquals(l,Math.round(l),n/1e3)?Math.round(l):Math.ceil(l),a.push(void 0!==t.min?t.min:o);for(var u=1;u<l;++u)a.push(o+u*n);return a.push(void 0!==t.max?t.max:s),a},logarithmic:function(t,e){var n,a,r=[],o=i.valueOrDefault,s=o(t.min,Math.pow(10,Math.floor(i.log10(e.min)))),l=Math.floor(i.log10(e.max)),u=Math.ceil(e.max/Math.pow(10,l));0===s?(n=Math.floor(i.log10(e.minNotZero)),a=Math.floor(e.minNotZero/Math.pow(10,n)),r.push(s),s=a*Math.pow(10,n)):(n=Math.floor(i.log10(s)),a=Math.floor(s/Math.pow(10,n)));do{r.push(s),10===++a&&(a=1,++n),s=a*Math.pow(10,n)}while(n<l||n===l&&a<u);var d=o(t.max,s);return r.push(d),r}},formatters:{values:function(t){return i.isArray(t)?t:""+t},linear:function(t,e,n){var a=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(a)>1&&t!==Math.floor(t)&&(a=t-Math.floor(t));var r=i.log10(Math.abs(a)),o="";if(0!==t){var s=-1*Math.floor(r);s=Math.max(Math.min(s,20),0),o=t.toFixed(s)}else o="0";return o},logarithmic:function(t,e,n){var a=t/Math.pow(10,Math.floor(i.log10(t)));return 0===t?"0":1===a||2===a||5===a||0===e||e===n.length-1?t.toExponential():""}}}},{45:45}],35:[function(t,e,n){"use strict";var i=t(25),a=t(26),r=t(45);i._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:r.noop,title:function(t,e){var n="",i=e.labels,a=i?i.length:0;if(t.length>0){var r=t[0];r.xLabel?n=r.xLabel:a>0&&r.index<a&&(n=i[r.index])}return n},afterTitle:r.noop,beforeBody:r.noop,beforeLabel:r.noop,label:function(t,e){var n=e.datasets[t.datasetIndex].label||"";return n&&(n+=": "),n+=t.yLabel},labelColor:function(t,e){var n=e.getDatasetMeta(t.datasetIndex).data[t.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:r.noop,afterBody:r.noop,beforeFooter:r.noop,footer:r.noop,afterFooter:r.noop}}}),e.exports=function(t){function e(t,e){var n=r.color(t);return n.alpha(e*n.alpha()).rgbaString()}function n(t,e){return e&&(r.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function o(t){var e=t._xScale,n=t._yScale||t._scale,i=t._index,a=t._datasetIndex;return{xLabel:e?e.getLabelForIndex(i,a):"",yLabel:n?n.getLabelForIndex(i,a):"",index:i,datasetIndex:a,x:t._model.x,y:t._model.y}}function s(t){var e=i.global,n=r.valueOrDefault;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,bodyFontColor:t.bodyFontColor,_bodyFontFamily:n(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:n(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:n(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:n(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:n(t.titleFontStyle,e.defaultFontStyle),titleFontSize:n(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:n(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:n(t.footerFontStyle,e.defaultFontStyle),footerFontSize:n(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function l(t,e){var n=t._chart.ctx,i=2*e.yPadding,a=0,o=e.body,s=o.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);s+=e.beforeBody.length+e.afterBody.length;var l=e.title.length,u=e.footer.length,d=e.titleFontSize,c=e.bodyFontSize,h=e.footerFontSize;i+=l*d,i+=l?(l-1)*e.titleSpacing:0,i+=l?e.titleMarginBottom:0,i+=s*c,i+=s?(s-1)*e.bodySpacing:0,i+=u?e.footerMarginTop:0,i+=u*h,i+=u?(u-1)*e.footerSpacing:0;var f=0,g=function(t){a=Math.max(a,n.measureText(t).width+f)};return n.font=r.fontString(d,e._titleFontStyle,e._titleFontFamily),r.each(e.title,g),n.font=r.fontString(c,e._bodyFontStyle,e._bodyFontFamily),r.each(e.beforeBody.concat(e.afterBody),g),f=e.displayColors?c+2:0,r.each(o,function(t){r.each(t.before,g),r.each(t.lines,g),r.each(t.after,g)}),f=0,n.font=r.fontString(h,e._footerFontStyle,e._footerFontFamily),r.each(e.footer,g),a+=2*e.xPadding,{width:a,height:i}}function u(t,e){var n=t._model,i=t._chart,a=t._chart.chartArea,r="center",o="center";n.y<e.height?o="top":n.y>i.height-e.height&&(o="bottom");var s,l,u,d,c,h=(a.left+a.right)/2,f=(a.top+a.bottom)/2;"center"===o?(s=function(t){return t<=h},l=function(t){return t>h}):(s=function(t){return t<=e.width/2},l=function(t){return t>=i.width-e.width/2}),u=function(t){return t+e.width>i.width},d=function(t){return t-e.width<0},c=function(t){return t<=f?"top":"bottom"},s(n.x)?(r="left",u(n.x)&&(r="center",o=c(n.y))):l(n.x)&&(r="right",d(n.x)&&(r="center",o=c(n.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:r,yAlign:g.yAlign?g.yAlign:o}}function d(t,e,n){var i=t.x,a=t.y,r=t.caretSize,o=t.caretPadding,s=t.cornerRadius,l=n.xAlign,u=n.yAlign,d=r+o,c=s+o;return"right"===l?i-=e.width:"center"===l&&(i-=e.width/2),"top"===u?a+=d:a-="bottom"===u?e.height+d:e.height/2,"center"===u?"left"===l?i+=d:"right"===l&&(i-=d):"left"===l?i-=c:"right"===l&&(i+=c),{x:i,y:a}}t.Tooltip=a.extend({initialize:function(){this._model=s(this._options)},getTitle:function(){var t=this,e=t._options.callbacks,i=e.beforeTitle.apply(t,arguments),a=e.title.apply(t,arguments),r=e.afterTitle.apply(t,arguments),o=[];return o=n(o,i),o=n(o,a),o=n(o,r)},getBeforeBody:function(){var t=this._options.callbacks.beforeBody.apply(this,arguments);return r.isArray(t)?t:void 0!==t?[t]:[]},getBody:function(t,e){var i=this,a=i._options.callbacks,o=[];return r.each(t,function(t){var r={before:[],lines:[],after:[]};n(r.before,a.beforeLabel.call(i,t,e)),n(r.lines,a.label.call(i,t,e)),n(r.after,a.afterLabel.call(i,t,e)),o.push(r)}),o},getAfterBody:function(){var t=this._options.callbacks.afterBody.apply(this,arguments);return r.isArray(t)?t:void 0!==t?[t]:[]},getFooter:function(){var t=this,e=t._options.callbacks,i=e.beforeFooter.apply(t,arguments),a=e.footer.apply(t,arguments),r=e.afterFooter.apply(t,arguments),o=[];return o=n(o,i),o=n(o,a),o=n(o,r)},update:function(e){var n,i,a=this,c=a._options,h=a._model,f=a._model=s(c),g=a._active,m=a._data,p={xAlign:h.xAlign,yAlign:h.yAlign},v={x:h.x,y:h.y},y={width:h.width,height:h.height},b={x:h.caretX,y:h.caretY};if(g.length){f.opacity=1;var x=[],_=[];b=t.Tooltip.positioners[c.position](g,a._eventPosition);var k=[];for(n=0,i=g.length;n<i;++n)k.push(o(g[n]));c.filter&&(k=k.filter(function(t){return c.filter(t,m)})),c.itemSort&&(k=k.sort(function(t,e){return c.itemSort(t,e,m)})),r.each(k,function(t){x.push(c.callbacks.labelColor.call(a,t,a._chart)),_.push(c.callbacks.labelTextColor.call(a,t,a._chart))}),f.title=a.getTitle(k,m),f.beforeBody=a.getBeforeBody(k,m),f.body=a.getBody(k,m),f.afterBody=a.getAfterBody(k,m),f.footer=a.getFooter(k,m),f.x=Math.round(b.x),f.y=Math.round(b.y),f.caretPadding=c.caretPadding,f.labelColors=x,f.labelTextColors=_,f.dataPoints=k,v=d(f,y=l(this,f),p=u(this,y))}else f.opacity=0;return f.xAlign=p.xAlign,f.yAlign=p.yAlign,f.x=v.x,f.y=v.y,f.width=y.width,f.height=y.height,f.caretX=b.x,f.caretY=b.y,a._model=f,e&&c.custom&&c.custom.call(a,f),a},drawCaret:function(t,e){var n=this._chart.ctx,i=this._view,a=this.getCaretPosition(t,e,i);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,n){var i,a,r,o,s,l,u=n.caretSize,d=n.cornerRadius,c=n.xAlign,h=n.yAlign,f=t.x,g=t.y,m=e.width,p=e.height;if("center"===h)s=g+p/2,"left"===c?(a=(i=f)-u,r=i,o=s+u,l=s-u):(a=(i=f+m)+u,r=i,o=s-u,l=s+u);else if("left"===c?(i=(a=f+d+u)-u,r=a+u):"right"===c?(i=(a=f+m-d-u)-u,r=a+u):(i=(a=f+m/2)-u,r=a+u),"top"===h)s=(o=g)-u,l=o;else{s=(o=g+p)+u,l=o;var v=r;r=i,i=v}return{x1:i,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,n,i,a){var o=n.title;if(o.length){i.textAlign=n._titleAlign,i.textBaseline="top";var s=n.titleFontSize,l=n.titleSpacing;i.fillStyle=e(n.titleFontColor,a),i.font=r.fontString(s,n._titleFontStyle,n._titleFontFamily);var u,d;for(u=0,d=o.length;u<d;++u)i.fillText(o[u],t.x,t.y),t.y+=s+l,u+1===o.length&&(t.y+=n.titleMarginBottom-l)}},drawBody:function(t,n,i,a){var o=n.bodyFontSize,s=n.bodySpacing,l=n.body;i.textAlign=n._bodyAlign,i.textBaseline="top",i.font=r.fontString(o,n._bodyFontStyle,n._bodyFontFamily);var u=0,d=function(e){i.fillText(e,t.x+u,t.y),t.y+=o+s};r.each(n.beforeBody,d);var c=n.displayColors;u=c?o+2:0,r.each(l,function(s,l){r.each(s.before,d),r.each(s.lines,function(r){if(c){i.fillStyle=e(n.legendColorBackground,a),i.fillRect(t.x,t.y,o,o),i.lineWidth=1,i.strokeStyle=e(n.labelColors[l].borderColor,a),i.strokeRect(t.x,t.y,o,o),i.fillStyle=e(n.labelColors[l].backgroundColor,a),i.fillRect(t.x+1,t.y+1,o-2,o-2);var s=e(n.labelTextColors[l],a);i.fillStyle=s}d(r)}),r.each(s.after,d)}),u=0,r.each(n.afterBody,d),t.y-=s},drawFooter:function(t,n,i,a){var o=n.footer;o.length&&(t.y+=n.footerMarginTop,i.textAlign=n._footerAlign,i.textBaseline="top",i.fillStyle=e(n.footerFontColor,a),i.font=r.fontString(n.footerFontSize,n._footerFontStyle,n._footerFontFamily),r.each(o,function(e){i.fillText(e,t.x,t.y),t.y+=n.footerFontSize+n.footerSpacing}))},drawBackground:function(t,n,i,a,r){i.fillStyle=e(n.backgroundColor,r),i.strokeStyle=e(n.borderColor,r),i.lineWidth=n.borderWidth;var o=n.xAlign,s=n.yAlign,l=t.x,u=t.y,d=a.width,c=a.height,h=n.cornerRadius;i.beginPath(),i.moveTo(l+h,u),"top"===s&&this.drawCaret(t,a),i.lineTo(l+d-h,u),i.quadraticCurveTo(l+d,u,l+d,u+h),"center"===s&&"right"===o&&this.drawCaret(t,a),i.lineTo(l+d,u+c-h),i.quadraticCurveTo(l+d,u+c,l+d-h,u+c),"bottom"===s&&this.drawCaret(t,a),i.lineTo(l+h,u+c),i.quadraticCurveTo(l,u+c,l,u+c-h),"center"===s&&"left"===o&&this.drawCaret(t,a),i.lineTo(l,u+h),i.quadraticCurveTo(l,u,l+h,u),i.closePath(),i.fill(),n.borderWidth>0&&i.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var n={width:e.width,height:e.height},i={x:e.x,y:e.y},a=Math.abs(e.opacity<.001)?0:e.opacity,r=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&r&&(this.drawBackground(i,e,t,n,a),i.x+=e.xPadding,i.y+=e.yPadding,this.drawTitle(i,e,t,a),this.drawBody(i,e,t,a),this.drawFooter(i,e,t,a))}},handleEvent:function(t){var e=this,n=e._options,i=!1;if(e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:e._active=e._chart.getElementsAtEventForMode(t,n.mode,n),!(i=!r.arrayEquals(e._active,e._lastActive)))return!1;if(e._lastActive=e._active,n.enabled||n.custom){e._eventPosition={x:t.x,y:t.y};var a=e._model;e.update(!0),e.pivot(),i|=a.x!==e._model.x||a.y!==e._model.y}return i}}),t.Tooltip.positioners={average:function(t){if(!t.length)return!1;var e,n,i=0,a=0,r=0;for(e=0,n=t.length;e<n;++e){var o=t[e];if(o&&o.hasValue()){var s=o.tooltipPosition();i+=s.x,a+=s.y,++r}}return{x:Math.round(i/r),y:Math.round(a/r)}},nearest:function(t,e){var n,i,a,o=e.x,s=e.y,l=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){var u=t[n];if(u&&u.hasValue()){var d=u.getCenterPoint(),c=r.distanceBetweenPoints(e,d);c<l&&(l=c,a=u)}}if(a){var h=a.tooltipPosition();o=h.x,s=h.y}return{x:o,y:s}}}}},{25:25,26:26,45:45}],36:[function(t,e,n){"use strict";var i=t(25),a=t(26),r=t(45);i._set("global",{elements:{arc:{backgroundColor:i.global.defaultColor,borderColor:"#fff",borderWidth:2}}}),e.exports=a.extend({inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var n=this._view;if(n){for(var i=r.getAngleFromPoint(n,{x:t,y:e}),a=i.angle,o=i.distance,s=n.startAngle,l=n.endAngle;l<s;)l+=2*Math.PI;for(;a>l;)a-=2*Math.PI;for(;a<s;)a+=2*Math.PI;var u=a>=s&&a<=l,d=o>=n.innerRadius&&o<=n.outerRadius;return u&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,n=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,n=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},draw:function(){var t=this._chart.ctx,e=this._view,n=e.startAngl