WP Statistics - Version 10.3

Version Description

This is primarily a maintenance release with updates to various libraries and bug fixes, note that Google Maps is no longer supported as of 10.2.

=

Download this release

Release Info

Developer GregRoss
Plugin Icon 128x128 WP Statistics
Version 10.3
Comparing to
See all releases

Code changes from version 10.2 to 10.3

Files changed (36) hide show
  1. assets/css/admin-old.min.css +1 -0
  2. assets/css/admin.min.css +1 -0
  3. assets/css/jquery-ui-1.10.4.custom.min.css +5 -0
  4. assets/css/jquery-ui-smoothness.min.css +5 -0
  5. assets/css/jquery.jqplot.min.css +0 -1
  6. assets/css/log.css +6 -1
  7. assets/css/log.min.css +1 -0
  8. assets/css/pagination.min.css +1 -0
  9. assets/css/rtl.min.css +1 -0
  10. assets/css/style.min.css +1 -0
  11. assets/jqplot/jquery.jqplot.css +259 -0
  12. assets/jqplot/jquery.jqplot.js +11477 -0
  13. assets/jqplot/jquery.jqplot.min.css +1 -0
  14. assets/jqplot/jquery.jqplot.min.js +8 -0
  15. assets/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js +203 -0
  16. assets/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js +1 -0
  17. assets/jqplot/plugins/jqplot.canvasAxisTickRenderer.js +253 -0
  18. assets/jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js +1 -0
  19. assets/jqplot/plugins/jqplot.canvasTextRenderer.js +449 -0
  20. assets/jqplot/plugins/jqplot.canvasTextRenderer.min.js +1 -0
  21. assets/jqplot/plugins/jqplot.dateAxisRenderer.js +741 -0
  22. assets/jqplot/plugins/jqplot.dateAxisRenderer.min.js +1 -0
  23. assets/jqplot/plugins/jqplot.enhancedLegendRenderer.js +305 -0
  24. assets/jqplot/plugins/jqplot.enhancedLegendRenderer.min.js +1 -0
  25. assets/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js +261 -0
  26. assets/jqplot/plugins/jqplot.enhancedPieLegendRenderer.min.js +1 -0
  27. assets/jqplot/plugins/jqplot.highlighter.js +465 -0
  28. assets/jqplot/plugins/jqplot.highlighter.min.js +1 -0
  29. assets/jqplot/plugins/jqplot.pieRenderer.js +946 -0
  30. assets/jqplot/plugins/jqplot.pieRenderer.min.js +1 -0
  31. assets/jqvmap/jquery.vmap.js +1281 -0
  32. assets/jqvmap/jquery.vmap.min.js +8 -10
  33. assets/jqvmap/jqvmap.css +50 -56
  34. assets/jqvmap/jqvmap.min.css +1 -0
  35. assets/jqvmap/maps/continents/jquery.vmap.africa.js +0 -2
  36. assets/jqvmap/maps/continents/jquery.vmap.asia.js +0 -2
assets/css/admin-old.min.css ADDED
@@ -0,0 +1 @@
 
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.min.css ADDED
@@ -0,0 +1 @@
 
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}
assets/css/jquery-ui-1.10.4.custom.min.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
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 */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default !important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("images/animated-overlay.gif");height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}#tabs{border:0;padding:0;margin:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;margin-right:10px;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px;margin-right:10px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:transparent;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border-left:0;border-top:0;border-right:0;border-bottom:1px solid #aaa;background:transparent;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:0}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:0}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:0}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:0}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
assets/css/jquery-ui-smoothness.min.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
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 */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default !important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;min-height:0;font-size:100%}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{overflow:hidden;position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{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==");height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px .4em;margin:.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-button{display:inline-block;overflow:hidden;position:relative;text-decoration:none;cursor:pointer}.ui-selectmenu-button span.ui-icon{right:.5em;left:auto;margin-top:-8px;position:absolute;top:50%}.ui-selectmenu-button span.ui-selectmenu-text{text-align:left;padding:.4em 2.1em .4em 1em;display:block;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:0;background:0;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url("../images/ui-bg_flat_75_ffffff_40x100.png") 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url("../images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url("../images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url("../images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url("../images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url("../images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url("../images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("../images/ui-icons_222222_256x240.png")}.ui-widget-header .ui-icon{background-image:url("../images/ui-icons_222222_256x240.png")}.ui-state-default .ui-icon{background-image:url("../images/ui-icons_888888_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url("../images/ui-icons_454545_256x240.png")}.ui-state-active .ui-icon{background-image:url("../images/ui-icons_454545_256x240.png")}.ui-state-highlight .ui-icon{background-image:url("../images/ui-icons_2e83ff_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("../images/ui-icons_cd0a0a_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url("../images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url("../images/ui-bg_flat_0_aaaaaa_40x100.png") 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px}
assets/css/jquery.jqplot.min.css DELETED
@@ -1 +0,0 @@
1
- .jqplot-target{position:relative;color:#666;font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;font-size:1em}.jqplot-axis{font-size:.75em}.jqplot-xaxis{margin-top:10px}.jqplot-x2axis{margin-bottom:10px}.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-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{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 1px 5px;z-index:2;font-size:1.5em}.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-xaxis-label{margin-top:10px;font-size:11pt;position:absolute}.jqplot-x2axis-label{margin-bottom:10px;font-size:11pt;position:absolute}.jqplot-yaxis-label{margin-right:10px;font-size:11pt;position:absolute}.jqplot-yMidAxis-label{font-size:11pt;position:absolute}.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-top:12px;margin-bottom:12px;margin-left:12px;margin-right:12px}table.jqplot-table-legend,table.jqplot-cursor-legend{background-color:rgba(255,255,255,0.6);border:1px solid #ccc;position:absolute;font-size:.75em}td.jqplot-table-legend{vertical-align:middle}td.jqplot-seriesToggle:hover,td.jqplot-seriesToggle:active{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-top-width:5px;border-bottom-width:5px;border-left-width:6px;border-right-width:6px;border-top-style:solid;border-bottom-style:solid;border-left-style:solid;border-right-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-cursor-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.5);padding:1px}.jqplot-highlighter-tooltip,.jqplot-canvasOverlay-tooltip{border:1px solid #ccc;font-size:.75em;white-space:nowrap;background:rgba(208,208,208,0.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%,0.7)}div.jqplot-noData-container{text-align:center;background-color:rgba(96%,96%,96%,0.3)}
 
assets/css/log.css CHANGED
@@ -236,4 +236,9 @@
236
  #donate-button {
237
  float: right;
238
  margin: 12px 0 0;
239
- }
 
 
 
 
 
236
  #donate-button {
237
  float: right;
238
  margin: 12px 0 0;
239
+ }
240
+
241
+ .jqvmap-label
242
+ {
243
+ z-index: 10000;
244
+ }
assets/css/log.min.css ADDED
@@ -0,0 +1 @@
 
1
+ #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}#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;height:46px;padding:3px 7px}.log-item:hover{background:none repeat scroll 0 0 #eee}.show-map{float:left}.log-referred{float:left;overflow:hidden;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:auto}.log-page-title{float:left;overflow:hidden;white-space:nowrap;overflow:hidden;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}.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}
assets/css/pagination.min.css ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1 @@
 
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}
assets/css/style.min.css ADDED
@@ -0,0 +1 @@
 
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/jqplot/jquery.jqplot.css ADDED
@@ -0,0 +1,259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 ADDED
@@ -0,0 +1,11477 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: d96a669
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 = "d96a669";
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 accomodate 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
+ if (this.legend.location === 's') {
3055
+ legendPadding.left = this._gridPadding.left;
3056
+ legendPadding.right = this._gridPadding.right;
3057
+ }
3058
+ }
3059
+
3060
+ 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});
3061
+ 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});
3062
+ 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});
3063
+ for (i=8; i>0; i--) {
3064
+ 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});
3065
+ }
3066
+ var ltemp = (this._width - this._gridPadding.left - this._gridPadding.right)/2.0 + this._gridPadding.left - ax.yMidAxis.getWidth()/2.0;
3067
+ ax.yMidAxis.pack({position:'absolute', top:0, left:ltemp, zIndex:9, textAlign: 'center'}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top});
3068
+
3069
+ this.target.append(this.grid.createElement(this._gridPadding, this));
3070
+ this.grid.draw();
3071
+
3072
+ var series = this.series;
3073
+ var seriesLength = series.length;
3074
+ // put the shadow canvases behind the series canvases so shadows don't overlap on stacked bars.
3075
+ for (i=0, l=seriesLength; i<l; i++) {
3076
+ // draw series in order of stacking. This affects only
3077
+ // order in which canvases are added to dom.
3078
+ j = this.seriesStack[i];
3079
+ this.target.append(series[j].shadowCanvas.createElement(this._gridPadding, 'jqplot-series-shadowCanvas', null, this));
3080
+ series[j].shadowCanvas.setContext();
3081
+ series[j].shadowCanvas._elem.data('seriesIndex', j);
3082
+ }
3083
+
3084
+ for (i=0, l=seriesLength; i<l; i++) {
3085
+ // draw series in order of stacking. This affects only
3086
+ // order in which canvases are added to dom.
3087
+ j = this.seriesStack[i];
3088
+ this.target.append(series[j].canvas.createElement(this._gridPadding, 'jqplot-series-canvas', null, this));
3089
+ series[j].canvas.setContext();
3090
+ series[j].canvas._elem.data('seriesIndex', j);
3091
+ }
3092
+ // Need to use filled canvas to capture events in IE.
3093
+ // Also, canvas seems to block selection of other elements in document on FF.
3094
+ this.target.append(this.eventCanvas.createElement(this._gridPadding, 'jqplot-event-canvas', null, this));
3095
+ this.eventCanvas.setContext();
3096
+ this.eventCanvas._ctx.fillStyle = 'rgba(0,0,0,0)';
3097
+ this.eventCanvas._ctx.fillRect(0,0,this.eventCanvas._ctx.canvas.width, this.eventCanvas._ctx.canvas.height);
3098
+
3099
+ // bind custom event handlers to regular events.
3100
+ this.bindCustomEvents();
3101
+
3102
+ // draw legend before series if the series needs to know the legend dimensions.
3103
+ if (this.legend.preDraw) {
3104
+ this.eventCanvas._elem.before(legendElem);
3105
+ this.legend.pack(legendPadding);
3106
+ if (this.legend._elem) {
3107
+ 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}});
3108
+ }
3109
+ else {
3110
+ this.drawSeries();
3111
+ }
3112
+ }
3113
+ else { // draw series before legend
3114
+ this.drawSeries();
3115
+ if (seriesLength) {
3116
+ $(series[seriesLength-1].canvas._elem).after(legendElem);
3117
+ }
3118
+ this.legend.pack(legendPadding);
3119
+ }
3120
+
3121
+ // register event listeners on the overlay canvas
3122
+ for (var i=0, l=$.jqplot.eventListenerHooks.length; i<l; i++) {
3123
+ // in the handler, this will refer to the eventCanvas dom element.
3124
+ // make sure there are references back into plot objects.
3125
+ this.eventCanvas._elem.bind($.jqplot.eventListenerHooks[i][0], {plot:this}, $.jqplot.eventListenerHooks[i][1]);
3126
+ }
3127
+
3128
+ // register event listeners on the overlay canvas
3129
+ for (var i=0, l=this.eventListenerHooks.hooks.length; i<l; i++) {
3130
+ // in the handler, this will refer to the eventCanvas dom element.
3131
+ // make sure there are references back into plot objects.
3132
+ this.eventCanvas._elem.bind(this.eventListenerHooks.hooks[i][0], {plot:this}, this.eventListenerHooks.hooks[i][1]);
3133
+ }
3134
+
3135
+ var fb = this.fillBetween;
3136
+ if(typeof fb.series1 == 'number'){
3137
+ if(fb.fill&&fb.series1!==fb.series2&&fb.series1<seriesLength&&fb.series2<seriesLength&&series[fb.series1]._type==="line"&&series[fb.series2]._type==="line")
3138
+ this.doFillBetweenLines();
3139
+ }
3140
+ else{
3141
+ if(fb.series1 != null && fb.series2 != null){
3142
+ var doFb = false;
3143
+ if(fb.series1.length === fb.series2.length){
3144
+ var tempSeries1 = 0;
3145
+ var tempSeries2 = 0;
3146
+
3147
+ for(var cnt = 0; cnt < fb.series1.length; cnt++){
3148
+ tempSeries1 = fb.series1[cnt];
3149
+ tempSeries2 = fb.series2[cnt];
3150
+ if(tempSeries1!==tempSeries2&&tempSeries1<seriesLength&&tempSeries2<seriesLength&&series[tempSeries1]._type==="line"&&series[tempSeries2]._type==="line"){
3151
+ doFb = true;
3152
+ }
3153
+ else{
3154
+ doFb = false;
3155
+ break;
3156
+ }
3157
+ }
3158
+ }
3159
+ if(fb.fill && doFb){
3160
+ this.doFillBetweenLines();
3161
+ }
3162
+ }
3163
+ }
3164
+
3165
+ for (var i=0, l=$.jqplot.postDrawHooks.length; i<l; i++) {
3166
+ $.jqplot.postDrawHooks[i].call(this);
3167
+ }
3168
+
3169
+ for (var i=0, l=this.postDrawHooks.hooks.length; i<l; i++) {
3170
+ this.postDrawHooks.hooks[i].apply(this, this.postDrawHooks.args[i]);
3171
+ }
3172
+
3173
+ if (this.target.is(':visible')) {
3174
+ this._drawCount += 1;
3175
+ }
3176
+
3177
+ var temps,
3178
+ tempr,
3179
+ sel,
3180
+ _els;
3181
+ // ughh. ideally would hide all series then show them.
3182
+ for (i=0, l=seriesLength; i<l; i++) {
3183
+ temps = series[i];
3184
+ tempr = temps.renderer;
3185
+ sel = '.jqplot-point-label.jqplot-series-'+i;
3186
+ if (tempr.animation && tempr.animation._supported && tempr.animation.show && (this._drawCount < 2 || this.animateReplot)) {
3187
+ _els = this.target.find(sel);
3188
+ _els.stop(true, true).hide();
3189
+ temps.canvas._elem.stop(true, true).hide();
3190
+ temps.shadowCanvas._elem.stop(true, true).hide();
3191
+ temps.canvas._elem.jqplotEffect('blind', {mode: 'show', direction: tempr.animation.direction}, tempr.animation.speed);
3192
+ temps.shadowCanvas._elem.jqplotEffect('blind', {mode: 'show', direction: tempr.animation.direction}, tempr.animation.speed);
3193
+ _els.fadeIn(tempr.animation.speed*0.8);
3194
+ }
3195
+ }
3196
+ _els = null;
3197
+
3198
+ this.target.trigger('jqplotPostDraw', [this]);
3199
+ }
3200
+ };
3201
+
3202
+ jqPlot.prototype.doFillBetweenLines = function () {
3203
+ var fb = this.fillBetween;
3204
+ var series = this.series;
3205
+ var sid1 = fb.series1;
3206
+ var sid2 = fb.series2;
3207
+ var id1 = 0, id2 = 0;
3208
+
3209
+ function fill(id1, id2){
3210
+ var series1 = series[id1];
3211
+ var series2 = series[id2];
3212
+ if (series2.renderer.smooth)
3213
+ var tempgd = series2.renderer._smoothedData.slice(0).reverse();
3214
+ else
3215
+ var tempgd = series2.gridData.slice(0).reverse();
3216
+ if (series1.renderer.smooth)
3217
+ var gd = series1.renderer._smoothedData.concat(tempgd);
3218
+ else
3219
+ var gd = series1.gridData.concat(tempgd);
3220
+ var color = fb.color !== null ? fb.color : series[sid1].fillColor;
3221
+ var baseSeries = fb.baseSeries !== null ? fb.baseSeries : id1;
3222
+ var sr =
3223
+ series[baseSeries].renderer.shapeRenderer;
3224
+ var opts =
3225
+ {
3226
+ fillStyle : color,
3227
+ fill : true,
3228
+ closePath : true
3229
+ };
3230
+ sr.draw(series1.shadowCanvas._ctx, gd, opts)
3231
+ }
3232
+
3233
+ if(typeof sid1 == 'number' && typeof sid2 == 'number'){
3234
+ id1 = sid1 < sid2 ? sid1 : sid2;
3235
+ id2 = sid2 > sid1 ? sid2 : sid1;
3236
+ fill(id1, id2);
3237
+ }
3238
+ else{
3239
+ for(var cnt = 0; cnt < sid1.length ; cnt++){
3240
+ id1 = sid1[cnt] < sid2[cnt] ? sid1[cnt] : sid2[cnt];
3241
+ id2 = sid2[cnt] > sid1[cnt] ? sid2[cnt] : sid1[cnt];
3242
+ fill(id1, id2);
3243
+ }
3244
+ }
3245
+ };
3246
+
3247
+ this.bindCustomEvents = function() {
3248
+ this.eventCanvas._elem.bind('click', {plot:this}, this.onClick);
3249
+ this.eventCanvas._elem.bind('dblclick', {plot:this}, this.onDblClick);
3250
+ this.eventCanvas._elem.bind('mousedown', {plot:this}, this.onMouseDown);
3251
+ this.eventCanvas._elem.bind('mousemove', {plot:this}, this.onMouseMove);
3252
+ this.eventCanvas._elem.bind('mouseenter', {plot:this}, this.onMouseEnter);
3253
+ this.eventCanvas._elem.bind('mouseleave', {plot:this}, this.onMouseLeave);
3254
+ if (this.captureRightClick) {
3255
+ this.eventCanvas._elem.bind('mouseup', {plot:this}, this.onRightClick);
3256
+ this.eventCanvas._elem.get(0).oncontextmenu = function() {
3257
+ return false;
3258
+ };
3259
+ }
3260
+ else {
3261
+ this.eventCanvas._elem.bind('mouseup', {plot:this}, this.onMouseUp);
3262
+ }
3263
+ };
3264
+
3265
+ function getEventPosition(ev) {
3266
+ var plot = ev.data.plot;
3267
+ var go = plot.eventCanvas._elem.offset();
3268
+ var gridPos = {x:ev.pageX - go.left, y:ev.pageY - go.top};
3269
+ 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};
3270
+ var an = ['xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis', 'yMidAxis'];
3271
+ var ax = plot.axes;
3272
+ var n, axis;
3273
+ for (n=11; n>0; n--) {
3274
+ axis = an[n-1];
3275
+ if (ax[axis].show) {
3276
+ dataPos[axis] = ax[axis].series_p2u(gridPos[axis.charAt(0)]);
3277
+ }
3278
+ }
3279
+
3280
+ return {offsets:go, gridPos:gridPos, dataPos:dataPos};
3281
+ }
3282
+
3283
+
3284
+ // function to check if event location is over a area area
3285
+ function checkIntersection(gridpos, plot) {
3286
+ var series = plot.series;
3287
+ var i, j, k, s, r, x, y, theta, sm, sa, minang, maxang;
3288
+ var d0, d, p, pp, points, bw, hp;
3289
+ var threshold, t;
3290
+ for (k=plot.seriesStack.length-1; k>=0; k--) {
3291
+ i = plot.seriesStack[k];
3292
+ s = series[i];
3293
+ hp = s._highlightThreshold;
3294
+ switch (s.renderer.constructor) {
3295
+ case $.jqplot.BarRenderer:
3296
+ x = gridpos.x;
3297
+ y = gridpos.y;
3298
+ for (j=0; j<s._barPoints.length; j++) {
3299
+ points = s._barPoints[j];
3300
+ p = s.gridData[j];
3301
+ 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])) {
3302
+ return {seriesIndex:s.index, pointIndex:j, gridData:p, data:s.data[j], points:s._barPoints[j]};
3303
+ }
3304
+ }
3305
+ break;
3306
+ case $.jqplot.PyramidRenderer:
3307
+ x = gridpos.x;
3308
+ y = gridpos.y;
3309
+ for (j=0; j<s._barPoints.length; j++) {
3310
+ points = s._barPoints[j];
3311
+ p = s.gridData[j];
3312
+ if (x > points[0][0] + hp[0][0] && x < points[2][0] + hp[2][0] && y > points[2][1] && y < points[0][1]) {
3313
+ return {seriesIndex:s.index, pointIndex:j, gridData:p, data:s.data[j], points:s._barPoints[j]};
3314
+ }
3315
+ }
3316
+ break;
3317
+
3318
+ case $.jqplot.DonutRenderer:
3319
+ sa = s.startAngle/180*Math.PI;
3320
+ x = gridpos.x - s._center[0];
3321
+ y = gridpos.y - s._center[1];
3322
+ r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
3323
+ if (x > 0 && -y >= 0) {
3324
+ theta = 2*Math.PI - Math.atan(-y/x);
3325
+ }
3326
+ else if (x > 0 && -y < 0) {
3327
+ theta = -Math.atan(-y/x);
3328
+ }
3329
+ else if (x < 0) {
3330
+ theta = Math.PI - Math.atan(-y/x);
3331
+ }
3332
+ else if (x == 0 && -y > 0) {
3333
+ theta = 3*Math.PI/2;
3334
+ }
3335
+ else if (x == 0 && -y < 0) {
3336
+ theta = Math.PI/2;
3337
+ }
3338
+ else if (x == 0 && y == 0) {
3339
+ theta = 0;
3340
+ }
3341
+ if (sa) {
3342
+ theta -= sa;
3343
+ if (theta < 0) {
3344
+ theta += 2*Math.PI;
3345
+ }
3346
+ else if (theta > 2*Math.PI) {
3347
+ theta -= 2*Math.PI;
3348
+ }
3349
+ }
3350
+
3351
+ sm = s.sliceMargin/180*Math.PI;
3352
+ if (r < s._radius && r > s._innerRadius) {
3353
+ for (j=0; j<s.gridData.length; j++) {
3354
+ minang = (j>0) ? s.gridData[j-1][1]+sm : sm;
3355
+ maxang = s.gridData[j][1];
3356
+ if (theta > minang && theta < maxang) {
3357
+ return {seriesIndex:s.index, pointIndex:j, gridData:[gridpos.x,gridpos.y], data:s.data[j]};
3358
+ }
3359
+ }
3360
+ }
3361
+ break;
3362
+
3363
+ case $.jqplot.PieRenderer:
3364
+ sa = s.startAngle/180*Math.PI;
3365
+ x = gridpos.x - s._center[0];
3366
+ y = gridpos.y - s._center[1];
3367
+ r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
3368
+ if (x > 0 && -y >= 0) {
3369
+ theta = 2*Math.PI - Math.atan(-y/x);
3370
+ }
3371
+ else if (x > 0 && -y < 0) {
3372
+ theta = -Math.atan(-y/x);
3373
+ }
3374
+ else if (x < 0) {
3375
+ theta = Math.PI - Math.atan(-y/x);
3376
+ }
3377
+ else if (x == 0 && -y > 0) {
3378
+ theta = 3*Math.PI/2;
3379
+ }
3380
+ else if (x == 0 && -y < 0) {
3381
+ theta = Math.PI/2;
3382
+ }
3383
+ else if (x == 0 && y == 0) {
3384
+ theta = 0;
3385
+ }
3386
+ if (sa) {
3387
+ theta -= sa;
3388
+ if (theta < 0) {
3389
+ theta += 2*Math.PI;
3390
+ }
3391
+ else if (theta > 2*Math.PI) {
3392
+ theta -= 2*Math.PI;
3393
+ }
3394
+ }
3395
+
3396
+ sm = s.sliceMargin/180*Math.PI;
3397
+ if (r < s._radius) {
3398
+ for (j=0; j<s.gridData.length; j++) {
3399
+ minang = (j>0) ? s.gridData[j-1][1]+sm : sm;
3400
+ maxang = s.gridData[j][1];
3401
+ if (theta > minang && theta < maxang) {
3402
+ return {seriesIndex:s.index, pointIndex:j, gridData:[gridpos.x,gridpos.y], data:s.data[j]};
3403
+ }
3404
+ }
3405
+ }
3406
+ break;
3407
+
3408
+ case $.jqplot.BubbleRenderer:
3409
+ x = gridpos.x;
3410
+ y = gridpos.y;
3411
+ var ret = null;
3412
+
3413
+ if (s.show) {
3414
+ for (var j=0; j<s.gridData.length; j++) {
3415
+ p = s.gridData[j];
3416
+ d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );
3417
+ if (d <= p[2] && (d <= d0 || d0 == null)) {
3418
+ d0 = d;
3419
+ ret = {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3420
+ }
3421
+ }
3422
+ if (ret != null) {
3423
+ return ret;
3424
+ }
3425
+ }
3426
+ break;
3427
+
3428
+ case $.jqplot.FunnelRenderer:
3429
+ x = gridpos.x;
3430
+ y = gridpos.y;
3431
+ var v = s._vertices,
3432
+ vfirst = v[0],
3433
+ vlast = v[v.length-1],
3434
+ lex,
3435
+ rex,
3436
+ cv;
3437
+
3438
+ // equations of right and left sides, returns x, y values given height of section (y value and 2 points)
3439
+
3440
+ function findedge (l, p1 , p2) {
3441
+ var m = (p1[1] - p2[1])/(p1[0] - p2[0]);
3442
+ var b = p1[1] - m*p1[0];
3443
+ var y = l + p1[1];
3444
+
3445
+ return [(y - b)/m, y];
3446
+ }
3447
+
3448
+ // check each section
3449
+ lex = findedge(y, vfirst[0], vlast[3]);
3450
+ rex = findedge(y, vfirst[1], vlast[2]);
3451
+ for (j=0; j<v.length; j++) {
3452
+ cv = v[j];
3453
+ if (y >= cv[0][1] && y <= cv[3][1] && x >= lex[0] && x <= rex[0]) {
3454
+ return {seriesIndex:s.index, pointIndex:j, gridData:null, data:s.data[j]};
3455
+ }
3456
+ }
3457
+ break;
3458
+
3459
+ case $.jqplot.LineRenderer:
3460
+ x = gridpos.x;
3461
+ y = gridpos.y;
3462
+ r = s.renderer;
3463
+ if (s.show) {
3464
+ if ((s.fill || (s.renderer.bands.show && s.renderer.bands.fill)) && (!plot.plugins.highlighter || !plot.plugins.highlighter.show)) {
3465
+ // first check if it is in bounding box
3466
+ var inside = false;
3467
+ if (x>s._boundingBox[0][0] && x<s._boundingBox[1][0] && y>s._boundingBox[1][1] && y<s._boundingBox[0][1]) {
3468
+ // now check the crossing number
3469
+
3470
+ var numPoints = s._areaPoints.length;
3471
+ var ii;
3472
+ var j = numPoints-1;
3473
+
3474
+ for(var ii=0; ii < numPoints; ii++) {
3475
+ var vertex1 = [s._areaPoints[ii][0], s._areaPoints[ii][1]];
3476
+ var vertex2 = [s._areaPoints[j][0], s._areaPoints[j][1]];
3477
+
3478
+ if (vertex1[1] < y && vertex2[1] >= y || vertex2[1] < y && vertex1[1] >= y) {
3479
+ if (vertex1[0] + (y - vertex1[1]) / (vertex2[1] - vertex1[1]) * (vertex2[0] - vertex1[0]) < x) {
3480
+ inside = !inside;
3481
+ }
3482
+ }
3483
+
3484
+ j = ii;
3485
+ }
3486
+ }
3487
+ if (inside) {
3488
+ return {seriesIndex:i, pointIndex:null, gridData:s.gridData, data:s.data, points:s._areaPoints};
3489
+ }
3490
+ break;
3491
+
3492
+ }
3493
+
3494
+ else {
3495
+ t = s.markerRenderer.size/2+s.neighborThreshold;
3496
+ threshold = (t > 0) ? t : 0;
3497
+ for (var j=0; j<s.gridData.length; j++) {
3498
+ p = s.gridData[j];
3499
+ // neighbor looks different to OHLC chart.
3500
+ if (r.constructor == $.jqplot.OHLCRenderer) {
3501
+ if (r.candleStick) {
3502
+ var yp = s._yaxis.series_u2p;
3503
+ 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])) {
3504
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3505
+ }
3506
+ }
3507
+ // if an open hi low close chart
3508
+ else if (!r.hlc){
3509
+ var yp = s._yaxis.series_u2p;
3510
+ if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {
3511
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3512
+ }
3513
+ }
3514
+ // a hi low close chart
3515
+ else {
3516
+ var yp = s._yaxis.series_u2p;
3517
+ if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][1]) && y <= yp(s.data[j][2])) {
3518
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3519
+ }
3520
+ }
3521
+
3522
+ }
3523
+ else if (p[0] != null && p[1] != null){
3524
+ d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );
3525
+ if (d <= threshold && (d <= d0 || d0 == null)) {
3526
+ d0 = d;
3527
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3528
+ }
3529
+ }
3530
+ }
3531
+ }
3532
+ }
3533
+ break;
3534
+
3535
+ default:
3536
+ x = gridpos.x;
3537
+ y = gridpos.y;
3538
+ r = s.renderer;
3539
+ if (s.show) {
3540
+ t = s.markerRenderer.size/2+s.neighborThreshold;
3541
+ threshold = (t > 0) ? t : 0;
3542
+ for (var j=0; j<s.gridData.length; j++) {
3543
+ p = s.gridData[j];
3544
+ // neighbor looks different to OHLC chart.
3545
+ if (r.constructor == $.jqplot.OHLCRenderer) {
3546
+ if (r.candleStick) {
3547
+ var yp = s._yaxis.series_u2p;
3548
+ 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])) {
3549
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3550
+ }
3551
+ }
3552
+ // if an open hi low close chart
3553
+ else if (!r.hlc){
3554
+ var yp = s._yaxis.series_u2p;
3555
+ if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) {
3556
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3557
+ }
3558
+ }
3559
+ // a hi low close chart
3560
+ else {
3561
+ var yp = s._yaxis.series_u2p;
3562
+ if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][1]) && y <= yp(s.data[j][2])) {
3563
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3564
+ }
3565
+ }
3566
+
3567
+ }
3568
+ else {
3569
+ d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) );
3570
+ if (d <= threshold && (d <= d0 || d0 == null)) {
3571
+ d0 = d;
3572
+ return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]};
3573
+ }
3574
+ }
3575
+ }
3576
+ }
3577
+ break;
3578
+ }
3579
+ }
3580
+
3581
+ return null;
3582
+ }
3583
+
3584
+
3585
+
3586
+ this.onClick = function(ev) {
3587
+ // Event passed in is normalized and will have data attribute.
3588
+ // Event passed out is unnormalized.
3589
+ var positions = getEventPosition(ev);
3590
+ var p = ev.data.plot;
3591
+ var neighbor = checkIntersection(positions.gridPos, p);
3592
+ var evt = $.Event('jqplotClick');
3593
+ evt.pageX = ev.pageX;
3594
+ evt.pageY = ev.pageY;
3595
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
3596
+ };
3597
+
3598
+ this.onDblClick = function(ev) {
3599
+ // Event passed in is normalized and will have data attribute.
3600
+ // Event passed out is unnormalized.
3601
+ var positions = getEventPosition(ev);
3602
+ var p = ev.data.plot;
3603
+ var neighbor = checkIntersection(positions.gridPos, p);
3604
+ var evt = $.Event('jqplotDblClick');
3605
+ evt.pageX = ev.pageX;
3606
+ evt.pageY = ev.pageY;
3607
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
3608
+ };
3609
+
3610
+ this.onMouseDown = function(ev) {
3611
+ var positions = getEventPosition(ev);
3612
+ var p = ev.data.plot;
3613
+ var neighbor = checkIntersection(positions.gridPos, p);
3614
+ var evt = $.Event('jqplotMouseDown');
3615
+ evt.pageX = ev.pageX;
3616
+ evt.pageY = ev.pageY;
3617
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
3618
+ };
3619
+
3620
+ this.onMouseUp = function(ev) {
3621
+ var positions = getEventPosition(ev);
3622
+ var evt = $.Event('jqplotMouseUp');
3623
+ evt.pageX = ev.pageX;
3624
+ evt.pageY = ev.pageY;
3625
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, ev.data.plot]);
3626
+ };
3627
+
3628
+ this.onRightClick = function(ev) {
3629
+ var positions = getEventPosition(ev);
3630
+ var p = ev.data.plot;
3631
+ var neighbor = checkIntersection(positions.gridPos, p);
3632
+ if (p.captureRightClick) {
3633
+ if (ev.which == 3) {
3634
+ var evt = $.Event('jqplotRightClick');
3635
+ evt.pageX = ev.pageX;
3636
+ evt.pageY = ev.pageY;
3637
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
3638
+ }
3639
+ else {
3640
+ var evt = $.Event('jqplotMouseUp');
3641
+ evt.pageX = ev.pageX;
3642
+ evt.pageY = ev.pageY;
3643
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
3644
+ }
3645
+ }
3646
+ };
3647
+
3648
+ this.onMouseMove = function(ev) {
3649
+ var positions = getEventPosition(ev);
3650
+ var p = ev.data.plot;
3651
+ var neighbor = checkIntersection(positions.gridPos, p);
3652
+ var evt = $.Event('jqplotMouseMove');
3653
+ evt.pageX = ev.pageX;
3654
+ evt.pageY = ev.pageY;
3655
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]);
3656
+ };
3657
+
3658
+ this.onMouseEnter = function(ev) {
3659
+ var positions = getEventPosition(ev);
3660
+ var p = ev.data.plot;
3661
+ var evt = $.Event('jqplotMouseEnter');
3662
+ evt.pageX = ev.pageX;
3663
+ evt.pageY = ev.pageY;
3664
+ evt.relatedTarget = ev.relatedTarget;
3665
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, p]);
3666
+ };
3667
+
3668
+ this.onMouseLeave = function(ev) {
3669
+ var positions = getEventPosition(ev);
3670
+ var p = ev.data.plot;
3671
+ var evt = $.Event('jqplotMouseLeave');
3672
+ evt.pageX = ev.pageX;
3673
+ evt.pageY = ev.pageY;
3674
+ evt.relatedTarget = ev.relatedTarget;
3675
+ $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, p]);
3676
+ };
3677
+
3678
+ // method: drawSeries
3679
+ // Redraws all or just one series on the plot. No axis scaling
3680
+ // is performed and no other elements on the plot are redrawn.
3681
+ // options is an options object to pass on to the series renderers.
3682
+ // It can be an empty object {}. idx is the series index
3683
+ // to redraw if only one series is to be redrawn.
3684
+ this.drawSeries = function(options, idx){
3685
+ var i, series, ctx;
3686
+ // if only one argument passed in and it is a number, use it ad idx.
3687
+ idx = (typeof(options) === "number" && idx == null) ? options : idx;
3688
+ options = (typeof(options) === "object") ? options : {};
3689
+ // draw specified series
3690
+ if (idx != undefined) {
3691
+ series = this.series[idx];
3692
+ ctx = series.shadowCanvas._ctx;
3693
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
3694
+ series.drawShadow(ctx, options, this);
3695
+ ctx = series.canvas._ctx;
3696
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
3697
+ series.draw(ctx, options, this);
3698
+ if (series.renderer.constructor == $.jqplot.BezierCurveRenderer) {
3699
+ if (idx < this.series.length - 1) {
3700
+ this.drawSeries(idx+1);
3701
+ }
3702
+ }
3703
+ }
3704
+
3705
+ else {
3706
+ // if call series drawShadow method first, in case all series shadows
3707
+ // should be drawn before any series. This will ensure, like for
3708
+ // stacked bar plots, that shadows don't overlap series.
3709
+ for (i=0; i<this.series.length; i++) {
3710
+ // first clear the canvas
3711
+ series = this.series[i];
3712
+ ctx = series.shadowCanvas._ctx;
3713
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
3714
+ series.drawShadow(ctx, options, this);
3715
+ ctx = series.canvas._ctx;
3716
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
3717
+ series.draw(ctx, options, this);
3718
+ }
3719
+ }
3720
+ options = idx = i = series = ctx = null;
3721
+ };
3722
+
3723
+ // method: moveSeriesToFront
3724
+ // This method requires jQuery 1.4+
3725
+ // Moves the specified series canvas in front of all other series canvases.
3726
+ // This effectively "draws" the specified series on top of all other series,
3727
+ // although it is performed through DOM manipulation, no redrawing is performed.
3728
+ //
3729
+ // Parameters:
3730
+ // idx - 0 based index of the series to move. This will be the index of the series
3731
+ // as it was first passed into the jqplot function.
3732
+ this.moveSeriesToFront = function (idx) {
3733
+ idx = parseInt(idx, 10);
3734
+ var stackIndex = $.inArray(idx, this.seriesStack);
3735
+ // if already in front, return
3736
+ if (stackIndex == -1) {
3737
+ return;
3738
+ }
3739
+ if (stackIndex == this.seriesStack.length -1) {
3740
+ this.previousSeriesStack = this.seriesStack.slice(0);
3741
+ return;
3742
+ }
3743
+ var opidx = this.seriesStack[this.seriesStack.length -1];
3744
+ var serelem = this.series[idx].canvas._elem.detach();
3745
+ var shadelem = this.series[idx].shadowCanvas._elem.detach();
3746
+ this.series[opidx].shadowCanvas._elem.after(shadelem);
3747
+ this.series[opidx].canvas._elem.after(serelem);
3748
+ this.previousSeriesStack = this.seriesStack.slice(0);
3749
+ this.seriesStack.splice(stackIndex, 1);
3750
+ this.seriesStack.push(idx);
3751
+ };
3752
+
3753
+ // method: moveSeriesToBack
3754
+ // This method requires jQuery 1.4+
3755
+ // Moves the specified series canvas behind all other series canvases.
3756
+ //
3757
+ // Parameters:
3758
+ // idx - 0 based index of the series to move. This will be the index of the series
3759
+ // as it was first passed into the jqplot function.
3760
+ this.moveSeriesToBack = function (idx) {
3761
+ idx = parseInt(idx, 10);
3762
+ var stackIndex = $.inArray(idx, this.seriesStack);
3763
+ // if already in back, return
3764
+ if (stackIndex == 0 || stackIndex == -1) {
3765
+ return;
3766
+ }
3767
+ var opidx = this.seriesStack[0];
3768
+ var serelem = this.series[idx].canvas._elem.detach();
3769
+ var shadelem = this.series[idx].shadowCanvas._elem.detach();
3770
+ this.series[opidx].shadowCanvas._elem.before(shadelem);
3771
+ this.series[opidx].canvas._elem.before(serelem);
3772
+ this.previousSeriesStack = this.seriesStack.slice(0);
3773
+ this.seriesStack.splice(stackIndex, 1);
3774
+ this.seriesStack.unshift(idx);
3775
+ };
3776
+
3777
+ // method: restorePreviousSeriesOrder
3778
+ // This method requires jQuery 1.4+
3779
+ // Restore the series canvas order to its previous state.
3780
+ // Useful to put a series back where it belongs after moving
3781
+ // it to the front.
3782
+ this.restorePreviousSeriesOrder = function () {
3783
+ var i, j, serelem, shadelem, temp, move, keep;
3784
+ // if no change, return.
3785
+ if (this.seriesStack == this.previousSeriesStack) {
3786
+ return;
3787
+ }
3788
+ for (i=1; i<this.previousSeriesStack.length; i++) {
3789
+ move = this.previousSeriesStack[i];
3790
+ keep = this.previousSeriesStack[i-1];
3791
+ serelem = this.series[move].canvas._elem.detach();
3792
+ shadelem = this.series[move].shadowCanvas._elem.detach();
3793
+ this.series[keep].shadowCanvas._elem.after(shadelem);
3794
+ this.series[keep].canvas._elem.after(serelem);
3795
+ }
3796
+ temp = this.seriesStack.slice(0);
3797
+ this.seriesStack = this.previousSeriesStack.slice(0);
3798
+ this.previousSeriesStack = temp;
3799
+ };
3800
+
3801
+ // method: restoreOriginalSeriesOrder
3802
+ // This method requires jQuery 1.4+
3803
+ // Restore the series canvas order to its original order
3804
+ // when the plot was created.
3805
+ this.restoreOriginalSeriesOrder = function () {
3806
+ var i, j, arr=[], serelem, shadelem;
3807
+ for (i=0; i<this.series.length; i++) {
3808
+ arr.push(i);
3809
+ }
3810
+ if (this.seriesStack == arr) {
3811
+ return;
3812
+ }
3813
+ this.previousSeriesStack = this.seriesStack.slice(0);
3814
+ this.seriesStack = arr;
3815
+ for (i=1; i<this.seriesStack.length; i++) {
3816
+ serelem = this.series[i].canvas._elem.detach();
3817
+ shadelem = this.series[i].shadowCanvas._elem.detach();
3818
+ this.series[i-1].shadowCanvas._elem.after(shadelem);
3819
+ this.series[i-1].canvas._elem.after(serelem);
3820
+ }
3821
+ };
3822
+
3823
+ this.activateTheme = function (name) {
3824
+ this.themeEngine.activate(this, name);
3825
+ };
3826
+ }
3827
+
3828
+
3829
+ // conpute a highlight color or array of highlight colors from given colors.
3830
+ $.jqplot.computeHighlightColors = function(colors) {
3831
+ var ret;
3832
+ if ($.isArray(colors)) {
3833
+ ret = [];
3834
+ for (var i=0; i<colors.length; i++){
3835
+ var rgba = $.jqplot.getColorComponents(colors[i]);
3836
+ var newrgb = [rgba[0], rgba[1], rgba[2]];
3837
+ var sum = newrgb[0] + newrgb[1] + newrgb[2];
3838
+ for (var j=0; j<3; j++) {
3839
+ // when darkening, lowest color component can be is 60.
3840
+ newrgb[j] = (sum > 660) ? newrgb[j] * 0.85 : 0.73 * newrgb[j] + 90;
3841
+ newrgb[j] = parseInt(newrgb[j], 10);
3842
+ (newrgb[j] > 255) ? 255 : newrgb[j];
3843
+ }
3844
+ // newrgb[3] = (rgba[3] > 0.4) ? rgba[3] * 0.4 : rgba[3] * 1.5;
3845
+ // newrgb[3] = (rgba[3] > 0.5) ? 0.8 * rgba[3] - .1 : rgba[3] + 0.2;
3846
+ newrgb[3] = 0.3 + 0.35 * rgba[3];
3847
+ ret.push('rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+newrgb[3]+')');
3848
+ }
3849
+ }
3850
+ else {
3851
+ var rgba = $.jqplot.getColorComponents(colors);
3852
+ var newrgb = [rgba[0], rgba[1], rgba[2]];
3853
+ var sum = newrgb[0] + newrgb[1] + newrgb[2];
3854
+ for (var j=0; j<3; j++) {
3855
+ // when darkening, lowest color component can be is 60.
3856
+ // newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
3857
+ // newrgb[j] = parseInt(newrgb[j], 10);
3858
+ newrgb[j] = (sum > 660) ? newrgb[j] * 0.85 : 0.73 * newrgb[j] + 90;
3859
+ newrgb[j] = parseInt(newrgb[j], 10);
3860
+ (newrgb[j] > 255) ? 255 : newrgb[j];
3861
+ }
3862
+ // newrgb[3] = (rgba[3] > 0.4) ? rgba[3] * 0.4 : rgba[3] * 1.5;
3863
+ // newrgb[3] = (rgba[3] > 0.5) ? 0.8 * rgba[3] - .1 : rgba[3] + 0.2;
3864
+ newrgb[3] = 0.3 + 0.35 * rgba[3];
3865
+ ret = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+newrgb[3]+')';
3866
+ }
3867
+ return ret;
3868
+ };
3869
+
3870
+ $.jqplot.ColorGenerator = function(colors) {
3871
+ colors = colors || $.jqplot.config.defaultColors;
3872
+ var idx = 0;
3873
+
3874
+ this.next = function () {
3875
+ if (idx < colors.length) {
3876
+ return colors[idx++];
3877
+ }
3878
+ else {
3879
+ idx = 0;
3880
+ return colors[idx++];
3881
+ }
3882
+ };
3883
+
3884
+ this.previous = function () {
3885
+ if (idx > 0) {
3886
+ return colors[idx--];
3887
+ }
3888
+ else {
3889
+ idx = colors.length-1;
3890
+ return colors[idx];
3891
+ }
3892
+ };
3893
+
3894
+ // get a color by index without advancing pointer.
3895
+ this.get = function(i) {
3896
+ var idx = i - colors.length * Math.floor(i/colors.length);
3897
+ return colors[idx];
3898
+ };
3899
+
3900
+ this.setColors = function(c) {
3901
+ colors = c;
3902
+ };
3903
+
3904
+ this.reset = function() {
3905
+ idx = 0;
3906
+ };
3907
+
3908
+ this.getIndex = function() {
3909
+ return idx;
3910
+ };
3911
+
3912
+ this.setIndex = function(index) {
3913
+ idx = index;
3914
+ };
3915
+ };
3916
+
3917
+ // convert a hex color string to rgb string.
3918
+ // h - 3 or 6 character hex string, with or without leading #
3919
+ // a - optional alpha
3920
+ $.jqplot.hex2rgb = function(h, a) {
3921
+ h = h.replace('#', '');
3922
+ if (h.length == 3) {
3923
+ h = h.charAt(0)+h.charAt(0)+h.charAt(1)+h.charAt(1)+h.charAt(2)+h.charAt(2);
3924
+ }
3925
+ var rgb;
3926
+ rgb = 'rgba('+parseInt(h.slice(0,2), 16)+', '+parseInt(h.slice(2,4), 16)+', '+parseInt(h.slice(4,6), 16);
3927
+ if (a) {
3928
+ rgb += ', '+a;
3929
+ }
3930
+ rgb += ')';
3931
+ return rgb;
3932
+ };
3933
+
3934
+ // convert an rgb color spec to a hex spec. ignore any alpha specification.
3935
+ $.jqplot.rgb2hex = function(s) {
3936
+ var pat = /rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;
3937
+ var m = s.match(pat);
3938
+ var h = '#';
3939
+ for (var i=1; i<4; i++) {
3940
+ var temp;
3941
+ if (m[i].search(/%/) != -1) {
3942
+ temp = parseInt(255*m[i]/100, 10).toString(16);
3943
+ if (temp.length == 1) {
3944
+ temp = '0'+temp;
3945
+ }
3946
+ }
3947
+ else {
3948
+ temp = parseInt(m[i], 10).toString(16);
3949
+ if (temp.length == 1) {
3950
+ temp = '0'+temp;
3951
+ }
3952
+ }
3953
+ h += temp;
3954
+ }
3955
+ return h;
3956
+ };
3957
+
3958
+ // given a css color spec, return an rgb css color spec
3959
+ $.jqplot.normalize2rgb = function(s, a) {
3960
+ if (s.search(/^ *rgba?\(/) != -1) {
3961
+ return s;
3962
+ }
3963
+ else if (s.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/) != -1) {
3964
+ return $.jqplot.hex2rgb(s, a);
3965
+ }
3966
+ else {
3967
+ throw new Error('Invalid color spec');
3968
+ }
3969
+ };
3970
+
3971
+ // extract the r, g, b, a color components out of a css color spec.
3972
+ $.jqplot.getColorComponents = function(s) {
3973
+ // check to see if a color keyword.
3974
+ s = $.jqplot.colorKeywordMap[s] || s;
3975
+ var rgb = $.jqplot.normalize2rgb(s);
3976
+ var pat = /rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;
3977
+ var m = rgb.match(pat);
3978
+ var ret = [];
3979
+ for (var i=1; i<4; i++) {
3980
+ if (m[i].search(/%/) != -1) {
3981
+ ret[i-1] = parseInt(255*m[i]/100, 10);
3982
+ }
3983
+ else {
3984
+ ret[i-1] = parseInt(m[i], 10);
3985
+ }
3986
+ }
3987
+ ret[3] = parseFloat(m[4]) ? parseFloat(m[4]) : 1.0;
3988
+ return ret;
3989
+ };
3990
+
3991
+ $.jqplot.colorKeywordMap = {
3992
+ aliceblue: 'rgb(240, 248, 255)',
3993
+ antiquewhite: 'rgb(250, 235, 215)',
3994
+ aqua: 'rgb( 0, 255, 255)',
3995
+ aquamarine: 'rgb(127, 255, 212)',
3996
+ azure: 'rgb(240, 255, 255)',
3997
+ beige: 'rgb(245, 245, 220)',
3998
+ bisque: 'rgb(255, 228, 196)',
3999
+ black: 'rgb( 0, 0, 0)',
4000
+ blanchedalmond: 'rgb(255, 235, 205)',
4001
+ blue: 'rgb( 0, 0, 255)',
4002
+ blueviolet: 'rgb(138, 43, 226)',
4003
+ brown: 'rgb(165, 42, 42)',
4004
+ burlywood: 'rgb(222, 184, 135)',
4005
+ cadetblue: 'rgb( 95, 158, 160)',
4006
+ chartreuse: 'rgb(127, 255, 0)',
4007
+ chocolate: 'rgb(210, 105, 30)',
4008
+ coral: 'rgb(255, 127, 80)',
4009
+ cornflowerblue: 'rgb(100, 149, 237)',
4010
+ cornsilk: 'rgb(255, 248, 220)',
4011
+ crimson: 'rgb(220, 20, 60)',
4012
+ cyan: 'rgb( 0, 255, 255)',
4013
+ darkblue: 'rgb( 0, 0, 139)',
4014
+ darkcyan: 'rgb( 0, 139, 139)',
4015
+ darkgoldenrod: 'rgb(184, 134, 11)',
4016
+ darkgray: 'rgb(169, 169, 169)',
4017
+ darkgreen: 'rgb( 0, 100, 0)',
4018
+ darkgrey: 'rgb(169, 169, 169)',
4019
+ darkkhaki: 'rgb(189, 183, 107)',
4020
+ darkmagenta: 'rgb(139, 0, 139)',
4021
+ darkolivegreen: 'rgb( 85, 107, 47)',
4022
+ darkorange: 'rgb(255, 140, 0)',
4023
+ darkorchid: 'rgb(153, 50, 204)',
4024
+ darkred: 'rgb(139, 0, 0)',
4025
+ darksalmon: 'rgb(233, 150, 122)',
4026
+ darkseagreen: 'rgb(143, 188, 143)',
4027
+ darkslateblue: 'rgb( 72, 61, 139)',
4028
+ darkslategray: 'rgb( 47, 79, 79)',
4029
+ darkslategrey: 'rgb( 47, 79, 79)',
4030
+ darkturquoise: 'rgb( 0, 206, 209)',
4031
+ darkviolet: 'rgb(148, 0, 211)',
4032
+ deeppink: 'rgb(255, 20, 147)',
4033
+ deepskyblue: 'rgb( 0, 191, 255)',
4034
+ dimgray: 'rgb(105, 105, 105)',
4035
+ dimgrey: 'rgb(105, 105, 105)',
4036
+ dodgerblue: 'rgb( 30, 144, 255)',
4037
+ firebrick: 'rgb(178, 34, 34)',
4038
+ floralwhite: 'rgb(255, 250, 240)',
4039
+ forestgreen: 'rgb( 34, 139, 34)',
4040
+ fuchsia: 'rgb(255, 0, 255)',
4041
+ gainsboro: 'rgb(220, 220, 220)',
4042
+ ghostwhite: 'rgb(248, 248, 255)',
4043
+ gold: 'rgb(255, 215, 0)',
4044
+ goldenrod: 'rgb(218, 165, 32)',
4045
+ gray: 'rgb(128, 128, 128)',
4046
+ grey: 'rgb(128, 128, 128)',
4047
+ green: 'rgb( 0, 128, 0)',
4048
+ greenyellow: 'rgb(173, 255, 47)',
4049
+ honeydew: 'rgb(240, 255, 240)',
4050
+ hotpink: 'rgb(255, 105, 180)',
4051
+ indianred: 'rgb(205, 92, 92)',
4052
+ indigo: 'rgb( 75, 0, 130)',
4053
+ ivory: 'rgb(255, 255, 240)',
4054
+ khaki: 'rgb(240, 230, 140)',
4055
+ lavender: 'rgb(230, 230, 250)',
4056
+ lavenderblush: 'rgb(255, 240, 245)',
4057
+ lawngreen: 'rgb(124, 252, 0)',
4058
+ lemonchiffon: 'rgb(255, 250, 205)',
4059
+ lightblue: 'rgb(173, 216, 230)',
4060
+ lightcoral: 'rgb(240, 128, 128)',
4061
+ lightcyan: 'rgb(224, 255, 255)',
4062
+ lightgoldenrodyellow: 'rgb(250, 250, 210)',
4063
+ lightgray: 'rgb(211, 211, 211)',
4064
+ lightgreen: 'rgb(144, 238, 144)',
4065
+ lightgrey: 'rgb(211, 211, 211)',
4066
+ lightpink: 'rgb(255, 182, 193)',
4067
+ lightsalmon: 'rgb(255, 160, 122)',
4068
+ lightseagreen: 'rgb( 32, 178, 170)',
4069
+ lightskyblue: 'rgb(135, 206, 250)',
4070
+ lightslategray: 'rgb(119, 136, 153)',
4071
+ lightslategrey: 'rgb(119, 136, 153)',
4072
+ lightsteelblue: 'rgb(176, 196, 222)',
4073
+ lightyellow: 'rgb(255, 255, 224)',
4074
+ lime: 'rgb( 0, 255, 0)',
4075
+ limegreen: 'rgb( 50, 205, 50)',
4076
+ linen: 'rgb(250, 240, 230)',
4077
+ magenta: 'rgb(255, 0, 255)',
4078
+ maroon: 'rgb(128, 0, 0)',
4079
+ mediumaquamarine: 'rgb(102, 205, 170)',
4080
+ mediumblue: 'rgb( 0, 0, 205)',
4081
+ mediumorchid: 'rgb(186, 85, 211)',
4082
+ mediumpurple: 'rgb(147, 112, 219)',
4083
+ mediumseagreen: 'rgb( 60, 179, 113)',
4084
+ mediumslateblue: 'rgb(123, 104, 238)',
4085
+ mediumspringgreen: 'rgb( 0, 250, 154)',
4086
+ mediumturquoise: 'rgb( 72, 209, 204)',
4087
+ mediumvioletred: 'rgb(199, 21, 133)',
4088
+ midnightblue: 'rgb( 25, 25, 112)',
4089
+ mintcream: 'rgb(245, 255, 250)',
4090
+ mistyrose: 'rgb(255, 228, 225)',
4091
+ moccasin: 'rgb(255, 228, 181)',
4092
+ navajowhite: 'rgb(255, 222, 173)',
4093
+ navy: 'rgb( 0, 0, 128)',
4094
+ oldlace: 'rgb(253, 245, 230)',
4095
+ olive: 'rgb(128, 128, 0)',
4096
+ olivedrab: 'rgb(107, 142, 35)',
4097
+ orange: 'rgb(255, 165, 0)',
4098
+ orangered: 'rgb(255, 69, 0)',
4099
+ orchid: 'rgb(218, 112, 214)',
4100
+ palegoldenrod: 'rgb(238, 232, 170)',
4101
+ palegreen: 'rgb(152, 251, 152)',
4102
+ paleturquoise: 'rgb(175, 238, 238)',
4103
+ palevioletred: 'rgb(219, 112, 147)',
4104
+ papayawhip: 'rgb(255, 239, 213)',
4105
+ peachpuff: 'rgb(255, 218, 185)',
4106
+ peru: 'rgb(205, 133, 63)',
4107
+ pink: 'rgb(255, 192, 203)',
4108
+ plum: 'rgb(221, 160, 221)',
4109
+ powderblue: 'rgb(176, 224, 230)',
4110
+ purple: 'rgb(128, 0, 128)',
4111
+ red: 'rgb(255, 0, 0)',
4112
+ rosybrown: 'rgb(188, 143, 143)',
4113
+ royalblue: 'rgb( 65, 105, 225)',
4114
+ saddlebrown: 'rgb(139, 69, 19)',
4115
+ salmon: 'rgb(250, 128, 114)',
4116
+ sandybrown: 'rgb(244, 164, 96)',
4117
+ seagreen: 'rgb( 46, 139, 87)',
4118
+ seashell: 'rgb(255, 245, 238)',
4119
+ sienna: 'rgb(160, 82, 45)',
4120
+ silver: 'rgb(192, 192, 192)',
4121
+ skyblue: 'rgb(135, 206, 235)',
4122
+ slateblue: 'rgb(106, 90, 205)',
4123
+ slategray: 'rgb(112, 128, 144)',
4124
+ slategrey: 'rgb(112, 128, 144)',
4125
+ snow: 'rgb(255, 250, 250)',
4126
+ springgreen: 'rgb( 0, 255, 127)',
4127
+ steelblue: 'rgb( 70, 130, 180)',
4128
+ tan: 'rgb(210, 180, 140)',
4129
+ teal: 'rgb( 0, 128, 128)',
4130
+ thistle: 'rgb(216, 191, 216)',
4131
+ tomato: 'rgb(255, 99, 71)',
4132
+ turquoise: 'rgb( 64, 224, 208)',
4133
+ violet: 'rgb(238, 130, 238)',
4134
+ wheat: 'rgb(245, 222, 179)',
4135
+ white: 'rgb(255, 255, 255)',
4136
+ whitesmoke: 'rgb(245, 245, 245)',
4137
+ yellow: 'rgb(255, 255, 0)',
4138
+ yellowgreen: 'rgb(154, 205, 50)'
4139
+ };
4140
+
4141
+
4142
+
4143
+
4144
+ // class: $.jqplot.AxisLabelRenderer
4145
+ // Renderer to place labels on the axes.
4146
+ $.jqplot.AxisLabelRenderer = function(options) {
4147
+ // Group: Properties
4148
+ $.jqplot.ElemContainer.call(this);
4149
+ // name of the axis associated with this tick
4150
+ this.axis;
4151
+ // prop: show
4152
+ // whether or not to show the tick (mark and label).
4153
+ this.show = true;
4154
+ // prop: label
4155
+ // The text or html for the label.
4156
+ this.label = '';
4157
+ this.fontFamily = null;
4158
+ this.fontSize = null;
4159
+ this.textColor = null;
4160
+ this._elem;
4161
+ // prop: escapeHTML
4162
+ // true to escape HTML entities in the label.
4163
+ this.escapeHTML = false;
4164
+
4165
+ $.extend(true, this, options);
4166
+ };
4167
+
4168
+ $.jqplot.AxisLabelRenderer.prototype = new $.jqplot.ElemContainer();
4169
+ $.jqplot.AxisLabelRenderer.prototype.constructor = $.jqplot.AxisLabelRenderer;
4170
+
4171
+ $.jqplot.AxisLabelRenderer.prototype.init = function(options) {
4172
+ $.extend(true, this, options);
4173
+ };
4174
+
4175
+ $.jqplot.AxisLabelRenderer.prototype.draw = function(ctx, plot) {
4176
+ // Memory Leaks patch
4177
+ if (this._elem) {
4178
+ this._elem.emptyForce();
4179
+ this._elem = null;
4180
+ }
4181
+
4182
+ this._elem = $('<div style="position:absolute;" class="jqplot-'+this.axis+'-label"></div>');
4183
+
4184
+ if (Number(this.label)) {
4185
+ this._elem.css('white-space', 'nowrap');
4186
+ }
4187
+
4188
+ if (!this.escapeHTML) {
4189
+ this._elem.html(this.label);
4190
+ }
4191
+ else {
4192
+ this._elem.text(this.label);
4193
+ }
4194
+ if (this.fontFamily) {
4195
+ this._elem.css('font-family', this.fontFamily);
4196
+ }
4197
+ if (this.fontSize) {
4198
+ this._elem.css('font-size', this.fontSize);
4199
+ }
4200
+ if (this.textColor) {
4201
+ this._elem.css('color', this.textColor);
4202
+ }
4203
+
4204
+ return this._elem;
4205
+ };
4206
+
4207
+ $.jqplot.AxisLabelRenderer.prototype.pack = function() {
4208
+ };
4209
+
4210
+ // class: $.jqplot.AxisTickRenderer
4211
+ // A "tick" object showing the value of a tick/gridline on the plot.
4212
+ $.jqplot.AxisTickRenderer = function(options) {
4213
+ // Group: Properties
4214
+ $.jqplot.ElemContainer.call(this);
4215
+ // prop: mark
4216
+ // tick mark on the axis. One of 'inside', 'outside', 'cross', '' or null.
4217
+ this.mark = 'outside';
4218
+ // name of the axis associated with this tick
4219
+ this.axis;
4220
+ // prop: showMark
4221
+ // whether or not to show the mark on the axis.
4222
+ this.showMark = true;
4223
+ // prop: showGridline
4224
+ // whether or not to draw the gridline on the grid at this tick.
4225
+ this.showGridline = true;
4226
+ // prop: isMinorTick
4227
+ // if this is a minor tick.
4228
+ this.isMinorTick = false;
4229
+ // prop: size
4230
+ // Length of the tick beyond the grid in pixels.
4231
+ // DEPRECATED: This has been superceeded by markSize
4232
+ this.size = 4;
4233
+ // prop: markSize
4234
+ // Length of the tick marks in pixels. For 'cross' style, length
4235
+ // will be stoked above and below axis, so total length will be twice this.
4236
+ this.markSize = 6;
4237
+ // prop: show
4238
+ // whether or not to show the tick (mark and label).
4239
+ // Setting this to false requires more testing. It is recommended
4240
+ // to set showLabel and showMark to false instead.
4241
+ this.show = true;
4242
+ // prop: showLabel
4243
+ // whether or not to show the label.
4244
+ this.showLabel = true;
4245
+ this.label = null;
4246
+ this.value = null;
4247
+ this._styles = {};
4248
+ // prop: formatter
4249
+ // A class of a formatter for the tick text. sprintf by default.
4250
+ this.formatter = $.jqplot.DefaultTickFormatter;
4251
+ // prop: prefix
4252
+ // String to prepend to the tick label.
4253
+ // Prefix is prepended to the formatted tick label.
4254
+ this.prefix = '';
4255
+ // prop: suffix
4256
+ // String to append to the tick label.
4257
+ // Suffix is appended to the formatted tick label.
4258
+ this.suffix = '';
4259
+ // prop: formatString
4260
+ // string passed to the formatter.
4261
+ this.formatString = '';
4262
+ // prop: fontFamily
4263
+ // css spec for the font-family css attribute.
4264
+ this.fontFamily;
4265
+ // prop: fontSize
4266
+ // css spec for the font-size css attribute.
4267
+ this.fontSize;
4268
+ // prop: textColor
4269
+ // css spec for the color attribute.
4270
+ this.textColor;
4271
+ // prop: escapeHTML
4272
+ // true to escape HTML entities in the label.
4273
+ this.escapeHTML = false;
4274
+ this._elem;
4275
+ this._breakTick = false;
4276
+
4277
+ $.extend(true, this, options);
4278
+ };
4279
+
4280
+ $.jqplot.AxisTickRenderer.prototype.init = function(options) {
4281
+ $.extend(true, this, options);
4282
+ };
4283
+
4284
+ $.jqplot.AxisTickRenderer.prototype = new $.jqplot.ElemContainer();
4285
+ $.jqplot.AxisTickRenderer.prototype.constructor = $.jqplot.AxisTickRenderer;
4286
+
4287
+ $.jqplot.AxisTickRenderer.prototype.setTick = function(value, axisName, isMinor) {
4288
+ this.value = value;
4289
+ this.axis = axisName;
4290
+ if (isMinor) {
4291
+ this.isMinorTick = true;
4292
+ }
4293
+ return this;
4294
+ };
4295
+
4296
+ $.jqplot.AxisTickRenderer.prototype.draw = function() {
4297
+ if (this.label === null) {
4298
+ this.label = this.prefix + this.formatter(this.formatString, this.value) + this.suffix;
4299
+ }
4300
+ var style = {position: 'absolute'};
4301
+ if (Number(this.label)) {
4302
+ style['whitSpace'] = 'nowrap';
4303
+ }
4304
+
4305
+ // Memory Leaks patch
4306
+ if (this._elem) {
4307
+ this._elem.emptyForce();
4308
+ this._elem = null;
4309
+ }
4310
+
4311
+ this._elem = $(document.createElement('div'));
4312
+ this._elem.addClass("jqplot-"+this.axis+"-tick");
4313
+
4314
+ if (!this.escapeHTML) {
4315
+ this._elem.html(this.label);
4316
+ }
4317
+ else {
4318
+ this._elem.text(this.label);
4319
+ }
4320
+
4321
+ this._elem.css(style);
4322
+
4323
+ for (var s in this._styles) {
4324
+ this._elem.css(s, this._styles[s]);
4325
+ }
4326
+ if (this.fontFamily) {
4327
+ this._elem.css('font-family', this.fontFamily);
4328
+ }
4329
+ if (this.fontSize) {
4330
+ this._elem.css('font-size', this.fontSize);
4331
+ }
4332
+ if (this.textColor) {
4333
+ this._elem.css('color', this.textColor);
4334
+ }
4335
+ if (this._breakTick) {
4336
+ this._elem.addClass('jqplot-breakTick');
4337
+ }
4338
+
4339
+ return this._elem;
4340
+ };
4341
+
4342
+ $.jqplot.DefaultTickFormatter = function (format, val) {
4343
+ if (typeof val == 'number') {
4344
+ if (!format) {
4345
+ format = $.jqplot.config.defaultTickFormatString;
4346
+ }
4347
+ return $.jqplot.sprintf(format, val);
4348
+ }
4349
+ else {
4350
+ return String(val);
4351
+ }
4352
+ };
4353
+
4354
+ $.jqplot.PercentTickFormatter = function (format, val) {
4355
+ if (typeof val == 'number') {
4356
+ val = 100 * val;
4357
+ if (!format) {
4358
+ format = $.jqplot.config.defaultTickFormatString;
4359
+ }
4360
+ return $.jqplot.sprintf(format, val);
4361
+ }
4362
+ else {
4363
+ return String(val);
4364
+ }
4365
+ };
4366
+
4367
+ $.jqplot.AxisTickRenderer.prototype.pack = function() {
4368
+ };
4369
+
4370
+ // Class: $.jqplot.CanvasGridRenderer
4371
+ // The default jqPlot grid renderer, creating a grid on a canvas element.
4372
+ // The renderer has no additional options beyond the <Grid> class.
4373
+ $.jqplot.CanvasGridRenderer = function(){
4374
+ this.shadowRenderer = new $.jqplot.ShadowRenderer();
4375
+ };
4376
+
4377
+ // called with context of Grid object
4378
+ $.jqplot.CanvasGridRenderer.prototype.init = function(options) {
4379
+ this._ctx;
4380
+ $.extend(true, this, options);
4381
+ // set the shadow renderer options
4382
+ 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};
4383
+ this.renderer.shadowRenderer.init(sopts);
4384
+ };
4385
+
4386
+ // called with context of Grid.
4387
+ $.jqplot.CanvasGridRenderer.prototype.createElement = function(plot) {
4388
+ var elem;
4389
+ // Memory Leaks patch
4390
+ if (this._elem) {
4391
+ if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
4392
+ elem = this._elem.get(0);
4393
+ window.G_vmlCanvasManager.uninitElement(elem);
4394
+ elem = null;
4395
+ }
4396
+
4397
+ this._elem.emptyForce();
4398
+ this._elem = null;
4399
+ }
4400
+
4401
+ elem = plot.canvasManager.getCanvas();
4402
+
4403
+ var w = this._plotDimensions.width;
4404
+ var h = this._plotDimensions.height;
4405
+ elem.width = w;
4406
+ elem.height = h;
4407
+ this._elem = $(elem);
4408
+ this._elem.addClass('jqplot-grid-canvas');
4409
+ this._elem.css({ position: 'absolute', left: 0, top: 0 });
4410
+
4411
+ elem = plot.canvasManager.initCanvas(elem);
4412
+
4413
+ this._top = this._offsets.top;
4414
+ this._bottom = h - this._offsets.bottom;
4415
+ this._left = this._offsets.left;
4416
+ this._right = w - this._offsets.right;
4417
+ this._width = this._right - this._left;
4418
+ this._height = this._bottom - this._top;
4419
+ // avoid memory leak
4420
+ elem = null;
4421
+ return this._elem;
4422
+ };
4423
+
4424
+ $.jqplot.CanvasGridRenderer.prototype.draw = function() {
4425
+ this._ctx = this._elem.get(0).getContext("2d");
4426
+ var ctx = this._ctx;
4427
+ var axes = this._axes;
4428
+ // Add the grid onto the grid canvas. This is the bottom most layer.
4429
+ ctx.save();
4430
+ ctx.clearRect(0, 0, this._plotDimensions.width, this._plotDimensions.height);
4431
+ ctx.fillStyle = this.backgroundColor || this.background;
4432
+ ctx.fillRect(this._left, this._top, this._width, this._height);
4433
+
4434
+ ctx.save();
4435
+ ctx.lineJoin = 'miter';
4436
+ ctx.lineCap = 'butt';
4437
+ ctx.lineWidth = this.gridLineWidth;
4438
+ ctx.strokeStyle = this.gridLineColor;
4439
+ var b, e, s, m;
4440
+ var ax = ['xaxis', 'yaxis', 'x2axis', 'y2axis'];
4441
+ for (var i=4; i>0; i--) {
4442
+ var name = ax[i-1];
4443
+ var axis = axes[name];
4444
+ var ticks = axis._ticks;
4445
+ var numticks = ticks.length;
4446
+ if (axis.show) {
4447
+ if (axis.drawBaseline) {
4448
+ var bopts = {};
4449
+ if (axis.baselineWidth !== null) {
4450
+ bopts.lineWidth = axis.baselineWidth;
4451
+ }
4452
+ if (axis.baselineColor !== null) {
4453
+ bopts.strokeStyle = axis.baselineColor;
4454
+ }
4455
+ switch (name) {
4456
+ case 'xaxis':
4457
+ drawLine (this._left, this._bottom, this._right, this._bottom, bopts);
4458
+ break;
4459
+ case 'yaxis':
4460
+ drawLine (this._left, this._bottom, this._left, this._top, bopts);
4461
+ break;
4462
+ case 'x2axis':
4463
+ drawLine (this._left, this._bottom, this._right, this._bottom, bopts);
4464
+ break;
4465
+ case 'y2axis':
4466
+ drawLine (this._right, this._bottom, this._right, this._top, bopts);
4467
+ break;
4468
+ }
4469
+ }
4470
+ for (var j=numticks; j>0; j--) {
4471
+ var t = ticks[j-1];
4472
+ if (t.show) {
4473
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
4474
+ switch (name) {
4475
+ case 'xaxis':
4476
+ // draw the grid line if we should
4477
+ if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) {
4478
+ drawLine(pos, this._top, pos, this._bottom);
4479
+ }
4480
+ // draw the mark
4481
+ if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) {
4482
+ s = t.markSize;
4483
+ m = t.mark;
4484
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
4485
+ switch (m) {
4486
+ case 'outside':
4487
+ b = this._bottom;
4488
+ e = this._bottom+s;
4489
+ break;
4490
+ case 'inside':
4491
+ b = this._bottom-s;
4492
+ e = this._bottom;
4493
+ break;
4494
+ case 'cross':
4495
+ b = this._bottom-s;
4496
+ e = this._bottom+s;
4497
+ break;
4498
+ default:
4499
+ b = this._bottom;
4500
+ e = this._bottom+s;
4501
+ break;
4502
+ }
4503
+ // draw the shadow
4504
+ if (this.shadow) {
4505
+ 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});
4506
+ }
4507
+ // draw the line
4508
+ drawLine(pos, b, pos, e);
4509
+ }
4510
+ break;
4511
+ case 'yaxis':
4512
+ // draw the grid line
4513
+ if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) {
4514
+ drawLine(this._right, pos, this._left, pos);
4515
+ }
4516
+ // draw the mark
4517
+ if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) {
4518
+ s = t.markSize;
4519
+ m = t.mark;
4520
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
4521
+ switch (m) {
4522
+ case 'outside':
4523
+ b = this._left-s;
4524
+ e = this._left;
4525
+ break;
4526
+ case 'inside':
4527
+ b = this._left;
4528
+ e = this._left+s;
4529
+ break;
4530
+ case 'cross':
4531
+ b = this._left-s;
4532
+ e = this._left+s;
4533
+ break;
4534
+ default:
4535
+ b = this._left-s;
4536
+ e = this._left;
4537
+ break;
4538
+ }
4539
+ // draw the shadow
4540
+ if (this.shadow) {
4541
+ 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});
4542
+ }
4543
+ drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
4544
+ }
4545
+ break;
4546
+ case 'x2axis':
4547
+ // draw the grid line
4548
+ if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) {
4549
+ drawLine(pos, this._bottom, pos, this._top);
4550
+ }
4551
+ // draw the mark
4552
+ if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) {
4553
+ s = t.markSize;
4554
+ m = t.mark;
4555
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
4556
+ switch (m) {
4557
+ case 'outside':
4558
+ b = this._top-s;
4559
+ e = this._top;
4560
+ break;
4561
+ case 'inside':
4562
+ b = this._top;
4563
+ e = this._top+s;
4564
+ break;
4565
+ case 'cross':
4566
+ b = this._top-s;
4567
+ e = this._top+s;
4568
+ break;
4569
+ default:
4570
+ b = this._top-s;
4571
+ e = this._top;
4572
+ break;
4573
+ }
4574
+ // draw the shadow
4575
+ if (this.shadow) {
4576
+ 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});
4577
+ }
4578
+ drawLine(pos, b, pos, e);
4579
+ }
4580
+ break;
4581
+ case 'y2axis':
4582
+ // draw the grid line
4583
+ if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) {
4584
+ drawLine(this._left, pos, this._right, pos);
4585
+ }
4586
+ // draw the mark
4587
+ if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) {
4588
+ s = t.markSize;
4589
+ m = t.mark;
4590
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
4591
+ switch (m) {
4592
+ case 'outside':
4593
+ b = this._right;
4594
+ e = this._right+s;
4595
+ break;
4596
+ case 'inside':
4597
+ b = this._right-s;
4598
+ e = this._right;
4599
+ break;
4600
+ case 'cross':
4601
+ b = this._right-s;
4602
+ e = this._right+s;
4603
+ break;
4604
+ default:
4605
+ b = this._right;
4606
+ e = this._right+s;
4607
+ break;
4608
+ }
4609
+ // draw the shadow
4610
+ if (this.shadow) {
4611
+ 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});
4612
+ }
4613
+ drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
4614
+ }
4615
+ break;
4616
+ default:
4617
+ break;
4618
+ }
4619
+ }
4620
+ }
4621
+ t = null;
4622
+ }
4623
+ axis = null;
4624
+ ticks = null;
4625
+ }
4626
+ // Now draw grid lines for additional y axes
4627
+ //////
4628
+ // TO DO: handle yMidAxis
4629
+ //////
4630
+ ax = ['y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis', 'yMidAxis'];
4631
+ for (var i=7; i>0; i--) {
4632
+ var axis = axes[ax[i-1]];
4633
+ var ticks = axis._ticks;
4634
+ if (axis.show) {
4635
+ var tn = ticks[axis.numberTicks-1];
4636
+ var t0 = ticks[0];
4637
+ var left = axis.getLeft();
4638
+ var points = [[left, tn.getTop() + tn.getHeight()/2], [left, t0.getTop() + t0.getHeight()/2 + 1.0]];
4639
+ // draw the shadow
4640
+ if (this.shadow) {
4641
+ this.renderer.shadowRenderer.draw(ctx, points, {lineCap:'butt', fill:false, closePath:false});
4642
+ }
4643
+ // draw the line
4644
+ drawLine(points[0][0], points[0][1], points[1][0], points[1][1], {lineCap:'butt', strokeStyle:axis.borderColor, lineWidth:axis.borderWidth});
4645
+ // draw the tick marks
4646
+ for (var j=ticks.length; j>0; j--) {
4647
+ var t = ticks[j-1];
4648
+ s = t.markSize;
4649
+ m = t.mark;
4650
+ var pos = Math.round(axis.u2p(t.value)) + 0.5;
4651
+ if (t.showMark && t.mark) {
4652
+ switch (m) {
4653
+ case 'outside':
4654
+ b = left;
4655
+ e = left+s;
4656
+ break;
4657
+ case 'inside':
4658
+ b = left-s;
4659
+ e = left;
4660
+ break;
4661
+ case 'cross':
4662
+ b = left-s;
4663
+ e = left+s;
4664
+ break;
4665
+ default:
4666
+ b = left;
4667
+ e = left+s;
4668
+ break;
4669
+ }
4670
+ points = [[b,pos], [e,pos]];
4671
+ // draw the shadow
4672
+ if (this.shadow) {
4673
+ this.renderer.shadowRenderer.draw(ctx, points, {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false});
4674
+ }
4675
+ // draw the line
4676
+ drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor});
4677
+ }
4678
+ t = null;
4679
+ }
4680
+ t0 = null;
4681
+ }
4682
+ axis = null;
4683
+ ticks = null;
4684
+ }
4685
+
4686
+ ctx.restore();
4687
+
4688
+ function drawLine(bx, by, ex, ey, opts) {
4689
+ ctx.save();
4690
+ opts = opts || {};
4691
+ if (opts.lineWidth == null || opts.lineWidth != 0){
4692
+ $.extend(true, ctx, opts);
4693
+ ctx.beginPath();
4694
+ ctx.moveTo(bx, by);
4695
+ ctx.lineTo(ex, ey);
4696
+ ctx.stroke();
4697
+ ctx.restore();
4698
+ }
4699
+ }
4700
+
4701
+ if (this.shadow) {
4702
+ var points = [[this._left, this._bottom], [this._right, this._bottom], [this._right, this._top]];
4703
+ this.renderer.shadowRenderer.draw(ctx, points);
4704
+ }
4705
+ // Now draw border around grid. Use axis border definitions. start at
4706
+ // upper left and go clockwise.
4707
+ if (this.borderWidth != 0 && this.drawBorder) {
4708
+ drawLine (this._left, this._top, this._right, this._top, {lineCap:'round', strokeStyle:axes.x2axis.borderColor, lineWidth:axes.x2axis.borderWidth});
4709
+ drawLine (this._right, this._top, this._right, this._bottom, {lineCap:'round', strokeStyle:axes.y2axis.borderColor, lineWidth:axes.y2axis.borderWidth});
4710
+ drawLine (this._right, this._bottom, this._left, this._bottom, {lineCap:'round', strokeStyle:axes.xaxis.borderColor, lineWidth:axes.xaxis.borderWidth});
4711
+ drawLine (this._left, this._bottom, this._left, this._top, {lineCap:'round', strokeStyle:axes.yaxis.borderColor, lineWidth:axes.yaxis.borderWidth});
4712
+ }
4713
+ // ctx.lineWidth = this.borderWidth;
4714
+ // ctx.strokeStyle = this.borderColor;
4715
+ // ctx.strokeRect(this._left, this._top, this._width, this._height);
4716
+
4717
+ ctx.restore();
4718
+ ctx = null;
4719
+ axes = null;
4720
+ };
4721
+
4722
+ // Class: $.jqplot.DivTitleRenderer
4723
+ // The default title renderer for jqPlot. This class has no options beyond the <Title> class.
4724
+ $.jqplot.DivTitleRenderer = function() {
4725
+ };
4726
+
4727
+ $.jqplot.DivTitleRenderer.prototype.init = function(options) {
4728
+ $.extend(true, this, options);
4729
+ };
4730
+
4731
+ $.jqplot.DivTitleRenderer.prototype.draw = function() {
4732
+ // Memory Leaks patch
4733
+ if (this._elem) {
4734
+ this._elem.emptyForce();
4735
+ this._elem = null;
4736
+ }
4737
+
4738
+ var r = this.renderer;
4739
+ var elem = document.createElement('div');
4740
+ this._elem = $(elem);
4741
+ this._elem.addClass('jqplot-title');
4742
+
4743
+ if (!this.text) {
4744
+ this.show = false;
4745
+ this._elem.height(0);
4746
+ this._elem.width(0);
4747
+ }
4748
+ else if (this.text) {
4749
+ var color;
4750
+ if (this.color) {
4751
+ color = this.color;
4752
+ }
4753
+ else if (this.textColor) {
4754
+ color = this.textColor;
4755
+ }
4756
+
4757
+ // don't trust that a stylesheet is present, set the position.
4758
+ var styles = {position:'absolute', top:'0px', left:'0px'};
4759
+
4760
+ if (this._plotWidth) {
4761
+ styles['width'] = this._plotWidth+'px';
4762
+ }
4763
+ if (this.fontSize) {
4764
+ styles['fontSize'] = this.fontSize;
4765
+ }
4766
+ if (typeof this.textAlign === 'string') {
4767
+ styles['textAlign'] = this.textAlign;
4768
+ }
4769
+ else {
4770
+ styles['textAlign'] = 'center';
4771
+ }
4772
+ if (color) {
4773
+ styles['color'] = color;
4774
+ }
4775
+ if (this.paddingBottom) {
4776
+ styles['paddingBottom'] = this.paddingBottom;
4777
+ }
4778
+ if (this.fontFamily) {
4779
+ styles['fontFamily'] = this.fontFamily;
4780
+ }
4781
+
4782
+ this._elem.css(styles);
4783
+ if (this.escapeHtml) {
4784
+ this._elem.text(this.text);
4785
+ }
4786
+ else {
4787
+ this._elem.html(this.text);
4788
+ }
4789
+
4790
+
4791
+ // styletext += (this._plotWidth) ? 'width:'+this._plotWidth+'px;' : '';
4792
+ // styletext += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
4793
+ // styletext += (this.textAlign) ? 'text-align:'+this.textAlign+';' : 'text-align:center;';
4794
+ // styletext += (color) ? 'color:'+color+';' : '';
4795
+ // styletext += (this.paddingBottom) ? 'padding-bottom:'+this.paddingBottom+';' : '';
4796
+ // this._elem = $('<div class="jqplot-title" style="'+styletext+'">'+this.text+'</div>');
4797
+ // if (this.fontFamily) {
4798
+ // this._elem.css('font-family', this.fontFamily);
4799
+ // }
4800
+ }
4801
+
4802
+ elem = null;
4803
+
4804
+ return this._elem;
4805
+ };
4806
+
4807
+ $.jqplot.DivTitleRenderer.prototype.pack = function() {
4808
+ // nothing to do here
4809
+ };
4810
+
4811
+
4812
+ var dotlen = 0.1;
4813
+
4814
+ $.jqplot.LinePattern = function (ctx, pattern) {
4815
+
4816
+ var defaultLinePatterns = {
4817
+ dotted: [ dotlen, $.jqplot.config.dotGapLength ],
4818
+ dashed: [ $.jqplot.config.dashLength, $.jqplot.config.gapLength ],
4819
+ solid: null
4820
+ };
4821
+
4822
+ if (typeof pattern === 'string') {
4823
+ if (pattern[0] === '.' || pattern[0] === '-') {
4824
+ var s = pattern;
4825
+ pattern = [];
4826
+ for (var i=0, imax=s.length; i<imax; i++) {
4827
+ if (s[i] === '.') {
4828
+ pattern.push( dotlen );
4829
+ }
4830
+ else if (s[i] === '-') {
4831
+ pattern.push( $.jqplot.config.dashLength );
4832
+ }
4833
+ else {
4834
+ continue;
4835
+ }
4836
+ pattern.push( $.jqplot.config.gapLength );
4837
+ }
4838
+ }
4839
+ else {
4840
+ pattern = defaultLinePatterns[pattern];
4841
+ }
4842
+ }
4843
+
4844
+ if (!(pattern && pattern.length)) {
4845
+ return ctx;
4846
+ }
4847
+
4848
+ var patternIndex = 0;
4849
+ var patternDistance = pattern[0];
4850
+ var px = 0;
4851
+ var py = 0;
4852
+ var pathx0 = 0;
4853
+ var pathy0 = 0;
4854
+
4855
+ var moveTo = function (x, y) {
4856
+ ctx.moveTo( x, y );
4857
+ px = x;
4858
+ py = y;
4859
+ pathx0 = x;
4860
+ pathy0 = y;
4861
+ };
4862
+
4863
+ var lineTo = function (x, y) {
4864
+ var scale = ctx.lineWidth;
4865
+ var dx = x - px;
4866
+ var dy = y - py;
4867
+ var dist = Math.sqrt(dx*dx+dy*dy);
4868
+ if ((dist > 0) && (scale > 0)) {
4869
+ dx /= dist;
4870
+ dy /= dist;
4871
+ while (true) {
4872
+ var dp = scale * patternDistance;
4873
+ if (dp < dist) {
4874
+ px += dp * dx;
4875
+ py += dp * dy;
4876
+ if ((patternIndex & 1) == 0) {
4877
+ ctx.lineTo( px, py );
4878
+ }
4879
+ else {
4880
+ ctx.moveTo( px, py );
4881
+ }
4882
+ dist -= dp;
4883
+ patternIndex++;
4884
+ if (patternIndex >= pattern.length) {
4885
+ patternIndex = 0;
4886
+ }
4887
+ patternDistance = pattern[patternIndex];
4888
+ }
4889
+ else {
4890
+ px = x;
4891
+ py = y;
4892
+ if ((patternIndex & 1) == 0) {
4893
+ ctx.lineTo( px, py );
4894
+ }
4895
+ else {
4896
+ ctx.moveTo( px, py );
4897
+ }
4898
+ patternDistance -= dist / scale;
4899
+ break;
4900
+ }
4901
+ }
4902
+ }
4903
+ };
4904
+
4905
+ var beginPath = function () {
4906
+ ctx.beginPath();
4907
+ };
4908
+
4909
+ var closePath = function () {
4910
+ lineTo( pathx0, pathy0 );
4911
+ };
4912
+
4913
+ return {
4914
+ moveTo: moveTo,
4915
+ lineTo: lineTo,
4916
+ beginPath: beginPath,
4917
+ closePath: closePath
4918
+ };
4919
+ };
4920
+
4921
+ // Class: $.jqplot.LineRenderer
4922
+ // The default line renderer for jqPlot, this class has no options beyond the <Series> class.
4923
+ // Draws series as a line.
4924
+ $.jqplot.LineRenderer = function(){
4925
+ this.shapeRenderer = new $.jqplot.ShapeRenderer();
4926
+ this.shadowRenderer = new $.jqplot.ShadowRenderer();
4927
+ };
4928
+
4929
+ // called with scope of series.
4930
+ $.jqplot.LineRenderer.prototype.init = function(options, plot) {
4931
+ // Group: Properties
4932
+ //
4933
+ options = options || {};
4934
+ this._type='line';
4935
+ this.renderer.animation = {
4936
+ show: false,
4937
+ direction: 'left',
4938
+ speed: 2500,
4939
+ _supported: true
4940
+ };
4941
+ // prop: smooth
4942
+ // True to draw a smoothed (interpolated) line through the data points
4943
+ // with automatically computed number of smoothing points.
4944
+ // Set to an integer number > 2 to specify number of smoothing points
4945
+ // to use between each data point.
4946
+ this.renderer.smooth = false; // true or a number > 2 for smoothing.
4947
+ this.renderer.tension = null; // null to auto compute or a number typically > 6. Fewer points requires higher tension.
4948
+ // prop: constrainSmoothing
4949
+ // True to use a more accurate smoothing algorithm that will
4950
+ // not overshoot any data points. False to allow overshoot but
4951
+ // produce a smoother looking line.
4952
+ this.renderer.constrainSmoothing = true;
4953
+ // this is smoothed data in grid coordinates, like gridData
4954
+ this.renderer._smoothedData = [];
4955
+ // this is smoothed data in plot units (plot coordinates), like plotData.
4956
+ this.renderer._smoothedPlotData = [];
4957
+ this.renderer._hiBandGridData = [];
4958
+ this.renderer._lowBandGridData = [];
4959
+ this.renderer._hiBandSmoothedData = [];
4960
+ this.renderer._lowBandSmoothedData = [];
4961
+
4962
+ // prop: bandData
4963
+ // Data used to draw error bands or confidence intervals above/below a line.
4964
+ //
4965
+ // bandData can be input in 3 forms. jqPlot will figure out which is the
4966
+ // low band line and which is the high band line for all forms:
4967
+ //
4968
+ // A 2 dimensional array like [[yl1, yl2, ...], [yu1, yu2, ...]] where
4969
+ // [yl1, yl2, ...] are y values of the lower line and
4970
+ // [yu1, yu2, ...] are y values of the upper line.
4971
+ // In this case there must be the same number of y data points as data points
4972
+ // in the series and the bands will inherit the x values of the series.
4973
+ //
4974
+ // A 2 dimensional array like [[[xl1, yl1], [xl2, yl2], ...], [[xh1, yh1], [xh2, yh2], ...]]
4975
+ // where [xl1, yl1] are x,y data points for the lower line and
4976
+ // [xh1, yh1] are x,y data points for the high line.
4977
+ // x values do not have to correspond to the x values of the series and can
4978
+ // be of any arbitrary length.
4979
+ //
4980
+ // Can be of form [[yl1, yu1], [yl2, yu2], [yl3, yu3], ...] where
4981
+ // there must be 3 or more arrays and there must be the same number of arrays
4982
+ // as there are data points in the series. In this case,
4983
+ // [yl1, yu1] specifies the lower and upper y values for the 1st
4984
+ // data point and so on. The bands will inherit the x
4985
+ // values from the series.
4986
+ this.renderer.bandData = [];
4987
+
4988
+ // Group: bands
4989
+ // Banding around line, e.g error bands or confidence intervals.
4990
+ this.renderer.bands = {
4991
+ // prop: show
4992
+ // true to show the bands. If bandData or interval is
4993
+ // supplied, show will be set to true by default.
4994
+ show: false,
4995
+ hiData: [],
4996
+ lowData: [],
4997
+ // prop: color
4998
+ // color of lines at top and bottom of bands [default: series color].
4999
+ color: this.color,
5000
+ // prop: showLines
5001
+ // True to show lines at top and bottom of bands [default: false].
5002
+ showLines: false,
5003
+ // prop: fill
5004
+ // True to fill area between bands [default: true].
5005
+ fill: true,
5006
+ // prop: fillColor
5007
+ // css color spec for filled area. [default: series color].
5008
+ fillColor: null,
5009
+ _min: null,
5010
+ _max: null,
5011
+ // prop: interval
5012
+ // User specified interval above and below line for bands [default: '3%''].
5013
+ // Can be a value like 3 or a string like '3%'
5014
+ // or an upper/lower array like [1, -2] or ['2%', '-1.5%']
5015
+ interval: '3%'
5016
+ };
5017
+
5018
+
5019
+ var lopts = {highlightMouseOver: options.highlightMouseOver, highlightMouseDown: options.highlightMouseDown, highlightColor: options.highlightColor};
5020
+
5021
+ delete (options.highlightMouseOver);
5022
+ delete (options.highlightMouseDown);
5023
+ delete (options.highlightColor);
5024
+
5025
+ $.extend(true, this.renderer, options);
5026
+
5027
+ this.renderer.options = options;
5028
+
5029
+ // if we are given some band data, and bands aren't explicity set to false in options, turn them on.
5030
+ if (this.renderer.bandData.length > 1 && (!options.bands || options.bands.show == null)) {
5031
+ this.renderer.bands.show = true;
5032
+ }
5033
+
5034
+ // if we are given an interval, and bands aren't explicity set to false in options, turn them on.
5035
+ else if (options.bands && options.bands.show == null && options.bands.interval != null) {
5036
+ this.renderer.bands.show = true;
5037
+ }
5038
+
5039
+ // if plot is filled, turn off bands.
5040
+ if (this.fill) {
5041
+ this.renderer.bands.show = false;
5042
+ }
5043
+
5044
+ if (this.renderer.bands.show) {
5045
+ this.renderer.initBands.call(this, this.renderer.options, plot);
5046
+ }
5047
+
5048
+
5049
+ // smoothing is not compatible with stacked lines, disable
5050
+ if (this._stack) {
5051
+ this.renderer.smooth = false;
5052
+ }
5053
+
5054
+ // set the shape renderer options
5055
+ 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};
5056
+ this.renderer.shapeRenderer.init(opts);
5057
+
5058
+ var shadow_offset = options.shadowOffset;
5059
+ // set the shadow renderer options
5060
+ if (shadow_offset == null) {
5061
+ // scale the shadowOffset to the width of the line.
5062
+ if (this.lineWidth > 2.5) {
5063
+ shadow_offset = 1.25 * (1 + (Math.atan((this.lineWidth/2.5))/0.785398163 - 1)*0.6);
5064
+ // var shadow_offset = this.shadowOffset;
5065
+ }
5066
+ // for skinny lines, don't make such a big shadow.
5067
+ else {
5068
+ shadow_offset = 1.25 * Math.atan((this.lineWidth/2.5))/0.785398163;
5069
+ }
5070
+ }
5071
+
5072
+ 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};
5073
+ this.renderer.shadowRenderer.init(sopts);
5074
+ this._areaPoints = [];
5075
+ this._boundingBox = [[],[]];
5076
+
5077
+ if (!this.isTrendline && this.fill || this.renderer.bands.show) {
5078
+ // Group: Properties
5079
+ //
5080
+ // prop: highlightMouseOver
5081
+ // True to highlight area on a filled plot when moused over.
5082
+ // This must be false to enable highlightMouseDown to highlight when clicking on an area on a filled plot.
5083
+ this.highlightMouseOver = true;
5084
+ // prop: highlightMouseDown
5085
+ // True to highlight when a mouse button is pressed over an area on a filled plot.
5086
+ // This will be disabled if highlightMouseOver is true.
5087
+ this.highlightMouseDown = false;
5088
+ // prop: highlightColor
5089
+ // color to use when highlighting an area on a filled plot.
5090
+ this.highlightColor = null;
5091
+ // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
5092
+ if (lopts.highlightMouseDown && lopts.highlightMouseOver == null) {
5093
+ lopts.highlightMouseOver = false;
5094
+ }
5095
+
5096
+ $.extend(true, this, {highlightMouseOver: lopts.highlightMouseOver, highlightMouseDown: lopts.highlightMouseDown, highlightColor: lopts.highlightColor});
5097
+
5098
+ if (!this.highlightColor) {
5099
+ var fc = (this.renderer.bands.show) ? this.renderer.bands.fillColor : this.fillColor;
5100
+ this.highlightColor = $.jqplot.computeHighlightColors(fc);
5101
+ }
5102
+ // turn off (disable) the highlighter plugin
5103
+ if (this.highlighter) {
5104
+ this.highlighter.show = false;
5105
+ }
5106
+ }
5107
+
5108
+ if (!this.isTrendline && plot) {
5109
+ plot.plugins.lineRenderer = {};
5110
+ plot.postInitHooks.addOnce(postInit);
5111
+ plot.postDrawHooks.addOnce(postPlotDraw);
5112
+ plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
5113
+ plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
5114
+ plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
5115
+ plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
5116
+ plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
5117
+ }
5118
+
5119
+ };
5120
+
5121
+ $.jqplot.LineRenderer.prototype.initBands = function(options, plot) {
5122
+ // use bandData if no data specified in bands option
5123
+ //var bd = this.renderer.bandData;
5124
+ var bd = options.bandData || [];
5125
+ var bands = this.renderer.bands;
5126
+ bands.hiData = [];
5127
+ bands.lowData = [];
5128
+ var data = this.data;
5129
+ bands._max = null;
5130
+ bands._min = null;
5131
+ // If 2 arrays, and each array greater than 2 elements, assume it is hi and low data bands of y values.
5132
+ if (bd.length == 2) {
5133
+ // Do we have an array of x,y values?
5134
+ // like [[[1,1], [2,4], [3,3]], [[1,3], [2,6], [3,5]]]
5135
+ if ($.isArray(bd[0][0])) {
5136
+ // since an arbitrary array of points, spin through all of them to determine max and min lines.
5137
+
5138
+ var p;
5139
+ var bdminidx = 0, bdmaxidx = 0;
5140
+ for (var i = 0, l = bd[0].length; i<l; i++) {
5141
+ p = bd[0][i];
5142
+ if ((p[1] != null && p[1] > bands._max) || bands._max == null) {
5143
+ bands._max = p[1];
5144
+ }
5145
+ if ((p[1] != null && p[1] < bands._min) || bands._min == null) {
5146
+ bands._min = p[1];
5147
+ }
5148
+ }
5149
+ for (var i = 0, l = bd[1].length; i<l; i++) {
5150
+ p = bd[1][i];
5151
+ if ((p[1] != null && p[1] > bands._max) || bands._max == null) {
5152
+ bands._max = p[1];
5153
+ bdmaxidx = 1;
5154
+ }
5155
+ if ((p[1] != null && p[1] < bands._min) || bands._min == null) {
5156
+ bands._min = p[1];
5157
+ bdminidx = 1;
5158
+ }
5159
+ }
5160
+
5161
+ if (bdmaxidx === bdminidx) {
5162
+ bands.show = false;
5163
+ }
5164
+
5165
+ bands.hiData = bd[bdmaxidx];
5166
+ bands.lowData = bd[bdminidx];
5167
+ }
5168
+ // else data is arrays of y values
5169
+ // like [[1,4,3], [3,6,5]]
5170
+ // must have same number of band data points as points in series
5171
+ else if (bd[0].length === data.length && bd[1].length === data.length) {
5172
+ var hi = (bd[0][0] > bd[1][0]) ? 0 : 1;
5173
+ var low = (hi) ? 0 : 1;
5174
+ for (var i=0, l=data.length; i < l; i++) {
5175
+ bands.hiData.push([data[i][0], bd[hi][i]]);
5176
+ bands.lowData.push([data[i][0], bd[low][i]]);
5177
+ }
5178
+ }
5179
+
5180
+ // we don't have proper data array, don't show bands.
5181
+ else {
5182
+ bands.show = false;
5183
+ }
5184
+ }
5185
+
5186
+ // if more than 2 arrays, have arrays of [ylow, yhi] values.
5187
+ // note, can't distinguish case of [[ylow, yhi], [ylow, yhi]] from [[ylow, ylow], [yhi, yhi]]
5188
+ // this is assumed to be of the latter form.
5189
+ else if (bd.length > 2 && !$.isArray(bd[0][0])) {
5190
+ var hi = (bd[0][0] > bd[0][1]) ? 0 : 1;
5191
+ var low = (hi) ? 0 : 1;
5192
+ for (var i=0, l=bd.length; i<l; i++) {
5193
+ bands.hiData.push([data[i][0], bd[i][hi]]);
5194
+ bands.lowData.push([data[i][0], bd[i][low]]);
5195
+ }
5196
+ }
5197
+
5198
+ // don't have proper data, auto calculate
5199
+ else {
5200
+ var intrv = bands.interval;
5201
+ var a = null;
5202
+ var b = null;
5203
+ var afunc = null;
5204
+ var bfunc = null;
5205
+
5206
+ if ($.isArray(intrv)) {
5207
+ a = intrv[0];
5208
+ b = intrv[1];
5209
+ }
5210
+ else {
5211
+ a = intrv;
5212
+ }
5213
+
5214
+ if (isNaN(a)) {
5215
+ // we have a string
5216
+ if (a.charAt(a.length - 1) === '%') {
5217
+ afunc = 'multiply';
5218
+ a = parseFloat(a)/100 + 1;
5219
+ }
5220
+ }
5221
+
5222
+ else {
5223
+ a = parseFloat(a);
5224
+ afunc = 'add';
5225
+ }
5226
+
5227
+ if (b !== null && isNaN(b)) {
5228
+ // we have a string
5229
+ if (b.charAt(b.length - 1) === '%') {
5230
+ bfunc = 'multiply';
5231
+ b = parseFloat(b)/100 + 1;
5232
+ }
5233
+ }
5234
+
5235
+ else if (b !== null) {
5236
+ b = parseFloat(b);
5237
+ bfunc = 'add';
5238
+ }
5239
+
5240
+ if (a !== null) {
5241
+ if (b === null) {
5242
+ b = -a;
5243
+ bfunc = afunc;
5244
+ if (bfunc === 'multiply') {
5245
+ b += 2;
5246
+ }
5247
+ }
5248
+
5249
+ // make sure a always applies to hi band.
5250
+ if (a < b) {
5251
+ var temp = a;
5252
+ a = b;
5253
+ b = temp;
5254
+ temp = afunc;
5255
+ afunc = bfunc;
5256
+ bfunc = temp;
5257
+ }
5258
+
5259
+ for (var i=0, l = data.length; i < l; i++) {
5260
+ switch (afunc) {
5261
+ case 'add':
5262
+ bands.hiData.push([data[i][0], data[i][1] + a]);
5263
+ break;
5264
+ case 'multiply':
5265
+ bands.hiData.push([data[i][0], data[i][1] * a]);
5266
+ break;
5267
+ }
5268
+ switch (bfunc) {
5269
+ case 'add':
5270
+ bands.lowData.push([data[i][0], data[i][1] + b]);
5271
+ break;
5272
+ case 'multiply':
5273
+ bands.lowData.push([data[i][0], data[i][1] * b]);
5274
+ break;
5275
+ }
5276
+ }
5277
+ }
5278
+
5279
+ else {
5280
+ bands.show = false;
5281
+ }
5282
+ }
5283
+
5284
+ var hd = bands.hiData;
5285
+ var ld = bands.lowData;
5286
+ for (var i = 0, l = hd.length; i<l; i++) {
5287
+ if ((hd[i][1] != null && hd[i][1] > bands._max) || bands._max == null) {
5288
+ bands._max = hd[i][1];
5289
+ }
5290
+ }
5291
+ for (var i = 0, l = ld.length; i<l; i++) {
5292
+ if ((ld[i][1] != null && ld[i][1] < bands._min) || bands._min == null) {
5293
+ bands._min = ld[i][1];
5294
+ }
5295
+ }
5296
+
5297
+ // one last check for proper data
5298
+ // these don't apply any more since allowing arbitrary x,y values
5299
+ // if (bands.hiData.length != bands.lowData.length) {
5300
+ // bands.show = false;
5301
+ // }
5302
+
5303
+ // if (bands.hiData.length != this.data.length) {
5304
+ // bands.show = false;
5305
+ // }
5306
+
5307
+ if (bands.fillColor === null) {
5308
+ var c = $.jqplot.getColorComponents(bands.color);
5309
+ // now adjust alpha to differentiate fill
5310
+ c[3] = c[3] * 0.5;
5311
+ bands.fillColor = 'rgba(' + c[0] +', '+ c[1] +', '+ c[2] +', '+ c[3] + ')';
5312
+ }
5313
+ };
5314
+
5315
+ function getSteps (d, f) {
5316
+ return (3.4182054+f) * Math.pow(d, -0.3534992);
5317
+ }
5318
+
5319
+ function computeSteps (d1, d2) {
5320
+ var s = Math.sqrt(Math.pow((d2[0]- d1[0]), 2) + Math.pow ((d2[1] - d1[1]), 2));
5321
+ return 5.7648 * Math.log(s) + 7.4456;
5322
+ }
5323
+
5324
+ function tanh (x) {
5325
+ var a = (Math.exp(2*x) - 1) / (Math.exp(2*x) + 1);
5326
+ return a;
5327
+ }
5328
+
5329
+ //////////
5330
+ // computeConstrainedSmoothedData
5331
+ // An implementation of the constrained cubic spline interpolation
5332
+ // method as presented in:
5333
+ //
5334
+ // Kruger, CJC, Constrained Cubic Spine Interpolation for Chemical Engineering Applications
5335
+ // http://www.korf.co.uk/spline.pdf
5336
+ //
5337
+ // The implementation below borrows heavily from the sample Visual Basic
5338
+ // implementation by CJC Kruger found in http://www.korf.co.uk/spline.xls
5339
+ //
5340
+ /////////
5341
+
5342
+ // called with scope of series
5343
+ function computeConstrainedSmoothedData (gd) {
5344
+ var smooth = this.renderer.smooth;
5345
+ var dim = this.canvas.getWidth();
5346
+ var xp = this._xaxis.series_p2u;
5347
+ var yp = this._yaxis.series_p2u;
5348
+ var steps =null;
5349
+ var _steps = null;
5350
+ var dist = gd.length/dim;
5351
+ var _smoothedData = [];
5352
+ var _smoothedPlotData = [];
5353
+
5354
+ if (!isNaN(parseFloat(smooth))) {
5355
+ steps = parseFloat(smooth);
5356
+ }
5357
+ else {
5358
+ steps = getSteps(dist, 0.5);
5359
+ }
5360
+
5361
+ var yy = [];
5362
+ var xx = [];
5363
+
5364
+ for (var i=0, l = gd.length; i<l; i++) {
5365
+ yy.push(gd[i][1]);
5366
+ xx.push(gd[i][0]);
5367
+ }
5368
+
5369
+ function dxx(x1, x0) {
5370
+ if (x1 - x0 == 0) {
5371
+ return Math.pow(10,10);
5372
+ }
5373
+ else {
5374
+ return x1 - x0;
5375
+ }
5376
+ }
5377
+
5378
+ var A, B, C, D;
5379
+ // loop through each line segment. Have # points - 1 line segments. Nmber segments starting at 1.
5380
+ var nmax = gd.length - 1;
5381
+ for (var num = 1, gdl = gd.length; num<gdl; num++) {
5382
+ var gxx = [];
5383
+ var ggxx = [];
5384
+ // point at each end of segment.
5385
+ for (var j = 0; j < 2; j++) {
5386
+ var i = num - 1 + j; // point number, 0 to # points.
5387
+
5388
+ if (i == 0 || i == nmax) {
5389
+ gxx[j] = Math.pow(10, 10);
5390
+ }
5391
+ else if (yy[i+1] - yy[i] == 0 || yy[i] - yy[i-1] == 0) {
5392
+ gxx[j] = 0;
5393
+ }
5394
+ else if (((xx[i+1] - xx[i]) / (yy[i+1] - yy[i]) + (xx[i] - xx[i-1]) / (yy[i] - yy[i-1])) == 0 ) {
5395
+ gxx[j] = 0;
5396
+ }
5397
+ else if ( (yy[i+1] - yy[i]) * (yy[i] - yy[i-1]) < 0 ) {
5398
+ gxx[j] = 0;
5399
+ }
5400
+
5401
+ else {
5402
+ 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]));
5403
+ }
5404
+ }
5405
+
5406
+ // Reset first derivative (slope) at first and last point
5407
+ if (num == 1) {
5408
+ // First point has 0 2nd derivative
5409
+ gxx[0] = 3 / 2 * (yy[1] - yy[0]) / dxx(xx[1], xx[0]) - gxx[1] / 2;
5410
+ }
5411
+ else if (num == nmax) {
5412
+ // Last point has 0 2nd derivative
5413
+ gxx[1] = 3 / 2 * (yy[nmax] - yy[nmax - 1]) / dxx(xx[nmax], xx[nmax - 1]) - gxx[0] / 2;
5414
+ }
5415
+
5416
+ // Calc second derivative at points
5417
+ 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);
5418
+ 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);
5419
+
5420
+ // Calc constants for cubic interpolation
5421
+ D = 1 / 6 * (ggxx[1] - ggxx[0]) / dxx(xx[num], xx[num - 1]);
5422
+ C = 1 / 2 * (xx[num] * ggxx[0] - xx[num - 1] * ggxx[1]) / dxx(xx[num], xx[num - 1]);
5423
+ 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]);
5424
+ A = yy[num - 1] - B * xx[num - 1] - C * Math.pow(xx[num - 1], 2) - D * Math.pow(xx[num - 1], 3);
5425
+
5426
+ var increment = (xx[num] - xx[num - 1]) / steps;
5427
+ var temp, tempx;
5428
+
5429
+ for (var j = 0, l = steps; j < l; j++) {
5430
+ temp = [];
5431
+ tempx = xx[num - 1] + j * increment;
5432
+ temp.push(tempx);
5433
+ temp.push(A + B * tempx + C * Math.pow(tempx, 2) + D * Math.pow(tempx, 3));
5434
+ _smoothedData.push(temp);
5435
+ _smoothedPlotData.push([xp(temp[0]), yp(temp[1])]);
5436
+ }
5437
+ }
5438
+
5439
+ _smoothedData.push(gd[i]);
5440
+ _smoothedPlotData.push([xp(gd[i][0]), yp(gd[i][1])]);
5441
+
5442
+ return [_smoothedData, _smoothedPlotData];
5443
+ }
5444
+
5445
+ ///////
5446
+ // computeHermiteSmoothedData
5447
+ // A hermite spline smoothing of the plot data.
5448
+ // This implementation is derived from the one posted
5449
+ // by krypin on the jqplot-users mailing list:
5450
+ //
5451
+ // http://groups.google.com/group/jqplot-users/browse_thread/thread/748be6a445723cea?pli=1
5452
+ //
5453
+ // with a blog post:
5454
+ //
5455
+ // http://blog.statscollector.com/a-plugin-renderer-for-jqplot-to-draw-a-hermite-spline/
5456
+ //
5457
+ // and download of the original plugin:
5458
+ //
5459
+ // http://blog.statscollector.com/wp-content/uploads/2010/02/jqplot.hermiteSplineRenderer.js
5460
+ //////////
5461
+
5462
+ // called with scope of series
5463
+ function computeHermiteSmoothedData (gd) {
5464
+ var smooth = this.renderer.smooth;
5465
+ var tension = this.renderer.tension;
5466
+ var dim = this.canvas.getWidth();
5467
+ var xp = this._xaxis.series_p2u;
5468
+ var yp = this._yaxis.series_p2u;
5469
+ var steps =null;
5470
+ var _steps = null;
5471
+ var a = null;
5472
+ var a1 = null;
5473
+ var a2 = null;
5474
+ var slope = null;
5475
+ var slope2 = null;
5476
+ var temp = null;
5477
+ var t, s, h1, h2, h3, h4;
5478
+ var TiX, TiY, Ti1X, Ti1Y;
5479
+ var pX, pY, p;
5480
+ var sd = [];
5481
+ var spd = [];
5482
+ var dist = gd.length/dim;
5483
+ var min, max, stretch, scale, shift;
5484
+ var _smoothedData = [];
5485
+ var _smoothedPlotData = [];
5486
+ if (!isNaN(parseFloat(smooth))) {
5487
+ steps = parseFloat(smooth);
5488
+ }
5489
+ else {
5490
+ steps = getSteps(dist, 0.5);
5491
+ }
5492
+ if (!isNaN(parseFloat(tension))) {
5493
+ tension = parseFloat(tension);
5494
+ }
5495
+
5496
+ for (var i=0, l = gd.length-1; i < l; i++) {
5497
+
5498
+ if (tension === null) {
5499
+ slope = Math.abs((gd[i+1][1] - gd[i][1]) / (gd[i+1][0] - gd[i][0]));
5500
+
5501
+ min = 0.3;
5502
+ max = 0.6;
5503
+ stretch = (max - min)/2.0;
5504
+ scale = 2.5;
5505
+ shift = -1.4;
5506
+
5507
+ temp = slope/scale + shift;
5508
+
5509
+ a1 = stretch * tanh(temp) - stretch * tanh(shift) + min;
5510
+
5511
+ // if have both left and right line segments, will use minimum tension.
5512
+ if (i > 0) {
5513
+ slope2 = Math.abs((gd[i][1] - gd[i-1][1]) / (gd[i][0] - gd[i-1][0]));
5514
+ }
5515
+ temp = slope2/scale + shift;
5516
+
5517
+ a2 = stretch * tanh(temp) - stretch * tanh(shift) + min;
5518
+
5519
+ a = (a1 + a2)/2.0;
5520
+
5521
+ }
5522
+ else {
5523
+ a = tension;
5524
+ }
5525
+ for (t=0; t < steps; t++) {
5526
+ s = t / steps;
5527
+ h1 = (1 + 2*s)*Math.pow((1-s),2);
5528
+ h2 = s*Math.pow((1-s),2);
5529
+ h3 = Math.pow(s,2)*(3-2*s);
5530
+ h4 = Math.pow(s,2)*(s-1);
5531
+
5532
+ if (gd[i-1]) {
5533
+ TiX = a * (gd[i+1][0] - gd[i-1][0]);
5534
+ TiY = a * (gd[i+1][1] - gd[i-1][1]);
5535
+ } else {
5536
+ TiX = a * (gd[i+1][0] - gd[i][0]);
5537
+ TiY = a * (gd[i+1][1] - gd[i][1]);
5538
+ }
5539
+ if (gd[i+2]) {
5540
+ Ti1X = a * (gd[i+2][0] - gd[i][0]);
5541
+ Ti1Y = a * (gd[i+2][1] - gd[i][1]);
5542
+ } else {
5543
+ Ti1X = a * (gd[i+1][0] - gd[i][0]);
5544
+ Ti1Y = a * (gd[i+1][1] - gd[i][1]);
5545
+ }
5546
+
5547
+ pX = h1*gd[i][0] + h3*gd[i+1][0] + h2*TiX + h4*Ti1X;
5548
+ pY = h1*gd[i][1] + h3*gd[i+1][1] + h2*TiY + h4*Ti1Y;
5549
+ p = [pX, pY];
5550
+
5551
+ _smoothedData.push(p);
5552
+ _smoothedPlotData.push([xp(pX), yp(pY)]);
5553
+ }
5554
+ }
5555
+ _smoothedData.push(gd[l]);
5556
+ _smoothedPlotData.push([xp(gd[l][0]), yp(gd[l][1])]);
5557
+
5558
+ return [_smoothedData, _smoothedPlotData];
5559
+ }
5560
+
5561
+ // setGridData
5562
+ // converts the user data values to grid coordinates and stores them
5563
+ // in the gridData array.
5564
+ // Called with scope of a series.
5565
+ $.jqplot.LineRenderer.prototype.setGridData = function(plot) {
5566
+ // recalculate the grid data
5567
+ var xp = this._xaxis.series_u2p;
5568
+ var yp = this._yaxis.series_u2p;
5569
+ var data = this._plotData;
5570
+ var pdata = this._prevPlotData;
5571
+ this.gridData = [];
5572
+ this._prevGridData = [];
5573
+ this.renderer._smoothedData = [];
5574
+ this.renderer._smoothedPlotData = [];
5575
+ this.renderer._hiBandGridData = [];
5576
+ this.renderer._lowBandGridData = [];
5577
+ this.renderer._hiBandSmoothedData = [];
5578
+ this.renderer._lowBandSmoothedData = [];
5579
+ var bands = this.renderer.bands;
5580
+ var hasNull = false;
5581
+ for (var i=0, l=data.length; i < l; i++) {
5582
+ // if not a line series or if no nulls in data, push the converted point onto the array.
5583
+ if (data[i][0] != null && data[i][1] != null) {
5584
+ this.gridData.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1])]);
5585
+ }
5586
+ // else if there is a null, preserve it.
5587
+ else if (data[i][0] == null) {
5588
+ hasNull = true;
5589
+ this.gridData.push([null, yp.call(this._yaxis, data[i][1])]);
5590
+ }
5591
+ else if (data[i][1] == null) {
5592
+ hasNull = true;
5593
+ this.gridData.push([xp.call(this._xaxis, data[i][0]), null]);
5594
+ }
5595
+ // if not a line series or if no nulls in data, push the converted point onto the array.
5596
+ if (pdata[i] != null && pdata[i][0] != null && pdata[i][1] != null) {
5597
+ this._prevGridData.push([xp.call(this._xaxis, pdata[i][0]), yp.call(this._yaxis, pdata[i][1])]);
5598
+ }
5599
+ // else if there is a null, preserve it.
5600
+ else if (pdata[i] != null && pdata[i][0] == null) {
5601
+ this._prevGridData.push([null, yp.call(this._yaxis, pdata[i][1])]);
5602
+ }
5603
+ else if (pdata[i] != null && pdata[i][0] != null && pdata[i][1] == null) {
5604
+ this._prevGridData.push([xp.call(this._xaxis, pdata[i][0]), null]);
5605
+ }
5606
+ }
5607
+
5608
+ // don't do smoothing or bands on broken lines.
5609
+ if (hasNull) {
5610
+ this.renderer.smooth = false;
5611
+ if (this._type === 'line') {
5612
+ bands.show = false;
5613
+ }
5614
+ }
5615
+
5616
+ if (this._type === 'line' && bands.show) {
5617
+ for (var i=0, l=bands.hiData.length; i<l; i++) {
5618
+ this.renderer._hiBandGridData.push([xp.call(this._xaxis, bands.hiData[i][0]), yp.call(this._yaxis, bands.hiData[i][1])]);
5619
+ }
5620
+ for (var i=0, l=bands.lowData.length; i<l; i++) {
5621
+ this.renderer._lowBandGridData.push([xp.call(this._xaxis, bands.lowData[i][0]), yp.call(this._yaxis, bands.lowData[i][1])]);
5622
+ }
5623
+ }
5624
+
5625
+ // calculate smoothed data if enough points and no nulls
5626
+ if (this._type === 'line' && this.renderer.smooth && this.gridData.length > 2) {
5627
+ var ret;
5628
+ if (this.renderer.constrainSmoothing) {
5629
+ ret = computeConstrainedSmoothedData.call(this, this.gridData);
5630
+ this.renderer._smoothedData = ret[0];
5631
+ this.renderer._smoothedPlotData = ret[1];
5632
+
5633
+ if (bands.show) {
5634
+ ret = computeConstrainedSmoothedData.call(this, this.renderer._hiBandGridData);
5635
+ this.renderer._hiBandSmoothedData = ret[0];
5636
+ ret = computeConstrainedSmoothedData.call(this, this.renderer._lowBandGridData);
5637
+ this.renderer._lowBandSmoothedData = ret[0];
5638
+ }
5639
+
5640
+ ret = null;
5641
+ }
5642
+ else {
5643
+ ret = computeHermiteSmoothedData.call(this, this.gridData);
5644
+ this.renderer._smoothedData = ret[0];
5645
+ this.renderer._smoothedPlotData = ret[1];
5646
+
5647
+ if (bands.show) {
5648
+ ret = computeHermiteSmoothedData.call(this, this.renderer._hiBandGridData);
5649
+ this.renderer._hiBandSmoothedData = ret[0];
5650
+ ret = computeHermiteSmoothedData.call(this, this.renderer._lowBandGridData);
5651
+ this.renderer._lowBandSmoothedData = ret[0];
5652
+ }
5653
+
5654
+ ret = null;
5655
+ }
5656
+ }
5657
+ };
5658
+
5659
+ // makeGridData
5660
+ // converts any arbitrary data values to grid coordinates and
5661
+ // returns them. This method exists so that plugins can use a series'
5662
+ // linerenderer to generate grid data points without overwriting the
5663
+ // grid data associated with that series.
5664
+ // Called with scope of a series.
5665
+ $.jqplot.LineRenderer.prototype.makeGridData = function(data, plot) {
5666
+ // recalculate the grid data
5667
+ var xp = this._xaxis.series_u2p;
5668
+ var yp = this._yaxis.series_u2p;
5669
+ var gd = [];
5670
+ var pgd = [];
5671
+ this.renderer._smoothedData = [];
5672
+ this.renderer._smoothedPlotData = [];
5673
+ this.renderer._hiBandGridData = [];
5674
+ this.renderer._lowBandGridData = [];
5675
+ this.renderer._hiBandSmoothedData = [];
5676
+ this.renderer._lowBandSmoothedData = [];
5677
+ var bands = this.renderer.bands;
5678
+ var hasNull = false;
5679
+ for (var i=0; i<data.length; i++) {
5680
+ // if not a line series or if no nulls in data, push the converted point onto the array.
5681
+ if (data[i][0] != null && data[i][1] != null) {
5682
+ if (this.step && i>0) {
5683
+ gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i-1][1])]);
5684
+ }
5685
+ gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1])]);
5686
+ }
5687
+ // else if there is a null, preserve it.
5688
+ else if (data[i][0] == null) {
5689
+ hasNull = true;
5690
+ gd.push([null, yp.call(this._yaxis, data[i][1])]);
5691
+ }
5692
+ else if (data[i][1] == null) {
5693
+ hasNull = true;
5694
+ gd.push([xp.call(this._xaxis, data[i][0]), null]);
5695
+ }
5696
+ }
5697
+
5698
+ // don't do smoothing or bands on broken lines.
5699
+ if (hasNull) {
5700
+ this.renderer.smooth = false;
5701
+ if (this._type === 'line') {
5702
+ bands.show = false;
5703
+ }
5704
+ }
5705
+
5706
+ if (this._type === 'line' && bands.show) {
5707
+ for (var i=0, l=bands.hiData.length; i<l; i++) {
5708
+ this.renderer._hiBandGridData.push([xp.call(this._xaxis, bands.hiData[i][0]), yp.call(this._yaxis, bands.hiData[i][1])]);
5709
+ }
5710
+ for (var i=0, l=bands.lowData.length; i<l; i++) {
5711
+ this.renderer._lowBandGridData.push([xp.call(this._xaxis, bands.lowData[i][0]), yp.call(this._yaxis, bands.lowData[i][1])]);
5712
+ }
5713
+ }
5714
+
5715
+ if (this._type === 'line' && this.renderer.smooth && gd.length > 2) {
5716
+ var ret;
5717
+ if (this.renderer.constrainSmoothing) {
5718
+ ret = computeConstrainedSmoothedData.call(this, gd);
5719
+ this.renderer._smoothedData = ret[0];
5720
+ this.renderer._smoothedPlotData = ret[1];
5721
+
5722
+ if (bands.show) {
5723
+ ret = computeConstrainedSmoothedData.call(this, this.renderer._hiBandGridData);
5724
+ this.renderer._hiBandSmoothedData = ret[0];
5725
+ ret = computeConstrainedSmoothedData.call(this, this.renderer._lowBandGridData);
5726
+ this.renderer._lowBandSmoothedData = ret[0];
5727
+ }
5728
+
5729
+ ret = null;
5730
+ }
5731
+ else {
5732
+ ret = computeHermiteSmoothedData.call(this, gd);
5733
+ this.renderer._smoothedData = ret[0];
5734
+ this.renderer._smoothedPlotData = ret[1];
5735
+
5736
+ if (bands.show) {
5737
+ ret = computeHermiteSmoothedData.call(this, this.renderer._hiBandGridData);
5738
+ this.renderer._hiBandSmoothedData = ret[0];
5739
+ ret = computeHermiteSmoothedData.call(this, this.renderer._lowBandGridData);
5740
+ this.renderer._lowBandSmoothedData = ret[0];
5741
+ }
5742
+
5743
+ ret = null;
5744
+ }
5745
+ }
5746
+ return gd;
5747
+ };
5748
+
5749
+
5750
+ // called within scope of series.
5751
+ $.jqplot.LineRenderer.prototype.draw = function(ctx, gd, options, plot) {
5752
+ var i;
5753
+ // get a copy of the options, so we don't modify the original object.
5754
+ var opts = $.extend(true, {}, options);
5755
+ var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
5756
+ var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
5757
+ var fill = (opts.fill != undefined) ? opts.fill : this.fill;
5758
+ var fillAndStroke = (opts.fillAndStroke != undefined) ? opts.fillAndStroke : this.fillAndStroke;
5759
+ var xmin, ymin, xmax, ymax;
5760
+ ctx.save();
5761
+ if (gd.length) {
5762
+ if (showLine) {
5763
+ // if we fill, we'll have to add points to close the curve.
5764
+ if (fill) {
5765
+ if (this.fillToZero) {
5766
+ // have to break line up into shapes at axis crossings
5767
+ var negativeColor = this.negativeColor;
5768
+ if (! this.useNegativeColors) {
5769
+ negativeColor = opts.fillStyle;
5770
+ }
5771
+ var isnegative = false;
5772
+ var posfs = opts.fillStyle;
5773
+
5774
+ // if stoking line as well as filling, get a copy of line data.
5775
+ if (fillAndStroke) {
5776
+ var fasgd = gd.slice(0);
5777
+ }
5778
+ // if not stacked, fill down to axis
5779
+ if (this.index == 0 || !this._stack) {
5780
+
5781
+ var tempgd = [];
5782
+ var pd = (this.renderer.smooth) ? this.renderer._smoothedPlotData : this._plotData;
5783
+ this._areaPoints = [];
5784
+ var pyzero = this._yaxis.series_u2p(this.fillToValue);
5785
+ var pxzero = this._xaxis.series_u2p(this.fillToValue);
5786
+
5787
+ opts.closePath = true;
5788
+
5789
+ if (this.fillAxis == 'y') {
5790
+ tempgd.push([gd[0][0], pyzero]);
5791
+ this._areaPoints.push([gd[0][0], pyzero]);
5792
+
5793
+ for (var i=0; i<gd.length-1; i++) {
5794
+ tempgd.push(gd[i]);
5795
+ this._areaPoints.push(gd[i]);
5796
+ // do we have an axis crossing?
5797
+ if (pd[i][1] * pd[i+1][1] <= 0) {
5798
+ if (pd[i][1] < 0) {
5799
+ isnegative = true;
5800
+ opts.fillStyle = negativeColor;
5801
+ }
5802
+ else {
5803
+ isnegative = false;
5804
+ opts.fillStyle = posfs;
5805
+ }
5806
+
5807
+ var xintercept = gd[i][0] + (gd[i+1][0] - gd[i][0]) * (pyzero-gd[i][1])/(gd[i+1][1] - gd[i][1]);
5808
+ tempgd.push([xintercept, pyzero]);
5809
+ this._areaPoints.push([xintercept, pyzero]);
5810
+ // now draw this shape and shadow.
5811
+ if (shadow) {
5812
+ this.renderer.shadowRenderer.draw(ctx, tempgd, opts);
5813
+ }
5814
+ this.renderer.shapeRenderer.draw(ctx, tempgd, opts);
5815
+ // now empty temp array and continue
5816
+ tempgd = [[xintercept, pyzero]];
5817
+ // this._areaPoints = [[xintercept, pyzero]];
5818
+ }
5819
+ }
5820
+ if (pd[gd.length-1][1] < 0) {
5821
+ isnegative = true;
5822
+ opts.fillStyle = negativeColor;
5823
+ }
5824
+ else {
5825
+ isnegative = false;
5826
+ opts.fillStyle = posfs;
5827
+ }
5828
+ tempgd.push(gd[gd.length-1]);
5829
+ this._areaPoints.push(gd[gd.length-1]);
5830
+ tempgd.push([gd[gd.length-1][0], pyzero]);
5831
+ this._areaPoints.push([gd[gd.length-1][0], pyzero]);
5832
+ }
5833
+ // now draw the last area.
5834
+ if (shadow) {
5835
+ this.renderer.shadowRenderer.draw(ctx, tempgd, opts);
5836
+ }
5837
+ this.renderer.shapeRenderer.draw(ctx, tempgd, opts);
5838
+
5839
+
5840
+ // var gridymin = this._yaxis.series_u2p(0);
5841
+ // // IE doesn't return new length on unshift
5842
+ // gd.unshift([gd[0][0], gridymin]);
5843
+ // len = gd.length;
5844
+ // gd.push([gd[len - 1][0], gridymin]);
5845
+ }
5846
+ // if stacked, fill to line below
5847
+ else {
5848
+ var prev = this._prevGridData;
5849
+ for (var i=prev.length; i>0; i--) {
5850
+ gd.push(prev[i-1]);
5851
+ // this._areaPoints.push(prev[i-1]);
5852
+ }
5853
+ if (shadow) {
5854
+ this.renderer.shadowRenderer.draw(ctx, gd, opts);
5855
+ }
5856
+ this._areaPoints = gd;
5857
+ this.renderer.shapeRenderer.draw(ctx, gd, opts);
5858
+ }
5859
+ }
5860
+ /////////////////////////
5861
+ // Not filled to zero
5862
+ ////////////////////////
5863
+ else {
5864
+ // if stoking line as well as filling, get a copy of line data.
5865
+ if (fillAndStroke) {
5866
+ var fasgd = gd.slice(0);
5867
+ }
5868
+ // if not stacked, fill down to axis
5869
+ if (this.index == 0 || !this._stack) {
5870
+ // var gridymin = this._yaxis.series_u2p(this._yaxis.min) - this.gridBorderWidth / 2;
5871
+ var gridymin = ctx.canvas.height;
5872
+ // IE doesn't return new length on unshift
5873
+ gd.unshift([gd[0][0], gridymin]);
5874
+ var len = gd.length;
5875
+ gd.push([gd[len - 1][0], gridymin]);
5876
+ }
5877
+ // if stacked, fill to line below
5878
+ else {
5879
+ var prev = this._prevGridData;
5880
+ for (var i=prev.length; i>0; i--) {
5881
+ gd.push(prev[i-1]);
5882
+ }
5883
+ }
5884
+ this._areaPoints = gd;
5885
+
5886
+ if (shadow) {
5887
+ this.renderer.shadowRenderer.draw(ctx, gd, opts);
5888
+ }
5889
+
5890
+ this.renderer.shapeRenderer.draw(ctx, gd, opts);
5891
+ }
5892
+ if (fillAndStroke) {
5893
+ var fasopts = $.extend(true, {}, opts, {fill:false, closePath:false});
5894
+ this.renderer.shapeRenderer.draw(ctx, fasgd, fasopts);
5895
+ //////////
5896
+ // TODO: figure out some way to do shadows nicely
5897
+ // if (shadow) {
5898
+ // this.renderer.shadowRenderer.draw(ctx, fasgd, fasopts);
5899
+ // }
5900
+ // now draw the markers
5901
+ if (this.markerRenderer.show) {
5902
+ if (this.renderer.smooth) {
5903
+ fasgd = this.gridData;
5904
+ }
5905
+ for (i=0; i<fasgd.length; i++) {
5906
+ this.markerRenderer.draw(fasgd[i][0], fasgd[i][1], ctx, opts.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
+ if (gd[i][0] != null && gd[i][1] != null) {
5977
+ this.markerRenderer.draw(gd[i][0], gd[i][1], ctx, opts.markerOptions);
5978
+ }
5979
+ }
5980
+ }
5981
+ }
5982
+
5983
+ ctx.restore();
5984
+ };
5985
+
5986
+ $.jqplot.LineRenderer.prototype.drawShadow = function(ctx, gd, options) {
5987
+ // This is a no-op, shadows drawn with lines.
5988
+ };
5989
+
5990
+ // called with scope of plot.
5991
+ // make sure to not leave anything highlighted.
5992
+ function postInit(target, data, options) {
5993
+ for (var i=0; i<this.series.length; i++) {
5994
+ if (this.series[i].renderer.constructor == $.jqplot.LineRenderer) {
5995
+ // don't allow mouseover and mousedown at same time.
5996
+ if (this.series[i].highlightMouseOver) {
5997
+ this.series[i].highlightMouseDown = false;
5998
+ }
5999
+ }
6000
+ }
6001
+ }
6002
+
6003
+ // called within context of plot
6004
+ // create a canvas which we can draw on.
6005
+ // insert it before the eventCanvas, so eventCanvas will still capture events.
6006
+ function postPlotDraw() {
6007
+ // Memory Leaks patch
6008
+ if (this.plugins.lineRenderer && this.plugins.lineRenderer.highlightCanvas) {
6009
+ this.plugins.lineRenderer.highlightCanvas.resetCanvas();
6010
+ this.plugins.lineRenderer.highlightCanvas = null;
6011
+ }
6012
+
6013
+ this.plugins.lineRenderer.highlightedSeriesIndex = null;
6014
+ this.plugins.lineRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
6015
+
6016
+ this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-lineRenderer-highlight-canvas', this._plotDimensions, this));
6017
+ this.plugins.lineRenderer.highlightCanvas.setContext();
6018
+ this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
6019
+ }
6020
+
6021
+ function highlight (plot, sidx, pidx, points) {
6022
+ var s = plot.series[sidx];
6023
+ var canvas = plot.plugins.lineRenderer.highlightCanvas;
6024
+ canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
6025
+ s._highlightedPoint = pidx;
6026
+ plot.plugins.lineRenderer.highlightedSeriesIndex = sidx;
6027
+ var opts = {fillStyle: s.highlightColor};
6028
+ if (s.type === 'line' && s.renderer.bands.show) {
6029
+ opts.fill = true;
6030
+ opts.closePath = true;
6031
+ }
6032
+ s.renderer.shapeRenderer.draw(canvas._ctx, points, opts);
6033
+ canvas = null;
6034
+ }
6035
+
6036
+ function unhighlight (plot) {
6037
+ var canvas = plot.plugins.lineRenderer.highlightCanvas;
6038
+ canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
6039
+ for (var i=0; i<plot.series.length; i++) {
6040
+ plot.series[i]._highlightedPoint = null;
6041
+ }
6042
+ plot.plugins.lineRenderer.highlightedSeriesIndex = null;
6043
+ plot.target.trigger('jqplotDataUnhighlight');
6044
+ canvas = null;
6045
+ }
6046
+
6047
+
6048
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
6049
+ if (neighbor) {
6050
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
6051
+ var evt1 = jQuery.Event('jqplotDataMouseOver');
6052
+ evt1.pageX = ev.pageX;
6053
+ evt1.pageY = ev.pageY;
6054
+ plot.target.trigger(evt1, ins);
6055
+ if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.lineRenderer.highlightedSeriesIndex)) {
6056
+ var evt = jQuery.Event('jqplotDataHighlight');
6057
+ evt.which = ev.which;
6058
+ evt.pageX = ev.pageX;
6059
+ evt.pageY = ev.pageY;
6060
+ plot.target.trigger(evt, ins);
6061
+ highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
6062
+ }
6063
+ }
6064
+ else if (neighbor == null) {
6065
+ unhighlight (plot);
6066
+ }
6067
+ }
6068
+
6069
+ function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
6070
+ if (neighbor) {
6071
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
6072
+ if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.lineRenderer.highlightedSeriesIndex)) {
6073
+ var evt = jQuery.Event('jqplotDataHighlight');
6074
+ evt.which = ev.which;
6075
+ evt.pageX = ev.pageX;
6076
+ evt.pageY = ev.pageY;
6077
+ plot.target.trigger(evt, ins);
6078
+ highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
6079
+ }
6080
+ }
6081
+ else if (neighbor == null) {
6082
+ unhighlight (plot);
6083
+ }
6084
+ }
6085
+
6086
+ function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
6087
+ var idx = plot.plugins.lineRenderer.highlightedSeriesIndex;
6088
+ if (idx != null && plot.series[idx].highlightMouseDown) {
6089
+ unhighlight(plot);
6090
+ }
6091
+ }
6092
+
6093
+ function handleClick(ev, gridpos, datapos, neighbor, plot) {
6094
+ if (neighbor) {
6095
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
6096
+ var evt = jQuery.Event('jqplotDataClick');
6097
+ evt.which = ev.which;
6098
+ evt.pageX = ev.pageX;
6099
+ evt.pageY = ev.pageY;
6100
+ plot.target.trigger(evt, ins);
6101
+ }
6102
+ }
6103
+
6104
+ function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
6105
+ if (neighbor) {
6106
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
6107
+ var idx = plot.plugins.lineRenderer.highlightedSeriesIndex;
6108
+ if (idx != null && plot.series[idx].highlightMouseDown) {
6109
+ unhighlight(plot);
6110
+ }
6111
+ var evt = jQuery.Event('jqplotDataRightClick');
6112
+ evt.which = ev.which;
6113
+ evt.pageX = ev.pageX;
6114
+ evt.pageY = ev.pageY;
6115
+ plot.target.trigger(evt, ins);
6116
+ }
6117
+ }
6118
+
6119
+
6120
+ // class: $.jqplot.LinearAxisRenderer
6121
+ // The default jqPlot axis renderer, creating a numeric axis.
6122
+ $.jqplot.LinearAxisRenderer = function() {
6123
+ };
6124
+
6125
+ // called with scope of axis object.
6126
+ $.jqplot.LinearAxisRenderer.prototype.init = function(options){
6127
+ // prop: breakPoints
6128
+ // EXPERIMENTAL!! Use at your own risk!
6129
+ // Works only with linear axes and the default tick renderer.
6130
+ // Array of [start, stop] points to create a broken axis.
6131
+ // Broken axes have a "jump" in them, which is an immediate
6132
+ // transition from a smaller value to a larger value.
6133
+ // Currently, axis ticks MUST be manually assigned if using breakPoints
6134
+ // by using the axis ticks array option.
6135
+ this.breakPoints = null;
6136
+ // prop: breakTickLabel
6137
+ // Label to use at the axis break if breakPoints are specified.
6138
+ this.breakTickLabel = "&asymp;";
6139
+ // prop: drawBaseline
6140
+ // True to draw the axis baseline.
6141
+ this.drawBaseline = true;
6142
+ // prop: baselineWidth
6143
+ // width of the baseline in pixels.
6144
+ this.baselineWidth = null;
6145
+ // prop: baselineColor
6146
+ // CSS color spec for the baseline.
6147
+ this.baselineColor = null;
6148
+ // prop: forceTickAt0
6149
+ // This will ensure that there is always a tick mark at 0.
6150
+ // If data range is strictly positive or negative,
6151
+ // this will force 0 to be inside the axis bounds unless
6152
+ // the appropriate axis pad (pad, padMin or padMax) is set
6153
+ // to 0, then this will force an axis min or max value at 0.
6154
+ // This has know effect when any of the following options
6155
+ // are set: autoscale, min, max, numberTicks or tickInterval.
6156
+ this.forceTickAt0 = false;
6157
+ // prop: forceTickAt100
6158
+ // This will ensure that there is always a tick mark at 100.
6159
+ // If data range is strictly above or below 100,
6160
+ // this will force 100 to be inside the axis bounds unless
6161
+ // the appropriate axis pad (pad, padMin or padMax) is set
6162
+ // to 0, then this will force an axis min or max value at 100.
6163
+ // This has know effect when any of the following options
6164
+ // are set: autoscale, min, max, numberTicks or tickInterval.
6165
+ this.forceTickAt100 = false;
6166
+ // prop: tickInset
6167
+ // Controls the amount to inset the first and last ticks from
6168
+ // the edges of the grid, in multiples of the tick interval.
6169
+ // 0 is no inset, 0.5 is one half a tick interval, 1 is a full
6170
+ // tick interval, etc.
6171
+ this.tickInset = 0;
6172
+ // prop: minorTicks
6173
+ // Number of ticks to add between "major" ticks.
6174
+ // Major ticks are ticks supplied by user or auto computed.
6175
+ // Minor ticks cannot be created by user.
6176
+ this.minorTicks = 0;
6177
+ // prop: alignTicks
6178
+ // true to align tick marks across opposed axes
6179
+ // such as from the y2axis to yaxis.
6180
+ this.alignTicks = false;
6181
+ this._autoFormatString = '';
6182
+ this._overrideFormatString = false;
6183
+ this._scalefact = 1.0;
6184
+ $.extend(true, this, options);
6185
+ if (this.breakPoints) {
6186
+ if (!$.isArray(this.breakPoints)) {
6187
+ this.breakPoints = null;
6188
+ }
6189
+ else if (this.breakPoints.length < 2 || this.breakPoints[1] <= this.breakPoints[0]) {
6190
+ this.breakPoints = null;
6191
+ }
6192
+ }
6193
+ if (this.numberTicks != null && this.numberTicks < 2) {
6194
+ this.numberTicks = 2;
6195
+ }
6196
+ this.resetDataBounds();
6197
+ };
6198
+
6199
+ // called with scope of axis
6200
+ $.jqplot.LinearAxisRenderer.prototype.draw = function(ctx, plot) {
6201
+ if (this.show) {
6202
+ // populate the axis label and value properties.
6203
+ // createTicks is a method on the renderer, but
6204
+ // call it within the scope of the axis.
6205
+ this.renderer.createTicks.call(this, plot);
6206
+ // fill a div with axes labels in the right direction.
6207
+ // Need to pregenerate each axis to get its bounds and
6208
+ // position it and the labels correctly on the plot.
6209
+ var dim=0;
6210
+ var temp;
6211
+ // Added for theming.
6212
+ if (this._elem) {
6213
+ // Memory Leaks patch
6214
+ //this._elem.empty();
6215
+ this._elem.emptyForce();
6216
+ this._elem = null;
6217
+ }
6218
+
6219
+ this._elem = $(document.createElement('div'));
6220
+ this._elem.addClass('jqplot-axis jqplot-'+this.name);
6221
+ this._elem.css('position', 'absolute');
6222
+
6223
+
6224
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
6225
+ this._elem.width(this._plotDimensions.width);
6226
+ }
6227
+ else {
6228
+ this._elem.height(this._plotDimensions.height);
6229
+ }
6230
+
6231
+ // create a _label object.
6232
+ this.labelOptions.axis = this.name;
6233
+ this._label = new this.labelRenderer(this.labelOptions);
6234
+ if (this._label.show) {
6235
+ var elem = this._label.draw(ctx, plot);
6236
+ elem.appendTo(this._elem);
6237
+ elem = null;
6238
+ }
6239
+
6240
+ var t = this._ticks;
6241
+ var tick;
6242
+ for (var i=0; i<t.length; i++) {
6243
+ tick = t[i];
6244
+ if (tick.show && tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
6245
+ this._elem.append(tick.draw(ctx, plot));
6246
+ }
6247
+ }
6248
+ tick = null;
6249
+ t = null;
6250
+ }
6251
+ return this._elem;
6252
+ };
6253
+
6254
+ // called with scope of an axis
6255
+ $.jqplot.LinearAxisRenderer.prototype.reset = function() {
6256
+ this.min = this._options.min;
6257
+ this.max = this._options.max;
6258
+ this.tickInterval = this._options.tickInterval;
6259
+ this.numberTicks = this._options.numberTicks;
6260
+ this._autoFormatString = '';
6261
+ if (this._overrideFormatString && this.tickOptions && this.tickOptions.formatString) {
6262
+ this.tickOptions.formatString = '';
6263
+ }
6264
+
6265
+ // this._ticks = this.__ticks;
6266
+ };
6267
+
6268
+ // called with scope of axis
6269
+ $.jqplot.LinearAxisRenderer.prototype.set = function() {
6270
+ var dim = 0;
6271
+ var temp;
6272
+ var w = 0;
6273
+ var h = 0;
6274
+ var lshow = (this._label == null) ? false : this._label.show;
6275
+ if (this.show) {
6276
+ var t = this._ticks;
6277
+ var tick;
6278
+ for (var i=0; i<t.length; i++) {
6279
+ tick = t[i];
6280
+ if (!tick._breakTick && tick.show && tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
6281
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
6282
+ temp = tick._elem.outerHeight(true);
6283
+ }
6284
+ else {
6285
+ temp = tick._elem.outerWidth(true);
6286
+ }
6287
+ if (temp > dim) {
6288
+ dim = temp;
6289
+ }
6290
+ }
6291
+ }
6292
+ tick = null;
6293
+ t = null;
6294
+
6295
+ if (lshow) {
6296
+ w = this._label._elem.outerWidth(true);
6297
+ h = this._label._elem.outerHeight(true);
6298
+ }
6299
+ if (this.name == 'xaxis') {
6300
+ dim = dim + h;
6301
+ this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'});
6302
+ }
6303
+ else if (this.name == 'x2axis') {
6304
+ dim = dim + h;
6305
+ this._elem.css({'height':dim+'px', left:'0px', top:'0px'});
6306
+ }
6307
+ else if (this.name == 'yaxis') {
6308
+ dim = dim + w;
6309
+ this._elem.css({'width':dim+'px', left:'0px', top:'0px'});
6310
+ if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
6311
+ this._label._elem.css('width', w+'px');
6312
+ }
6313
+ }
6314
+ else {
6315
+ dim = dim + w;
6316
+ this._elem.css({'width':dim+'px', right:'0px', top:'0px'});
6317
+ if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
6318
+ this._label._elem.css('width', w+'px');
6319
+ }
6320
+ }
6321
+ }
6322
+ };
6323
+
6324
+ // called with scope of axis
6325
+ $.jqplot.LinearAxisRenderer.prototype.createTicks = function(plot) {
6326
+ // we're are operating on an axis here
6327
+ var ticks = this._ticks;
6328
+ var userTicks = this.ticks;
6329
+ var name = this.name;
6330
+ // databounds were set on axis initialization.
6331
+ var db = this._dataBounds;
6332
+ var dim = (this.name.charAt(0) === 'x') ? this._plotDimensions.width : this._plotDimensions.height;
6333
+ var interval;
6334
+ var min, max;
6335
+ var pos1, pos2;
6336
+ var tt, i;
6337
+ // get a copy of user's settings for min/max.
6338
+ var userMin = this.min;
6339
+ var userMax = this.max;
6340
+ var userNT = this.numberTicks;
6341
+ var userTI = this.tickInterval;
6342
+
6343
+ var threshold = 30;
6344
+ this._scalefact = (Math.max(dim, threshold+1) - threshold)/300.0;
6345
+
6346
+ // if we already have ticks, use them.
6347
+ // ticks must be in order of increasing value.
6348
+
6349
+ if (userTicks.length) {
6350
+ // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
6351
+ for (i=0; i<userTicks.length; i++){
6352
+ var ut = userTicks[i];
6353
+ var t = new this.tickRenderer(this.tickOptions);
6354
+ if ($.isArray(ut)) {
6355
+ t.value = ut[0];
6356
+ if (this.breakPoints) {
6357
+ if (ut[0] == this.breakPoints[0]) {
6358
+ t.label = this.breakTickLabel;
6359
+ t._breakTick = true;
6360
+ t.showGridline = false;
6361
+ t.showMark = false;
6362
+ }
6363
+ else if (ut[0] > this.breakPoints[0] && ut[0] <= this.breakPoints[1]) {
6364
+ t.show = false;
6365
+ t.showGridline = false;
6366
+ t.label = ut[1];
6367
+ }
6368
+ else {
6369
+ t.label = ut[1];
6370
+ }
6371
+ }
6372
+ else {
6373
+ t.label = ut[1];
6374
+ }
6375
+ t.setTick(ut[0], this.name);
6376
+ this._ticks.push(t);
6377
+ }
6378
+
6379
+ else if ($.isPlainObject(ut)) {
6380
+ $.extend(true, t, ut);
6381
+ t.axis = this.name;
6382
+ this._ticks.push(t);
6383
+ }
6384
+
6385
+ else {
6386
+ t.value = ut;
6387
+ if (this.breakPoints) {
6388
+ if (ut == this.breakPoints[0]) {
6389
+ t.label = this.breakTickLabel;
6390
+ t._breakTick = true;
6391
+ t.showGridline = false;
6392
+ t.showMark = false;
6393
+ }
6394
+ else if (ut > this.breakPoints[0] && ut <= this.breakPoints[1]) {
6395
+ t.show = false;
6396
+ t.showGridline = false;
6397
+ }
6398
+ }
6399
+ t.setTick(ut, this.name);
6400
+ this._ticks.push(t);
6401
+ }
6402
+ }
6403
+ this.numberTicks = userTicks.length;
6404
+ this.min = this._ticks[0].value;
6405
+ this.max = this._ticks[this.numberTicks-1].value;
6406
+ this.tickInterval = (this.max - this.min) / (this.numberTicks - 1);
6407
+ }
6408
+
6409
+ // we don't have any ticks yet, let's make some!
6410
+ else {
6411
+ if (name == 'xaxis' || name == 'x2axis') {
6412
+ dim = this._plotDimensions.width;
6413
+ }
6414
+ else {
6415
+ dim = this._plotDimensions.height;
6416
+ }
6417
+
6418
+ var _numberTicks = this.numberTicks;
6419
+
6420
+ // if aligning this axis, use number of ticks from previous axis.
6421
+ // Do I need to reset somehow if alignTicks is changed and then graph is replotted??
6422
+ if (this.alignTicks) {
6423
+ if (this.name === 'x2axis' && plot.axes.xaxis.show) {
6424
+ _numberTicks = plot.axes.xaxis.numberTicks;
6425
+ }
6426
+ else if (this.name.charAt(0) === 'y' && this.name !== 'yaxis' && this.name !== 'yMidAxis' && plot.axes.yaxis.show) {
6427
+ _numberTicks = plot.axes.yaxis.numberTicks;
6428
+ }
6429
+ }
6430
+
6431
+ min = ((this.min != null) ? this.min : db.min);
6432
+ max = ((this.max != null) ? this.max : db.max);
6433
+
6434
+ var range = max - min;
6435
+ var rmin, rmax;
6436
+ var temp;
6437
+
6438
+ if (this.tickOptions == null || !this.tickOptions.formatString) {
6439
+ this._overrideFormatString = true;
6440
+ }
6441
+
6442
+ // Doing complete autoscaling
6443
+ if (this.min == null || this.max == null && this.tickInterval == null && !this.autoscale) {
6444
+ // Check if user must have tick at 0 or 100 and ensure they are in range.
6445
+ // The autoscaling algorithm will always place ticks at 0 and 100 if they are in range.
6446
+ if (this.forceTickAt0) {
6447
+ if (min > 0) {
6448
+ min = 0;
6449
+ }
6450
+ if (max < 0) {
6451
+ max = 0;
6452
+ }
6453
+ }
6454
+
6455
+ if (this.forceTickAt100) {
6456
+ if (min > 100) {
6457
+ min = 100;
6458
+ }
6459
+ if (max < 100) {
6460
+ max = 100;
6461
+ }
6462
+ }
6463
+
6464
+ var keepMin = false,
6465
+ keepMax = false;
6466
+
6467
+ if (this.min != null) {
6468
+ keepMin = true;
6469
+ }
6470
+
6471
+ else if (this.max != null) {
6472
+ keepMax = true;
6473
+ }
6474
+
6475
+ // var threshold = 30;
6476
+ // var tdim = Math.max(dim, threshold+1);
6477
+ // this._scalefact = (tdim-threshold)/300.0;
6478
+ var ret = $.jqplot.LinearTickGenerator(min, max, this._scalefact, _numberTicks, keepMin, keepMax);
6479
+ // calculate a padded max and min, points should be less than these
6480
+ // so that they aren't too close to the edges of the plot.
6481
+ // User can adjust how much padding is allowed with pad, padMin and PadMax options.
6482
+ // If min or max is set, don't pad that end of axis.
6483
+ var tumin = (this.min != null) ? min : min + range*(this.padMin - 1);
6484
+ var tumax = (this.max != null) ? max : max - range*(this.padMax - 1);
6485
+
6486
+ // if they're equal, we shouldn't have to do anything, right?
6487
+ // if (min <=tumin || max >= tumax) {
6488
+ if (min <tumin || max > tumax) {
6489
+ tumin = (this.min != null) ? min : min - range*(this.padMin - 1);
6490
+ tumax = (this.max != null) ? max : max + range*(this.padMax - 1);
6491
+ ret = $.jqplot.LinearTickGenerator(tumin, tumax, this._scalefact, _numberTicks, keepMin, keepMax);
6492
+ }
6493
+
6494
+ this.min = ret[0];
6495
+ this.max = ret[1];
6496
+ // if numberTicks specified, it should return the same.
6497
+ this.numberTicks = ret[2];
6498
+ this._autoFormatString = ret[3];
6499
+ this.tickInterval = ret[4];
6500
+ }
6501
+
6502
+ // User has specified some axis scale related option, can use auto algorithm
6503
+ else {
6504
+
6505
+ // if min and max are same, space them out a bit
6506
+ if (min == max) {
6507
+ var adj = 0.05;
6508
+ if (min > 0) {
6509
+ adj = Math.max(Math.log(min)/Math.LN10, 0.05);
6510
+ }
6511
+ min -= adj;
6512
+ max += adj;
6513
+ }
6514
+
6515
+ // autoscale. Can't autoscale if min or max is supplied.
6516
+ // Will use numberTicks and tickInterval if supplied. Ticks
6517
+ // across multiple axes may not line up depending on how
6518
+ // bars are to be plotted.
6519
+ if (this.autoscale && this.min == null && this.max == null) {
6520
+ var rrange, ti, margin;
6521
+ var forceMinZero = false;
6522
+ var forceZeroLine = false;
6523
+ var intervals = {min:null, max:null, average:null, stddev:null};
6524
+ // if any series are bars, or if any are fill to zero, and if this
6525
+ // is the axis to fill toward, check to see if we can start axis at zero.
6526
+ for (var i=0; i<this._series.length; i++) {
6527
+ var s = this._series[i];
6528
+ var faname = (s.fillAxis == 'x') ? s._xaxis.name : s._yaxis.name;
6529
+ // check to see if this is the fill axis
6530
+ if (this.name == faname) {
6531
+ var vals = s._plotValues[s.fillAxis];
6532
+ var vmin = vals[0];
6533
+ var vmax = vals[0];
6534
+ for (var j=1; j<vals.length; j++) {
6535
+ if (vals[j] < vmin) {
6536
+ vmin = vals[j];
6537
+ }
6538
+ else if (vals[j] > vmax) {
6539
+ vmax = vals[j];
6540
+ }
6541
+ }
6542
+ var dp = (vmax - vmin) / vmax;
6543
+ // is this sries a bar?
6544
+ if (s.renderer.constructor == $.jqplot.BarRenderer) {
6545
+ // if no negative values and could also check range.
6546
+ if (vmin >= 0 && (s.fillToZero || dp > 0.1)) {
6547
+ forceMinZero = true;
6548
+ }
6549
+ else {
6550
+ forceMinZero = false;
6551
+ if (s.fill && s.fillToZero && vmin < 0 && vmax > 0) {
6552
+ forceZeroLine = true;
6553
+ }
6554
+ else {
6555
+ forceZeroLine = false;
6556
+ }
6557
+ }
6558
+ }
6559
+
6560
+ // if not a bar and filling, use appropriate method.
6561
+ else if (s.fill) {
6562
+ if (vmin >= 0 && (s.fillToZero || dp > 0.1)) {
6563
+ forceMinZero = true;
6564
+ }
6565
+ else if (vmin < 0 && vmax > 0 && s.fillToZero) {
6566
+ forceMinZero = false;
6567
+ forceZeroLine = true;
6568
+ }
6569
+ else {
6570
+ forceMinZero = false;
6571
+ forceZeroLine = false;
6572
+ }
6573
+ }
6574
+
6575
+ // if not a bar and not filling, only change existing state
6576
+ // if it doesn't make sense
6577
+ else if (vmin < 0) {
6578
+ forceMinZero = false;
6579
+ }
6580
+ }
6581
+ }
6582
+
6583
+ // check if we need make axis min at 0.
6584
+ if (forceMinZero) {
6585
+ // compute number of ticks
6586
+ this.numberTicks = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
6587
+ this.min = 0;
6588
+ userMin = 0;
6589
+ // what order is this range?
6590
+ // what tick interval does that give us?
6591
+ ti = max/(this.numberTicks-1);
6592
+ temp = Math.pow(10, Math.abs(Math.floor(Math.log(ti)/Math.LN10)));
6593
+ if (ti/temp == parseInt(ti/temp, 10)) {
6594
+ ti += temp;
6595
+ }
6596
+ this.tickInterval = Math.ceil(ti/temp) * temp;
6597
+ this.max = this.tickInterval * (this.numberTicks - 1);
6598
+ }
6599
+
6600
+ // check if we need to make sure there is a tick at 0.
6601
+ else if (forceZeroLine) {
6602
+ // compute number of ticks
6603
+ this.numberTicks = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
6604
+ var ntmin = Math.ceil(Math.abs(min)/range*(this.numberTicks-1));
6605
+ var ntmax = this.numberTicks - 1 - ntmin;
6606
+ ti = Math.max(Math.abs(min/ntmin), Math.abs(max/ntmax));
6607
+ temp = Math.pow(10, Math.abs(Math.floor(Math.log(ti)/Math.LN10)));
6608
+ this.tickInterval = Math.ceil(ti/temp) * temp;
6609
+ this.max = this.tickInterval * ntmax;
6610
+ this.min = -this.tickInterval * ntmin;
6611
+ }
6612
+
6613
+ // if nothing else, do autoscaling which will try to line up ticks across axes.
6614
+ else {
6615
+ if (this.numberTicks == null){
6616
+ if (this.tickInterval) {
6617
+ this.numberTicks = 3 + Math.ceil(range / this.tickInterval);
6618
+ }
6619
+ else {
6620
+ this.numberTicks = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
6621
+ }
6622
+ }
6623
+
6624
+ if (this.tickInterval == null) {
6625
+ // get a tick interval
6626
+ ti = range/(this.numberTicks - 1);
6627
+
6628
+ if (ti < 1) {
6629
+ temp = Math.pow(10, Math.abs(Math.floor(Math.log(ti)/Math.LN10)));
6630
+ }
6631
+ else {
6632
+ temp = 1;
6633
+ }
6634
+ this.tickInterval = Math.ceil(ti*temp*this.pad)/temp;
6635
+ }
6636
+ else {
6637
+ temp = 1 / this.tickInterval;
6638
+ }
6639
+
6640
+ // try to compute a nicer, more even tick interval
6641
+ // temp = Math.pow(10, Math.floor(Math.log(ti)/Math.LN10));
6642
+ // this.tickInterval = Math.ceil(ti/temp) * temp;
6643
+ rrange = this.tickInterval * (this.numberTicks - 1);
6644
+ margin = (rrange - range)/2;
6645
+
6646
+ if (this.min == null) {
6647
+ this.min = Math.floor(temp*(min-margin))/temp;
6648
+ }
6649
+ if (this.max == null) {
6650
+ this.max = this.min + rrange;
6651
+ }
6652
+ }
6653
+
6654
+ // Compute a somewhat decent format string if it is needed.
6655
+ // get precision of interval and determine a format string.
6656
+ var sf = $.jqplot.getSignificantFigures(this.tickInterval);
6657
+
6658
+ var fstr;
6659
+
6660
+ // if we have only a whole number, use integer formatting
6661
+ if (sf.digitsLeft >= sf.significantDigits) {
6662
+ fstr = '%d';
6663
+ }
6664
+
6665
+ else {
6666
+ var temp = Math.max(0, 5 - sf.digitsLeft);
6667
+ temp = Math.min(temp, sf.digitsRight);
6668
+ fstr = '%.'+ temp + 'f';
6669
+ }
6670
+
6671
+ this._autoFormatString = fstr;
6672
+ }
6673
+
6674
+ // Use the default algorithm which pads each axis to make the chart
6675
+ // centered nicely on the grid.
6676
+ else {
6677
+
6678
+ rmin = (this.min != null) ? this.min : min - range*(this.padMin - 1);
6679
+ rmax = (this.max != null) ? this.max : max + range*(this.padMax - 1);
6680
+ range = rmax - rmin;
6681
+
6682
+ if (this.numberTicks == null){
6683
+ // if tickInterval is specified by user, we will ignore computed maximum.
6684
+ // max will be equal or greater to fit even # of ticks.
6685
+ if (this.tickInterval != null) {
6686
+ this.numberTicks = Math.ceil((rmax - rmin)/this.tickInterval)+1;
6687
+ }
6688
+ else if (dim > 100) {
6689
+ this.numberTicks = parseInt(3+(dim-100)/75, 10);
6690
+ }
6691
+ else {
6692
+ this.numberTicks = 2;
6693
+ }
6694
+ }
6695
+
6696
+ if (this.tickInterval == null) {
6697
+ this.tickInterval = range / (this.numberTicks-1);
6698
+ }
6699
+
6700
+ if (this.max == null) {
6701
+ rmax = rmin + this.tickInterval*(this.numberTicks - 1);
6702
+ }
6703
+ if (this.min == null) {
6704
+ rmin = rmax - this.tickInterval*(this.numberTicks - 1);
6705
+ }
6706
+
6707
+ // get precision of interval and determine a format string.
6708
+ var sf = $.jqplot.getSignificantFigures(this.tickInterval);
6709
+
6710
+ var fstr;
6711
+
6712
+ // if we have only a whole number, use integer formatting
6713
+ if (sf.digitsLeft >= sf.significantDigits) {
6714
+ fstr = '%d';
6715
+ }
6716
+
6717
+ else {
6718
+ var temp = Math.max(0, 5 - sf.digitsLeft);
6719
+ temp = Math.min(temp, sf.digitsRight);
6720
+ fstr = '%.'+ temp + 'f';
6721
+ }
6722
+
6723
+
6724
+ this._autoFormatString = fstr;
6725
+
6726
+ this.min = rmin;
6727
+ this.max = rmax;
6728
+ }
6729
+
6730
+ if (this.renderer.constructor == $.jqplot.LinearAxisRenderer && this._autoFormatString == '') {
6731
+ // fix for misleading tick display with small range and low precision.
6732
+ range = this.max - this.min;
6733
+ // figure out precision
6734
+ var temptick = new this.tickRenderer(this.tickOptions);
6735
+ // use the tick formatString or, the default.
6736
+ var fs = temptick.formatString || $.jqplot.config.defaultTickFormatString;
6737
+ var fs = fs.match($.jqplot.sprintf.regex)[0];
6738
+ var precision = 0;
6739
+ if (fs) {
6740
+ if (fs.search(/[fFeEgGpP]/) > -1) {
6741
+ var m = fs.match(/\%\.(\d{0,})?[eEfFgGpP]/);
6742
+ if (m) {
6743
+ precision = parseInt(m[1], 10);
6744
+ }
6745
+ else {
6746
+ precision = 6;
6747
+ }
6748
+ }
6749
+ else if (fs.search(/[di]/) > -1) {
6750
+ precision = 0;
6751
+ }
6752
+ // fact will be <= 1;
6753
+ var fact = Math.pow(10, -precision);
6754
+ if (this.tickInterval < fact) {
6755
+ // need to correct underrange
6756
+ if (userNT == null && userTI == null) {
6757
+ this.tickInterval = fact;
6758
+ if (userMax == null && userMin == null) {
6759
+ // this.min = Math.floor((this._dataBounds.min - this.tickInterval)/fact) * fact;
6760
+ this.min = Math.floor(this._dataBounds.min/fact) * fact;
6761
+ if (this.min == this._dataBounds.min) {
6762
+ this.min = this._dataBounds.min - this.tickInterval;
6763
+ }
6764
+ // this.max = Math.ceil((this._dataBounds.max + this.tickInterval)/fact) * fact;
6765
+ this.max = Math.ceil(this._dataBounds.max/fact) * fact;
6766
+ if (this.max == this._dataBounds.max) {
6767
+ this.max = this._dataBounds.max + this.tickInterval;
6768
+ }
6769
+ var n = (this.max - this.min)/this.tickInterval;
6770
+ n = n.toFixed(11);
6771
+ n = Math.ceil(n);
6772
+ this.numberTicks = n + 1;
6773
+ }
6774
+ else if (userMax == null) {
6775
+ // add one tick for top of range.
6776
+ var n = (this._dataBounds.max - this.min) / this.tickInterval;
6777
+ n = n.toFixed(11);
6778
+ this.numberTicks = Math.ceil(n) + 2;
6779
+ this.max = this.min + this.tickInterval * (this.numberTicks-1);
6780
+ }
6781
+ else if (userMin == null) {
6782
+ // add one tick for bottom of range.
6783
+ var n = (this.max - this._dataBounds.min) / this.tickInterval;
6784
+ n = n.toFixed(11);
6785
+ this.numberTicks = Math.ceil(n) + 2;
6786
+ this.min = this.max - this.tickInterval * (this.numberTicks-1);
6787
+ }
6788
+ else {
6789
+ // calculate a number of ticks so max is within axis scale
6790
+ this.numberTicks = Math.ceil((userMax - userMin)/this.tickInterval) + 1;
6791
+ // if user's min and max don't fit evenly in ticks, adjust.
6792
+ // This takes care of cases such as user min set to 0, max set to 3.5 but tick
6793
+ // format string set to %d (integer ticks)
6794
+ this.min = Math.floor(userMin*Math.pow(10, precision))/Math.pow(10, precision);
6795
+ this.max = Math.ceil(userMax*Math.pow(10, precision))/Math.pow(10, precision);
6796
+ // this.max = this.min + this.tickInterval*(this.numberTicks-1);
6797
+ this.numberTicks = Math.ceil((this.max - this.min)/this.tickInterval) + 1;
6798
+ }
6799
+ }
6800
+ }
6801
+ }
6802
+ }
6803
+
6804
+ }
6805
+
6806
+ if (this._overrideFormatString && this._autoFormatString != '') {
6807
+ this.tickOptions = this.tickOptions || {};
6808
+ this.tickOptions.formatString = this._autoFormatString;
6809
+ }
6810
+
6811
+ var t, to;
6812
+ for (var i=0; i<this.numberTicks; i++){
6813
+ tt = this.min + i * this.tickInterval;
6814
+ t = new this.tickRenderer(this.tickOptions);
6815
+ // var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
6816
+
6817
+ t.setTick(tt, this.name);
6818
+ this._ticks.push(t);
6819
+
6820
+ if (i < this.numberTicks - 1) {
6821
+ for (var j=0; j<this.minorTicks; j++) {
6822
+ tt += this.tickInterval/(this.minorTicks+1);
6823
+ to = $.extend(true, {}, this.tickOptions, {name:this.name, value:tt, label:'', isMinorTick:true});
6824
+ t = new this.tickRenderer(to);
6825
+ this._ticks.push(t);
6826
+ }
6827
+ }
6828
+ t = null;
6829
+ }
6830
+ }
6831
+
6832
+ if (this.tickInset) {
6833
+ this.min = this.min - this.tickInset * this.tickInterval;
6834
+ this.max = this.max + this.tickInset * this.tickInterval;
6835
+ }
6836
+
6837
+ ticks = null;
6838
+ };
6839
+
6840
+ // Used to reset just the values of the ticks and then repack, which will
6841
+ // recalculate the positioning functions. It is assuemd that the
6842
+ // number of ticks is the same and the values of the new array are at the
6843
+ // proper interval.
6844
+ // This method needs to be called with the scope of an axis object, like:
6845
+ //
6846
+ // > plot.axes.yaxis.renderer.resetTickValues.call(plot.axes.yaxis, yarr);
6847
+ //
6848
+ $.jqplot.LinearAxisRenderer.prototype.resetTickValues = function(opts) {
6849
+ if ($.isArray(opts) && opts.length == this._ticks.length) {
6850
+ var t;
6851
+ for (var i=0; i<opts.length; i++) {
6852
+ t = this._ticks[i];
6853
+ t.value = opts[i];
6854
+ t.label = t.formatter(t.formatString, opts[i]);
6855
+ t.label = t.prefix + t.label;
6856
+ t._elem.html(t.label);
6857
+ }
6858
+ t = null;
6859
+ this.min = $.jqplot.arrayMin(opts);
6860
+ this.max = $.jqplot.arrayMax(opts);
6861
+ this.pack();
6862
+ }
6863
+ // Not implemented yet.
6864
+ // else if ($.isPlainObject(opts)) {
6865
+ //
6866
+ // }
6867
+ };
6868
+
6869
+ // called with scope of axis
6870
+ $.jqplot.LinearAxisRenderer.prototype.pack = function(pos, offsets) {
6871
+ // Add defaults for repacking from resetTickValues function.
6872
+ pos = pos || {};
6873
+ offsets = offsets || this._offsets;
6874
+
6875
+ var ticks = this._ticks;
6876
+ var max = this.max;
6877
+ var min = this.min;
6878
+ var offmax = offsets.max;
6879
+ var offmin = offsets.min;
6880
+ var lshow = (this._label == null) ? false : this._label.show;
6881
+
6882
+ for (var p in pos) {
6883
+ this._elem.css(p, pos[p]);
6884
+ }
6885
+
6886
+ this._offsets = offsets;
6887
+ // pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
6888
+ var pixellength = offmax - offmin;
6889
+ var unitlength = max - min;
6890
+
6891
+ // point to unit and unit to point conversions references to Plot DOM element top left corner.
6892
+ if (this.breakPoints) {
6893
+ unitlength = unitlength - this.breakPoints[1] + this.breakPoints[0];
6894
+
6895
+ this.p2u = function(p){
6896
+ return (p - offmin) * unitlength / pixellength + min;
6897
+ };
6898
+
6899
+ this.u2p = function(u){
6900
+ if (u > this.breakPoints[0] && u < this.breakPoints[1]){
6901
+ u = this.breakPoints[0];
6902
+ }
6903
+ if (u <= this.breakPoints[0]) {
6904
+ return (u - min) * pixellength / unitlength + offmin;
6905
+ }
6906
+ else {
6907
+ return (u - this.breakPoints[1] + this.breakPoints[0] - min) * pixellength / unitlength + offmin;
6908
+ }
6909
+ };
6910
+
6911
+ if (this.name.charAt(0) == 'x'){
6912
+ this.series_u2p = function(u){
6913
+ if (u > this.breakPoints[0] && u < this.breakPoints[1]){
6914
+ u = this.breakPoints[0];
6915
+ }
6916
+ if (u <= this.breakPoints[0]) {
6917
+ return (u - min) * pixellength / unitlength;
6918
+ }
6919
+ else {
6920
+ return (u - this.breakPoints[1] + this.breakPoints[0] - min) * pixellength / unitlength;
6921
+ }
6922
+ };
6923
+ this.series_p2u = function(p){
6924
+ return p * unitlength / pixellength + min;
6925
+ };
6926
+ }
6927
+
6928
+ else {
6929
+ this.series_u2p = function(u){
6930
+ if (u > this.breakPoints[0] && u < this.breakPoints[1]){
6931
+ u = this.breakPoints[0];
6932
+ }
6933
+ if (u >= this.breakPoints[1]) {
6934
+ return (u - max) * pixellength / unitlength;
6935
+ }
6936
+ else {
6937
+ return (u + this.breakPoints[1] - this.breakPoints[0] - max) * pixellength / unitlength;
6938
+ }
6939
+ };
6940
+ this.series_p2u = function(p){
6941
+ return p * unitlength / pixellength + max;
6942
+ };
6943
+ }
6944
+ }
6945
+ else {
6946
+ this.p2u = function(p){
6947
+ return (p - offmin) * unitlength / pixellength + min;
6948
+ };
6949
+
6950
+ this.u2p = function(u){
6951
+ return (u - min) * pixellength / unitlength + offmin;
6952
+ };
6953
+
6954
+ if (this.name == 'xaxis' || this.name == 'x2axis'){
6955
+ this.series_u2p = function(u){
6956
+ return (u - min) * pixellength / unitlength;
6957
+ };
6958
+ this.series_p2u = function(p){
6959
+ return p * unitlength / pixellength + min;
6960
+ };
6961
+ }
6962
+
6963
+ else {
6964
+ this.series_u2p = function(u){
6965
+ return (u - max) * pixellength / unitlength;
6966
+ };
6967
+ this.series_p2u = function(p){
6968
+ return p * unitlength / pixellength + max;
6969
+ };
6970
+ }
6971
+ }
6972
+
6973
+ if (this.show) {
6974
+ if (this.name == 'xaxis' || this.name == 'x2axis') {
6975
+ for (var i=0; i<ticks.length; i++) {
6976
+ var t = ticks[i];
6977
+ if (t.show && t.showLabel) {
6978
+ var shim;
6979
+
6980
+ if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
6981
+ // will need to adjust auto positioning based on which axis this is.
6982
+ var temp = (this.name == 'xaxis') ? 1 : -1;
6983
+ switch (t.labelPosition) {
6984
+ case 'auto':
6985
+ // position at end
6986
+ if (temp * t.angle < 0) {
6987
+ shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
6988
+ }
6989
+ // position at start
6990
+ else {
6991
+ shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
6992
+ }
6993
+ break;
6994
+ case 'end':
6995
+ shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
6996
+ break;
6997
+ case 'start':
6998
+ shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
6999
+ break;
7000
+ case 'middle':
7001
+ shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
7002
+ break;
7003
+ default:
7004
+ shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
7005
+ break;
7006
+ }
7007
+ }
7008
+ else {
7009
+ shim = -t.getWidth()/2;
7010
+ }
7011
+ var val = this.u2p(t.value) + shim + 'px';
7012
+ t._elem.css('left', val);
7013
+ t.pack();
7014
+ }
7015
+ }
7016
+ if (lshow) {
7017
+ var w = this._label._elem.outerWidth(true);
7018
+ this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
7019
+ if (this.name == 'xaxis') {
7020
+ this._label._elem.css('bottom', '0px');
7021
+ }
7022
+ else {
7023
+ this._label._elem.css('top', '0px');
7024
+ }
7025
+ this._label.pack();
7026
+ }
7027
+ }
7028
+ else {
7029
+ for (var i=0; i<ticks.length; i++) {
7030
+ var t = ticks[i];
7031
+ if (t.show && t.showLabel) {
7032
+ var shim;
7033
+ if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
7034
+ // will need to adjust auto positioning based on which axis this is.
7035
+ var temp = (this.name == 'yaxis') ? 1 : -1;
7036
+ switch (t.labelPosition) {
7037
+ case 'auto':
7038
+ // position at end
7039
+ case 'end':
7040
+ if (temp * t.angle < 0) {
7041
+ shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
7042
+ }
7043
+ else {
7044
+ shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
7045
+ }
7046
+ break;
7047
+ case 'start':
7048
+ if (t.angle > 0) {
7049
+ shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
7050
+ }
7051
+ else {
7052
+ shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
7053
+ }
7054
+ break;
7055
+ case 'middle':
7056
+ // if (t.angle > 0) {
7057
+ // shim = -t.getHeight()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
7058
+ // }
7059
+ // else {
7060
+ // shim = -t.getHeight()/2 - t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
7061
+ // }
7062
+ shim = -t.getHeight()/2;
7063
+ break;
7064
+ default:
7065
+ shim = -t.getHeight()/2;
7066
+ break;
7067
+ }
7068
+ }
7069
+ else {
7070
+ shim = -t.getHeight()/2;
7071
+ }
7072
+
7073
+ var val = this.u2p(t.value) + shim + 'px';
7074
+ t._elem.css('top', val);
7075
+ t.pack();
7076
+ }
7077
+ }
7078
+ if (lshow) {
7079
+ var h = this._label._elem.outerHeight(true);
7080
+ this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
7081
+ if (this.name == 'yaxis') {
7082
+ this._label._elem.css('left', '0px');
7083
+ }
7084
+ else {
7085
+ this._label._elem.css('right', '0px');
7086
+ }
7087
+ this._label.pack();
7088
+ }
7089
+ }
7090
+ }
7091
+
7092
+ ticks = null;
7093
+ };
7094
+
7095
+
7096
+ /**
7097
+ * The following code was generaously given to me a while back by Scott Prahl.
7098
+ * He did a good job at computing axes min, max and number of ticks for the
7099
+ * case where the user has not set any scale related parameters (tickInterval,
7100
+ * numberTicks, min or max). I had ignored this use case for a long time,
7101
+ * focusing on the more difficult case where user has set some option controlling
7102
+ * tick generation. Anyway, about time I got this into jqPlot.
7103
+ * Thanks Scott!!
7104
+ */
7105
+
7106
+ /**
7107
+ * Copyright (c) 2010 Scott Prahl
7108
+ * The next three routines are currently available for use in all personal
7109
+ * or commercial projects under both the MIT and GPL version 2.0 licenses.
7110
+ * This means that you can choose the license that best suits your project
7111
+ * and use it accordingly.
7112
+ */
7113
+
7114
+ // A good format string depends on the interval. If the interval is greater
7115
+ // than 1 then there is no need to show any decimal digits. If it is < 1.0, then
7116
+ // use the magnitude of the interval to determine the number of digits to show.
7117
+ function bestFormatString (interval)
7118
+ {
7119
+ var fstr;
7120
+ interval = Math.abs(interval);
7121
+ if (interval >= 10) {
7122
+ fstr = '%d';
7123
+ }
7124
+
7125
+ else if (interval > 1) {
7126
+ if (interval === parseInt(interval, 10)) {
7127
+ fstr = '%d';
7128
+ }
7129
+ else {
7130
+ fstr = '%.1f';
7131
+ }
7132
+ }
7133
+
7134
+ else {
7135
+ var expv = -Math.floor(Math.log(interval)/Math.LN10);
7136
+ fstr = '%.' + expv + 'f';
7137
+ }
7138
+
7139
+ return fstr;
7140
+ }
7141
+
7142
+ var _factors = [0.1, 0.2, 0.3, 0.4, 0.5, 0.8, 1, 2, 3, 4, 5];
7143
+
7144
+ var _getLowerFactor = function(f) {
7145
+ var i = _factors.indexOf(f);
7146
+ if (i > 0) {
7147
+ return _factors[i-1];
7148
+ }
7149
+ else {
7150
+ return _factors[_factors.length - 1] / 100;
7151
+ }
7152
+ };
7153
+
7154
+ var _getHigherFactor = function(f) {
7155
+ var i = _factors.indexOf(f);
7156
+ if (i < _factors.length-1) {
7157
+ return _factors[i+1];
7158
+ }
7159
+ else {
7160
+ return _factors[0] * 100;
7161
+ }
7162
+ };
7163
+
7164
+ // Given a fixed minimum and maximum and a target number ot ticks
7165
+ // figure out the best interval and
7166
+ // return min, max, number ticks, format string and tick interval
7167
+ function bestConstrainedInterval(min, max, nttarget) {
7168
+ // run through possible number to ticks and see which interval is best
7169
+ var low = Math.floor(nttarget/2);
7170
+ var hi = Math.ceil(nttarget*1.5);
7171
+ var badness = Number.MAX_VALUE;
7172
+ var r = (max - min);
7173
+ var temp;
7174
+ var sd;
7175
+ var bestNT;
7176
+ var gsf = $.jqplot.getSignificantFigures;
7177
+ var fsd;
7178
+ var fs;
7179
+ var currentNT;
7180
+ var bestPrec;
7181
+
7182
+ for (var i=0, l=hi-low+1; i<l; i++) {
7183
+ currentNT = low + i;
7184
+ temp = r/(currentNT-1);
7185
+ sd = gsf(temp);
7186
+
7187
+ temp = Math.abs(nttarget - currentNT) + sd.digitsRight;
7188
+ if (temp < badness) {
7189
+ badness = temp;
7190
+ bestNT = currentNT;
7191
+ bestPrec = sd.digitsRight;
7192
+ }
7193
+ else if (temp === badness) {
7194
+ // let nicer ticks trump number ot ticks
7195
+ if (sd.digitsRight < bestPrec) {
7196
+ bestNT = currentNT;
7197
+ bestPrec = sd.digitsRight;
7198
+ }
7199
+ }
7200
+
7201
+ }
7202
+
7203
+ fsd = Math.max(bestPrec, Math.max(gsf(min).digitsRight, gsf(max).digitsRight));
7204
+ if (fsd === 0) {
7205
+ fs = '%d';
7206
+ }
7207
+ else {
7208
+ fs = '%.' + fsd + 'f';
7209
+ }
7210
+ temp = r / (bestNT - 1);
7211
+ // min, max, number ticks, format string, tick interval
7212
+ return [min, max, bestNT, fs, temp];
7213
+ }
7214
+
7215
+ // This will return an interval of form 2 * 10^n, 5 * 10^n or 10 * 10^n
7216
+ // it is based soley on the range and number of ticks. So if user specifies
7217
+ // number of ticks, use this.
7218
+ function bestInterval(range, numberTicks) {
7219
+ numberTicks = numberTicks || 7;
7220
+ var minimum = range / (numberTicks - 1);
7221
+ var magnitude = Math.pow(10, Math.floor(Math.log(minimum) / Math.LN10));
7222
+ var residual = minimum / magnitude;
7223
+ var interval;
7224
+ // "nicest" ranges are 1, 2, 5 or powers of these.
7225
+ // for magnitudes below 1, only allow these.
7226
+ if (magnitude < 1) {
7227
+ if (residual > 5) {
7228
+ interval = 10 * magnitude;
7229
+ }
7230
+ else if (residual > 2) {
7231
+ interval = 5 * magnitude;
7232
+ }
7233
+ else if (residual > 1) {
7234
+ interval = 2 * magnitude;
7235
+ }
7236
+ else {
7237
+ interval = magnitude;
7238
+ }
7239
+ }
7240
+ // for large ranges (whole integers), allow intervals like 3, 4 or powers of these.
7241
+ // this helps a lot with poor choices for number of ticks.
7242
+ else {
7243
+ if (residual > 5) {
7244
+ interval = 10 * magnitude;
7245
+ }
7246
+ else if (residual > 4) {
7247
+ interval = 5 * magnitude;
7248
+ }
7249
+ else if (residual > 3) {
7250
+ interval = 4 * magnitude;
7251
+ }
7252
+ else if (residual > 2) {
7253
+ interval = 3 * magnitude;
7254
+ }
7255
+ else if (residual > 1) {
7256
+ interval = 2 * magnitude;
7257
+ }
7258
+ else {
7259
+ interval = magnitude;
7260
+ }
7261
+ }
7262
+
7263
+ return interval;
7264
+ }
7265
+
7266
+ // This will return an interval of form 2 * 10^n, 5 * 10^n or 10 * 10^n
7267
+ // it is based soley on the range of data, number of ticks must be computed later.
7268
+ function bestLinearInterval(range, scalefact) {
7269
+ scalefact = scalefact || 1;
7270
+ var expv = Math.floor(Math.log(range)/Math.LN10);
7271
+ var magnitude = Math.pow(10, expv);
7272
+ // 0 < f < 10
7273
+ var f = range / magnitude;
7274
+ var fact;
7275
+ // for large plots, scalefact will decrease f and increase number of ticks.
7276
+ // for small plots, scalefact will increase f and decrease number of ticks.
7277
+ f = f/scalefact;
7278
+
7279
+ // for large plots, smaller interval, more ticks.
7280
+ if (f<=0.38) {
7281
+ fact = 0.1;
7282
+ }
7283
+ else if (f<=1.6) {
7284
+ fact = 0.2;
7285
+ }
7286
+ else if (f<=4.0) {
7287
+ fact = 0.5;
7288
+ }
7289
+ else if (f<=8.0) {
7290
+ fact = 1.0;
7291
+ }
7292
+ // for very small plots, larger interval, less ticks in number ticks
7293
+ else if (f<=16.0) {
7294
+ fact = 2;
7295
+ }
7296
+ else {
7297
+ fact = 5;
7298
+ }
7299
+
7300
+ return fact*magnitude;
7301
+ }
7302
+
7303
+ function bestLinearComponents(range, scalefact) {
7304
+ var expv = Math.floor(Math.log(range)/Math.LN10);
7305
+ var magnitude = Math.pow(10, expv);
7306
+ // 0 < f < 10
7307
+ var f = range / magnitude;
7308
+ var interval;
7309
+ var fact;
7310
+ // for large plots, scalefact will decrease f and increase number of ticks.
7311
+ // for small plots, scalefact will increase f and decrease number of ticks.
7312
+ f = f/scalefact;
7313
+
7314
+ // for large plots, smaller interval, more ticks.
7315
+ if (f<=0.38) {
7316
+ fact = 0.1;
7317
+ }
7318
+ else if (f<=1.6) {
7319
+ fact = 0.2;
7320
+ }
7321
+ else if (f<=4.0) {
7322
+ fact = 0.5;
7323
+ }
7324
+ else if (f<=8.0) {
7325
+ fact = 1.0;
7326
+ }
7327
+ // for very small plots, larger interval, less ticks in number ticks
7328
+ else if (f<=16.0) {
7329
+ fact = 2;
7330
+ }
7331
+ // else if (f<=20.0) {
7332
+ // fact = 3;
7333
+ // }
7334
+ // else if (f<=24.0) {
7335
+ // fact = 4;
7336
+ // }
7337
+ else {
7338
+ fact = 5;
7339
+ }
7340
+
7341
+ interval = fact * magnitude;
7342
+
7343
+ return [interval, fact, magnitude];
7344
+ }
7345
+
7346
+ // Given the min and max for a dataset, return suitable endpoints
7347
+ // for the graphing, a good number for the number of ticks, and a
7348
+ // format string so that extraneous digits are not displayed.
7349
+ // returned is an array containing [min, max, nTicks, format]
7350
+ $.jqplot.LinearTickGenerator = function(axis_min, axis_max, scalefact, numberTicks, keepMin, keepMax) {
7351
+ // Set to preserve EITHER min OR max.
7352
+ // If min is preserved, max must be free.
7353
+ keepMin = (keepMin === null) ? false : keepMin;
7354
+ keepMax = (keepMax === null || keepMin) ? false : keepMax;
7355
+ // if endpoints are equal try to include zero otherwise include one
7356
+ if (axis_min === axis_max) {
7357
+ axis_max = (axis_max) ? 0 : 1;
7358
+ }
7359
+
7360
+ scalefact = scalefact || 1.0;
7361
+
7362
+ // make sure range is positive
7363
+ if (axis_max < axis_min) {
7364
+ var a = axis_max;
7365
+ axis_max = axis_min;
7366
+ axis_min = a;
7367
+ }
7368
+
7369
+ var r = [];
7370
+ var ss = bestLinearInterval(axis_max - axis_min, scalefact);
7371
+
7372
+ var gsf = $.jqplot.getSignificantFigures;
7373
+
7374
+ if (numberTicks == null) {
7375
+
7376
+ // Figure out the axis min, max and number of ticks
7377
+ // the min and max will be some multiple of the tick interval,
7378
+ // 1*10^n, 2*10^n or 5*10^n. This gaurantees that, if the
7379
+ // axis min is negative, 0 will be a tick.
7380
+ if (!keepMin && !keepMax) {
7381
+ r[0] = Math.floor(axis_min / ss) * ss; // min
7382
+ r[1] = Math.ceil(axis_max / ss) * ss; // max
7383
+ r[2] = Math.round((r[1]-r[0])/ss+1.0); // number of ticks
7384
+ r[3] = bestFormatString(ss); // format string
7385
+ r[4] = ss; // tick Interval
7386
+ }
7387
+
7388
+ else if (keepMin) {
7389
+ r[0] = axis_min; // min
7390
+ r[2] = Math.ceil((axis_max - axis_min) / ss + 1.0); // number of ticks
7391
+ r[1] = axis_min + (r[2] - 1) * ss; // max
7392
+ var digitsMin = gsf(axis_min).digitsRight;
7393
+ var digitsSS = gsf(ss).digitsRight;
7394
+ if (digitsMin < digitsSS) {
7395
+ r[3] = bestFormatString(ss); // format string
7396
+ }
7397
+ else {
7398
+ r[3] = '%.' + digitsMin + 'f';
7399
+ }
7400
+ r[4] = ss; // tick Interval
7401
+ }
7402
+
7403
+ else if (keepMax) {
7404
+ r[1] = axis_max; // max
7405
+ r[2] = Math.ceil((axis_max - axis_min) / ss + 1.0); // number of ticks
7406
+ r[0] = axis_max - (r[2] - 1) * ss; // min
7407
+ var digitsMax = gsf(axis_max).digitsRight;
7408
+ var digitsSS = gsf(ss).digitsRight;
7409
+ if (digitsMax < digitsSS) {
7410
+ r[3] = bestFormatString(ss); // format string
7411
+ }
7412
+ else {
7413
+ r[3] = '%.' + digitsMax + 'f';
7414
+ }
7415
+ r[4] = ss; // tick Interval
7416
+ }
7417
+ }
7418
+
7419
+ else {
7420
+ var tempr = [];
7421
+
7422
+ // Figure out the axis min, max and number of ticks
7423
+ // the min and max will be some multiple of the tick interval,
7424
+ // 1*10^n, 2*10^n or 5*10^n. This gaurantees that, if the
7425
+ // axis min is negative, 0 will be a tick.
7426
+ tempr[0] = Math.floor(axis_min / ss) * ss; // min
7427
+ tempr[1] = Math.ceil(axis_max / ss) * ss; // max
7428
+ tempr[2] = Math.round((tempr[1]-tempr[0])/ss+1.0); // number of ticks
7429
+ tempr[3] = bestFormatString(ss); // format string
7430
+ tempr[4] = ss; // tick Interval
7431
+
7432
+ // first, see if we happen to get the right number of ticks
7433
+ if (tempr[2] === numberTicks) {
7434
+ r = tempr;
7435
+ }
7436
+
7437
+ else {
7438
+
7439
+ var newti = bestInterval(tempr[1] - tempr[0], numberTicks);
7440
+
7441
+ r[0] = tempr[0]; // min
7442
+ r[2] = numberTicks; // number of ticks
7443
+ r[4] = newti; // tick interval
7444
+ r[3] = bestFormatString(newti); // format string
7445
+ r[1] = r[0] + (r[2] - 1) * r[4]; // max
7446
+ }
7447
+ }
7448
+
7449
+ return r;
7450
+ };
7451
+
7452
+ $.jqplot.LinearTickGenerator.bestLinearInterval = bestLinearInterval;
7453
+ $.jqplot.LinearTickGenerator.bestInterval = bestInterval;
7454
+ $.jqplot.LinearTickGenerator.bestLinearComponents = bestLinearComponents;
7455
+ $.jqplot.LinearTickGenerator.bestConstrainedInterval = bestConstrainedInterval;
7456
+
7457
+
7458
+ // class: $.jqplot.MarkerRenderer
7459
+ // The default jqPlot marker renderer, rendering the points on the line.
7460
+ $.jqplot.MarkerRenderer = function(options){
7461
+ // Group: Properties
7462
+
7463
+ // prop: show
7464
+ // whether or not to show the marker.
7465
+ this.show = true;
7466
+ // prop: style
7467
+ // One of diamond, circle, square, x, plus, dash, filledDiamond, filledCircle, filledSquare
7468
+ this.style = 'filledCircle';
7469
+ // prop: lineWidth
7470
+ // size of the line for non-filled markers.
7471
+ this.lineWidth = 2;
7472
+ // prop: size
7473
+ // Size of the marker (diameter or circle, length of edge of square, etc.)
7474
+ this.size = 9.0;
7475
+ // prop: color
7476
+ // color of marker. Will be set to color of series by default on init.
7477
+ this.color = '#666666';
7478
+ // prop: shadow
7479
+ // whether or not to draw a shadow on the line
7480
+ this.shadow = true;
7481
+ // prop: shadowAngle
7482
+ // Shadow angle in degrees
7483
+ this.shadowAngle = 45;
7484
+ // prop: shadowOffset
7485
+ // Shadow offset from line in pixels
7486
+ this.shadowOffset = 1;
7487
+ // prop: shadowDepth
7488
+ // Number of times shadow is stroked, each stroke offset shadowOffset from the last.
7489
+ this.shadowDepth = 3;
7490
+ // prop: shadowAlpha
7491
+ // Alpha channel transparency of shadow. 0 = transparent.
7492
+ this.shadowAlpha = '0.07';
7493
+ // prop: shadowRenderer
7494
+ // Renderer that will draws the shadows on the marker.
7495
+ this.shadowRenderer = new $.jqplot.ShadowRenderer();
7496
+ // prop: shapeRenderer
7497
+ // Renderer that will draw the marker.
7498
+ this.shapeRenderer = new $.jqplot.ShapeRenderer();
7499
+
7500
+ $.extend(true, this, options);
7501
+ };
7502
+
7503
+ $.jqplot.MarkerRenderer.prototype.init = function(options) {
7504
+ $.extend(true, this, options);
7505
+ var sdopt = {angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, lineWidth:this.lineWidth, depth:this.shadowDepth, closePath:true};
7506
+ if (this.style.indexOf('filled') != -1) {
7507
+ sdopt.fill = true;
7508
+ }
7509
+ if (this.style.indexOf('ircle') != -1) {
7510
+ sdopt.isarc = true;
7511
+ sdopt.closePath = false;
7512
+ }
7513
+ this.shadowRenderer.init(sdopt);
7514
+
7515
+ var shopt = {fill:false, isarc:false, strokeStyle:this.color, fillStyle:this.color, lineWidth:this.lineWidth, closePath:true};
7516
+ if (this.style.indexOf('filled') != -1) {
7517
+ shopt.fill = true;
7518
+ }
7519
+ if (this.style.indexOf('ircle') != -1) {
7520
+ shopt.isarc = true;
7521
+ shopt.closePath = false;
7522
+ }
7523
+ this.shapeRenderer.init(shopt);
7524
+ };
7525
+
7526
+ $.jqplot.MarkerRenderer.prototype.drawDiamond = function(x, y, ctx, fill, options) {
7527
+ var stretch = 1.2;
7528
+ var dx = this.size/2/stretch;
7529
+ var dy = this.size/2*stretch;
7530
+ var points = [[x-dx, y], [x, y+dy], [x+dx, y], [x, y-dy]];
7531
+ if (this.shadow) {
7532
+ this.shadowRenderer.draw(ctx, points);
7533
+ }
7534
+ this.shapeRenderer.draw(ctx, points, options);
7535
+ };
7536
+
7537
+ $.jqplot.MarkerRenderer.prototype.drawPlus = function(x, y, ctx, fill, options) {
7538
+ var stretch = 1.0;
7539
+ var dx = this.size/2*stretch;
7540
+ var dy = this.size/2*stretch;
7541
+ var points1 = [[x, y-dy], [x, y+dy]];
7542
+ var points2 = [[x+dx, y], [x-dx, y]];
7543
+ var opts = $.extend(true, {}, this.options, {closePath:false});
7544
+ if (this.shadow) {
7545
+ this.shadowRenderer.draw(ctx, points1, {closePath:false});
7546
+ this.shadowRenderer.draw(ctx, points2, {closePath:false});
7547
+ }
7548
+ this.shapeRenderer.draw(ctx, points1, opts);
7549
+ this.shapeRenderer.draw(ctx, points2, opts);
7550
+ };
7551
+
7552
+ $.jqplot.MarkerRenderer.prototype.drawX = function(x, y, ctx, fill, options) {
7553
+ var stretch = 1.0;
7554
+ var dx = this.size/2*stretch;
7555
+ var dy = this.size/2*stretch;
7556
+ var opts = $.extend(true, {}, this.options, {closePath:false});
7557
+ var points1 = [[x-dx, y-dy], [x+dx, y+dy]];
7558
+ var points2 = [[x-dx, y+dy], [x+dx, y-dy]];
7559
+ if (this.shadow) {
7560
+ this.shadowRenderer.draw(ctx, points1, {closePath:false});
7561
+ this.shadowRenderer.draw(ctx, points2, {closePath:false});
7562
+ }
7563
+ this.shapeRenderer.draw(ctx, points1, opts);
7564
+ this.shapeRenderer.draw(ctx, points2, opts);
7565
+ };
7566
+
7567
+ $.jqplot.MarkerRenderer.prototype.drawDash = function(x, y, ctx, fill, options) {
7568
+ var stretch = 1.0;
7569
+ var dx = this.size/2*stretch;
7570
+ var dy = this.size/2*stretch;
7571
+ var points = [[x-dx, y], [x+dx, y]];
7572
+ if (this.shadow) {
7573
+ this.shadowRenderer.draw(ctx, points);
7574
+ }
7575
+ this.shapeRenderer.draw(ctx, points, options);
7576
+ };
7577
+
7578
+ $.jqplot.MarkerRenderer.prototype.drawLine = function(p1, p2, ctx, fill, options) {
7579
+ var points = [p1, p2];
7580
+ if (this.shadow) {
7581
+ this.shadowRenderer.draw(ctx, points);
7582
+ }
7583
+ this.shapeRenderer.draw(ctx, points, options);
7584
+ };
7585
+
7586
+ $.jqplot.MarkerRenderer.prototype.drawSquare = function(x, y, ctx, fill, options) {
7587
+ var stretch = 1.0;
7588
+ var dx = this.size/2/stretch;
7589
+ var dy = this.size/2*stretch;
7590
+ var points = [[x-dx, y-dy], [x-dx, y+dy], [x+dx, y+dy], [x+dx, y-dy]];
7591
+ if (this.shadow) {
7592
+ this.shadowRenderer.draw(ctx, points);
7593
+ }
7594
+ this.shapeRenderer.draw(ctx, points, options);
7595
+ };
7596
+
7597
+ $.jqplot.MarkerRenderer.prototype.drawCircle = function(x, y, ctx, fill, options) {
7598
+ var radius = this.size/2;
7599
+ var end = 2*Math.PI;
7600
+ var points = [x, y, radius, 0, end, true];
7601
+ if (this.shadow) {
7602
+ this.shadowRenderer.draw(ctx, points);
7603
+ }
7604
+ this.shapeRenderer.draw(ctx, points, options);
7605
+ };
7606
+
7607
+ $.jqplot.MarkerRenderer.prototype.draw = function(x, y, ctx, options) {
7608
+ options = options || {};
7609
+ // hack here b/c shape renderer uses canvas based color style options
7610
+ // and marker uses css style names.
7611
+ if (options.show == null || options.show != false) {
7612
+ if (options.color && !options.fillStyle) {
7613
+ options.fillStyle = options.color;
7614
+ }
7615
+ if (options.color && !options.strokeStyle) {
7616
+ options.strokeStyle = options.color;
7617
+ }
7618
+ switch (this.style) {
7619
+ case 'diamond':
7620
+ this.drawDiamond(x,y,ctx, false, options);
7621
+ break;
7622
+ case 'filledDiamond':
7623
+ this.drawDiamond(x,y,ctx, true, options);
7624
+ break;
7625
+ case 'circle':
7626
+ this.drawCircle(x,y,ctx, false, options);
7627
+ break;
7628
+ case 'filledCircle':
7629
+ this.drawCircle(x,y,ctx, true, options);
7630
+ break;
7631
+ case 'square':
7632
+ this.drawSquare(x,y,ctx, false, options);
7633
+ break;
7634
+ case 'filledSquare':
7635
+ this.drawSquare(x,y,ctx, true, options);
7636
+ break;
7637
+ case 'x':
7638
+ this.drawX(x,y,ctx, true, options);
7639
+ break;
7640
+ case 'plus':
7641
+ this.drawPlus(x,y,ctx, true, options);
7642
+ break;
7643
+ case 'dash':
7644
+ this.drawDash(x,y,ctx, true, options);
7645
+ break;
7646
+ case 'line':
7647
+ this.drawLine(x, y, ctx, false, options);
7648
+ break;
7649
+ default:
7650
+ this.drawDiamond(x,y,ctx, false, options);
7651
+ break;
7652
+ }
7653
+ }
7654
+ };
7655
+
7656
+ // class: $.jqplot.shadowRenderer
7657
+ // The default jqPlot shadow renderer, rendering shadows behind shapes.
7658
+ $.jqplot.ShadowRenderer = function(options){
7659
+ // Group: Properties
7660
+
7661
+ // prop: angle
7662
+ // Angle of the shadow in degrees. Measured counter-clockwise from the x axis.
7663
+ this.angle = 45;
7664
+ // prop: offset
7665
+ // Pixel offset at the given shadow angle of each shadow stroke from the last stroke.
7666
+ this.offset = 1;
7667
+ // prop: alpha
7668
+ // alpha transparency of shadow stroke.
7669
+ this.alpha = 0.07;
7670
+ // prop: lineWidth
7671
+ // width of the shadow line stroke.
7672
+ this.lineWidth = 1.5;
7673
+ // prop: lineJoin
7674
+ // How line segments of the shadow are joined.
7675
+ this.lineJoin = 'miter';
7676
+ // prop: lineCap
7677
+ // how ends of the shadow line are rendered.
7678
+ this.lineCap = 'round';
7679
+ // prop; closePath
7680
+ // whether line path segment is closed upon itself.
7681
+ this.closePath = false;
7682
+ // prop: fill
7683
+ // whether to fill the shape.
7684
+ this.fill = false;
7685
+ // prop: depth
7686
+ // how many times the shadow is stroked. Each stroke will be offset by offset at angle degrees.
7687
+ this.depth = 3;
7688
+ this.strokeStyle = 'rgba(0,0,0,0.1)';
7689
+ // prop: isarc
7690
+ // whether the shadow is an arc or not.
7691
+ this.isarc = false;
7692
+
7693
+ $.extend(true, this, options);
7694
+ };
7695
+
7696
+ $.jqplot.ShadowRenderer.prototype.init = function(options) {
7697
+ $.extend(true, this, options);
7698
+ };
7699
+
7700
+ // function: draw
7701
+ // draws an transparent black (i.e. gray) shadow.
7702
+ //
7703
+ // ctx - canvas drawing context
7704
+ // points - array of points or [x, y, radius, start angle (rad), end angle (rad)]
7705
+ $.jqplot.ShadowRenderer.prototype.draw = function(ctx, points, options) {
7706
+ ctx.save();
7707
+ var opts = (options != null) ? options : {};
7708
+ var fill = (opts.fill != null) ? opts.fill : this.fill;
7709
+ var fillRect = (opts.fillRect != null) ? opts.fillRect : this.fillRect;
7710
+ var closePath = (opts.closePath != null) ? opts.closePath : this.closePath;
7711
+ var offset = (opts.offset != null) ? opts.offset : this.offset;
7712
+ var alpha = (opts.alpha != null) ? opts.alpha : this.alpha;
7713
+ var depth = (opts.depth != null) ? opts.depth : this.depth;
7714
+ var isarc = (opts.isarc != null) ? opts.isarc : this.isarc;
7715
+ var linePattern = (opts.linePattern != null) ? opts.linePattern : this.linePattern;
7716
+ ctx.lineWidth = (opts.lineWidth != null) ? opts.lineWidth : this.lineWidth;
7717
+ ctx.lineJoin = (opts.lineJoin != null) ? opts.lineJoin : this.lineJoin;
7718
+ ctx.lineCap = (opts.lineCap != null) ? opts.lineCap : this.lineCap;
7719
+ ctx.strokeStyle = opts.strokeStyle || this.strokeStyle || 'rgba(0,0,0,'+alpha+')';
7720
+ ctx.fillStyle = opts.fillStyle || this.fillStyle || 'rgba(0,0,0,'+alpha+')';
7721
+ for (var j=0; j<depth; j++) {
7722
+ var ctxPattern = $.jqplot.LinePattern(ctx, linePattern);
7723
+ ctx.translate(Math.cos(this.angle*Math.PI/180)*offset, Math.sin(this.angle*Math.PI/180)*offset);
7724
+ ctxPattern.beginPath();
7725
+ if (isarc) {
7726
+ ctx.arc(points[0], points[1], points[2], points[3], points[4], true);
7727
+ }
7728
+ else if (fillRect) {
7729
+ if (fillRect) {
7730
+ ctx.fillRect(points[0], points[1], points[2], points[3]);
7731
+ }
7732
+ }
7733
+ else if (points && points.length){
7734
+ var move = true;
7735
+ for (var i=0; i<points.length; i++) {
7736
+ // skip to the first non-null point and move to it.
7737
+ if (points[i][0] != null && points[i][1] != null) {
7738
+ if (move) {
7739
+ ctxPattern.moveTo(points[i][0], points[i][1]);
7740
+ move = false;
7741
+ }
7742
+ else {
7743
+ ctxPattern.lineTo(points[i][0], points[i][1]);
7744
+ }
7745
+ }
7746
+ else {
7747
+ move = true;
7748
+ }
7749
+ }
7750
+
7751
+ }
7752
+ if (closePath) {
7753
+ ctxPattern.closePath();
7754
+ }
7755
+ if (fill) {
7756
+ ctx.fill();
7757
+ }
7758
+ else {
7759
+ ctx.stroke();
7760
+ }
7761
+ }
7762
+ ctx.restore();
7763
+ };
7764
+
7765
+ // class: $.jqplot.shapeRenderer
7766
+ // The default jqPlot shape renderer. Given a set of points will
7767
+ // plot them and either stroke a line (fill = false) or fill them (fill = true).
7768
+ // If a filled shape is desired, closePath = true must also be set to close
7769
+ // the shape.
7770
+ $.jqplot.ShapeRenderer = function(options){
7771
+
7772
+ this.lineWidth = 1.5;
7773
+ // prop: linePattern
7774
+ // line pattern 'dashed', 'dotted', 'solid', some combination
7775
+ // of '-' and '.' characters such as '.-.' or a numerical array like
7776
+ // [draw, skip, draw, skip, ...] such as [1, 10] to draw a dotted line,
7777
+ // [1, 10, 20, 10] to draw a dot-dash line, and so on.
7778
+ this.linePattern = 'solid';
7779
+ // prop: lineJoin
7780
+ // How line segments of the shadow are joined.
7781
+ this.lineJoin = 'miter';
7782
+ // prop: lineCap
7783
+ // how ends of the shadow line are rendered.
7784
+ this.lineCap = 'round';
7785
+ // prop; closePath
7786
+ // whether line path segment is closed upon itself.
7787
+ this.closePath = false;
7788
+ // prop: fill
7789
+ // whether to fill the shape.
7790
+ this.fill = false;
7791
+ // prop: isarc
7792
+ // whether the shadow is an arc or not.
7793
+ this.isarc = false;
7794
+ // prop: fillRect
7795
+ // true to draw shape as a filled rectangle.
7796
+ this.fillRect = false;
7797
+ // prop: strokeRect
7798
+ // true to draw shape as a stroked rectangle.
7799
+ this.strokeRect = false;
7800
+ // prop: clearRect
7801
+ // true to cear a rectangle.
7802
+ this.clearRect = false;
7803
+ // prop: strokeStyle
7804
+ // css color spec for the stoke style
7805
+ this.strokeStyle = '#999999';
7806
+ // prop: fillStyle
7807
+ // css color spec for the fill style.
7808
+ this.fillStyle = '#999999';
7809
+
7810
+ $.extend(true, this, options);
7811
+ };
7812
+
7813
+ $.jqplot.ShapeRenderer.prototype.init = function(options) {
7814
+ $.extend(true, this, options);
7815
+ };
7816
+
7817
+ // function: draw
7818
+ // draws the shape.
7819
+ //
7820
+ // ctx - canvas drawing context
7821
+ // points - array of points for shapes or
7822
+ // [x, y, width, height] for rectangles or
7823
+ // [x, y, radius, start angle (rad), end angle (rad)] for circles and arcs.
7824
+ $.jqplot.ShapeRenderer.prototype.draw = function(ctx, points, options) {
7825
+ ctx.save();
7826
+ var opts = (options != null) ? options : {};
7827
+ var fill = (opts.fill != null) ? opts.fill : this.fill;
7828
+ var closePath = (opts.closePath != null) ? opts.closePath : this.closePath;
7829
+ var fillRect = (opts.fillRect != null) ? opts.fillRect : this.fillRect;
7830
+ var strokeRect = (opts.strokeRect != null) ? opts.strokeRect : this.strokeRect;
7831
+ var clearRect = (opts.clearRect != null) ? opts.clearRect : this.clearRect;
7832
+ var isarc = (opts.isarc != null) ? opts.isarc : this.isarc;
7833
+ var linePattern = (opts.linePattern != null) ? opts.linePattern : this.linePattern;
7834
+ var ctxPattern = $.jqplot.LinePattern(ctx, linePattern);
7835
+ ctx.lineWidth = opts.lineWidth || this.lineWidth;
7836
+ ctx.lineJoin = opts.lineJoin || this.lineJoin;
7837
+ ctx.lineCap = opts.lineCap || this.lineCap;
7838
+ ctx.strokeStyle = (opts.strokeStyle || opts.color) || this.strokeStyle;
7839
+ ctx.fillStyle = opts.fillStyle || this.fillStyle;
7840
+ ctx.beginPath();
7841
+ if (isarc) {
7842
+ ctx.arc(points[0], points[1], points[2], points[3], points[4], true);
7843
+ if (closePath) {
7844
+ ctx.closePath();
7845
+ }
7846
+ if (fill) {
7847
+ ctx.fill();
7848
+ }
7849
+ else {
7850
+ ctx.stroke();
7851
+ }
7852
+ ctx.restore();
7853
+ return;
7854
+ }
7855
+ else if (clearRect) {
7856
+ ctx.clearRect(points[0], points[1], points[2], points[3]);
7857
+ ctx.restore();
7858
+ return;
7859
+ }
7860
+ else if (fillRect || strokeRect) {
7861
+ if (fillRect) {
7862
+ ctx.fillRect(points[0], points[1], points[2], points[3]);
7863
+ }
7864
+ if (strokeRect) {
7865
+ ctx.strokeRect(points[0], points[1], points[2], points[3]);
7866
+ ctx.restore();
7867
+ return;
7868
+ }
7869
+ }
7870
+ else if (points && points.length){
7871
+ var move = true;
7872
+ for (var i=0; i<points.length; i++) {
7873
+ // skip to the first non-null point and move to it.
7874
+ if (points[i][0] != null && points[i][1] != null) {
7875
+ if (move) {
7876
+ ctxPattern.moveTo(points[i][0], points[i][1]);
7877
+ move = false;
7878
+ }
7879
+ else {
7880
+ ctxPattern.lineTo(points[i][0], points[i][1]);
7881
+ }
7882
+ }
7883
+ else {
7884
+ move = true;
7885
+ }
7886
+ }
7887
+ if (closePath) {
7888
+ ctxPattern.closePath();
7889
+ }
7890
+ if (fill) {
7891
+ ctx.fill();
7892
+ }
7893
+ else {
7894
+ ctx.stroke();
7895
+ }
7896
+ }
7897
+ ctx.restore();
7898
+ };
7899
+
7900
+ // class $.jqplot.TableLegendRenderer
7901
+ // The default legend renderer for jqPlot.
7902
+ $.jqplot.TableLegendRenderer = function(){
7903
+ //
7904
+ };
7905
+
7906
+ $.jqplot.TableLegendRenderer.prototype.init = function(options) {
7907
+ $.extend(true, this, options);
7908
+ };
7909
+
7910
+ $.jqplot.TableLegendRenderer.prototype.addrow = function (label, color, pad, reverse) {
7911
+ var rs = (pad) ? this.rowSpacing+'px' : '0px';
7912
+ var tr;
7913
+ var td;
7914
+ var elem;
7915
+ var div0;
7916
+ var div1;
7917
+ elem = document.createElement('tr');
7918
+ tr = $(elem);
7919
+ tr.addClass('jqplot-table-legend');
7920
+ elem = null;
7921
+
7922
+ if (reverse){
7923
+ tr.prependTo(this._elem);
7924
+ }
7925
+
7926
+ else{
7927
+ tr.appendTo(this._elem);
7928
+ }
7929
+
7930
+ if (this.showSwatches) {
7931
+ td = $(document.createElement('td'));
7932
+ td.addClass('jqplot-table-legend jqplot-table-legend-swatch');
7933
+ td.css({textAlign: 'center', paddingTop: rs});
7934
+
7935
+ div0 = $(document.createElement('div'));
7936
+ div0.addClass('jqplot-table-legend-swatch-outline');
7937
+ div1 = $(document.createElement('div'));
7938
+ div1.addClass('jqplot-table-legend-swatch');
7939
+ div1.css({backgroundColor: color, borderColor: color});
7940
+
7941
+ tr.append(td.append(div0.append(div1)));
7942
+
7943
+ // $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
7944
+ // '<div><div class="jqplot-table-legend-swatch" style="background-color:'+color+';border-color:'+color+';"></div>'+
7945
+ // '</div></td>').appendTo(tr);
7946
+ }
7947
+ if (this.showLabels) {
7948
+ td = $(document.createElement('td'));
7949
+ td.addClass('jqplot-table-legend jqplot-table-legend-label');
7950
+ td.css('paddingTop', rs);
7951
+ tr.append(td);
7952
+
7953
+ // elem = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
7954
+ // elem.appendTo(tr);
7955
+ if (this.escapeHtml) {
7956
+ td.text(label);
7957
+ }
7958
+ else {
7959
+ td.html(label);
7960
+ }
7961
+ }
7962
+ td = null;
7963
+ div0 = null;
7964
+ div1 = null;
7965
+ tr = null;
7966
+ elem = null;
7967
+ };
7968
+
7969
+ // called with scope of legend
7970
+ $.jqplot.TableLegendRenderer.prototype.draw = function() {
7971
+ if (this._elem) {
7972
+ this._elem.emptyForce();
7973
+ this._elem = null;
7974
+ }
7975
+
7976
+ if (this.show) {
7977
+ var series = this._series;
7978
+ // make a table. one line label per row.
7979
+ var elem = document.createElement('table');
7980
+ this._elem = $(elem);
7981
+ this._elem.addClass('jqplot-table-legend');
7982
+
7983
+ var ss = {position:'absolute'};
7984
+ if (this.background) {
7985
+ ss['background'] = this.background;
7986
+ }
7987
+ if (this.border) {
7988
+ ss['border'] = this.border;
7989
+ }
7990
+ if (this.fontSize) {
7991
+ ss['fontSize'] = this.fontSize;
7992
+ }
7993
+ if (this.fontFamily) {
7994
+ ss['fontFamily'] = this.fontFamily;
7995
+ }
7996
+ if (this.textColor) {
7997
+ ss['textColor'] = this.textColor;
7998
+ }
7999
+ if (this.marginTop != null) {
8000
+ ss['marginTop'] = this.marginTop;
8001
+ }
8002
+ if (this.marginBottom != null) {
8003
+ ss['marginBottom'] = this.marginBottom;
8004
+ }
8005
+ if (this.marginLeft != null) {
8006
+ ss['marginLeft'] = this.marginLeft;
8007
+ }
8008
+ if (this.marginRight != null) {
8009
+ ss['marginRight'] = this.marginRight;
8010
+ }
8011
+
8012
+
8013
+ var pad = false,
8014
+ reverse = false,
8015
+ s;
8016
+ for (var i = 0; i< series.length; i++) {
8017
+ s = series[i];
8018
+ if (s._stack || s.renderer.constructor == $.jqplot.BezierCurveRenderer){
8019
+ reverse = true;
8020
+ }
8021
+ if (s.show && s.showLabel) {
8022
+ var lt = this.labels[i] || s.label.toString();
8023
+ if (lt) {
8024
+ var color = s.color;
8025
+ if (reverse && i < series.length - 1){
8026
+ pad = true;
8027
+ }
8028
+ else if (reverse && i == series.length - 1){
8029
+ pad = false;
8030
+ }
8031
+ this.renderer.addrow.call(this, lt, color, pad, reverse);
8032
+ pad = true;
8033
+ }
8034
+ // let plugins add more rows to legend. Used by trend line plugin.
8035
+ for (var j=0; j<$.jqplot.addLegendRowHooks.length; j++) {
8036
+ var item = $.jqplot.addLegendRowHooks[j].call(this, s);
8037
+ if (item) {
8038
+ this.renderer.addrow.call(this, item.label, item.color, pad);
8039
+ pad = true;
8040
+ }
8041
+ }
8042
+ lt = null;
8043
+ }
8044
+ }
8045
+ }
8046
+ return this._elem;
8047
+ };
8048
+
8049
+ $.jqplot.TableLegendRenderer.prototype.pack = function(offsets) {
8050
+ if (this.show) {
8051
+ if (this.placement == 'insideGrid') {
8052
+ switch (this.location) {
8053
+ case 'nw':
8054
+ var a = offsets.left;
8055
+ var b = offsets.top;
8056
+ this._elem.css('left', a);
8057
+ this._elem.css('top', b);
8058
+ break;
8059
+ case 'n':
8060
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
8061
+ var b = offsets.top;
8062
+ this._elem.css('left', a);
8063
+ this._elem.css('top', b);
8064
+ break;
8065
+ case 'ne':
8066
+ var a = offsets.right;
8067
+ var b = offsets.top;
8068
+ this._elem.css({right:a, top:b});
8069
+ break;
8070
+ case 'e':
8071
+ var a = offsets.right;
8072
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
8073
+ this._elem.css({right:a, top:b});
8074
+ break;
8075
+ case 'se':
8076
+ var a = offsets.right;
8077
+ var b = offsets.bottom;
8078
+ this._elem.css({right:a, bottom:b});
8079
+ break;
8080
+ case 's':
8081
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
8082
+ var b = offsets.bottom;
8083
+ this._elem.css({left:a, bottom:b});
8084
+ break;
8085
+ case 'sw':
8086
+ var a = offsets.left;
8087
+ var b = offsets.bottom;
8088
+ this._elem.css({left:a, bottom:b});
8089
+ break;
8090
+ case 'w':
8091
+ var a = offsets.left;
8092
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
8093
+ this._elem.css({left:a, top:b});
8094
+ break;
8095
+ default: // same as 'se'
8096
+ var a = offsets.right;
8097
+ var b = offsets.bottom;
8098
+ this._elem.css({right:a, bottom:b});
8099
+ break;
8100
+ }
8101
+
8102
+ }
8103
+ else if (this.placement == 'outside'){
8104
+ switch (this.location) {
8105
+ case 'nw':
8106
+ var a = this._plotDimensions.width - offsets.left;
8107
+ var b = offsets.top;
8108
+ this._elem.css('right', a);
8109
+ this._elem.css('top', b);
8110
+ break;
8111
+ case 'n':
8112
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
8113
+ var b = this._plotDimensions.height - offsets.top;
8114
+ this._elem.css('left', a);
8115
+ this._elem.css('bottom', b);
8116
+ break;
8117
+ case 'ne':
8118
+ var a = this._plotDimensions.width - offsets.right;
8119
+ var b = offsets.top;
8120
+ this._elem.css({left:a, top:b});
8121
+ break;
8122
+ case 'e':
8123
+ var a = this._plotDimensions.width - offsets.right;
8124
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
8125
+ this._elem.css({left:a, top:b});
8126
+ break;
8127
+ case 'se':
8128
+ var a = this._plotDimensions.width - offsets.right;
8129
+ var b = offsets.bottom;
8130
+ this._elem.css({left:a, bottom:b});
8131
+ break;
8132
+ case 's':
8133
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
8134
+ var b = this._plotDimensions.height - offsets.bottom;
8135
+ this._elem.css({left:a, top:b});
8136
+ break;
8137
+ case 'sw':
8138
+ var a = this._plotDimensions.width - offsets.left;
8139
+ var b = offsets.bottom;
8140
+ this._elem.css({right:a, bottom:b});
8141
+ break;
8142
+ case 'w':
8143
+ var a = this._plotDimensions.width - offsets.left;
8144
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
8145
+ this._elem.css({right:a, top:b});
8146
+ break;
8147
+ default: // same as 'se'
8148
+ var a = offsets.right;
8149
+ var b = offsets.bottom;
8150
+ this._elem.css({right:a, bottom:b});
8151
+ break;
8152
+ }
8153
+ }
8154
+ else {
8155
+ switch (this.location) {
8156
+ case 'nw':
8157
+ this._elem.css({left:0, top:offsets.top});
8158
+ break;
8159
+ case 'n':
8160
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
8161
+ this._elem.css({left: a, top:offsets.top});
8162
+ break;
8163
+ case 'ne':
8164
+ this._elem.css({right:0, top:offsets.top});
8165
+ break;
8166
+ case 'e':
8167
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
8168
+ this._elem.css({right:offsets.right, top:b});
8169
+ break;
8170
+ case 'se':
8171
+ this._elem.css({right:offsets.right, bottom:offsets.bottom});
8172
+ break;
8173
+ case 's':
8174
+ var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
8175
+ this._elem.css({left: a, bottom:offsets.bottom});
8176
+ break;
8177
+ case 'sw':
8178
+ this._elem.css({left:offsets.left, bottom:offsets.bottom});
8179
+ break;
8180
+ case 'w':
8181
+ var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
8182
+ this._elem.css({left:offsets.left, top:b});
8183
+ break;
8184
+ default: // same as 'se'
8185
+ this._elem.css({right:offsets.right, bottom:offsets.bottom});
8186
+ break;
8187
+ }
8188
+ }
8189
+ }
8190
+ };
8191
+
8192
+ /**
8193
+ * Class: $.jqplot.ThemeEngine
8194
+ * Theme Engine provides a programatic way to change some of the more
8195
+ * common jqplot styling options such as fonts, colors and grid options.
8196
+ * A theme engine instance is created with each plot. The theme engine
8197
+ * manages a collection of themes which can be modified, added to, or
8198
+ * applied to the plot.
8199
+ *
8200
+ * The themeEngine class is not instantiated directly.
8201
+ * When a plot is initialized, the current plot options are scanned
8202
+ * an a default theme named "Default" is created. This theme is
8203
+ * used as the basis for other themes added to the theme engine and
8204
+ * is always available.
8205
+ *
8206
+ * A theme is a simple javascript object with styling parameters for
8207
+ * various entities of the plot. A theme has the form:
8208
+ *
8209
+ *
8210
+ * > {
8211
+ * > _name:f "Default",
8212
+ * > target: {
8213
+ * > backgroundColor: "transparent"
8214
+ * > },
8215
+ * > legend: {
8216
+ * > textColor: null,
8217
+ * > fontFamily: null,
8218
+ * > fontSize: null,
8219
+ * > border: null,
8220
+ * > background: null
8221
+ * > },
8222
+ * > title: {
8223
+ * > textColor: "rgb(102, 102, 102)",
8224
+ * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif",
8225
+ * > fontSize: "19.2px",
8226
+ * > textAlign: "center"
8227
+ * > },
8228
+ * > seriesStyles: {},
8229
+ * > series: [{
8230
+ * > color: "#4bb2c5",
8231
+ * > lineWidth: 2.5,
8232
+ * > linePattern: "solid",
8233
+ * > shadow: true,
8234
+ * > fillColor: "#4bb2c5",
8235
+ * > showMarker: true,
8236
+ * > markerOptions: {
8237
+ * > color: "#4bb2c5",
8238
+ * > show: true,
8239
+ * > style: 'filledCircle',
8240
+ * > lineWidth: 1.5,
8241
+ * > size: 4,
8242
+ * > shadow: true
8243
+ * > }
8244
+ * > }],
8245
+ * > grid: {
8246
+ * > drawGridlines: true,
8247
+ * > gridLineColor: "#cccccc",
8248
+ * > gridLineWidth: 1,
8249
+ * > backgroundColor: "#fffdf6",
8250
+ * > borderColor: "#999999",
8251
+ * > borderWidth: 2,
8252
+ * > shadow: true
8253
+ * > },
8254
+ * > axesStyles: {
8255
+ * > label: {},
8256
+ * > ticks: {}
8257
+ * > },
8258
+ * > axes: {
8259
+ * > xaxis: {
8260
+ * > borderColor: "#999999",
8261
+ * > borderWidth: 2,
8262
+ * > ticks: {
8263
+ * > show: true,
8264
+ * > showGridline: true,
8265
+ * > showLabel: true,
8266
+ * > showMark: true,
8267
+ * > size: 4,
8268
+ * > textColor: "",
8269
+ * > whiteSpace: "nowrap",
8270
+ * > fontSize: "12px",
8271
+ * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif"
8272
+ * > },
8273
+ * > label: {
8274
+ * > textColor: "rgb(102, 102, 102)",
8275
+ * > whiteSpace: "normal",
8276
+ * > fontSize: "14.6667px",
8277
+ * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif",
8278
+ * > fontWeight: "400"
8279
+ * > }
8280
+ * > },
8281
+ * > yaxis: {
8282
+ * > borderColor: "#999999",
8283
+ * > borderWidth: 2,
8284
+ * > ticks: {
8285
+ * > show: true,
8286
+ * > showGridline: true,
8287
+ * > showLabel: true,
8288
+ * > showMark: true,
8289
+ * > size: 4,
8290
+ * > textColor: "",
8291
+ * > whiteSpace: "nowrap",
8292
+ * > fontSize: "12px",
8293
+ * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif"
8294
+ * > },
8295
+ * > label: {
8296
+ * > textColor: null,
8297
+ * > whiteSpace: null,
8298
+ * > fontSize: null,
8299
+ * > fontFamily: null,
8300
+ * > fontWeight: null
8301
+ * > }
8302
+ * > },
8303
+ * > x2axis: {...
8304
+ * > },
8305
+ * > ...
8306
+ * > y9axis: {...
8307
+ * > }
8308
+ * > }
8309
+ * > }
8310
+ *
8311
+ * "seriesStyles" is a style object that will be applied to all series in the plot.
8312
+ * It will forcibly override any styles applied on the individual series. "axesStyles" is
8313
+ * a style object that will be applied to all axes in the plot. It will also forcibly
8314
+ * override any styles on the individual axes.
8315
+ *
8316
+ * The example shown above has series options for a line series. Options for other
8317
+ * series types are shown below:
8318
+ *
8319
+ * Bar Series:
8320
+ *
8321
+ * > {
8322
+ * > color: "#4bb2c5",
8323
+ * > seriesColors: ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"],
8324
+ * > lineWidth: 2.5,
8325
+ * > shadow: true,
8326
+ * > barPadding: 2,
8327
+ * > barMargin: 10,
8328
+ * > barWidth: 15.09375,
8329
+ * > 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)"]
8330
+ * > }
8331
+ *
8332
+ * Pie Series:
8333
+ *
8334
+ * > {
8335
+ * > seriesColors: ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"],
8336
+ * > padding: 20,
8337
+ * > sliceMargin: 0,
8338
+ * > fill: true,
8339
+ * > shadow: true,
8340
+ * > startAngle: 0,
8341
+ * > lineWidth: 2.5,
8342
+ * > 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)"]
8343
+ * > }
8344
+ *
8345
+ * Funnel Series:
8346
+ *
8347
+ * > {
8348
+ * > color: "#4bb2c5",
8349
+ * > lineWidth: 2,
8350
+ * > shadow: true,
8351
+ * > padding: {
8352
+ * > top: 20,
8353
+ * > right: 20,
8354
+ * > bottom: 20,
8355
+ * > left: 20
8356
+ * > },
8357
+ * > sectionMargin: 6,
8358
+ * > seriesColors: ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"],
8359
+ * > 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)"]
8360
+ * > }
8361
+ *
8362
+ */
8363
+ $.jqplot.ThemeEngine = function(){
8364
+ // Group: Properties
8365
+ //
8366
+ // prop: themes
8367
+ // hash of themes managed by the theme engine.
8368
+ // Indexed by theme name.
8369
+ this.themes = {};
8370
+ // prop: activeTheme
8371
+ // Pointer to currently active theme
8372
+ this.activeTheme=null;
8373
+
8374
+ };
8375
+
8376
+ // called with scope of plot
8377
+ $.jqplot.ThemeEngine.prototype.init = function() {
8378
+ // get the Default theme from the current plot settings.
8379
+ var th = new $.jqplot.Theme({_name:'Default'});
8380
+ var n, i, nn;
8381
+
8382
+ for (n in th.target) {
8383
+ if (n == "textColor") {
8384
+ th.target[n] = this.target.css('color');
8385
+ }
8386
+ else {
8387
+ th.target[n] = this.target.css(n);
8388
+ }
8389
+ }
8390
+
8391
+ if (this.title.show && this.title._elem) {
8392
+ for (n in th.title) {
8393
+ if (n == "textColor") {
8394
+ th.title[n] = this.title._elem.css('color');
8395
+ }
8396
+ else {
8397
+ th.title[n] = this.title._elem.css(n);
8398
+ }
8399
+ }
8400
+ }
8401
+
8402
+ for (n in th.grid) {
8403
+ th.grid[n] = this.grid[n];
8404
+ }
8405
+ if (th.grid.backgroundColor == null && this.grid.background != null) {
8406
+ th.grid.backgroundColor = this.grid.background;
8407
+ }
8408
+ if (this.legend.show && this.legend._elem) {
8409
+ for (n in th.legend) {
8410
+ if (n == 'textColor') {
8411
+ th.legend[n] = this.legend._elem.css('color');
8412
+ }
8413
+ else {
8414
+ th.legend[n] = this.legend._elem.css(n);
8415
+ }
8416
+ }
8417
+ }
8418
+ var s;
8419
+
8420
+ for (i=0; i<this.series.length; i++) {
8421
+ s = this.series[i];
8422
+ if (s.renderer.constructor == $.jqplot.LineRenderer) {
8423
+ th.series.push(new LineSeriesProperties());
8424
+ }
8425
+ else if (s.renderer.constructor == $.jqplot.BarRenderer) {
8426
+ th.series.push(new BarSeriesProperties());
8427
+ }
8428
+ else if (s.renderer.constructor == $.jqplot.PieRenderer) {
8429
+ th.series.push(new PieSeriesProperties());
8430
+ }
8431
+ else if (s.renderer.constructor == $.jqplot.DonutRenderer) {
8432
+ th.series.push(new DonutSeriesProperties());
8433
+ }
8434
+ else if (s.renderer.constructor == $.jqplot.FunnelRenderer) {
8435
+ th.series.push(new FunnelSeriesProperties());
8436
+ }
8437
+ else if (s.renderer.constructor == $.jqplot.MeterGaugeRenderer) {
8438
+ th.series.push(new MeterSeriesProperties());
8439
+ }
8440
+ else {
8441
+ th.series.push({});
8442
+ }
8443
+ for (n in th.series[i]) {
8444
+ th.series[i][n] = s[n];
8445
+ }
8446
+ }
8447
+ var a, ax;
8448
+ for (n in this.axes) {
8449
+ ax = this.axes[n];
8450
+ a = th.axes[n] = new AxisProperties();
8451
+ a.borderColor = ax.borderColor;
8452
+ a.borderWidth = ax.borderWidth;
8453
+ if (ax._ticks && ax._ticks[0]) {
8454
+ for (nn in a.ticks) {
8455
+ if (ax._ticks[0].hasOwnProperty(nn)) {
8456
+ a.ticks[nn] = ax._ticks[0][nn];
8457
+ }
8458
+ else if (ax._ticks[0]._elem){
8459
+ a.ticks[nn] = ax._ticks[0]._elem.css(nn);
8460
+ }
8461
+ }
8462
+ }
8463
+ if (ax._label && ax._label.show) {
8464
+ for (nn in a.label) {
8465
+ // a.label[nn] = ax._label._elem.css(nn);
8466
+ if (ax._label[nn]) {
8467
+ a.label[nn] = ax._label[nn];
8468
+ }
8469
+ else if (ax._label._elem){
8470
+ if (nn == 'textColor') {
8471
+ a.label[nn] = ax._label._elem.css('color');
8472
+ }
8473
+ else {
8474
+ a.label[nn] = ax._label._elem.css(nn);
8475
+ }
8476
+ }
8477
+ }
8478
+ }
8479
+ }
8480
+ this.themeEngine._add(th);
8481
+ this.themeEngine.activeTheme = this.themeEngine.themes[th._name];
8482
+ };
8483
+ /**
8484
+ * Group: methods
8485
+ *
8486
+ * method: get
8487
+ *
8488
+ * Get and return the named theme or the active theme if no name given.
8489
+ *
8490
+ * parameter:
8491
+ *
8492
+ * name - name of theme to get.
8493
+ *
8494
+ * returns:
8495
+ *
8496
+ * Theme instance of given name.
8497
+ */
8498
+ $.jqplot.ThemeEngine.prototype.get = function(name) {
8499
+ if (!name) {
8500
+ // return the active theme
8501
+ return this.activeTheme;
8502
+ }
8503
+ else {
8504
+ return this.themes[name];
8505
+ }
8506
+ };
8507
+
8508
+ function numericalOrder(a,b) { return a-b; }
8509
+
8510
+ /**
8511
+ * method: getThemeNames
8512
+ *
8513
+ * Return the list of theme names in this manager in alpha-numerical order.
8514
+ *
8515
+ * parameter:
8516
+ *
8517
+ * None
8518
+ *
8519
+ * returns:
8520
+ *
8521
+ * A the list of theme names in this manager in alpha-numerical order.
8522
+ */
8523
+ $.jqplot.ThemeEngine.prototype.getThemeNames = function() {
8524
+ var tn = [];
8525
+ for (var n in this.themes) {
8526
+ tn.push(n);
8527
+ }
8528
+ return tn.sort(numericalOrder);
8529
+ };
8530
+
8531
+ /**
8532
+ * method: getThemes
8533
+ *
8534
+ * Return a list of themes in alpha-numerical order by name.
8535
+ *
8536
+ * parameter:
8537
+ *
8538
+ * None
8539
+ *
8540
+ * returns:
8541
+ *
8542
+ * A list of themes in alpha-numerical order by name.
8543
+ */
8544
+ $.jqplot.ThemeEngine.prototype.getThemes = function() {
8545
+ var tn = [];
8546
+ var themes = [];
8547
+ for (var n in this.themes) {
8548
+ tn.push(n);
8549
+ }
8550
+ tn.sort(numericalOrder);
8551
+ for (var i=0; i<tn.length; i++) {
8552
+ themes.push(this.themes[tn[i]]);
8553
+ }
8554
+ return themes;
8555
+ };
8556
+
8557
+ $.jqplot.ThemeEngine.prototype.activate = function(plot, name) {
8558
+ // sometimes need to redraw whole plot.
8559
+ var redrawPlot = false;
8560
+ if (!name && this.activeTheme && this.activeTheme._name) {
8561
+ name = this.activeTheme._name;
8562
+ }
8563
+ if (!this.themes.hasOwnProperty(name)) {
8564
+ throw new Error("No theme of that name");
8565
+ }
8566
+ else {
8567
+ var th = this.themes[name];
8568
+ this.activeTheme = th;
8569
+ var val, checkBorderColor = false, checkBorderWidth = false;
8570
+ var arr = ['xaxis', 'x2axis', 'yaxis', 'y2axis'];
8571
+
8572
+ for (i=0; i<arr.length; i++) {
8573
+ var ax = arr[i];
8574
+ if (th.axesStyles.borderColor != null) {
8575
+ plot.axes[ax].borderColor = th.axesStyles.borderColor;
8576
+ }
8577
+ if (th.axesStyles.borderWidth != null) {
8578
+ plot.axes[ax].borderWidth = th.axesStyles.borderWidth;
8579
+ }
8580
+ }
8581
+
8582
+ for (var axname in plot.axes) {
8583
+ var axis = plot.axes[axname];
8584
+ if (axis.show) {
8585
+ var thaxis = th.axes[axname] || {};
8586
+ var thaxstyle = th.axesStyles;
8587
+ var thax = $.jqplot.extend(true, {}, thaxis, thaxstyle);
8588
+ val = (th.axesStyles.borderColor != null) ? th.axesStyles.borderColor : thax.borderColor;
8589
+ if (thax.borderColor != null) {
8590
+ axis.borderColor = thax.borderColor;
8591
+ redrawPlot = true;
8592
+ }
8593
+ val = (th.axesStyles.borderWidth != null) ? th.axesStyles.borderWidth : thax.borderWidth;
8594
+ if (thax.borderWidth != null) {
8595
+ axis.borderWidth = thax.borderWidth;
8596
+ redrawPlot = true;
8597
+ }
8598
+ if (axis._ticks && axis._ticks[0]) {
8599
+ for (var nn in thax.ticks) {
8600
+ // val = null;
8601
+ // if (th.axesStyles.ticks && th.axesStyles.ticks[nn] != null) {
8602
+ // val = th.axesStyles.ticks[nn];
8603
+ // }
8604
+ // else if (thax.ticks[nn] != null){
8605
+ // val = thax.ticks[nn]
8606
+ // }
8607
+ val = thax.ticks[nn];
8608
+ if (val != null) {
8609
+ axis.tickOptions[nn] = val;
8610
+ axis._ticks = [];
8611
+ redrawPlot = true;
8612
+ }
8613
+ }
8614
+ }
8615
+ if (axis._label && axis._label.show) {
8616
+ for (var nn in thax.label) {
8617
+ // val = null;
8618
+ // if (th.axesStyles.label && th.axesStyles.label[nn] != null) {
8619
+ // val = th.axesStyles.label[nn];
8620
+ // }
8621
+ // else if (thax.label && thax.label[nn] != null){
8622
+ // val = thax.label[nn]
8623
+ // }
8624
+ val = thax.label[nn];
8625
+ if (val != null) {
8626
+ axis.labelOptions[nn] = val;
8627
+ redrawPlot = true;
8628
+ }
8629
+ }
8630
+ }
8631
+
8632
+ }
8633
+ }
8634
+
8635
+ for (var n in th.grid) {
8636
+ if (th.grid[n] != null) {
8637
+ plot.grid[n] = th.grid[n];
8638
+ }
8639
+ }
8640
+ if (!redrawPlot) {
8641
+ plot.grid.draw();
8642
+ }
8643
+
8644
+ if (plot.legend.show) {
8645
+ for (n in th.legend) {
8646
+ if (th.legend[n] != null) {
8647
+ plot.legend[n] = th.legend[n];
8648
+ }
8649
+ }
8650
+ }
8651
+ if (plot.title.show) {
8652
+ for (n in th.title) {
8653
+ if (th.title[n] != null) {
8654
+ plot.title[n] = th.title[n];
8655
+ }
8656
+ }
8657
+ }
8658
+
8659
+ var i;
8660
+ for (i=0; i<th.series.length; i++) {
8661
+ var opts = {};
8662
+ var redrawSeries = false;
8663
+ for (n in th.series[i]) {
8664
+ val = (th.seriesStyles[n] != null) ? th.seriesStyles[n] : th.series[i][n];
8665
+ if (val != null) {
8666
+ opts[n] = val;
8667
+ if (n == 'color') {
8668
+ plot.series[i].renderer.shapeRenderer.fillStyle = val;
8669
+ plot.series[i].renderer.shapeRenderer.strokeStyle = val;
8670
+ plot.series[i][n] = val;
8671
+ }
8672
+ else if ((n == 'lineWidth') || (n == 'linePattern')) {
8673
+ plot.series[i].renderer.shapeRenderer[n] = val;
8674
+ plot.series[i][n] = val;
8675
+ }
8676
+ else if (n == 'markerOptions') {
8677
+ merge (plot.series[i].markerOptions, val);
8678
+ merge (plot.series[i].markerRenderer, val);
8679
+ }
8680
+ else {
8681
+ plot.series[i][n] = val;
8682
+ }
8683
+ redrawPlot = true;
8684
+ }
8685
+ }
8686
+ }
8687
+
8688
+ if (redrawPlot) {
8689
+ plot.target.empty();
8690
+ plot.draw();
8691
+ }
8692
+
8693
+ for (n in th.target) {
8694
+ if (th.target[n] != null) {
8695
+ plot.target.css(n, th.target[n]);
8696
+ }
8697
+ }
8698
+ }
8699
+
8700
+ };
8701
+
8702
+ $.jqplot.ThemeEngine.prototype._add = function(theme, name) {
8703
+ if (name) {
8704
+ theme._name = name;
8705
+ }
8706
+ if (!theme._name) {
8707
+ theme._name = Date.parse(new Date());
8708
+ }
8709
+ if (!this.themes.hasOwnProperty(theme._name)) {
8710
+ this.themes[theme._name] = theme;
8711
+ }
8712
+ else {
8713
+ throw new Error("jqplot.ThemeEngine Error: Theme already in use");
8714
+ }
8715
+ };
8716
+
8717
+ // method remove
8718
+ // Delete the named theme, return true on success, false on failure.
8719
+
8720
+
8721
+ /**
8722
+ * method: remove
8723
+ *
8724
+ * Remove the given theme from the themeEngine.
8725
+ *
8726
+ * parameters:
8727
+ *
8728
+ * name - name of the theme to remove.
8729
+ *
8730
+ * returns:
8731
+ *
8732
+ * true on success, false on failure.
8733
+ */
8734
+ $.jqplot.ThemeEngine.prototype.remove = function(name) {
8735
+ if (name == 'Default') {
8736
+ return false;
8737
+ }
8738
+ return delete this.themes[name];
8739
+ };
8740
+
8741
+ /**
8742
+ * method: newTheme
8743
+ *
8744
+ * Create a new theme based on the default theme, adding it the themeEngine.
8745
+ *
8746
+ * parameters:
8747
+ *
8748
+ * name - name of the new theme.
8749
+ * obj - optional object of styles to be applied to this new theme.
8750
+ *
8751
+ * returns:
8752
+ *
8753
+ * new Theme object.
8754
+ */
8755
+ $.jqplot.ThemeEngine.prototype.newTheme = function(name, obj) {
8756
+ if (typeof(name) == 'object') {
8757
+ obj = obj || name;
8758
+ name = null;
8759
+ }
8760
+ if (obj && obj._name) {
8761
+ name = obj._name;
8762
+ }
8763
+ else {
8764
+ name = name || Date.parse(new Date());
8765
+ }
8766
+ // var th = new $.jqplot.Theme(name);
8767
+ var th = this.copy(this.themes['Default']._name, name);
8768
+ $.jqplot.extend(th, obj);
8769
+ return th;
8770
+ };
8771
+
8772
+ // function clone(obj) {
8773
+ // return eval(obj.toSource());
8774
+ // }
8775
+
8776
+ function clone(obj){
8777
+ if(obj == null || typeof(obj) != 'object'){
8778
+ return obj;
8779
+ }
8780
+
8781
+ var temp = new obj.constructor();
8782
+ for(var key in obj){
8783
+ temp[key] = clone(obj[key]);
8784
+ }
8785
+ return temp;
8786
+ }
8787
+
8788
+ $.jqplot.clone = clone;
8789
+
8790
+ function merge(obj1, obj2) {
8791
+ if (obj2 == null || typeof(obj2) != 'object') {
8792
+ return;
8793
+ }
8794
+ for (var key in obj2) {
8795
+ if (key == 'highlightColors') {
8796
+ obj1[key] = clone(obj2[key]);
8797
+ }
8798
+ if (obj2[key] != null && typeof(obj2[key]) == 'object') {
8799
+ if (!obj1.hasOwnProperty(key)) {
8800
+ obj1[key] = {};
8801
+ }
8802
+ merge(obj1[key], obj2[key]);
8803
+ }
8804
+ else {
8805
+ obj1[key] = obj2[key];
8806
+ }
8807
+ }
8808
+ }
8809
+
8810
+ $.jqplot.merge = merge;
8811
+
8812
+ // Use the jQuery 1.3.2 extend function since behaviour in jQuery 1.4 seems problematic
8813
+ $.jqplot.extend = function() {
8814
+ // copy reference to target object
8815
+ var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
8816
+
8817
+ // Handle a deep copy situation
8818
+ if ( typeof target === "boolean" ) {
8819
+ deep = target;
8820
+ target = arguments[1] || {};
8821
+ // skip the boolean and the target
8822
+ i = 2;
8823
+ }
8824
+
8825
+ // Handle case when target is a string or something (possible in deep copy)
8826
+ if ( typeof target !== "object" && !toString.call(target) === "[object Function]" ) {
8827
+ target = {};
8828
+ }
8829
+
8830
+ for ( ; i < length; i++ ){
8831
+ // Only deal with non-null/undefined values
8832
+ if ( (options = arguments[ i ]) != null ) {
8833
+ // Extend the base object
8834
+ for ( var name in options ) {
8835
+ var src = target[ name ], copy = options[ name ];
8836
+
8837
+ // Prevent never-ending loop
8838
+ if ( target === copy ) {
8839
+ continue;
8840
+ }
8841
+
8842
+ // Recurse if we're merging object values
8843
+ if ( deep && copy && typeof copy === "object" && !copy.nodeType ) {
8844
+ target[ name ] = $.jqplot.extend( deep,
8845
+ // Never move original objects, clone them
8846
+ src || ( copy.length != null ? [ ] : { } )
8847
+ , copy );
8848
+ }
8849
+ // Don't bring in undefined values
8850
+ else if ( copy !== undefined ) {
8851
+ target[ name ] = copy;
8852
+ }
8853
+ }
8854
+ }
8855
+ }
8856
+ // Return the modified object
8857
+ return target;
8858
+ };
8859
+
8860
+ /**
8861
+ * method: rename
8862
+ *
8863
+ * Rename a theme.
8864
+ *
8865
+ * parameters:
8866
+ *
8867
+ * oldName - current name of the theme.
8868
+ * newName - desired name of the theme.
8869
+ *
8870
+ * returns:
8871
+ *
8872
+ * new Theme object.
8873
+ */
8874
+ $.jqplot.ThemeEngine.prototype.rename = function (oldName, newName) {
8875
+ if (oldName == 'Default' || newName == 'Default') {
8876
+ throw new Error ("jqplot.ThemeEngine Error: Cannot rename from/to Default");
8877
+ }
8878
+ if (this.themes.hasOwnProperty(newName)) {
8879
+ throw new Error ("jqplot.ThemeEngine Error: New name already in use.");
8880
+ }
8881
+ else if (this.themes.hasOwnProperty(oldName)) {
8882
+ var th = this.copy (oldName, newName);
8883
+ this.remove(oldName);
8884
+ return th;
8885
+ }
8886
+ throw new Error("jqplot.ThemeEngine Error: Old name or new name invalid");
8887
+ };
8888
+
8889
+ /**
8890
+ * method: copy
8891
+ *
8892
+ * Create a copy of an existing theme in the themeEngine, adding it the themeEngine.
8893
+ *
8894
+ * parameters:
8895
+ *
8896
+ * sourceName - name of the existing theme.
8897
+ * targetName - name of the copy.
8898
+ * obj - optional object of style parameter to apply to the new theme.
8899
+ *
8900
+ * returns:
8901
+ *
8902
+ * new Theme object.
8903
+ */
8904
+ $.jqplot.ThemeEngine.prototype.copy = function (sourceName, targetName, obj) {
8905
+ if (targetName == 'Default') {
8906
+ throw new Error ("jqplot.ThemeEngine Error: Cannot copy over Default theme");
8907
+ }
8908
+ if (!this.themes.hasOwnProperty(sourceName)) {
8909
+ var s = "jqplot.ThemeEngine Error: Source name invalid";
8910
+ throw new Error(s);
8911
+ }
8912
+ if (this.themes.hasOwnProperty(targetName)) {
8913
+ var s = "jqplot.ThemeEngine Error: Target name invalid";
8914
+ throw new Error(s);
8915
+ }
8916
+ else {
8917
+ var th = clone(this.themes[sourceName]);
8918
+ th._name = targetName;
8919
+ $.jqplot.extend(true, th, obj);
8920
+ this._add(th);
8921
+ return th;
8922
+ }
8923
+ };
8924
+
8925
+
8926
+ $.jqplot.Theme = function(name, obj) {
8927
+ if (typeof(name) == 'object') {
8928
+ obj = obj || name;
8929
+ name = null;
8930
+ }
8931
+ name = name || Date.parse(new Date());
8932
+ this._name = name;
8933
+ this.target = {
8934
+ backgroundColor: null
8935
+ };
8936
+ this.legend = {
8937
+ textColor: null,
8938
+ fontFamily: null,
8939
+ fontSize: null,
8940
+ border: null,
8941
+ background: null
8942
+ };
8943
+ this.title = {
8944
+ textColor: null,
8945
+ fontFamily: null,
8946
+ fontSize: null,
8947
+ textAlign: null
8948
+ };
8949
+ this.seriesStyles = {};
8950
+ this.series = [];
8951
+ this.grid = {
8952
+ drawGridlines: null,
8953
+ gridLineColor: null,
8954
+ gridLineWidth: null,
8955
+ backgroundColor: null,
8956
+ borderColor: null,
8957
+ borderWidth: null,
8958
+ shadow: null
8959
+ };
8960
+ this.axesStyles = {label:{}, ticks:{}};
8961
+ this.axes = {};
8962
+ if (typeof(obj) == 'string') {
8963
+ this._name = obj;
8964
+ }
8965
+ else if(typeof(obj) == 'object') {
8966
+ $.jqplot.extend(true, this, obj);
8967
+ }
8968
+ };
8969
+
8970
+ var AxisProperties = function() {
8971
+ this.borderColor = null;
8972
+ this.borderWidth = null;
8973
+ this.ticks = new AxisTicks();
8974
+ this.label = new AxisLabel();
8975
+ };
8976
+
8977
+ var AxisTicks = function() {
8978
+ this.show = null;
8979
+ this.showGridline = null;
8980
+ this.showLabel = null;
8981
+ this.showMark = null;
8982
+ this.size = null;
8983
+ this.textColor = null;
8984
+ this.whiteSpace = null;
8985
+ this.fontSize = null;
8986
+ this.fontFamily = null;
8987
+ };
8988
+
8989
+ var AxisLabel = function() {
8990
+ this.textColor = null;
8991
+ this.whiteSpace = null;
8992
+ this.fontSize = null;
8993
+ this.fontFamily = null;
8994
+ this.fontWeight = null;
8995
+ };
8996
+
8997
+ var LineSeriesProperties = function() {
8998
+ this.color=null;
8999
+ this.lineWidth=null;
9000
+ this.linePattern=null;
9001
+ this.shadow=null;
9002
+ this.fillColor=null;
9003
+ this.showMarker=null;
9004
+ this.markerOptions = new MarkerOptions();
9005
+ };
9006
+
9007
+ var MarkerOptions = function() {
9008
+ this.show = null;
9009
+ this.style = null;
9010
+ this.lineWidth = null;
9011
+ this.size = null;
9012
+ this.color = null;
9013
+ this.shadow = null;
9014
+ };
9015
+
9016
+ var BarSeriesProperties = function() {
9017
+ this.color=null;
9018
+ this.seriesColors=null;
9019
+ this.lineWidth=null;
9020
+ this.shadow=null;
9021
+ this.barPadding=null;
9022
+ this.barMargin=null;
9023
+ this.barWidth=null;
9024
+ this.highlightColors=null;
9025
+ };
9026
+
9027
+ var PieSeriesProperties = function() {
9028
+ this.seriesColors=null;
9029
+ this.padding=null;
9030
+ this.sliceMargin=null;
9031
+ this.fill=null;
9032
+ this.shadow=null;
9033
+ this.startAngle=null;
9034
+ this.lineWidth=null;
9035
+ this.highlightColors=null;
9036
+ };
9037
+
9038
+ var DonutSeriesProperties = function() {
9039
+ this.seriesColors=null;
9040
+ this.padding=null;
9041
+ this.sliceMargin=null;
9042
+ this.fill=null;
9043
+ this.shadow=null;
9044
+ this.startAngle=null;
9045
+ this.lineWidth=null;
9046
+ this.innerDiameter=null;
9047
+ this.thickness=null;
9048
+ this.ringMargin=null;
9049
+ this.highlightColors=null;
9050
+ };
9051
+
9052
+ var FunnelSeriesProperties = function() {
9053
+ this.color=null;
9054
+ this.lineWidth=null;
9055
+ this.shadow=null;
9056
+ this.padding=null;
9057
+ this.sectionMargin=null;
9058
+ this.seriesColors=null;
9059
+ this.highlightColors=null;
9060
+ };
9061
+
9062
+ var MeterSeriesProperties = function() {
9063
+ this.padding=null;
9064
+ this.backgroundColor=null;
9065
+ this.ringColor=null;
9066
+ this.tickColor=null;
9067
+ this.ringWidth=null;
9068
+ this.intervalColors=null;
9069
+ this.intervalInnerRadius=null;
9070
+ this.intervalOuterRadius=null;
9071
+ this.hubRadius=null;
9072
+ this.needleThickness=null;
9073
+ this.needlePad=null;
9074
+ };
9075
+
9076
+
9077
+
9078
+
9079
+ $.fn.jqplotChildText = function() {
9080
+ return $(this).contents().filter(function() {
9081
+ return this.nodeType == 3; // Node.TEXT_NODE not defined in I7
9082
+ }).text();
9083
+ };
9084
+
9085
+ // Returns font style as abbreviation for "font" property.
9086
+ $.fn.jqplotGetComputedFontStyle = function() {
9087
+ var css = window.getComputedStyle ? window.getComputedStyle(this[0], "") : this[0].currentStyle;
9088
+ var attrs = css['font-style'] ? ['font-style', 'font-weight', 'font-size', 'font-family'] : ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily'];
9089
+ var style = [];
9090
+
9091
+ for (var i=0 ; i < attrs.length; ++i) {
9092
+ var attr = String(css[attrs[i]]);
9093
+
9094
+ if (attr && attr != 'normal') {
9095
+ style.push(attr);
9096
+ }
9097
+ }
9098
+ return style.join(' ');
9099
+ };
9100
+
9101
+ /**
9102
+ * Namespace: $.fn
9103
+ * jQuery namespace to attach functions to jQuery elements.
9104
+ *
9105
+ */
9106
+
9107
+ $.fn.jqplotToImageCanvas = function(options) {
9108
+
9109
+ options = options || {};
9110
+ var x_offset = (options.x_offset == null) ? 0 : options.x_offset;
9111
+ var y_offset = (options.y_offset == null) ? 0 : options.y_offset;
9112
+ var backgroundColor = (options.backgroundColor == null) ? 'rgb(255,255,255)' : options.backgroundColor;
9113
+
9114
+ if ($(this).width() == 0 || $(this).height() == 0) {
9115
+ return null;
9116
+ }
9117
+
9118
+ // excanvas and hence IE < 9 do not support toDataURL and cannot export images.
9119
+ if ($.jqplot.use_excanvas) {
9120
+ return null;
9121
+ }
9122
+
9123
+ var newCanvas = document.createElement("canvas");
9124
+ var h = $(this).outerHeight(true);
9125
+ var w = $(this).outerWidth(true);
9126
+ var offs = $(this).offset();
9127
+ var plotleft = offs.left;
9128
+ var plottop = offs.top;
9129
+ var transx = 0, transy = 0;
9130
+
9131
+ // have to check if any elements are hanging outside of plot area before rendering,
9132
+ // since changing width of canvas will erase canvas.
9133
+
9134
+ var clses = ['jqplot-table-legend', 'jqplot-xaxis-tick', 'jqplot-x2axis-tick', 'jqplot-yaxis-tick', 'jqplot-y2axis-tick', 'jqplot-y3axis-tick',
9135
+ 'jqplot-y4axis-tick', 'jqplot-y5axis-tick', 'jqplot-y6axis-tick', 'jqplot-y7axis-tick', 'jqplot-y8axis-tick', 'jqplot-y9axis-tick',
9136
+ 'jqplot-xaxis-label', 'jqplot-x2axis-label', 'jqplot-yaxis-label', 'jqplot-y2axis-label', 'jqplot-y3axis-label', 'jqplot-y4axis-label',
9137
+ 'jqplot-y5axis-label', 'jqplot-y6axis-label', 'jqplot-y7axis-label', 'jqplot-y8axis-label', 'jqplot-y9axis-label' ];
9138
+
9139
+ var temptop, templeft, tempbottom, tempright;
9140
+
9141
+ for (var i = 0; i < clses.length; i++) {
9142
+ $(this).find('.'+clses[i]).each(function() {
9143
+ temptop = $(this).offset().top - plottop;
9144
+ templeft = $(this).offset().left - plotleft;
9145
+ tempright = templeft + $(this).outerWidth(true) + transx;
9146
+ tempbottom = temptop + $(this).outerHeight(true) + transy;
9147
+ if (templeft < -transx) {
9148
+ w = w - transx - templeft;
9149
+ transx = -templeft;
9150
+ }
9151
+ if (temptop < -transy) {
9152
+ h = h - transy - temptop;
9153
+ transy = - temptop;
9154
+ }
9155
+ if (tempright > w) {
9156
+ w = tempright;
9157
+ }
9158
+ if (tempbottom > h) {
9159
+ h = tempbottom;
9160
+ }
9161
+ });
9162
+ }
9163
+
9164
+ newCanvas.width = w + Number(x_offset);
9165
+ newCanvas.height = h + Number(y_offset);
9166
+
9167
+ var newContext = newCanvas.getContext("2d");
9168
+
9169
+ newContext.save();
9170
+ newContext.fillStyle = backgroundColor;
9171
+ newContext.fillRect(0,0, newCanvas.width, newCanvas.height);
9172
+ newContext.restore();
9173
+
9174
+ newContext.translate(transx, transy);
9175
+ newContext.textAlign = 'left';
9176
+ newContext.textBaseline = 'top';
9177
+
9178
+ function getLineheight(el) {
9179
+ var lineheight = parseInt($(el).css('line-height'), 10);
9180
+
9181
+ if (isNaN(lineheight)) {
9182
+ lineheight = parseInt($(el).css('font-size'), 10) * 1.2;
9183
+ }
9184
+ return lineheight;
9185
+ }
9186
+
9187
+ function writeWrappedText (el, context, text, left, top, canvasWidth) {
9188
+ var lineheight = getLineheight(el);
9189
+ var tagwidth = $(el).innerWidth();
9190
+ var tagheight = $(el).innerHeight();
9191
+ var words = text.split(/\s+/);
9192
+ var wl = words.length;
9193
+ var w = '';
9194
+ var breaks = [];
9195
+ var temptop = top;
9196
+ var templeft = left;
9197
+
9198
+ for (var i=0; i<wl; i++) {
9199
+ w += words[i];
9200
+ if (context.measureText(w).width > tagwidth && w.length > words[i].length) {
9201
+ breaks.push(i);
9202
+ w = '';
9203
+ i--;
9204
+ }
9205
+ }
9206
+ if (breaks.length === 0) {
9207
+ // center text if necessary
9208
+ if ($(el).css('textAlign') === 'center') {
9209
+ templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx;
9210
+ }
9211
+ context.fillText(text, templeft, top);
9212
+ }
9213
+ else {
9214
+ w = words.slice(0, breaks[0]).join(' ');
9215
+ // center text if necessary
9216
+ if ($(el).css('textAlign') === 'center') {
9217
+ templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx;
9218
+ }
9219
+ context.fillText(w, templeft, temptop);
9220
+ temptop += lineheight;
9221
+ for (var i=1, l=breaks.length; i<l; i++) {
9222
+ w = words.slice(breaks[i-1], breaks[i]).join(' ');
9223
+ // center text if necessary
9224
+ if ($(el).css('textAlign') === 'center') {
9225
+ templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx;
9226
+ }
9227
+ context.fillText(w, templeft, temptop);
9228
+ temptop += lineheight;
9229
+ }
9230
+ w = words.slice(breaks[i-1], words.length).join(' ');
9231
+ // center text if necessary
9232
+ if ($(el).css('textAlign') === 'center') {
9233
+ templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx;
9234
+ }
9235
+ context.fillText(w, templeft, temptop);
9236
+ }
9237
+
9238
+ }
9239
+
9240
+ function _jqpToImage(el, x_offset, y_offset) {
9241
+ var tagname = el.tagName.toLowerCase();
9242
+ var p = $(el).position();
9243
+ var css = window.getComputedStyle ? window.getComputedStyle(el, "") : el.currentStyle; // for IE < 9
9244
+ var left = x_offset + p.left + parseInt(css.marginLeft, 10) + parseInt(css.borderLeftWidth, 10) + parseInt(css.paddingLeft, 10);
9245
+ var top = y_offset + p.top + parseInt(css.marginTop, 10) + parseInt(css.borderTopWidth, 10)+ parseInt(css.paddingTop, 10);
9246
+ var w = newCanvas.width;
9247
+ // var left = x_offset + p.left + $(el).css('marginLeft') + $(el).css('borderLeftWidth')
9248
+
9249
+ // somehow in here, for divs within divs, the width of the inner div should be used instead of the canvas.
9250
+
9251
+ if ((tagname == 'div' || tagname == 'span') && !$(el).hasClass('jqplot-highlighter-tooltip')) {
9252
+ $(el).children().each(function() {
9253
+ _jqpToImage(this, left, top);
9254
+ });
9255
+ var text = $(el).jqplotChildText();
9256
+
9257
+ if (text) {
9258
+ newContext.font = $(el).jqplotGetComputedFontStyle();
9259
+ newContext.fillStyle = $(el).css('color');
9260
+
9261
+ writeWrappedText(el, newContext, text, left, top, w);
9262
+ }
9263
+ }
9264
+
9265
+ // handle the standard table legend
9266
+
9267
+ else if (tagname === 'table' && $(el).hasClass('jqplot-table-legend')) {
9268
+ newContext.strokeStyle = $(el).css('border-top-color');
9269
+ newContext.fillStyle = $(el).css('background-color');
9270
+ newContext.fillRect(left, top, $(el).innerWidth(), $(el).innerHeight());
9271
+ if (parseInt($(el).css('border-top-width'), 10) > 0) {
9272
+ newContext.strokeRect(left, top, $(el).innerWidth(), $(el).innerHeight());
9273
+ }
9274
+
9275
+ // find all the swatches
9276
+ $(el).find('div.jqplot-table-legend-swatch-outline').each(function() {
9277
+ // get the first div and stroke it
9278
+ var elem = $(this);
9279
+ newContext.strokeStyle = elem.css('border-top-color');
9280
+ var l = left + elem.position().left;
9281
+ var t = top + elem.position().top;
9282
+ newContext.strokeRect(l, t, elem.innerWidth(), elem.innerHeight());
9283
+
9284
+ // now fill the swatch
9285
+
9286
+ l += parseInt(elem.css('padding-left'), 10);
9287
+ t += parseInt(elem.css('padding-top'), 10);
9288
+ var h = elem.innerHeight() - 2 * parseInt(elem.css('padding-top'), 10);
9289
+ var w = elem.innerWidth() - 2 * parseInt(elem.css('padding-left'), 10);
9290
+
9291
+ var swatch = elem.children('div.jqplot-table-legend-swatch');
9292
+ newContext.fillStyle = swatch.css('background-color');
9293
+ newContext.fillRect(l, t, w, h);
9294
+ });
9295
+
9296
+ // now add text
9297
+
9298
+ $(el).find('td.jqplot-table-legend-label').each(function(){
9299
+ var elem = $(this);
9300
+ var l = left + elem.position().left;
9301
+ var t = top + elem.position().top + parseInt(elem.css('padding-top'), 10);
9302
+ newContext.font = elem.jqplotGetComputedFontStyle();
9303
+ newContext.fillStyle = elem.css('color');
9304
+ writeWrappedText(elem, newContext, elem.text(), l, t, w);
9305
+ });
9306
+
9307
+ var elem = null;
9308
+ }
9309
+
9310
+ else if (tagname == 'canvas') {
9311
+ newContext.drawImage(el, left, top);
9312
+ }
9313
+ }
9314
+ $(this).children().each(function() {
9315
+ _jqpToImage(this, x_offset, y_offset);
9316
+ });
9317
+ return newCanvas;
9318
+ };
9319
+
9320
+ // return the raw image data string.
9321
+ // Should work on canvas supporting browsers.
9322
+ $.fn.jqplotToImageStr = function(options) {
9323
+ var imgCanvas = $(this).jqplotToImageCanvas(options);
9324
+ if (imgCanvas) {
9325
+ return imgCanvas.toDataURL("image/png");
9326
+ }
9327
+ else {
9328
+ return null;
9329
+ }
9330
+ };
9331
+
9332
+ // return a DOM <img> element and return it.
9333
+ // Should work on canvas supporting browsers.
9334
+ $.fn.jqplotToImageElem = function(options) {
9335
+ var elem = document.createElement("img");
9336
+ var str = $(this).jqplotToImageStr(options);
9337
+ elem.src = str;
9338
+ return elem;
9339
+ };
9340
+
9341
+ // return a string for an <img> element and return it.
9342
+ // Should work on canvas supporting browsers.
9343
+ $.fn.jqplotToImageElemStr = function(options) {
9344
+ var str = '<img src='+$(this).jqplotToImageStr(options)+' />';
9345
+ return str;
9346
+ };
9347
+
9348
+ // Not guaranteed to work, even on canvas supporting browsers due to
9349
+ // limitations with location.href and browser support.
9350
+ $.fn.jqplotSaveImage = function() {
9351
+ var imgData = $(this).jqplotToImageStr({});
9352
+ if (imgData) {
9353
+ window.location.href = imgData.replace("image/png", "image/octet-stream");
9354
+ }
9355
+
9356
+ };
9357
+
9358
+ // Not guaranteed to work, even on canvas supporting browsers due to
9359
+ // limitations with window.open and arbitrary data.
9360
+ $.fn.jqplotViewImage = function() {
9361
+ var imgStr = $(this).jqplotToImageElemStr({});
9362
+ var imgData = $(this).jqplotToImageStr({});
9363
+ if (imgStr) {
9364
+ var w = window.open('');
9365
+ w.document.open("image/png");
9366
+ w.document.write(imgStr);
9367
+ w.document.close();
9368
+ w = null;
9369
+ }
9370
+ };
9371
+
9372
+
9373
+
9374
+
9375
+ /**
9376
+ * @description
9377
+ * <p>Object with extended date parsing and formatting capabilities.
9378
+ * This library borrows many concepts and ideas from the Date Instance
9379
+ * Methods by Ken Snyder along with some parts of Ken's actual code.</p>
9380
+ *
9381
+ * <p>jsDate takes a different approach by not extending the built-in
9382
+ * Date Object, improving date parsing, allowing for multiple formatting
9383
+ * syntaxes and multiple and more easily expandable localization.</p>
9384
+ *
9385
+ * @author Chris Leonello
9386
+ * @date #date#
9387
+ * @version #VERSION#
9388
+ * @copyright (c) 2010-2015 Chris Leonello
9389
+ * jsDate is currently available for use in all personal or commercial projects
9390
+ * under both the MIT and GPL version 2.0 licenses. This means that you can
9391
+ * choose the license that best suits your project and use it accordingly.
9392
+ *
9393
+ * <p>Ken's original Date Instance Methods and copyright notice:</p>
9394
+ * <pre>
9395
+ * Ken Snyder (ken d snyder at gmail dot com)
9396
+ * 2008-09-10
9397
+ * version 2.0.2 (http://kendsnyder.com/sandbox/date/)
9398
+ * Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
9399
+ * </pre>
9400
+ *
9401
+ * @class
9402
+ * @name jsDate
9403
+ * @param {String | Number | Array | Date&nbsp;Object | Options&nbsp;Object} arguments Optional arguments, either a parsable date/time string,
9404
+ * a JavaScript timestamp, an array of numbers of form [year, month, day, hours, minutes, seconds, milliseconds],
9405
+ * a Date object, or an options object of form {syntax: "perl", date:some Date} where all options are optional.
9406
+ */
9407
+
9408
+ var jsDate = function () {
9409
+
9410
+ this.syntax = jsDate.config.syntax;
9411
+ this._type = "jsDate";
9412
+ this.proxy = new Date();
9413
+ this.options = {};
9414
+ this.locale = jsDate.regional.getLocale();
9415
+ this.formatString = '';
9416
+ this.defaultCentury = jsDate.config.defaultCentury;
9417
+
9418
+ switch ( arguments.length ) {
9419
+ case 0:
9420
+ break;
9421
+ case 1:
9422
+ // other objects either won't have a _type property or,
9423
+ // if they do, it shouldn't be set to "jsDate", so
9424
+ // assume it is an options argument.
9425
+ if (get_type(arguments[0]) == "[object Object]" && arguments[0]._type != "jsDate") {
9426
+ var opts = this.options = arguments[0];
9427
+ this.syntax = opts.syntax || this.syntax;
9428
+ this.defaultCentury = opts.defaultCentury || this.defaultCentury;
9429
+ this.proxy = jsDate.createDate(opts.date);
9430
+ }
9431
+ else {
9432
+ this.proxy = jsDate.createDate(arguments[0]);
9433
+ }
9434
+ break;
9435
+ default:
9436
+ var a = [];
9437
+ for ( var i=0; i<arguments.length; i++ ) {
9438
+ a.push(arguments[i]);
9439
+ }
9440
+ // this should be the current date/time?
9441
+ this.proxy = new Date();
9442
+ this.proxy.setFullYear.apply( this.proxy, a.slice(0,3) );
9443
+ if ( a.slice(3).length ) {
9444
+ this.proxy.setHours.apply( this.proxy, a.slice(3) );
9445
+ }
9446
+ break;
9447
+ }
9448
+ };
9449
+
9450
+ /**
9451
+ * @namespace Configuration options that will be used as defaults for all instances on the page.
9452
+ * @property {String} defaultLocale The default locale to use [en].
9453
+ * @property {String} syntax The default syntax to use [perl].
9454
+ * @property {Number} defaultCentury The default centry for 2 digit dates.
9455
+ */
9456
+ jsDate.config = {
9457
+ defaultLocale: 'en',
9458
+ syntax: 'perl',
9459
+ defaultCentury: 1900
9460
+ };
9461
+
9462
+ /**
9463
+ * Add an arbitrary amount to the currently stored date
9464
+ *
9465
+ * @param {Number} number
9466
+ * @param {String} unit
9467
+ * @returns {jsDate}
9468
+ */
9469
+
9470
+ jsDate.prototype.add = function(number, unit) {
9471
+ var factor = multipliers[unit] || multipliers.day;
9472
+ if (typeof factor == 'number') {
9473
+ this.proxy.setTime(this.proxy.getTime() + (factor * number));
9474
+ } else {
9475
+ factor.add(this, number);
9476
+ }
9477
+ return this;
9478
+ };
9479
+
9480
+ /**
9481
+ * Create a new jqplot.date object with the same date
9482
+ *
9483
+ * @returns {jsDate}
9484
+ */
9485
+
9486
+ jsDate.prototype.clone = function() {
9487
+ return new jsDate(this.proxy.getTime());
9488
+ };
9489
+
9490
+ /**
9491
+ * Get the UTC TimeZone Offset of this date in milliseconds.
9492
+ *
9493
+ * @returns {Number}
9494
+ */
9495
+
9496
+ jsDate.prototype.getUtcOffset = function() {
9497
+ return this.proxy.getTimezoneOffset() * 60000;
9498
+ };
9499
+
9500
+ /**
9501
+ * Find the difference between this jsDate and another date.
9502
+ *
9503
+ * @param {String| Number| Array| jsDate&nbsp;Object| Date&nbsp;Object} dateObj
9504
+ * @param {String} unit
9505
+ * @param {Boolean} allowDecimal
9506
+ * @returns {Number} Number of units difference between dates.
9507
+ */
9508
+
9509
+ jsDate.prototype.diff = function(dateObj, unit, allowDecimal) {
9510
+ // ensure we have a Date object
9511
+ dateObj = new jsDate(dateObj);
9512
+ if (dateObj === null) {
9513
+ return null;
9514
+ }
9515
+ // get the multiplying factor integer or factor function
9516
+ var factor = multipliers[unit] || multipliers.day;
9517
+ if (typeof factor == 'number') {
9518
+ // multiply
9519
+ var unitDiff = (this.proxy.getTime() - dateObj.proxy.getTime()) / factor;
9520
+ } else {
9521
+ // run function
9522
+ var unitDiff = factor.diff(this.proxy, dateObj.proxy);
9523
+ }
9524
+ // if decimals are not allowed, round toward zero
9525
+ return (allowDecimal ? unitDiff : Math[unitDiff > 0 ? 'floor' : 'ceil'](unitDiff));
9526
+ };
9527
+
9528
+ /**
9529
+ * Get the abbreviated name of the current week day
9530
+ *
9531
+ * @returns {String}
9532
+ */
9533
+
9534
+ jsDate.prototype.getAbbrDayName = function() {
9535
+ return jsDate.regional[this.locale]["dayNamesShort"][this.proxy.getDay()];
9536
+ };
9537
+
9538
+ /**
9539
+ * Get the abbreviated name of the current month
9540
+ *
9541
+ * @returns {String}
9542
+ */
9543
+
9544
+ jsDate.prototype.getAbbrMonthName = function() {
9545
+ return jsDate.regional[this.locale]["monthNamesShort"][this.proxy.getMonth()];
9546
+ };
9547
+
9548
+ /**
9549
+ * Get UPPER CASE AM or PM for the current time
9550
+ *
9551
+ * @returns {String}
9552
+ */
9553
+
9554
+ jsDate.prototype.getAMPM = function() {
9555
+ return this.proxy.getHours() >= 12 ? 'PM' : 'AM';
9556
+ };
9557
+
9558
+ /**
9559
+ * Get lower case am or pm for the current time
9560
+ *
9561
+ * @returns {String}
9562
+ */
9563
+
9564
+ jsDate.prototype.getAmPm = function() {
9565
+ return this.proxy.getHours() >= 12 ? 'pm' : 'am';
9566
+ };
9567
+
9568
+ /**
9569
+ * Get the century (19 for 20th Century)
9570
+ *
9571
+ * @returns {Integer} Century (19 for 20th century).
9572
+ */
9573
+ jsDate.prototype.getCentury = function() {
9574
+ return parseInt(this.proxy.getFullYear()/100, 10);
9575
+ };
9576
+
9577
+ /**
9578
+ * Implements Date functionality
9579
+ */
9580
+ jsDate.prototype.getDate = function() {
9581
+ return this.proxy.getDate();
9582
+ };
9583
+
9584
+ /**
9585
+ * Implements Date functionality
9586
+ */
9587
+ jsDate.prototype.getDay = function() {
9588
+ return this.proxy.getDay();
9589
+ };
9590
+
9591
+ /**
9592
+ * Get the Day of week 1 (Monday) thru 7 (Sunday)
9593
+ *
9594
+ * @returns {Integer} Day of week 1 (Monday) thru 7 (Sunday)
9595
+ */
9596
+ jsDate.prototype.getDayOfWeek = function() {
9597
+ var dow = this.proxy.getDay();
9598
+ return dow===0?7:dow;
9599
+ };
9600
+
9601
+ /**
9602
+ * Get the day of the year
9603
+ *
9604
+ * @returns {Integer} 1 - 366, day of the year
9605
+ */
9606
+ jsDate.prototype.getDayOfYear = function() {
9607
+ var d = this.proxy;
9608
+ var ms = d - new Date('' + d.getFullYear() + '/1/1 GMT');
9609
+ ms += d.getTimezoneOffset()*60000;
9610
+ d = null;
9611
+ return parseInt(ms/60000/60/24, 10)+1;
9612
+ };
9613
+
9614
+ /**
9615
+ * Get the name of the current week day
9616
+ *
9617
+ * @returns {String}
9618
+ */
9619
+
9620
+ jsDate.prototype.getDayName = function() {
9621
+ return jsDate.regional[this.locale]["dayNames"][this.proxy.getDay()];
9622
+ };
9623
+
9624
+ /**
9625
+ * Get the week number of the given year, starting with the first Sunday as the first week
9626
+ * @returns {Integer} Week number (13 for the 13th full week of the year).
9627
+ */
9628
+ jsDate.prototype.getFullWeekOfYear = function() {
9629
+ var d = this.proxy;
9630
+ var doy = this.getDayOfYear();
9631
+ var rdow = 6-d.getDay();
9632
+ var woy = parseInt((doy+rdow)/7, 10);
9633
+ return woy;
9634
+ };
9635
+
9636
+ /**
9637
+ * Implements Date functionality
9638
+ */
9639
+ jsDate.prototype.getFullYear = function() {
9640
+ return this.proxy.getFullYear();
9641
+ };
9642
+
9643
+ /**
9644
+ * Get the GMT offset in hours and minutes (e.g. +06:30)
9645
+ *
9646
+ * @returns {String}
9647
+ */
9648
+
9649
+ jsDate.prototype.getGmtOffset = function() {
9650
+ // divide the minutes offset by 60
9651
+ var hours = this.proxy.getTimezoneOffset() / 60;
9652
+ // decide if we are ahead of or behind GMT
9653
+ var prefix = hours < 0 ? '+' : '-';
9654
+ // remove the negative sign if any
9655
+ hours = Math.abs(hours);
9656
+ // add the +/- to the padded number of hours to : to the padded minutes
9657
+ return prefix + addZeros(Math.floor(hours), 2) + ':' + addZeros((hours % 1) * 60, 2);
9658
+ };
9659
+
9660
+ /**
9661
+ * Implements Date functionality
9662
+ */
9663
+ jsDate.prototype.getHours = function() {
9664
+ return this.proxy.getHours();
9665
+ };
9666
+
9667
+ /**
9668
+ * Get the current hour on a 12-hour scheme
9669
+ *
9670
+ * @returns {Integer}
9671
+ */
9672
+
9673
+ jsDate.prototype.getHours12 = function() {
9674
+ var hours = this.proxy.getHours();
9675
+ return hours > 12 ? hours - 12 : (hours == 0 ? 12 : hours);
9676
+ };
9677
+
9678
+
9679
+ jsDate.prototype.getIsoWeek = function() {
9680
+ var d = this.proxy;
9681
+ var woy = this.getWeekOfYear();
9682
+ var dow1_1 = (new Date('' + d.getFullYear() + '/1/1')).getDay();
9683
+ // First week is 01 and not 00 as in the case of %U and %W,
9684
+ // so we add 1 to the final result except if day 1 of the year
9685
+ // is a Monday (then %W returns 01).
9686
+ // We also need to subtract 1 if the day 1 of the year is
9687
+ // Friday-Sunday, so the resulting equation becomes:
9688
+ var idow = woy + (dow1_1 > 4 || dow1_1 <= 1 ? 0 : 1);
9689
+ if(idow == 53 && (new Date('' + d.getFullYear() + '/12/31')).getDay() < 4)
9690
+ {
9691
+ idow = 1;
9692
+ }
9693
+ else if(idow === 0)
9694
+ {
9695
+ d = new jsDate(new Date('' + (d.getFullYear()-1) + '/12/31'));
9696
+ idow = d.getIsoWeek();
9697
+ }
9698
+ d = null;
9699
+ return idow;
9700
+ };
9701
+
9702
+ /**
9703
+ * Implements Date functionality
9704
+ */
9705
+ jsDate.prototype.getMilliseconds = function() {
9706
+ return this.proxy.getMilliseconds();
9707
+ };
9708
+
9709
+ /**
9710
+ * Implements Date functionality
9711
+ */
9712
+ jsDate.prototype.getMinutes = function() {
9713
+ return this.proxy.getMinutes();
9714
+ };
9715
+
9716
+ /**
9717
+ * Implements Date functionality
9718
+ */
9719
+ jsDate.prototype.getMonth = function() {
9720
+ return this.proxy.getMonth();
9721
+ };
9722
+
9723
+ /**
9724
+ * Get the name of the current month
9725
+ *
9726
+ * @returns {String}
9727
+ */
9728
+
9729
+ jsDate.prototype.getMonthName = function() {
9730
+ return jsDate.regional[this.locale]["monthNames"][this.proxy.getMonth()];
9731
+ };
9732
+
9733
+ /**
9734
+ * Get the number of the current month, 1-12
9735
+ *
9736
+ * @returns {Integer}
9737
+ */
9738
+
9739
+ jsDate.prototype.getMonthNumber = function() {
9740
+ return this.proxy.getMonth() + 1;
9741
+ };
9742
+
9743
+ /**
9744
+ * Implements Date functionality
9745
+ */
9746
+ jsDate.prototype.getSeconds = function() {
9747
+ return this.proxy.getSeconds();
9748
+ };
9749
+
9750
+ /**
9751
+ * Return a proper two-digit year integer
9752
+ *
9753
+ * @returns {Integer}
9754
+ */
9755
+
9756
+ jsDate.prototype.getShortYear = function() {
9757
+ return this.proxy.getYear() % 100;
9758
+ };
9759
+
9760
+ /**
9761
+ * Implements Date functionality
9762
+ */
9763
+ jsDate.prototype.getTime = function() {
9764
+ return this.proxy.getTime();
9765
+ };
9766
+
9767
+ /**
9768
+ * Get the timezone abbreviation
9769
+ *
9770
+ * @returns {String} Abbreviation for the timezone
9771
+ */
9772
+ jsDate.prototype.getTimezoneAbbr = function() {
9773
+ return this.proxy.toString().replace(/^.*\(([^)]+)\)$/, '$1');
9774
+ };
9775
+
9776
+ /**
9777
+ * Get the browser-reported name for the current timezone (e.g. MDT, Mountain Daylight Time)
9778
+ *
9779
+ * @returns {String}
9780
+ */
9781
+ jsDate.prototype.getTimezoneName = function() {
9782
+ var match = /(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());
9783
+ return match[1] || match[2] || 'GMT' + this.getGmtOffset();
9784
+ };
9785
+
9786
+ /**
9787
+ * Implements Date functionality
9788
+ */
9789
+ jsDate.prototype.getTimezoneOffset = function() {
9790
+ return this.proxy.getTimezoneOffset();
9791
+ };
9792
+
9793
+
9794
+ /**
9795
+ * Get the week number of the given year, starting with the first Monday as the first week
9796
+ * @returns {Integer} Week number (13 for the 13th week of the year).
9797
+ */
9798
+ jsDate.prototype.getWeekOfYear = function() {
9799
+ var doy = this.getDayOfYear();
9800
+ var rdow = 7 - this.getDayOfWeek();
9801
+ var woy = parseInt((doy+rdow)/7, 10);
9802
+ return woy;
9803
+ };
9804
+
9805
+ /**
9806
+ * Get the current date as a Unix timestamp
9807
+ *
9808
+ * @returns {Integer}
9809
+ */
9810
+
9811
+ jsDate.prototype.getUnix = function() {
9812
+ return Math.round(this.proxy.getTime() / 1000, 0);
9813
+ };
9814
+
9815
+ /**
9816
+ * Implements Date functionality
9817
+ */
9818
+ jsDate.prototype.getYear = function() {
9819
+ return this.proxy.getYear();
9820
+ };
9821
+
9822
+ /**
9823
+ * Return a date one day ahead (or any other unit)
9824
+ *
9825
+ * @param {String} unit Optional, year | month | day | week | hour | minute | second | millisecond
9826
+ * @returns {jsDate}
9827
+ */
9828
+
9829
+ jsDate.prototype.next = function(unit) {
9830
+ unit = unit || 'day';
9831
+ return this.clone().add(1, unit);
9832
+ };
9833
+
9834
+ /**
9835
+ * Set the jsDate instance to a new date.
9836
+ *
9837
+ * @param {String | Number | Array | Date Object | jsDate Object | Options Object} arguments Optional arguments,
9838
+ * either a parsable date/time string,
9839
+ * a JavaScript timestamp, an array of numbers of form [year, month, day, hours, minutes, seconds, milliseconds],
9840
+ * a Date object, jsDate Object or an options object of form {syntax: "perl", date:some Date} where all options are optional.
9841
+ */
9842
+ jsDate.prototype.set = function() {
9843
+ switch ( arguments.length ) {
9844
+ case 0:
9845
+ this.proxy = new Date();
9846
+ break;
9847
+ case 1:
9848
+ // other objects either won't have a _type property or,
9849
+ // if they do, it shouldn't be set to "jsDate", so
9850
+ // assume it is an options argument.
9851
+ if (get_type(arguments[0]) == "[object Object]" && arguments[0]._type != "jsDate") {
9852
+ var opts = this.options = arguments[0];
9853
+ this.syntax = opts.syntax || this.syntax;
9854
+ this.defaultCentury = opts.defaultCentury || this.defaultCentury;
9855
+ this.proxy = jsDate.createDate(opts.date);
9856
+ }
9857
+ else {
9858
+ this.proxy = jsDate.createDate(arguments[0]);
9859
+ }
9860
+ break;
9861
+ default:
9862
+ var a = [];
9863
+ for ( var i=0; i<arguments.length; i++ ) {
9864
+ a.push(arguments[i]);
9865
+ }
9866
+ // this should be the current date/time
9867
+ this.proxy = new Date();
9868
+ this.proxy.setFullYear.apply( this.proxy, a.slice(0,3) );
9869
+ if ( a.slice(3).length ) {
9870
+ this.proxy.setHours.apply( this.proxy, a.slice(3) );
9871
+ }
9872
+ break;
9873
+ }
9874
+ return this;
9875
+ };
9876
+
9877
+ /**
9878
+ * Sets the day of the month for a specified date according to local time.
9879
+ * @param {Integer} dayValue An integer from 1 to 31, representing the day of the month.
9880
+ */
9881
+ jsDate.prototype.setDate = function(n) {
9882
+ this.proxy.setDate(n);
9883
+ return this;
9884
+ };
9885
+
9886
+ /**
9887
+ * Sets the full year for a specified date according to local time.
9888
+ * @param {Integer} yearValue The numeric value of the year, for example, 1995.
9889
+ * @param {Integer} monthValue Optional, between 0 and 11 representing the months January through December.
9890
+ * @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.
9891
+ */
9892
+ jsDate.prototype.setFullYear = function() {
9893
+ this.proxy.setFullYear.apply(this.proxy, arguments);
9894
+ return this;
9895
+ };
9896
+
9897
+ /**
9898
+ * Sets the hours for a specified date according to local time.
9899
+ *
9900
+ * @param {Integer} hoursValue An integer between 0 and 23, representing the hour.
9901
+ * @param {Integer} minutesValue Optional, An integer between 0 and 59, representing the minutes.
9902
+ * @param {Integer} secondsValue Optional, An integer between 0 and 59, representing the seconds.
9903
+ * If you specify the secondsValue parameter, you must also specify the minutesValue.
9904
+ * @param {Integer} msValue Optional, A number between 0 and 999, representing the milliseconds.
9905
+ * If you specify the msValue parameter, you must also specify the minutesValue and secondsValue.
9906
+ */
9907
+ jsDate.prototype.setHours = function() {
9908
+ this.proxy.setHours.apply(this.proxy, arguments);
9909
+ return this;
9910
+ };
9911
+
9912
+ /**
9913
+ * Implements Date functionality
9914
+ */
9915
+ jsDate.prototype.setMilliseconds = function(n) {
9916
+ this.proxy.setMilliseconds(n);
9917
+ return this;
9918
+ };
9919
+
9920
+ /**
9921
+ * Implements Date functionality
9922
+ */
9923
+ jsDate.prototype.setMinutes = function() {
9924
+ this.proxy.setMinutes.apply(this.proxy, arguments);
9925
+ return this;
9926
+ };
9927
+
9928
+ /**
9929
+ * Implements Date functionality
9930
+ */
9931
+ jsDate.prototype.setMonth = function() {
9932
+ this.proxy.setMonth.apply(this.proxy, arguments);
9933
+ return this;
9934
+ };
9935
+
9936
+ /**
9937
+ * Implements Date functionality
9938
+ */
9939
+ jsDate.prototype.setSeconds = function() {
9940
+ this.proxy.setSeconds.apply(this.proxy, arguments);
9941
+ return this;
9942
+ };
9943
+
9944
+ /**
9945
+ * Implements Date functionality
9946
+ */
9947
+ jsDate.prototype.setTime = function(n) {
9948
+ this.proxy.setTime(n);
9949
+ return this;
9950
+ };
9951
+
9952
+ /**
9953
+ * Implements Date functionality
9954
+ */
9955
+ jsDate.prototype.setYear = function() {
9956
+ this.proxy.setYear.apply(this.proxy, arguments);
9957
+ return this;
9958
+ };
9959
+
9960
+ /**
9961
+ * Provide a formatted string representation of this date.
9962
+ *
9963
+ * @param {String} formatString A format string.
9964
+ * See: {@link jsDate.formats}.
9965
+ * @returns {String} Date String.
9966
+ */
9967
+
9968
+ jsDate.prototype.strftime = function(formatString) {
9969
+ formatString = formatString || this.formatString || jsDate.regional[this.locale]['formatString'];
9970
+ return jsDate.strftime(this, formatString, this.syntax);
9971
+ };
9972
+
9973
+ /**
9974
+ * Return a String representation of this jsDate object.
9975
+ * @returns {String} Date string.
9976
+ */
9977
+
9978
+ jsDate.prototype.toString = function() {
9979
+ return this.proxy.toString();
9980
+ };
9981
+
9982
+ /**
9983
+ * Convert the current date to an 8-digit integer (%Y%m%d)
9984
+ *
9985
+ * @returns {Integer}
9986
+ */
9987
+
9988
+ jsDate.prototype.toYmdInt = function() {
9989
+ return (this.proxy.getFullYear() * 10000) + (this.getMonthNumber() * 100) + this.proxy.getDate();
9990
+ };
9991
+
9992
+ /**
9993
+ * @namespace Holds localizations for month/day names.
9994
+ * <p>jsDate attempts to detect locale when loaded and defaults to 'en'.
9995
+ * If a localization is detected which is not available, jsDate defaults to 'en'.
9996
+ * Additional localizations can be added after jsDate loads. After adding a localization,
9997
+ * call the jsDate.regional.getLocale() method. Currently, en, fr and de are defined.</p>
9998
+ *
9999
+ * <p>Localizations must be an object and have the following properties defined: monthNames, monthNamesShort, dayNames, dayNamesShort and Localizations are added like:</p>
10000
+ * <pre class="code">
10001
+ * jsDate.regional['en'] = {
10002
+ * monthNames : 'January February March April May June July August September October November December'.split(' '),
10003
+ * monthNamesShort : 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '),
10004
+ * dayNames : 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday'.split(' '),
10005
+ * dayNamesShort : 'Sun Mon Tue Wed Thu Fri Sat'.split(' ')
10006
+ * };
10007
+ * </pre>
10008
+ * <p>After adding localizations, call <code>jsDate.regional.getLocale();</code> to update the locale setting with the
10009
+ * new localizations.</p>
10010
+ */
10011
+
10012
+ jsDate.regional = {
10013
+ 'en': {
10014
+ monthNames: ['January','February','March','April','May','June','July','August','September','October','November','December'],
10015
+ monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
10016
+ dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
10017
+ dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
10018
+ formatString: '%Y-%m-%d %H:%M:%S'
10019
+ },
10020
+
10021
+ 'fr': {
10022
+ monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
10023
+ monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun','Jul','Aoû','Sep','Oct','Nov','Déc'],
10024
+ dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
10025
+ dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
10026
+ formatString: '%Y-%m-%d %H:%M:%S'
10027
+ },
10028
+
10029
+ 'de': {
10030
+ monthNames: ['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'],
10031
+ monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'],
10032
+ dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
10033
+ dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
10034
+ formatString: '%Y-%m-%d %H:%M:%S'
10035
+ },
10036
+
10037
+ 'es': {
10038
+ monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'],
10039
+ monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', 'Jul','Ago','Sep','Oct','Nov','Dic'],
10040
+ dayNames: ['Domingo','Lunes','Martes','Mi&eacute;rcoles','Jueves','Viernes','S&aacute;bado'],
10041
+ dayNamesShort: ['Dom','Lun','Mar','Mi&eacute;','Juv','Vie','S&aacute;b'],
10042
+ formatString: '%Y-%m-%d %H:%M:%S'
10043
+ },
10044
+
10045
+ 'ru': {
10046
+ monthNames: ['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'],
10047
+ monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн','Июл','Авг','Сен','Окт','Ноя','Дек'],
10048
+ dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'],
10049
+ dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'],
10050
+ formatString: '%Y-%m-%d %H:%M:%S'
10051
+ },
10052
+
10053
+ 'ar': {
10054
+ monthNames: ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'آذار', 'حزيران','تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'],
10055
+ monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],
10056
+ dayNames: ['السبت', 'الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة'],
10057
+ dayNamesShort: ['سبت', 'أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة'],
10058
+ formatString: '%Y-%m-%d %H:%M:%S'
10059
+ },
10060
+
10061
+ 'pt': {
10062
+ monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
10063
+ monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
10064
+ dayNames: ['Domingo','Segunda-feira','Ter&ccedil;a-feira','Quarta-feira','Quinta-feira','Sexta-feira','S&aacute;bado'],
10065
+ dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
10066
+ formatString: '%Y-%m-%d %H:%M:%S'
10067
+ },
10068
+
10069
+ 'pt-BR': {
10070
+ monthNames: ['Janeiro','Fevereiro','Mar&ccedil;o','Abril','Maio','Junho', 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
10071
+ monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
10072
+ dayNames: ['Domingo','Segunda-feira','Ter&ccedil;a-feira','Quarta-feira','Quinta-feira','Sexta-feira','S&aacute;bado'],
10073
+ dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','S&aacute;b'],
10074
+ formatString: '%Y-%m-%d %H:%M:%S'
10075
+ },
10076
+
10077
+ 'pl': {
10078
+ monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec','Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
10079
+ monthNamesShort: ['Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze','Lip', 'Sie', 'Wrz', 'Paź', 'Lis', 'Gru'],
10080
+ dayNames: ['Niedziela', 'Poniedziałek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota'],
10081
+ dayNamesShort: ['Ni', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'Sb'],
10082
+ formatString: '%Y-%m-%d %H:%M:%S'
10083
+ },
10084
+
10085
+ 'nl': {
10086
+ monthNames: ['Januari','Februari','Maart','April','Mei','Juni','July','Augustus','September','Oktober','November','December'],
10087
+ monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun','Jul','Aug','Sep','Okt','Nov','Dec'],
10088
+ dayNames:','['Zondag','Maandag','Dinsdag','Woensdag','Donderdag','Vrijdag','Zaterdag'],
10089
+ dayNamesShort: ['Zo','Ma','Di','Wo','Do','Vr','Za'],
10090
+ formatString: '%Y-%m-%d %H:%M:%S'
10091
+ },
10092
+
10093
+ 'sv': {
10094
+ monthNames: ['januari','februari','mars','april','maj','juni','juli','augusti','september','oktober','november','december'],
10095
+ monthNamesShort: ['jan','feb','mar','apr','maj','jun','jul','aug','sep','okt','nov','dec'],
10096
+ dayNames: ['söndag','måndag','tisdag','onsdag','torsdag','fredag','lördag'],
10097
+ dayNamesShort: ['sön','mån','tis','ons','tor','fre','lör'],
10098
+ formatString: '%Y-%m-%d %H:%M:%S'
10099
+ },
10100
+
10101
+ 'it': {
10102
+ monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'],
10103
+ monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago','Set','Ott','Nov','Dic'],
10104
+ dayNames: ['Domenica','Lunedi','Martedi','Mercoledi','Giovedi','Venerdi','Sabato'],
10105
+ dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'],
10106
+ formatString: '%d-%m-%Y %H:%M:%S'
10107
+ }
10108
+
10109
+ };
10110
+
10111
+ // Set english variants to 'en'
10112
+ jsDate.regional['en-US'] = jsDate.regional['en-GB'] = jsDate.regional['en'];
10113
+
10114
+ /**
10115
+ * Try to determine the users locale based on the lang attribute of the html page. Defaults to 'en'
10116
+ * if it cannot figure out a locale of if the locale does not have a localization defined.
10117
+ * @returns {String} locale
10118
+ */
10119
+
10120
+ jsDate.regional.getLocale = function () {
10121
+ var l = jsDate.config.defaultLocale;
10122
+
10123
+ if ( document && document.getElementsByTagName('html') && document.getElementsByTagName('html')[0].lang ) {
10124
+ l = document.getElementsByTagName('html')[0].lang;
10125
+ if (!jsDate.regional.hasOwnProperty(l)) {
10126
+ l = jsDate.config.defaultLocale;
10127
+ }
10128
+ }
10129
+
10130
+ return l;
10131
+ };
10132
+
10133
+ // ms in day
10134
+ var day = 24 * 60 * 60 * 1000;
10135
+
10136
+ // padd a number with zeros
10137
+ var addZeros = function(num, digits) {
10138
+ num = String(num);
10139
+ var i = digits - num.length;
10140
+ var s = String(Math.pow(10, i)).slice(1);
10141
+ return s.concat(num);
10142
+ };
10143
+
10144
+ // representations used for calculating differences between dates.
10145
+ // This borrows heavily from Ken Snyder's work.
10146
+ var multipliers = {
10147
+ millisecond: 1,
10148
+ second: 1000,
10149
+ minute: 60 * 1000,
10150
+ hour: 60 * 60 * 1000,
10151
+ day: day,
10152
+ week: 7 * day,
10153
+ month: {
10154
+ // add a number of months
10155
+ add: function(d, number) {
10156
+ // add any years needed (increments of 12)
10157
+ multipliers.year.add(d, Math[number > 0 ? 'floor' : 'ceil'](number / 12));
10158
+ // ensure that we properly wrap betwen December and January
10159
+ // 11 % 12 = 11
10160
+ // 12 % 12 = 0
10161
+ var prevMonth = d.getMonth() + (number % 12);
10162
+ if (prevMonth == 12) {
10163
+ prevMonth = 0;
10164
+ d.setYear(d.getFullYear() + 1);
10165
+ } else if (prevMonth == -1) {
10166
+ prevMonth = 11;
10167
+ d.setYear(d.getFullYear() - 1);
10168
+ }
10169
+ d.setMonth(prevMonth);
10170
+ },
10171
+ // get the number of months between two Date objects (decimal to the nearest day)
10172
+ diff: function(d1, d2) {
10173
+ // get the number of years
10174
+ var diffYears = d1.getFullYear() - d2.getFullYear();
10175
+ // get the number of remaining months
10176
+ var diffMonths = d1.getMonth() - d2.getMonth() + (diffYears * 12);
10177
+ // get the number of remaining days
10178
+ var diffDays = d1.getDate() - d2.getDate();
10179
+ // return the month difference with the days difference as a decimal
10180
+ return diffMonths + (diffDays / 30);
10181
+ }
10182
+ },
10183
+ year: {
10184
+ // add a number of years
10185
+ add: function(d, number) {
10186
+ d.setYear(d.getFullYear() + Math[number > 0 ? 'floor' : 'ceil'](number));
10187
+ },
10188
+ // get the number of years between two Date objects (decimal to the nearest day)
10189
+ diff: function(d1, d2) {
10190
+ return multipliers.month.diff(d1, d2) / 12;
10191
+ }
10192
+ }
10193
+ };
10194
+ //
10195
+ // Alias each multiplier with an 's' to allow 'year' and 'years' for example.
10196
+ // This comes from Ken Snyders work.
10197
+ //
10198
+ for (var unit in multipliers) {
10199
+ if (unit.substring(unit.length - 1) != 's') { // IE will iterate newly added properties :|
10200
+ multipliers[unit + 's'] = multipliers[unit];
10201
+ }
10202
+ }
10203
+
10204
+ //
10205
+ // take a jsDate instance and a format code and return the formatted value.
10206
+ // This is a somewhat modified version of Ken Snyder's method.
10207
+ //
10208
+ var format = function(d, code, syntax) {
10209
+ // if shorcut codes are used, recursively expand those.
10210
+ if (jsDate.formats[syntax]["shortcuts"][code]) {
10211
+ return jsDate.strftime(d, jsDate.formats[syntax]["shortcuts"][code], syntax);
10212
+ } else {
10213
+ // get the format code function and addZeros() argument
10214
+ var getter = (jsDate.formats[syntax]["codes"][code] || '').split('.');
10215
+ var nbr = d['get' + getter[0]] ? d['get' + getter[0]]() : '';
10216
+ if (getter[1]) {
10217
+ nbr = addZeros(nbr, getter[1]);
10218
+ }
10219
+ return nbr;
10220
+ }
10221
+ };
10222
+
10223
+ /**
10224
+ * @static
10225
+ * Static function for convert a date to a string according to a given format. Also acts as namespace for strftime format codes.
10226
+ * <p>strftime formatting can be accomplished without creating a jsDate object by calling jsDate.strftime():</p>
10227
+ * <pre class="code">
10228
+ * var formattedDate = jsDate.strftime('Feb 8, 2006 8:48:32', '%Y-%m-%d %H:%M:%S');
10229
+ * </pre>
10230
+ * @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.
10231
+ * @param {String} formatString String with embedded date formatting codes.
10232
+ * See: {@link jsDate.formats}.
10233
+ * @param {String} syntax Optional syntax to use [default perl].
10234
+ * @param {String} locale Optional locale to use.
10235
+ * @returns {String} Formatted representation of the date.
10236
+ */
10237
+ //
10238
+ // Logic as implemented here is very similar to Ken Snyder's Date Instance Methods.
10239
+ //
10240
+ jsDate.strftime = function(d, formatString, syntax, locale) {
10241
+ var syn = 'perl';
10242
+ var loc = jsDate.regional.getLocale();
10243
+
10244
+ // check if syntax and locale are available or reversed
10245
+ if (syntax && jsDate.formats.hasOwnProperty(syntax)) {
10246
+ syn = syntax;
10247
+ }
10248
+ else if (syntax && jsDate.regional.hasOwnProperty(syntax)) {
10249
+ loc = syntax;
10250
+ }
10251
+
10252
+ if (locale && jsDate.formats.hasOwnProperty(locale)) {
10253
+ syn = locale;
10254
+ }
10255
+ else if (locale && jsDate.regional.hasOwnProperty(locale)) {
10256
+ loc = locale;
10257
+ }
10258
+
10259
+ if (get_type(d) != "[object Object]" || d._type != "jsDate") {
10260
+ d = new jsDate(d);
10261
+ d.locale = loc;
10262
+ }
10263
+ if (!formatString) {
10264
+ formatString = d.formatString || jsDate.regional[loc]['formatString'];
10265
+ }
10266
+ // default the format string to year-month-day
10267
+ var source = formatString || '%Y-%m-%d',
10268
+ result = '',
10269
+ match;
10270
+ // replace each format code
10271
+ while (source.length > 0) {
10272
+ if (match = source.match(jsDate.formats[syn].codes.matcher)) {
10273
+ result += source.slice(0, match.index);
10274
+ result += (match[1] || '') + format(d, match[2], syn);
10275
+ source = source.slice(match.index + match[0].length);
10276
+ } else {
10277
+ result += source;
10278
+ source = '';
10279
+ }
10280
+ }
10281
+ return result;
10282
+ };
10283
+
10284
+ /**
10285
+ * @namespace
10286
+ * Namespace to hold format codes and format shortcuts. "perl" and "php" format codes
10287
+ * and shortcuts are defined by default. Additional codes and shortcuts can be
10288
+ * added like:
10289
+ *
10290
+ * <pre class="code">
10291
+ * jsDate.formats["perl"] = {
10292
+ * "codes": {
10293
+ * matcher: /someregex/,
10294
+ * Y: "fullYear", // name of "get" method without the "get",
10295
+ * ..., // more codes
10296
+ * },
10297
+ * "shortcuts": {
10298
+ * F: '%Y-%m-%d',
10299
+ * ..., // more shortcuts
10300
+ * }
10301
+ * };
10302
+ * </pre>
10303
+ *
10304
+ * <p>Additionally, ISO and SQL shortcuts are defined and can be accesses via:
10305
+ * <code>jsDate.formats.ISO</code> and <code>jsDate.formats.SQL</code>
10306
+ */
10307
+
10308
+ jsDate.formats = {
10309
+ ISO:'%Y-%m-%dT%H:%M:%S.%N%G',
10310
+ SQL:'%Y-%m-%d %H:%M:%S'
10311
+ };
10312
+
10313
+ /**
10314
+ * Perl format codes and shortcuts for strftime.
10315
+ *
10316
+ * A hash (object) of codes where each code must be an array where the first member is
10317
+ * the name of a Date.prototype or jsDate.prototype function to call
10318
+ * and optionally a second member indicating the number to pass to addZeros()
10319
+ *
10320
+ * <p>The following format codes are defined:</p>
10321
+ *
10322
+ * <pre class="code">
10323
+ * Code Result Description
10324
+ * == Years ==
10325
+ * %Y 2008 Four-digit year
10326
+ * %y 08 Two-digit year
10327
+ *
10328
+ * == Months ==
10329
+ * %m 09 Two-digit month
10330
+ * %#m 9 One or two-digit month
10331
+ * %B September Full month name
10332
+ * %b Sep Abbreviated month name
10333
+ *
10334
+ * == Days ==
10335
+ * %d 05 Two-digit day of month
10336
+ * %#d 5 One or two-digit day of month
10337
+ * %e 5 One or two-digit day of month
10338
+ * %A Sunday Full name of the day of the week
10339
+ * %a Sun Abbreviated name of the day of the week
10340
+ * %w 0 Number of the day of the week (0 = Sunday, 6 = Saturday)
10341
+ *
10342
+ * == Hours ==
10343
+ * %H 23 Hours in 24-hour format (two digits)
10344
+ * %#H 3 Hours in 24-hour integer format (one or two digits)
10345
+ * %I 11 Hours in 12-hour format (two digits)
10346
+ * %#I 3 Hours in 12-hour integer format (one or two digits)
10347
+ * %p PM AM or PM
10348
+ *
10349
+ * == Minutes ==
10350
+ * %M 09 Minutes (two digits)
10351
+ * %#M 9 Minutes (one or two digits)
10352
+ *
10353
+ * == Seconds ==
10354
+ * %S 02 Seconds (two digits)
10355
+ * %#S 2 Seconds (one or two digits)
10356
+ * %s 1206567625723 Unix timestamp (Seconds past 1970-01-01 00:00:00)
10357
+ *
10358
+ * == Milliseconds ==
10359
+ * %N 008 Milliseconds (three digits)
10360
+ * %#N 8 Milliseconds (one to three digits)
10361
+ *
10362
+ * == Timezone ==
10363
+ * %O 360 difference in minutes between local time and GMT
10364
+ * %Z Mountain Standard Time Name of timezone as reported by browser
10365
+ * %G 06:00 Hours and minutes between GMT
10366
+ *
10367
+ * == Shortcuts ==
10368
+ * %F 2008-03-26 %Y-%m-%d
10369
+ * %T 05:06:30 %H:%M:%S
10370
+ * %X 05:06:30 %H:%M:%S
10371
+ * %x 03/26/08 %m/%d/%y
10372
+ * %D 03/26/08 %m/%d/%y
10373
+ * %#c Wed Mar 26 15:31:00 2008 %a %b %e %H:%M:%S %Y
10374
+ * %v 3-Sep-2008 %e-%b-%Y
10375
+ * %R 15:31 %H:%M
10376
+ * %r 03:31:00 PM %I:%M:%S %p
10377
+ *
10378
+ * == Characters ==
10379
+ * %n \n Newline
10380
+ * %t \t Tab
10381
+ * %% % Percent Symbol
10382
+ * </pre>
10383
+ *
10384
+ * <p>Formatting shortcuts that will be translated into their longer version.
10385
+ * Be sure that format shortcuts do not refer to themselves: this will cause an infinite loop.</p>
10386
+ *
10387
+ * <p>Format codes and format shortcuts can be redefined after the jsDate
10388
+ * module is imported.</p>
10389
+ *
10390
+ * <p>Note that if you redefine the whole hash (object), you must supply a "matcher"
10391
+ * regex for the parser. The default matcher is:</p>
10392
+ *
10393
+ * <code>/()%(#?(%|[a-z]))/i</code>
10394
+ *
10395
+ * <p>which corresponds to the Perl syntax used by default.</p>
10396
+ *
10397
+ * <p>By customizing the matcher and format codes, nearly any strftime functionality is possible.</p>
10398
+ */
10399
+
10400
+ jsDate.formats.perl = {
10401
+ codes: {
10402
+ //
10403
+ // 2-part regex matcher for format codes
10404
+ //
10405
+ // first match must be the character before the code (to account for escaping)
10406
+ // second match must be the format code character(s)
10407
+ //
10408
+ matcher: /()%(#?(%|[a-z]))/i,
10409
+ // year
10410
+ Y: 'FullYear',
10411
+ y: 'ShortYear.2',
10412
+ // month
10413
+ m: 'MonthNumber.2',
10414
+ '#m': 'MonthNumber',
10415
+ B: 'MonthName',
10416
+ b: 'AbbrMonthName',
10417
+ // day
10418
+ d: 'Date.2',
10419
+ '#d': 'Date',
10420
+ e: 'Date',
10421
+ A: 'DayName',
10422
+ a: 'AbbrDayName',
10423
+ w: 'Day',
10424
+ // hours
10425
+ H: 'Hours.2',
10426
+ '#H': 'Hours',
10427
+ I: 'Hours12.2',
10428
+ '#I': 'Hours12',
10429
+ p: 'AMPM',
10430
+ // minutes
10431
+ M: 'Minutes.2',
10432
+ '#M': 'Minutes',
10433
+ // seconds
10434
+ S: 'Seconds.2',
10435
+ '#S': 'Seconds',
10436
+ s: 'Unix',
10437
+ // milliseconds
10438
+ N: 'Milliseconds.3',
10439
+ '#N': 'Milliseconds',
10440
+ // timezone
10441
+ O: 'TimezoneOffset',
10442
+ Z: 'TimezoneName',
10443
+ G: 'GmtOffset'
10444
+ },
10445
+
10446
+ shortcuts: {
10447
+ // date
10448
+ F: '%Y-%m-%d',
10449
+ // time
10450
+ T: '%H:%M:%S',
10451
+ X: '%H:%M:%S',
10452
+ // local format date
10453
+ x: '%m/%d/%y',
10454
+ D: '%m/%d/%y',
10455
+ // local format extended
10456
+ '#c': '%a %b %e %H:%M:%S %Y',
10457
+ // local format short
10458
+ v: '%e-%b-%Y',
10459
+ R: '%H:%M',
10460
+ r: '%I:%M:%S %p',
10461
+ // tab and newline
10462
+ t: '\t',
10463
+ n: '\n',
10464
+ '%': '%'
10465
+ }
10466
+ };
10467
+
10468
+ /**
10469
+ * PHP format codes and shortcuts for strftime.
10470
+ *
10471
+ * A hash (object) of codes where each code must be an array where the first member is
10472
+ * the name of a Date.prototype or jsDate.prototype function to call
10473
+ * and optionally a second member indicating the number to pass to addZeros()
10474
+ *
10475
+ * <p>The following format codes are defined:</p>
10476
+ *
10477
+ * <pre class="code">
10478
+ * Code Result Description
10479
+ * === Days ===
10480
+ * %a Sun through Sat An abbreviated textual representation of the day
10481
+ * %A Sunday - Saturday A full textual representation of the day
10482
+ * %d 01 to 31 Two-digit day of the month (with leading zeros)
10483
+ * %e 1 to 31 Day of the month, with a space preceding single digits.
10484
+ * %j 001 to 366 Day of the year, 3 digits with leading zeros
10485
+ * %u 1 - 7 (Mon - Sun) ISO-8601 numeric representation of the day of the week
10486
+ * %w 0 - 6 (Sun - Sat) Numeric representation of the day of the week
10487
+ *
10488
+ * === Week ===
10489
+ * %U 13 Full Week number, starting with the first Sunday as the first week
10490
+ * %V 01 through 53 ISO-8601:1988 week number, starting with the first week of the year
10491
+ * with at least 4 weekdays, with Monday being the start of the week
10492
+ * %W 46 A numeric representation of the week of the year,
10493
+ * starting with the first Monday as the first week
10494
+ * === Month ===
10495
+ * %b Jan through Dec Abbreviated month name, based on the locale
10496
+ * %B January - December Full month name, based on the locale
10497
+ * %h Jan through Dec Abbreviated month name, based on the locale (an alias of %b)
10498
+ * %m 01 - 12 (Jan - Dec) Two digit representation of the month
10499
+ *
10500
+ * === Year ===
10501
+ * %C 19 Two digit century (year/100, truncated to an integer)
10502
+ * %y 09 for 2009 Two digit year
10503
+ * %Y 2038 Four digit year
10504
+ *
10505
+ * === Time ===
10506
+ * %H 00 through 23 Two digit representation of the hour in 24-hour format
10507
+ * %I 01 through 12 Two digit representation of the hour in 12-hour format
10508
+ * %l 1 through 12 Hour in 12-hour format, with a space preceeding single digits
10509
+ * %M 00 through 59 Two digit representation of the minute
10510
+ * %p AM/PM UPPER-CASE 'AM' or 'PM' based on the given time
10511
+ * %P am/pm lower-case 'am' or 'pm' based on the given time
10512
+ * %r 09:34:17 PM Same as %I:%M:%S %p
10513
+ * %R 00:35 Same as %H:%M
10514
+ * %S 00 through 59 Two digit representation of the second
10515
+ * %T 21:34:17 Same as %H:%M:%S
10516
+ * %X 03:59:16 Preferred time representation based on locale, without the date
10517
+ * %z -0500 or EST Either the time zone offset from UTC or the abbreviation
10518
+ * %Z -0500 or EST The time zone offset/abbreviation option NOT given by %z
10519
+ *
10520
+ * === Time and Date ===
10521
+ * %D 02/05/09 Same as %m/%d/%y
10522
+ * %F 2009-02-05 Same as %Y-%m-%d (commonly used in database datestamps)
10523
+ * %s 305815200 Unix Epoch Time timestamp (same as the time() function)
10524
+ * %x 02/05/09 Preferred date representation, without the time
10525
+ *
10526
+ * === Miscellaneous ===
10527
+ * %n --- A newline character (\n)
10528
+ * %t --- A Tab character (\t)
10529
+ * %% --- A literal percentage character (%)
10530
+ * </pre>
10531
+ */
10532
+
10533
+ jsDate.formats.php = {
10534
+ codes: {
10535
+ //
10536
+ // 2-part regex matcher for format codes
10537
+ //
10538
+ // first match must be the character before the code (to account for escaping)
10539
+ // second match must be the format code character(s)
10540
+ //
10541
+ matcher: /()%((%|[a-z]))/i,
10542
+ // day
10543
+ a: 'AbbrDayName',
10544
+ A: 'DayName',
10545
+ d: 'Date.2',
10546
+ e: 'Date',
10547
+ j: 'DayOfYear.3',
10548
+ u: 'DayOfWeek',
10549
+ w: 'Day',
10550
+ // week
10551
+ U: 'FullWeekOfYear.2',
10552
+ V: 'IsoWeek.2',
10553
+ W: 'WeekOfYear.2',
10554
+ // month
10555
+ b: 'AbbrMonthName',
10556
+ B: 'MonthName',
10557
+ m: 'MonthNumber.2',
10558
+ h: 'AbbrMonthName',
10559
+ // year
10560
+ C: 'Century.2',
10561
+ y: 'ShortYear.2',
10562
+ Y: 'FullYear',
10563
+ // time
10564
+ H: 'Hours.2',
10565
+ I: 'Hours12.2',
10566
+ l: 'Hours12',
10567
+ p: 'AMPM',
10568
+ P: 'AmPm',
10569
+ M: 'Minutes.2',
10570
+ S: 'Seconds.2',
10571
+ s: 'Unix',
10572
+ O: 'TimezoneOffset',
10573
+ z: 'GmtOffset',
10574
+ Z: 'TimezoneAbbr'
10575
+ },
10576
+
10577
+ shortcuts: {
10578
+ D: '%m/%d/%y',
10579
+ F: '%Y-%m-%d',
10580
+ T: '%H:%M:%S',
10581
+ X: '%H:%M:%S',
10582
+ x: '%m/%d/%y',
10583
+ R: '%H:%M',
10584
+ r: '%I:%M:%S %p',
10585
+ t: '\t',
10586
+ n: '\n',
10587
+ '%': '%'
10588
+ }
10589
+ };
10590
+ //
10591
+ // Conceptually, the logic implemented here is similar to Ken Snyder's Date Instance Methods.
10592
+ // I use his idea of a set of parsers which can be regular expressions or functions,
10593
+ // iterating through those, and then seeing if Date.parse() will create a date.
10594
+ // The parser expressions and functions are a little different and some bugs have been
10595
+ // worked out. Also, a lot of "pre-parsing" is done to fix implementation
10596
+ // variations of Date.parse() between browsers.
10597
+ //
10598
+ jsDate.createDate = function(date) {
10599
+ // if passing in multiple arguments, try Date constructor
10600
+ if (date == null) {
10601
+ return new Date();
10602
+ }
10603
+ // If the passed value is already a date object, return it
10604
+ if (date instanceof Date) {
10605
+ return date;
10606
+ }
10607
+ // if (typeof date == 'number') return new Date(date * 1000);
10608
+ // If the passed value is an integer, interpret it as a javascript timestamp
10609
+ if (typeof date == 'number') {
10610
+ return new Date(date);
10611
+ }
10612
+
10613
+ // Before passing strings into Date.parse(), have to normalize them for certain conditions.
10614
+ // If strings are not formatted staccording to the EcmaScript spec, results from Date parse will be implementation dependent.
10615
+ //
10616
+ // For example:
10617
+ // * FF and Opera assume 2 digit dates are pre y2k, Chome assumes <50 is pre y2k, 50+ is 21st century.
10618
+ // * Chrome will correctly parse '1984-1-25' into localtime, FF and Opera will not parse.
10619
+ // * Both FF, Chrome and Opera will parse '1984/1/25' into localtime.
10620
+
10621
+ // remove leading and trailing spaces
10622
+ var parsable = String(date).replace(/^\s*(.+)\s*$/g, '$1');
10623
+
10624
+ // replace dahses (-) with slashes (/) in dates like n[nnn]/n[n]/n[nnn]
10625
+ parsable = parsable.replace(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/, "$1/$2/$3");
10626
+
10627
+ /////////
10628
+ // Need to check for '15-Dec-09' also.
10629
+ // FF will not parse, but Chrome will.
10630
+ // Chrome will set date to 2009 as well.
10631
+ /////////
10632
+
10633
+ // first check for 'dd-mmm-yyyy' or 'dd/mmm/yyyy' like '15-Dec-2010'
10634
+ parsable = parsable.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{4})/i, "$1 $2 $3");
10635
+
10636
+ // Now check for 'dd-mmm-yy' or 'dd/mmm/yy' and normalize years to default century.
10637
+ var match = parsable.match(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i);
10638
+ if (match && match.length > 3) {
10639
+ var m3 = parseFloat(match[3]);
10640
+ var ny = jsDate.config.defaultCentury + m3;
10641
+ ny = String(ny);
10642
+
10643
+ // now replace 2 digit year with 4 digit year
10644
+ parsable = parsable.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i, match[1] +' '+ match[2] +' '+ ny);
10645
+
10646
+ }
10647
+
10648
+ // Check for '1/19/70 8:14PM'
10649
+ // where starts with mm/dd/yy or yy/mm/dd and have something after
10650
+ // Check if 1st postiion is greater than 31, assume it is year.
10651
+ // Assme all 2 digit years are 1900's.
10652
+ // Finally, change them into US style mm/dd/yyyy representations.
10653
+ match = parsable.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})[^0-9]/);
10654
+
10655
+ function h1(parsable, match) {
10656
+ var m1 = parseFloat(match[1]);
10657
+ var m2 = parseFloat(match[2]);
10658
+ var m3 = parseFloat(match[3]);
10659
+ var cent = jsDate.config.defaultCentury;
10660
+ var ny, nd, nm, str;
10661
+
10662
+ if (m1 > 31) { // first number is a year
10663
+ nd = m3;
10664
+ nm = m2;
10665
+ ny = cent + m1;
10666
+ }
10667
+
10668
+ else { // last number is the year
10669
+ nd = m2;
10670
+ nm = m1;
10671
+ ny = cent + m3;
10672
+ }
10673
+
10674
+ str = nm+'/'+nd+'/'+ny;
10675
+
10676
+ // now replace 2 digit year with 4 digit year
10677
+ return parsable.replace(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})/, str);
10678
+
10679
+ }
10680
+
10681
+ if (match && match.length > 3) {
10682
+ parsable = h1(parsable, match);
10683
+ }
10684
+
10685
+ // Now check for '1/19/70' with nothing after and do as above
10686
+ var match = parsable.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})$/);
10687
+
10688
+ if (match && match.length > 3) {
10689
+ parsable = h1(parsable, match);
10690
+ }
10691
+
10692
+
10693
+ var i = 0;
10694
+ var length = jsDate.matchers.length;
10695
+ var pattern,
10696
+ ms,
10697
+ current = parsable,
10698
+ obj;
10699
+ while (i < length) {
10700
+ ms = Date.parse(current);
10701
+ if (!isNaN(ms)) {
10702
+ return new Date(ms);
10703
+ }
10704
+ pattern = jsDate.matchers[i];
10705
+ if (typeof pattern == 'function') {
10706
+ obj = pattern.call(jsDate, current);
10707
+ if (obj instanceof Date) {
10708
+ return obj;
10709
+ }
10710
+ } else {
10711
+ current = parsable.replace(pattern[0], pattern[1]);
10712
+ }
10713
+ i++;
10714
+ }
10715
+ return NaN;
10716
+ };
10717
+
10718
+
10719
+ /**
10720
+ * @static
10721
+ * Handy static utility function to return the number of days in a given month.
10722
+ * @param {Integer} year Year
10723
+ * @param {Integer} month Month (1-12)
10724
+ * @returns {Integer} Number of days in the month.
10725
+ */
10726
+ //
10727
+ // handy utility method Borrowed right from Ken Snyder's Date Instance Mehtods.
10728
+ //
10729
+ jsDate.daysInMonth = function(year, month) {
10730
+ if (month == 2) {
10731
+ return new Date(year, 1, 29).getDate() == 29 ? 29 : 28;
10732
+ }
10733
+ return [undefined,31,undefined,31,30,31,30,31,31,30,31,30,31][month];
10734
+ };
10735
+
10736
+
10737
+ //
10738
+ // An Array of regular expressions or functions that will attempt to match the date string.
10739
+ // Functions are called with scope of a jsDate instance.
10740
+ //
10741
+ jsDate.matchers = [
10742
+ // convert dd.mmm.yyyy to mm/dd/yyyy (world date to US date).
10743
+ [/(3[01]|[0-2]\d)\s*\.\s*(1[0-2]|0\d)\s*\.\s*([1-9]\d{3})/, '$2/$1/$3'],
10744
+ // convert yyyy-mm-dd to mm/dd/yyyy (ISO date to US date).
10745
+ [/([1-9]\d{3})\s*-\s*(1[0-2]|0\d)\s*-\s*(3[01]|[0-2]\d)/, '$2/$3/$1'],
10746
+ // Handle 12 hour or 24 hour time with milliseconds am/pm and optional date part.
10747
+ function(str) {
10748
+ var match = str.match(/^(?:(.+)\s+)?([012]?\d)(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d(\.\d*)?))?\s*(am|pm)?\s*$/i);
10749
+ // opt. date hour opt. minute opt. second opt. msec opt. am or pm
10750
+ if (match) {
10751
+ if (match[1]) {
10752
+ var d = this.createDate(match[1]);
10753
+ if (isNaN(d)) {
10754
+ return;
10755
+ }
10756
+ } else {
10757
+ var d = new Date();
10758
+ d.setMilliseconds(0);
10759
+ }
10760
+ var hour = parseFloat(match[2]);
10761
+ if (match[6]) {
10762
+ hour = match[6].toLowerCase() == 'am' ? (hour == 12 ? 0 : hour) : (hour == 12 ? 12 : hour + 12);
10763
+ }
10764
+ d.setHours(hour, parseInt(match[3] || 0, 10), parseInt(match[4] || 0, 10), ((parseFloat(match[5] || 0)) || 0)*1000);
10765
+ return d;
10766
+ }
10767
+ else {
10768
+ return str;
10769
+ }
10770
+ },
10771
+ // Handle ISO timestamp with time zone.
10772
+ function(str) {
10773
+ var match = str.match(/^(?:(.+))[T|\s+]([012]\d)(?:\:(\d\d))(?:\:(\d\d))(?:\.\d+)([\+\-]\d\d\:\d\d)$/i);
10774
+ if (match) {
10775
+ if (match[1]) {
10776
+ var d = this.createDate(match[1]);
10777
+ if (isNaN(d)) {
10778
+ return;
10779
+ }
10780
+ } else {
10781
+ var d = new Date();
10782
+ d.setMilliseconds(0);
10783
+ }
10784
+ var hour = parseFloat(match[2]);
10785
+ d.setHours(hour, parseInt(match[3], 10), parseInt(match[4], 10), parseFloat(match[5])*1000);
10786
+ return d;
10787
+ }
10788
+ else {
10789
+ return str;
10790
+ }
10791
+ },
10792
+ // Try to match ambiguous strings like 12/8/22.
10793
+ // Use FF date assumption that 2 digit years are 20th century (i.e. 1900's).
10794
+ // This may be redundant with pre processing of date already performed.
10795
+ function(str) {
10796
+ var match = str.match(/^([0-3]?\d)\s*[-\/.\s]{1}\s*([a-zA-Z]{3,9})\s*[-\/.\s]{1}\s*([0-3]?\d)$/);
10797
+ if (match) {
10798
+ var d = new Date();
10799
+ var cent = jsDate.config.defaultCentury;
10800
+ var m1 = parseFloat(match[1]);
10801
+ var m3 = parseFloat(match[3]);
10802
+ var ny, nd, nm;
10803
+ if (m1 > 31) { // first number is a year
10804
+ nd = m3;
10805
+ ny = cent + m1;
10806
+ }
10807
+
10808
+ else { // last number is the year
10809
+ nd = m1;
10810
+ ny = cent + m3;
10811
+ }
10812
+
10813
+ var nm = inArray(match[2], jsDate.regional[jsDate.regional.getLocale()]["monthNamesShort"]);
10814
+
10815
+ if (nm == -1) {
10816
+ nm = inArray(match[2], jsDate.regional[jsDate.regional.getLocale()]["monthNames"]);
10817
+ }
10818
+
10819
+ d.setFullYear(ny, nm, nd);
10820
+ d.setHours(0,0,0,0);
10821
+ return d;
10822
+ }
10823
+
10824
+ else {
10825
+ return str;
10826
+ }
10827
+ }
10828
+ ];
10829
+
10830
+ //
10831
+ // I think John Reisig published this method on his blog, ejohn.
10832
+ //
10833
+ function inArray( elem, array ) {
10834
+ if ( array.indexOf ) {
10835
+ return array.indexOf( elem );
10836
+ }
10837
+
10838
+ for ( var i = 0, length = array.length; i < length; i++ ) {
10839
+ if ( array[ i ] === elem ) {
10840
+ return i;
10841
+ }
10842
+ }
10843
+
10844
+ return -1;
10845
+ }
10846
+
10847
+ //
10848
+ // Thanks to Kangax, Christian Sciberras and Stack Overflow for this method.
10849
+ //
10850
+ function get_type(thing){
10851
+ if(thing===null) return "[object Null]"; // special case
10852
+ return Object.prototype.toString.call(thing);
10853
+ }
10854
+
10855
+ $.jsDate = jsDate;
10856
+
10857
+
10858
+ /**
10859
+ * JavaScript printf/sprintf functions.
10860
+ *
10861
+ * This code has been adapted from the publicly available sprintf methods
10862
+ * by Ash Searle. His original header follows:
10863
+ *
10864
+ * This code is unrestricted: you are free to use it however you like.
10865
+ *
10866
+ * The functions should work as expected, performing left or right alignment,
10867
+ * truncating strings, outputting numbers with a required precision etc.
10868
+ *
10869
+ * For complex cases, these functions follow the Perl implementations of
10870
+ * (s)printf, allowing arguments to be passed out-of-order, and to set the
10871
+ * precision or length of the output based on arguments instead of fixed
10872
+ * numbers.
10873
+ *
10874
+ * See http://perldoc.perl.org/functions/sprintf.html for more information.
10875
+ *
10876
+ * Implemented:
10877
+ * - zero and space-padding
10878
+ * - right and left-alignment,
10879
+ * - base X prefix (binary, octal and hex)
10880
+ * - positive number prefix
10881
+ * - (minimum) width
10882
+ * - precision / truncation / maximum width
10883
+ * - out of order arguments
10884
+ *
10885
+ * Not implemented (yet):
10886
+ * - vector flag
10887
+ * - size (bytes, words, long-words etc.)
10888
+ *
10889
+ * Will not implement:
10890
+ * - %n or %p (no pass-by-reference in JavaScript)
10891
+ *
10892
+ * @version 2007.04.27
10893
+ * @author Ash Searle
10894
+ *
10895
+ * You can see the original work and comments on his blog:
10896
+ * http://hexmen.com/blog/2007/03/printf-sprintf/
10897
+ * http://hexmen.com/js/sprintf.js
10898
+ */
10899
+
10900
+ /**
10901
+ * @Modifications 2009.05.26
10902
+ * @author Chris Leonello
10903
+ *
10904
+ * Added %p %P specifier
10905
+ * Acts like %g or %G but will not add more significant digits to the output than present in the input.
10906
+ * Example:
10907
+ * Format: '%.3p', Input: 0.012, Output: 0.012
10908
+ * Format: '%.3g', Input: 0.012, Output: 0.0120
10909
+ * Format: '%.4p', Input: 12.0, Output: 12.0
10910
+ * Format: '%.4g', Input: 12.0, Output: 12.00
10911
+ * Format: '%.4p', Input: 4.321e-5, Output: 4.321e-5
10912
+ * Format: '%.4g', Input: 4.321e-5, Output: 4.3210e-5
10913
+ *
10914
+ * Example:
10915
+ * >>> $.jqplot.sprintf('%.2f, %d', 23.3452, 43.23)
10916
+ * "23.35, 43"
10917
+ * >>> $.jqplot.sprintf("no value: %n, decimal with thousands separator: %'d", 23.3452, 433524)
10918
+ * "no value: , decimal with thousands separator: 433,524"
10919
+ */
10920
+ $.jqplot.sprintf = function() {
10921
+ function pad(str, len, chr, leftJustify) {
10922
+ var padding = (str.length >= len) ? '' : Array(1 + len - str.length >>> 0).join(chr);
10923
+ return leftJustify ? str + padding : padding + str;
10924
+
10925
+ }
10926
+
10927
+ function thousand_separate(value) {
10928
+ var value_str = new String(value);
10929
+ for (var i=10; i>0; i--) {
10930
+ if (value_str == (value_str = value_str.replace(/^(\d+)(\d{3})/, "$1"+$.jqplot.sprintf.thousandsSeparator+"$2"))) break;
10931
+ }
10932
+ return value_str;
10933
+ }
10934
+
10935
+ function justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace) {
10936
+ var diff = minWidth - value.length;
10937
+ if (diff > 0) {
10938
+ var spchar = ' ';
10939
+ if (htmlSpace) { spchar = '&nbsp;'; }
10940
+ if (leftJustify || !zeroPad) {
10941
+ value = pad(value, minWidth, spchar, leftJustify);
10942
+ } else {
10943
+ value = value.slice(0, prefix.length) + pad('', diff, '0', true) + value.slice(prefix.length);
10944
+ }
10945
+ }
10946
+ return value;
10947
+ }
10948
+
10949
+ function formatBaseX(value, base, prefix, leftJustify, minWidth, precision, zeroPad, htmlSpace) {
10950
+ // Note: casts negative numbers to positive ones
10951
+ var number = value >>> 0;
10952
+ prefix = prefix && number && {'2': '0b', '8': '0', '16': '0x'}[base] || '';
10953
+ value = prefix + pad(number.toString(base), precision || 0, '0', false);
10954
+ return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace);
10955
+ }
10956
+
10957
+ function formatString(value, leftJustify, minWidth, precision, zeroPad, htmlSpace) {
10958
+ if (precision != null) {
10959
+ value = value.slice(0, precision);
10960
+ }
10961
+ return justify(value, '', leftJustify, minWidth, zeroPad, htmlSpace);
10962
+ }
10963
+
10964
+ var a = arguments, i = 0, format = a[i++];
10965
+
10966
+ return format.replace($.jqplot.sprintf.regex, function(substring, valueIndex, flags, minWidth, _, precision, type) {
10967
+ if (substring == '%%') { return '%'; }
10968
+
10969
+ // parse flags
10970
+ var leftJustify = false, positivePrefix = '', zeroPad = false, prefixBaseX = false, htmlSpace = false, thousandSeparation = false;
10971
+ for (var j = 0; flags && j < flags.length; j++) switch (flags.charAt(j)) {
10972
+ case ' ': positivePrefix = ' '; break;
10973
+ case '+': positivePrefix = '+'; break;
10974
+ case '-': leftJustify = true; break;
10975
+ case '0': zeroPad = true; break;
10976
+ case '#': prefixBaseX = true; break;
10977
+ case '&': htmlSpace = true; break;
10978
+ case '\'': thousandSeparation = true; break;
10979
+ }
10980
+
10981
+ // parameters may be null, undefined, empty-string or real valued
10982
+ // we want to ignore null, undefined and empty-string values
10983
+
10984
+ if (!minWidth) {
10985
+ minWidth = 0;
10986
+ }
10987
+ else if (minWidth == '*') {
10988
+ minWidth = +a[i++];
10989
+ }
10990
+ else if (minWidth.charAt(0) == '*') {
10991
+ minWidth = +a[minWidth.slice(1, -1)];
10992
+ }
10993
+ else {
10994
+ minWidth = +minWidth;
10995
+ }
10996
+
10997
+ // Note: undocumented perl feature:
10998
+ if (minWidth < 0) {
10999
+ minWidth = -minWidth;
11000
+ leftJustify = true;
11001
+ }
11002
+
11003
+ if (!isFinite(minWidth)) {
11004
+ throw new Error('$.jqplot.sprintf: (minimum-)width must be finite');
11005
+ }
11006
+
11007
+ if (!precision) {
11008
+ precision = 'fFeE'.indexOf(type) > -1 ? 6 : (type == 'd') ? 0 : void(0);
11009
+ }
11010
+ else if (precision == '*') {
11011
+ precision = +a[i++];
11012
+ }
11013
+ else if (precision.charAt(0) == '*') {
11014
+ precision = +a[precision.slice(1, -1)];
11015
+ }
11016
+ else {
11017
+ precision = +precision;
11018
+ }
11019
+
11020
+ // grab value using valueIndex if required?
11021
+ var value = valueIndex ? a[valueIndex.slice(0, -1)] : a[i++];
11022
+
11023
+ switch (type) {
11024
+ case 's': {
11025
+ if (value == null) {
11026
+ return '';
11027
+ }
11028
+ return formatString(String(value), leftJustify, minWidth, precision, zeroPad, htmlSpace);
11029
+ }
11030
+ case 'c': return formatString(String.fromCharCode(+value), leftJustify, minWidth, precision, zeroPad, htmlSpace);
11031
+ case 'b': return formatBaseX(value, 2, prefixBaseX, leftJustify, minWidth, precision, zeroPad,htmlSpace);
11032
+ case 'o': return formatBaseX(value, 8, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace);
11033
+ case 'x': return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace);
11034
+ case 'X': return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace).toUpperCase();
11035
+ case 'u': return formatBaseX(value, 10, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace);
11036
+ case 'i': {
11037
+ var number = parseInt(+value, 10);
11038
+ if (isNaN(number)) {
11039
+ return '';
11040
+ }
11041
+ var prefix = number < 0 ? '-' : positivePrefix;
11042
+ var number_str = thousandSeparation ? thousand_separate(String(Math.abs(number))): String(Math.abs(number));
11043
+ value = prefix + pad(number_str, precision, '0', false);
11044
+ //value = prefix + pad(String(Math.abs(number)), precision, '0', false);
11045
+ return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace);
11046
+ }
11047
+ case 'd': {
11048
+ var number = Math.round(+value);
11049
+ if (isNaN(number)) {
11050
+ return '';
11051
+ }
11052
+ var prefix = number < 0 ? '-' : positivePrefix;
11053
+ var number_str = thousandSeparation ? thousand_separate(String(Math.abs(number))): String(Math.abs(number));
11054
+ value = prefix + pad(number_str, precision, '0', false);
11055
+ return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace);
11056
+ }
11057
+ case 'e':
11058
+ case 'E':
11059
+ case 'f':
11060
+ case 'F':
11061
+ case 'g':
11062
+ case 'G':
11063
+ {
11064
+ var number = +value;
11065
+ if (isNaN(number)) {
11066
+ return '';
11067
+ }
11068
+ var prefix = number < 0 ? '-' : positivePrefix;
11069
+ var method = ['toExponential', 'toFixed', 'toPrecision']['efg'.indexOf(type.toLowerCase())];
11070
+ var textTransform = ['toString', 'toUpperCase']['eEfFgG'.indexOf(type) % 2];
11071
+ var number_str = Math.abs(number)[method](precision);
11072
+
11073
+ // Apply the decimal mark properly by splitting the number by the
11074
+ // decimalMark, applying thousands separator, and then placing it
11075
+ // back in.
11076
+ var parts = number_str.toString().split('.');
11077
+ parts[0] = thousandSeparation ? thousand_separate(parts[0]) : parts[0];
11078
+ number_str = parts.join($.jqplot.sprintf.decimalMark);
11079
+
11080
+ value = prefix + number_str;
11081
+ var justified = justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace)[textTransform]();
11082
+
11083
+ return justified;
11084
+ }
11085
+ case 'p':
11086
+ case 'P':
11087
+ {
11088
+ // make sure number is a number
11089
+ var number = +value;
11090
+ if (isNaN(number)) {
11091
+ return '';
11092
+ }
11093
+ var prefix = number < 0 ? '-' : positivePrefix;
11094
+
11095
+ var parts = String(Number(Math.abs(number)).toExponential()).split(/e|E/);
11096
+ var sd = (parts[0].indexOf('.') != -1) ? parts[0].length - 1 : String(number).length;
11097
+ var zeros = (parts[1] < 0) ? -parts[1] - 1 : 0;
11098
+
11099
+ if (Math.abs(number) < 1) {
11100
+ if (sd + zeros <= precision) {
11101
+ value = prefix + Math.abs(number).toPrecision(sd);
11102
+ }
11103
+ else {
11104
+ if (sd <= precision - 1) {
11105
+ value = prefix + Math.abs(number).toExponential(sd-1);
11106
+ }
11107
+ else {
11108
+ value = prefix + Math.abs(number).toExponential(precision-1);
11109
+ }
11110
+ }
11111
+ }
11112
+ else {
11113
+ var prec = (sd <= precision) ? sd : precision;
11114
+ value = prefix + Math.abs(number).toPrecision(prec);
11115
+ }
11116
+ var textTransform = ['toString', 'toUpperCase']['pP'.indexOf(type) % 2];
11117
+ return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace)[textTransform]();
11118
+ }
11119
+ case 'n': return '';
11120
+ default: return substring;
11121
+ }
11122
+ });
11123
+ };
11124
+
11125
+ $.jqplot.sprintf.thousandsSeparator = ',';
11126
+ // Specifies the decimal mark for floating point values. By default a period '.'
11127
+ // is used. If you change this value to for example a comma be sure to also
11128
+ // change the thousands separator or else this won't work since a simple String
11129
+ // replace is used (replacing all periods with the mark specified here).
11130
+ $.jqplot.sprintf.decimalMark = '.';
11131
+
11132
+ $.jqplot.sprintf.regex = /%%|%(\d+\$)?([-+#0&\' ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g;
11133
+
11134
+ $.jqplot.getSignificantFigures = function(number) {
11135
+ var parts = String(Number(Math.abs(number)).toExponential()).split(/e|E/);
11136
+ // total significant digits
11137
+ var sd = (parts[0].indexOf('.') != -1) ? parts[0].length - 1 : parts[0].length;
11138
+ var zeros = (parts[1] < 0) ? -parts[1] - 1 : 0;
11139
+ // exponent
11140
+ var expn = parseInt(parts[1], 10);
11141
+ // digits to the left of the decimal place
11142
+ var dleft = (expn + 1 > 0) ? expn + 1 : 0;
11143
+ // digits to the right of the decimal place
11144
+ var dright = (sd <= dleft) ? 0 : sd - expn - 1;
11145
+ return {significantDigits: sd, digitsLeft: dleft, digitsRight: dright, zeros: zeros, exponent: expn} ;
11146
+ };
11147
+
11148
+ $.jqplot.getPrecision = function(number) {
11149
+ return $.jqplot.getSignificantFigures(number).digitsRight;
11150
+ };
11151
+
11152
+
11153
+
11154
+
11155
+ var backCompat = $.uiBackCompat !== false;
11156
+
11157
+ $.jqplot.effects = {
11158
+ effect: {}
11159
+ };
11160
+
11161
+ // prefix used for storing data on .data()
11162
+ var dataSpace = "jqplot.storage.";
11163
+
11164
+ /******************************************************************************/
11165
+ /*********************************** EFFECTS **********************************/
11166
+ /******************************************************************************/
11167
+
11168
+ $.extend( $.jqplot.effects, {
11169
+ version: "1.9pre",
11170
+
11171
+ // Saves a set of properties in a data storage
11172
+ save: function( element, set ) {
11173
+ for( var i=0; i < set.length; i++ ) {
11174
+ if ( set[ i ] !== null ) {
11175
+ element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
11176
+ }
11177
+ }
11178
+ },
11179
+
11180
+ // Restores a set of previously saved properties from a data storage
11181
+ restore: function( element, set ) {
11182
+ for( var i=0; i < set.length; i++ ) {
11183
+ if ( set[ i ] !== null ) {
11184
+ element.css( set[ i ], element.data( dataSpace + set[ i ] ) );
11185
+ }
11186
+ }
11187
+ },
11188
+
11189
+ setMode: function( el, mode ) {
11190
+ if (mode === "toggle") {
11191
+ mode = el.is( ":hidden" ) ? "show" : "hide";
11192
+ }
11193
+ return mode;
11194
+ },
11195
+
11196
+ // Wraps the element around a wrapper that copies position properties
11197
+ createWrapper: function( element ) {
11198
+
11199
+ // if the element is already wrapped, return it
11200
+ if ( element.parent().is( ".ui-effects-wrapper" )) {
11201
+ return element.parent();
11202
+ }
11203
+
11204
+ // wrap the element
11205
+ var props = {
11206
+ width: element.outerWidth(true),
11207
+ height: element.outerHeight(true),
11208
+ "float": element.css( "float" )
11209
+ },
11210
+ wrapper = $( "<div></div>" )
11211
+ .addClass( "ui-effects-wrapper" )
11212
+ .css({
11213
+ fontSize: "100%",
11214
+ background: "transparent",
11215
+ border: "none",
11216
+ margin: 0,
11217
+ padding: 0
11218
+ }),
11219
+ // Store the size in case width/height are defined in % - Fixes #5245
11220
+ size = {
11221
+ width: element.width(),
11222
+ height: element.height()
11223
+ },
11224
+ active = document.activeElement;
11225
+
11226
+ element.wrap( wrapper );
11227
+
11228
+ // Fixes #7595 - Elements lose focus when wrapped.
11229
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
11230
+ $( active ).focus();
11231
+ }
11232
+
11233
+ wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element
11234
+
11235
+ // transfer positioning properties to the wrapper
11236
+ if ( element.css( "position" ) === "static" ) {
11237
+ wrapper.css({ position: "relative" });
11238
+ element.css({ position: "relative" });
11239
+ } else {
11240
+ $.extend( props, {
11241
+ position: element.css( "position" ),
11242
+ zIndex: element.css( "z-index" )
11243
+ });
11244
+ $.each([ "top", "left", "bottom", "right" ], function(i, pos) {
11245
+ props[ pos ] = element.css( pos );
11246
+ if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
11247
+ props[ pos ] = "auto";
11248
+ }
11249
+ });
11250
+ element.css({
11251
+ position: "relative",
11252
+ top: 0,
11253
+ left: 0,
11254
+ right: "auto",
11255
+ bottom: "auto"
11256
+ });
11257
+ }
11258
+ element.css(size);
11259
+
11260
+ return wrapper.css( props ).show();
11261
+ },
11262
+
11263
+ removeWrapper: function( element ) {
11264
+ var active = document.activeElement;
11265
+
11266
+ if ( element.parent().is( ".ui-effects-wrapper" ) ) {
11267
+ element.parent().replaceWith( element );
11268
+
11269
+ // Fixes #7595 - Elements lose focus when wrapped.
11270
+ if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
11271
+ $( active ).focus();
11272
+ }
11273
+ }
11274
+
11275
+
11276
+ return element;
11277
+ }
11278
+ });
11279
+
11280
+ // return an effect options object for the given parameters:
11281
+ function _normalizeArguments( effect, options, speed, callback ) {
11282
+
11283
+ // short path for passing an effect options object:
11284
+ if ( $.isPlainObject( effect ) ) {
11285
+ return effect;
11286
+ }
11287
+
11288
+ // convert to an object
11289
+ effect = { effect: effect };
11290
+
11291
+ // catch (effect)
11292
+ if ( options === undefined ) {
11293
+ options = {};
11294
+ }
11295
+
11296
+ // catch (effect, callback)
11297
+ if ( $.isFunction( options ) ) {
11298
+ callback = options;
11299
+ speed = null;
11300
+ options = {};
11301
+ }
11302
+
11303
+ // catch (effect, speed, ?)
11304
+ if ( $.type( options ) === "number" || $.fx.speeds[ options ]) {
11305
+ callback = speed;
11306
+ speed = options;
11307
+ options = {};
11308
+ }
11309
+
11310
+ // catch (effect, options, callback)
11311
+ if ( $.isFunction( speed ) ) {
11312
+ callback = speed;
11313
+ speed = null;
11314
+ }
11315
+
11316
+ // add options to effect
11317
+ if ( options ) {
11318
+ $.extend( effect, options );
11319
+ }
11320
+
11321
+ speed = speed || options.duration;
11322
+ effect.duration = $.fx.off ? 0 : typeof speed === "number"
11323
+ ? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default;
11324
+
11325
+ effect.complete = callback || options.complete;
11326
+
11327
+ return effect;
11328
+ }
11329
+
11330
+ function standardSpeed( speed ) {
11331
+ // valid standard speeds
11332
+ if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {
11333
+ return true;
11334
+ }
11335
+
11336
+ // invalid strings - treat as "normal" speed
11337
+ if ( typeof speed === "string" && !$.jqplot.effects.effect[ speed ] ) {
11338
+ // TODO: remove in 2.0 (#7115)
11339
+ if ( backCompat && $.jqplot.effects[ speed ] ) {
11340
+ return false;
11341
+ }
11342
+ return true;
11343
+ }
11344
+
11345
+ return false;
11346
+ }
11347
+
11348
+ $.fn.extend({
11349
+ jqplotEffect: function( effect, options, speed, callback ) {
11350
+ var args = _normalizeArguments.apply( this, arguments ),
11351
+ mode = args.mode,
11352
+ queue = args.queue,
11353
+ effectMethod = $.jqplot.effects.effect[ args.effect ],
11354
+
11355
+ // DEPRECATED: remove in 2.0 (#7115)
11356
+ oldEffectMethod = !effectMethod && backCompat && $.jqplot.effects[ args.effect ];
11357
+
11358
+ if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) {
11359
+ // delegate to the original method (e.g., .show()) if possible
11360
+ if ( mode ) {
11361
+ return this[ mode ]( args.duration, args.complete );
11362
+ } else {
11363
+ return this.each( function() {
11364
+ if ( args.complete ) {
11365
+ args.complete.call( this );
11366
+ }
11367
+ });
11368
+ }
11369
+ }
11370
+
11371
+ function run( next ) {
11372
+ var elem = $( this ),
11373
+ complete = args.complete,
11374
+ mode = args.mode;
11375
+
11376
+ function done() {
11377
+ if ( $.isFunction( complete ) ) {
11378
+ complete.call( elem[0] );
11379
+ }
11380
+ if ( $.isFunction( next ) ) {
11381
+ next();
11382
+ }
11383
+ }
11384
+
11385
+ // if the element is hiddden and mode is hide,
11386
+ // or element is visible and mode is show
11387
+ if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
11388
+ done();
11389
+ } else {
11390
+ effectMethod.call( elem[0], args, done );
11391
+ }
11392
+ }
11393
+
11394
+ // TODO: remove this check in 2.0, effectMethod will always be true
11395
+ if ( effectMethod ) {
11396
+ return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
11397
+ } else {
11398
+ // DEPRECATED: remove in 2.0 (#7115)
11399
+ return oldEffectMethod.call(this, {
11400
+ options: args,
11401
+ duration: args.duration,
11402
+ callback: args.complete,
11403
+ mode: args.mode
11404
+ });
11405
+ }
11406
+ }
11407
+ });
11408
+
11409
+
11410
+
11411
+
11412
+ var rvertical = /up|down|vertical/,
11413
+ rpositivemotion = /up|left|vertical|horizontal/;
11414
+
11415
+ $.jqplot.effects.effect.blind = function( o, done ) {
11416
+ // Create element
11417
+ var el = $( this ),
11418
+ props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
11419
+ mode = $.jqplot.effects.setMode( el, o.mode || "hide" ),
11420
+ direction = o.direction || "up",
11421
+ vertical = rvertical.test( direction ),
11422
+ ref = vertical ? "height" : "width",
11423
+ ref2 = vertical ? "top" : "left",
11424
+ motion = rpositivemotion.test( direction ),
11425
+ animation = {},
11426
+ show = mode === "show",
11427
+ wrapper, distance, top;
11428
+
11429
+ // // if already wrapped, the wrapper's properties are my property. #6245
11430
+ if ( el.parent().is( ".ui-effects-wrapper" ) ) {
11431
+ $.jqplot.effects.save( el.parent(), props );
11432
+ } else {
11433
+ $.jqplot.effects.save( el, props );
11434
+ }
11435
+ el.show();
11436
+ top = parseInt(el.css('top'), 10);
11437
+ wrapper = $.jqplot.effects.createWrapper( el ).css({
11438
+ overflow: "hidden"
11439
+ });
11440
+
11441
+ distance = vertical ? wrapper[ ref ]() + top : wrapper[ ref ]();
11442
+
11443
+ animation[ ref ] = show ? String(distance) : '0';
11444
+ if ( !motion ) {
11445
+ el
11446
+ .css( vertical ? "bottom" : "right", 0 )
11447
+ .css( vertical ? "top" : "left", "" )
11448
+ .css({ position: "absolute" });
11449
+ animation[ ref2 ] = show ? '0' : String(distance);
11450
+ }
11451
+
11452
+ // // start at 0 if we are showing
11453
+ if ( show ) {
11454
+ wrapper.css( ref, 0 );
11455
+ if ( ! motion ) {
11456
+ wrapper.css( ref2, distance );
11457
+ }
11458
+ }
11459
+
11460
+ // // Animate
11461
+ wrapper.animate( animation, {
11462
+ duration: o.duration,
11463
+ easing: o.easing,
11464
+ queue: false,
11465
+ complete: function() {
11466
+ if ( mode === "hide" ) {
11467
+ el.hide();
11468
+ }
11469
+ $.jqplot.effects.restore( el, props );
11470
+ $.jqplot.effects.removeWrapper( el );
11471
+ done();
11472
+ }
11473
+ });
11474
+
11475
+ };
11476
+
11477
+ })(jQuery);
assets/jqplot/jquery.jqplot.min.css ADDED
@@ -0,0 +1 @@
 
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 ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ /* jqplot 1.0.9 | (c) 2009-2016 Chris Leonello | jplot.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;4>f;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&&0>-k?l=-Math.atan(-k/j):0>j?l=Math.PI-Math.atan(-k/j):0==j&&-k>0?l=3*Math.PI/2:0==j&&0>-k?l=Math.PI/2:0==j&&0==k&&(l=0),n&&(l-=n,0>l?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&&p>l)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&&0>-k?l=-Math.atan(-k/j):0>j?l=Math.PI-Math.atan(-k/j):0==j&&-k>0?l=3*Math.PI/2:0==j&&0>-k?l=Math.PI/2:0==j&&0==k&&(l=0),n&&(l-=n,0>l?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&&p>l)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]&&(q>=r||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;H>G;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])),v>=r&&(q>=r||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])),v>=r&&(q>=r||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=G.length;j>f;f++)this.axes[G[f]]=new b(G[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=G.length;j>f;f++)n=G[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=G.length;n>i;i++){j=G[i],m=this.axes[j],k=m._ticks;for(var l=0,o=k.length;o>l;l++){var p=k[l]._elem;p&&(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==F&&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;n>i;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=G.length;n>i;i++)j=G[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;n>i;i++)a.jqplot.postInitHooks[i].call(this,f,this.data,e);for(var i=0,n=this.postInitHooks.hooks.length;n>i;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;12>e;e++){d=G[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!==F&&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;d>c;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;i>h;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;c>l;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;h>c;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;12>c;c++){var i=G[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;f>e;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=G.length;h>c;c++){var i=G[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?!1:!0,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:!0,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;d>c;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;d>b;b++)a.jqplot.preDrawHooks[b].call(this);for(b=0,d=this.preDrawHooks.hooks.length;d>b;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;12>b;b++)g=G[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;8>i;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},"s"===this.legend.location&&(r.left=this._gridPadding.left,r.right=this._gridPadding.right)),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,
5
+ max:this._gridPadding.top}),this.target.append(this.grid.createElement(this._gridPadding,this)),this.grid.draw();var t=this.series,u=t.length;for(b=0,d=u;d>b;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;d>b;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;d>b;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;d>b;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&&u>x&&u>y&&"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;d>b;b++)a.jqplot.postDrawHooks[b].call(this);for(var b=0,d=this.postDrawHooks.hooks.length;d>b;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;d>b;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,e){var f=c[a],g=c[e];if(g.renderer.smooth)var h=g.renderer._smoothedData.slice(0).reverse();else var h=g.gridData.slice(0).reverse();if(f.renderer.smooth)var i=f.renderer._smoothedData.concat(h);else var i=f.gridData.concat(h);var j=null!==b.color?b.color:c[d].fillColor,k=null!==b.baseSeries?b.baseSeries:a,l=c[k].renderer.shapeRenderer,m={fillStyle:j,fill:!0,closePath:!0};l.draw(f.shadowCanvas._ctx,i,m)}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=e>d?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!=F)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(-1!=c){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&&-1!=c){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;o>n;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;v>u;u++){for(var w=[],x=[],y=0;2>y;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;o>y;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;L>K;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;A>b;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;r>q;q++)j=l+q,e=o/(j-1),f=p(e),e=Math.abs(d-j)+f.digitsRight,n>e?(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=1>e?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=.38>=f?.1:1.6>=f?.2:4>=f?.5:8>=f?1:16>=f?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=.38>=g?.1:1.6>=g?.2:4>=g?.5:8>=g?1:16>=g?2:5,c=d*f,[c,d,f]}function z(a,b){return a-b}function A(a){if(null==a||"object"!=typeof a)return a;var b=new a.constructor;for(var c in a)b[c]=A(a[c]);return b}function B(a,b){if(null!=b&&"object"==typeof b)for(var c in b)"highlightColors"==c&&(a[c]=A(b[c])),null!=b[c]&&"object"==typeof b[c]?(a.hasOwnProperty(c)||(a[c]={}),B(a[c],b[c])):a[c]=b[c]}function C(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;d>c;c++)if(b[c]===a)return c;return-1}function D(a){return null===a?"[object Null]":Object.prototype.toString.call(a)}function E(b,c,d,e){return a.isPlainObject(b)?b:(b={effect:b},c===F&&(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 F;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;e>d;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=j>d?b[d]:j?b[j-1]:null,h=k>d?c[d]:k?c[k-1]:null,e=i.attr("id"),e===F&&(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(i){var j=a.jqplot.config.errorMessage||i.message;a("#"+b).append('<div class="jqplot-error-message">'+j+"</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="d96a669",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;f>e;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===F||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;c>a;a++)this.freeCanvas(b[a]);b=[]},this.freeCanvas=function(b){if(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==F)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!==F&&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()?!1:!0,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?!0:!1,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;c>j;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;f>e;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==F?{}:c;b=b==F?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==F?{}:c;b=b==F?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!=F&&(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,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;
6
+ },a.jqplot.GenericCanvas.prototype.resetCanvas=function(){this._elem&&(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==F&&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;e>d;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;f>d;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 G=["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;3>h;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;3>h;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;4>e;e++){var f;-1!=c[e].search(/%/)?(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(-1!=b.search(/^ *rgba?\(/))return b;if(-1!=b.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/))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;4>g;g++)-1!=e[g].search(/%/)?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*c,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!==F&&(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 H=.1;a.jqplot.LinePattern=function(b,c){var d={dotted:[H,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;g>f;f++){if("."===e[f])c.push(H);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(!(l>m)){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;k>j;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;k>j;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;k>j;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;k>j;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)),p>o){var s=o;o=p,p=s,s=q,q=r,r=s}for(var j=0,k=f.length;k>j;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;k>j;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;k>j;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;i>h;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;i>h;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;i>h;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;i>h;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;i>h;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!=F?k.shadow:this.shadow,m=k.showLine!=F?k.showLine:this.showLine,n=k.fill!=F?k.fill:this.fill,o=k.fillAndStroke!=F?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++)this.markerRenderer.draw(s[f][0],s[f][1],b,k.markerOptions)}}else{if(this.renderer.bands.show){var B,C=a.extend(!0,{},k);this.renderer.bands.showLines&&(B=this.renderer.smooth?this.renderer._hiBandSmoothedData:this.renderer._hiBandGridData,this.renderer.shapeRenderer.draw(b,B,k),B=this.renderer.smooth?this.renderer._lowBandSmoothedData:this.renderer._lowBandGridData,this.renderer.shapeRenderer.draw(b,B,C)),this.renderer.bands.fill&&(B=this.renderer.smooth?this.renderer._hiBandSmoothedData.concat(this.renderer._lowBandSmoothedData.reverse()):this.renderer._hiBandGridData.concat(this.renderer._lowBandGridData.reverse()),this._areaPoints=B,C.closePath=!0,C.fill=!0,C.fillStyle=this.renderer.bands.fillColor,this.renderer.shapeRenderer.draw(b,B,C))}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 D=this._areaPoints[f];(g>D[0]||null==g)&&(g=D[0]),(j<D[1]||null==j)&&(j=D[1]),(i<D[0]||null==i)&&(i=D[0]),(h>D[1]||null==h)&&(h=D[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++)null!=c[f][0]&&null!=c[f][1]&&this.markerRenderer.draw(c[f][0],c[f][1],b,k.markerOptions)}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),
7
+ 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?!1: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),0>d&&(d=0)),this.forceTickAt100&&(c>100&&(c=100),100>d&&(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);(A>c||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&&0>L&&M>0?!0:!1):I.fill?L>=0&&(I.fillToZero||O>.1)?G=!0:0>L&&M>0&&I.fillToZero?(G=!1,H=!0):(G=!1,H=!1):0>L&&(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=1>E?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?!1: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?!1:f,g=null===g||f?!1:g,b===c&&(c=c?0:1),d=d||1,b>c){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;m>l?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;m>n?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);var c={angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,lineWidth:this.lineWidth,depth:this.shadowDepth,closePath:!0};-1!=this.style.indexOf("filled")&&(c.fill=!0),-1!=this.style.indexOf("ircle")&&(c.isarc=!0,c.closePath=!1),this.shadowRenderer.init(c);var d={fill:!1,isarc:!1,strokeStyle:this.color,fillStyle:this.color,lineWidth:this.lineWidth,closePath:!0};-1!=this.style.indexOf("filled")&&(d.fill=!0),-1!=this.style.indexOf("ircle")&&(d.isarc=!0,d.closePath=!1),this.shapeRenderer.init(d)},a.jqplot.MarkerRenderer.prototype.drawDiamond=function(a,b,c,d,e){var f=1.2,g=this.size/2/f,h=this.size/2*f,i=[[a-g,b],[a,b+h],[a+g,b],[a,b-h]];this.shadow&&this.shadowRenderer.draw(c,i),this.shapeRenderer.draw(c,i,e)},a.jqplot.MarkerRenderer.prototype.drawPlus=function(b,c,d,e,f){var g=1,h=this.size/2*g,i=this.size/2*g,j=[[b,c-i],[b,c+i]],k=[[b+h,c],[b-h,c]],l=a.extend(!0,{},this.options,{closePath:!1});this.shadow&&(this.shadowRenderer.draw(d,j,{closePath:!1}),this.shadowRenderer.draw(d,k,{closePath:!1})),this.shapeRenderer.draw(d,j,l),this.shapeRenderer.draw(d,k,l)},a.jqplot.MarkerRenderer.prototype.drawX=function(b,c,d,e,f){var g=1,h=this.size/2*g,i=this.size/2*g,j=a.extend(!0,{},this.options,{closePath:!1}),k=[[b-h,c-i],[b+h,c+i]],l=[[b-h,c+i],[b+h,c-i]];this.shadow&&(this.shadowRenderer.draw(d,k,{closePath:!1}),this.shadowRenderer.draw(d,l,{closePath:!1})),this.shapeRenderer.draw(d,k,j),this.shapeRenderer.draw(d,l,j)},a.jqplot.MarkerRenderer.prototype.drawDash=function(a,b,c,d,e){var f=1,g=this.size/2*f,h=(this.size/2*f,[[a-g,b],[a+g,b]]);this.shadow&&this.shadowRenderer.draw(c,h),this.shapeRenderer.draw(c,h,e)},a.jqplot.MarkerRenderer.prototype.drawLine=function(a,b,c,d,e){var f=[a,b];this.shadow&&this.shadowRenderer.draw(c,f),this.shapeRenderer.draw(c,f,e)},a.jqplot.MarkerRenderer.prototype.drawSquare=function(a,b,c,d,e){var f=1,g=this.size/2/f,h=this.size/2*f,i=[[a-g,b-h],[a-g,b+h],[a+g,b+h],[a+g,b-h]];this.shadow&&this.shadowRenderer.draw(c,i),this.shapeRenderer.draw(c,i,e)},a.jqplot.MarkerRenderer.prototype.drawCircle=function(a,b,c,d,e){var f=this.size/2,g=2*Math.PI,h=[a,b,f,0,g,!0];this.shadow&&this.shadowRenderer.draw(c,h),this.shapeRenderer.draw(c,h,e)},a.jqplot.MarkerRenderer.prototype.draw=function(a,b,c,d){if(d=d||{},null==d.show||0!=d.show)switch(d.color&&!d.fillStyle&&(d.fillStyle=d.color),d.color&&!d.strokeStyle&&(d.strokeStyle=d.color),this.style){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;k>n;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 L):f.renderer.constructor==a.jqplot.BarRenderer?e.series.push(new N):f.renderer.constructor==a.jqplot.PieRenderer?e.series.push(new O):f.renderer.constructor==a.jqplot.DonutRenderer?e.series.push(new P):f.renderer.constructor==a.jqplot.FunnelRenderer?e.series.push(new Q):f.renderer.constructor==a.jqplot.MeterGaugeRenderer?e.series.push(new R):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 I,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(z)},a.jqplot.ThemeEngine.prototype.getThemes=function(){var a=[],b=[];for(var c in this.themes)a.push(c);a.sort(z);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?(B(b.series[p].markerOptions,f),B(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?!1: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=A,a.jqplot.merge=B,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={});e>d;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!==F&&(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=A(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,shadow:null},this.axesStyles={label:{},ticks:{}},this.axes={},"string"==typeof c?this._name=c:"object"==typeof c&&a.jqplot.extend(!0,this,c)};var I=function(){this.borderColor=null,this.borderWidth=null,this.ticks=new J,this.label=new K},J=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},K=function(){this.textColor=null,this.whiteSpace=null,this.fontSize=null,
8
+ this.fontFamily=null,this.fontWeight=null},L=function(){this.color=null,this.lineWidth=null,this.linePattern=null,this.shadow=null,this.fillColor=null,this.showMarker=null,this.markerOptions=new M},M=function(){this.show=null,this.style=null,this.lineWidth=null,this.size=null,this.color=null,this.shadow=null},N=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},O=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},P=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},Q=function(){this.color=null,this.lineWidth=null,this.shadow=null,this.padding=null,this.sectionMargin=null,this.seriesColors=null,this.highlightColors=null},R=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;l>q;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;r>q;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"))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,-s>j&&(o=o-s-j,s=-j),-t>i&&(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 S=function(){switch(this.syntax=S.config.syntax,this._type="jsDate",this.proxy=new Date,this.options={},this.locale=S.regional.getLocale(),this.formatString="",this.defaultCentury=S.config.defaultCentury,arguments.length){case 0:break;case 1:if("[object Object]"==D(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=S.createDate(a.date)}else this.proxy=S.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))}};S.config={defaultLocale:"en",syntax:"perl",defaultCentury:1900},S.prototype.add=function(a,b){var c=V[b]||V.day;return"number"==typeof c?this.proxy.setTime(this.proxy.getTime()+c*a):c.add(this,a),this},S.prototype.clone=function(){return new S(this.proxy.getTime())},S.prototype.getUtcOffset=function(){return 6e4*this.proxy.getTimezoneOffset()},S.prototype.diff=function(a,b,c){if(a=new S(a),null===a)return null;var d=V[b]||V.day;if("number"==typeof d)var e=(this.proxy.getTime()-a.proxy.getTime())/d;else var e=d.diff(this.proxy,a.proxy);return c?e:Math[e>0?"floor":"ceil"](e)},S.prototype.getAbbrDayName=function(){return S.regional[this.locale].dayNamesShort[this.proxy.getDay()]},S.prototype.getAbbrMonthName=function(){return S.regional[this.locale].monthNamesShort[this.proxy.getMonth()]},S.prototype.getAMPM=function(){return this.proxy.getHours()>=12?"PM":"AM"},S.prototype.getAmPm=function(){return this.proxy.getHours()>=12?"pm":"am"},S.prototype.getCentury=function(){return parseInt(this.proxy.getFullYear()/100,10)},S.prototype.getDate=function(){return this.proxy.getDate()},S.prototype.getDay=function(){return this.proxy.getDay()},S.prototype.getDayOfWeek=function(){var a=this.proxy.getDay();return 0===a?7:a},S.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},S.prototype.getDayName=function(){return S.regional[this.locale].dayNames[this.proxy.getDay()]},S.prototype.getFullWeekOfYear=function(){var a=this.proxy,b=this.getDayOfYear(),c=6-a.getDay(),d=parseInt((b+c)/7,10);return d},S.prototype.getFullYear=function(){return this.proxy.getFullYear()},S.prototype.getGmtOffset=function(){var a=this.proxy.getTimezoneOffset()/60,b=0>a?"+":"-";return a=Math.abs(a),b+U(Math.floor(a),2)+":"+U(a%1*60,2)},S.prototype.getHours=function(){return this.proxy.getHours()},S.prototype.getHours12=function(){var a=this.proxy.getHours();return a>12?a-12:0==a?12:a},S.prototype.getIsoWeek=function(){var a=this.proxy,b=this.getWeekOfYear(),c=new Date(""+a.getFullYear()+"/1/1").getDay(),d=b+(c>4||1>=c?0:1);return 53==d&&new Date(""+a.getFullYear()+"/12/31").getDay()<4?d=1:0===d&&(a=new S(new Date(""+(a.getFullYear()-1)+"/12/31")),d=a.getIsoWeek()),a=null,d},S.prototype.getMilliseconds=function(){return this.proxy.getMilliseconds()},S.prototype.getMinutes=function(){return this.proxy.getMinutes()},S.prototype.getMonth=function(){return this.proxy.getMonth()},S.prototype.getMonthName=function(){return S.regional[this.locale].monthNames[this.proxy.getMonth()]},S.prototype.getMonthNumber=function(){return this.proxy.getMonth()+1},S.prototype.getSeconds=function(){return this.proxy.getSeconds()},S.prototype.getShortYear=function(){return this.proxy.getYear()%100},S.prototype.getTime=function(){return this.proxy.getTime()},S.prototype.getTimezoneAbbr=function(){return this.proxy.toString().replace(/^.*\(([^)]+)\)$/,"$1")},S.prototype.getTimezoneName=function(){var a=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return a[1]||a[2]||"GMT"+this.getGmtOffset()},S.prototype.getTimezoneOffset=function(){return this.proxy.getTimezoneOffset()},S.prototype.getWeekOfYear=function(){var a=this.getDayOfYear(),b=7-this.getDayOfWeek(),c=parseInt((a+b)/7,10);return c},S.prototype.getUnix=function(){return Math.round(this.proxy.getTime()/1e3,0)},S.prototype.getYear=function(){return this.proxy.getYear()},S.prototype.next=function(a){return a=a||"day",this.clone().add(1,a)},S.prototype.set=function(){switch(arguments.length){case 0:this.proxy=new Date;break;case 1:if("[object Object]"==D(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=S.createDate(a.date)}else this.proxy=S.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},S.prototype.setDate=function(a){return this.proxy.setDate(a),this},S.prototype.setFullYear=function(){return this.proxy.setFullYear.apply(this.proxy,arguments),this},S.prototype.setHours=function(){return this.proxy.setHours.apply(this.proxy,arguments),this},S.prototype.setMilliseconds=function(a){return this.proxy.setMilliseconds(a),this},S.prototype.setMinutes=function(){return this.proxy.setMinutes.apply(this.proxy,arguments),this},S.prototype.setMonth=function(){return this.proxy.setMonth.apply(this.proxy,arguments),this},S.prototype.setSeconds=function(){return this.proxy.setSeconds.apply(this.proxy,arguments),this},S.prototype.setTime=function(a){return this.proxy.setTime(a),this},S.prototype.setYear=function(){return this.proxy.setYear.apply(this.proxy,arguments),this},S.prototype.strftime=function(a){return a=a||this.formatString||S.regional[this.locale].formatString,S.strftime(this,a,this.syntax)},S.prototype.toString=function(){return this.proxy.toString()},S.prototype.toYmdInt=function(){return 1e4*this.proxy.getFullYear()+100*this.getMonthNumber()+this.proxy.getDate()},S.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"}},S.regional["en-US"]=S.regional["en-GB"]=S.regional.en,S.regional.getLocale=function(){var a=S.config.defaultLocale;return document&&document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang&&(a=document.getElementsByTagName("html")[0].lang,S.regional.hasOwnProperty(a)||(a=S.config.defaultLocale)),a};var T=864e5,U=function(a,b){a=String(a);var c=b-a.length,d=String(Math.pow(10,c)).slice(1);return d.concat(a)},V={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:T,week:7*T,month:{add:function(a,b){V.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)):-1==c&&(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 V.month.diff(a,b)/12}}};for(var W in V)"s"!=W.substring(W.length-1)&&(V[W+"s"]=V[W]);var X=function(a,b,c){if(S.formats[c].shortcuts[b])return S.strftime(a,S.formats[c].shortcuts[b],c);var d=(S.formats[c].codes[b]||"").split("."),e=a["get"+d[0]]?a["get"+d[0]]():"";return d[1]&&(e=U(e,d[1])),e};S.strftime=function(a,b,c,d){var e="perl",f=S.regional.getLocale();c&&S.formats.hasOwnProperty(c)?e=c:c&&S.regional.hasOwnProperty(c)&&(f=c),d&&S.formats.hasOwnProperty(d)?e=d:d&&S.regional.hasOwnProperty(d)&&(f=d),("[object Object]"!=D(a)||"jsDate"!=a._type)&&(a=new S(a),a.locale=f),b||(b=a.formatString||S.regional[f].formatString);for(var g,h=b||"%Y-%m-%d",i="";h.length>0;)(g=h.match(S.formats[e].codes.matcher))?(i+=h.slice(0,g.index),i+=(g[1]||"")+X(a,g[2],e),h=h.slice(g.index+g[0].length)):(i+=h,h="");return i},S.formats={ISO:"%Y-%m-%dT%H:%M:%S.%N%G",SQL:"%Y-%m-%d %H:%M:%S"},S.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:" ",n:"\n","%":"%"}},S.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:" ",n:"\n","%":"%"}},S.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=S.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=S.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=S.matchers.length,l=c;k>j;){if(h=Date.parse(l),!isNaN(h))return new Date(h);if(g=S.matchers[j],"function"==typeof g){if(i=g.call(S,l),i instanceof Date)return i}else l=c.replace(g[0],g[1]);j++}return NaN},S.daysInMonth=function(a,b){return 2==b?29==new Date(a,1,29).getDate()?29:28:[F,31,F,31,30,31,30,31,31,30,31,30,31][b]},S.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=S.config.defaultCentury,h=parseFloat(b[1]),i=parseFloat(b[3]);h>31?(d=i,c=g+h):(d=h,c=g+i);var e=C(b[2],S.regional[S.regional.getLocale()].monthNamesShort);return-1==e&&(e=C(b[2],S.regional[S.regional.getLocale()].monthNames)),f.setFullYear(c,e,d),f.setHours(0,0,0,0),f}return a}],a.jsDate=S,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,0>l&&(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=0>x?"-":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=0>x?"-":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=0>x?"-":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=0>x?"-":q,C=String(Number(Math.abs(x)).toExponential()).split(/e|E/),E=-1!=C[0].indexOf(".")?C[0].length-1:String(x).length,F=C[1]<0?-C[1]-1:0;if(Math.abs(x)<1)w=n>=E+F?y+Math.abs(x).toPrecision(E):n-1>=E?y+Math.abs(x).toExponential(E-1):y+Math.abs(x).toExponential(n-1);else{var G=n>=E?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=-1!=b[0].indexOf(".")?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=f>=c?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 Y=a.uiBackCompat!==!1;a.jqplot.effects={effect:{}};var Z="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(Z+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(Z+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=E.apply(this,arguments),h=g.mode,i=g.queue,j=a.jqplot.effects.effect[g.effect],k=!j&&Y&&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 $=/up|down|vertical/,_=/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=$.test(j),l=k?"height":"width",m=k?"top":"left",n=_.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 ADDED
@@ -0,0 +1,203 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jqPlot
3
+ * Pure JavaScript plotting plugin using jQuery
4
+ *
5
+ * Version: 1.0.9
6
+ * Revision: d96a669
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 ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){t.jqplot.CanvasAxisLabelRenderer=function(e){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},t.extend(!0,this,e),null==e.angle&&"xaxis"!=this.axis&&"x2axis"!=this.axis&&(this.angle=-90);var i={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};this.pt2px&&(i.pt2px=this.pt2px),this.enableFontSupport&&t.jqplot.support_canvas_text()?this._textRenderer=new t.jqplot.CanvasFontRenderer(i):this._textRenderer=new t.jqplot.CanvasTextRenderer(i)},t.jqplot.CanvasAxisLabelRenderer.prototype.init=function(e){t.extend(!0,this,e),this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})},t.jqplot.CanvasAxisLabelRenderer.prototype.getWidth=function(t){if(this._elem)return this._elem.outerWidth(!0);var e=this._textRenderer,i=e.getWidth(t),n=e.getHeight(t),s=Math.abs(Math.sin(e.angle)*n)+Math.abs(Math.cos(e.angle)*i);return s},t.jqplot.CanvasAxisLabelRenderer.prototype.getHeight=function(t){if(this._elem)return this._elem.outerHeight(!0);var e=this._textRenderer,i=e.getWidth(t),n=e.getHeight(t),s=Math.abs(Math.cos(e.angle)*n)+Math.abs(Math.sin(e.angle)*i);return s},t.jqplot.CanvasAxisLabelRenderer.prototype.getAngleRad=function(){var t=this.angle*Math.PI/180;return t},t.jqplot.CanvasAxisLabelRenderer.prototype.draw=function(e,i){this._elem&&(t.jqplot.use_excanvas&&void 0!==window.G_vmlCanvasManager.uninitElement&&window.G_vmlCanvasManager.uninitElement(this._elem.get(0)),this._elem.emptyForce(),this._elem=null);var n=i.canvasManager.getCanvas();this._textRenderer.setText(this.label,e);var s=this.getWidth(e),a=this.getHeight(e);return n.width=s,n.height=a,n.style.width=s,n.style.height=a,n=i.canvasManager.initCanvas(n),this._elem=t(n),this._elem.css({position:"absolute"}),this._elem.addClass("jqplot-"+this.axis+"-label"),n=null,this._elem},t.jqplot.CanvasAxisLabelRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}}(jQuery);
assets/jqplot/plugins/jqplot.canvasAxisTickRenderer.js ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jqPlot
3
+ * Pure JavaScript plotting plugin using jQuery
4
+ *
5
+ * Version: 1.0.9
6
+ * Revision: d96a669
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 ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){t.jqplot.CanvasAxisTickRenderer=function(e){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=t.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},t.extend(!0,this,e);var i={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};this.pt2px&&(i.pt2px=this.pt2px),this.enableFontSupport&&t.jqplot.support_canvas_text()?this._textRenderer=new t.jqplot.CanvasFontRenderer(i):this._textRenderer=new t.jqplot.CanvasTextRenderer(i)},t.jqplot.CanvasAxisTickRenderer.prototype.init=function(e){t.extend(!0,this,e),this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})},t.jqplot.CanvasAxisTickRenderer.prototype.getWidth=function(t){if(this._elem)return this._elem.outerWidth(!0);var e=this._textRenderer,i=e.getWidth(t),s=e.getHeight(t),n=Math.abs(Math.sin(e.angle)*s)+Math.abs(Math.cos(e.angle)*i);return n},t.jqplot.CanvasAxisTickRenderer.prototype.getHeight=function(t){if(this._elem)return this._elem.outerHeight(!0);var e=this._textRenderer,i=e.getWidth(t),s=e.getHeight(t),n=Math.abs(Math.cos(e.angle)*s)+Math.abs(Math.sin(e.angle)*i);return n},t.jqplot.CanvasAxisTickRenderer.prototype.getTop=function(t){return this._elem?this._elem.position().top:null},t.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad=function(){var t=this.angle*Math.PI/180;return t},t.jqplot.CanvasAxisTickRenderer.prototype.setTick=function(t,e,i){return this.value=t,i&&(this.isMinorTick=!0),this},t.jqplot.CanvasAxisTickRenderer.prototype.draw=function(e,i){this.label||(this.label=this.prefix+this.formatter(this.formatString,this.value)),this._elem&&(t.jqplot.use_excanvas&&void 0!==window.G_vmlCanvasManager.uninitElement&&window.G_vmlCanvasManager.uninitElement(this._elem.get(0)),this._elem.emptyForce(),this._elem=null);var s=i.canvasManager.getCanvas();this._textRenderer.setText(this.label,e);var n=this.getWidth(e),h=this.getHeight(e);return s.width=n,s.height=h,s.style.width=n,s.style.height=h,s.style.textAlign="left",s.style.position="absolute",s=i.canvasManager.initCanvas(s),this._elem=t(s),this._elem.css(this._styles),this._elem.addClass("jqplot-"+this.axis+"-tick"),s=null,this._elem},t.jqplot.CanvasAxisTickRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}}(jQuery);
assets/jqplot/plugins/jqplot.canvasTextRenderer.js ADDED
@@ -0,0 +1,449 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jqPlot
3
+ * Pure JavaScript plotting plugin using jQuery
4
+ *
5
+ * Version: 1.0.9
6
+ * Revision: d96a669
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 ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){t.jqplot.CanvasTextRenderer=function(i){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,t.extend(!0,this,i),this.normalizedFontSize=this.normalizeFontSize(this.fontSize),this.setHeight()},t.jqplot.CanvasTextRenderer.prototype.init=function(i){t.extend(!0,this,i),this.normalizedFontSize=this.normalizeFontSize(this.fontSize),this.setHeight()},t.jqplot.CanvasTextRenderer.prototype.normalizeFontSize=function(t){t=String(t);var i=parseFloat(t);return t.indexOf("px")>-1?i/this.pt2px:t.indexOf("pt")>-1?i:t.indexOf("em")>-1?12*i:t.indexOf("%")>-1?12*i/100:i/this.pt2px},t.jqplot.CanvasTextRenderer.prototype.fontWeight2Float=function(t){if(Number(t))return t/400;switch(t){case"normal":return 1;case"bold":return 1.75;case"bolder":return 2.25;case"lighter":return.75;default:return 1}},t.jqplot.CanvasTextRenderer.prototype.getText=function(){return this.text},t.jqplot.CanvasTextRenderer.prototype.setText=function(t,i){return this.text=t,this.setWidth(i),this},t.jqplot.CanvasTextRenderer.prototype.getWidth=function(t){return this.width},t.jqplot.CanvasTextRenderer.prototype.setWidth=function(t,i){return i?this.width=i:this.width=this.measure(t,this.text),this},t.jqplot.CanvasTextRenderer.prototype.getHeight=function(t){return this.height},t.jqplot.CanvasTextRenderer.prototype.setHeight=function(t){return t?this.height=t:this.height=this.normalizedFontSize*this.pt2px,this},t.jqplot.CanvasTextRenderer.prototype.letter=function(t){return this.letters[t]},t.jqplot.CanvasTextRenderer.prototype.ascent=function(){return this.normalizedFontSize},t.jqplot.CanvasTextRenderer.prototype.descent=function(){return 7*this.normalizedFontSize/25},t.jqplot.CanvasTextRenderer.prototype.measure=function(t,i){for(var h=0,n=i.length,e=0;e<n;e++){var s=this.letter(i.charAt(e));s&&(h+=s.width*this.normalizedFontSize/25*this.fontStretch)}return h},t.jqplot.CanvasTextRenderer.prototype.draw=function(t,i){var h=0,n=.72*this.height,e=0,s=i.length,o=this.normalizedFontSize/25;t.save();var a,r;-Math.PI/2<=this.angle&&this.angle<=0||3*Math.PI/2<=this.angle&&this.angle<=2*Math.PI?(a=0,r=-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?(a=Math.sin(this.angle)*this.height,r=0):-Math.PI<this.angle&&this.angle<-Math.PI/2||Math.PI<=this.angle&&this.angle<=3*Math.PI/2?(a=-Math.cos(this.angle)*this.width,r=-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)&&(a=Math.sin(this.angle)*this.height-Math.cos(this.angle)*this.width,r=-Math.cos(this.angle)*this.height),t.strokeStyle=this.fillStyle,t.fillStyle=this.fillStyle,t.translate(a,r),t.rotate(this.angle),t.lineCap="round";var p=this.normalizedFontSize>30?2:2+(30-this.normalizedFontSize)/20;t.lineWidth=p*o*this.fontWeight2Float(this.fontWeight);for(var d=0;d<s;d++){var l=this.letter(i.charAt(d));if(l){t.beginPath();for(var w=1,g=0;g<l.points.length;g++){var f=l.points[g];f[0]!=-1||f[1]!=-1?w?(t.moveTo(h+f[0]*o*this.fontStretch,n-f[1]*o),w=!1):t.lineTo(h+f[0]*o*this.fontStretch,n-f[1]*o):w=1}t.stroke(),h+=l.width*o*this.fontStretch}}return t.restore(),e},t.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]]}},t.jqplot.CanvasFontRenderer=function(i){i=i||{},i.pt2px||(i.pt2px=1.5),t.jqplot.CanvasTextRenderer.call(this,i)},t.jqplot.CanvasFontRenderer.prototype=new t.jqplot.CanvasTextRenderer({}),t.jqplot.CanvasFontRenderer.prototype.constructor=t.jqplot.CanvasFontRenderer,t.jqplot.CanvasFontRenderer.prototype.measure=function(t,i){var h=this.fontSize+" "+this.fontFamily;t.save(),t.font=h;var n=t.measureText(i).width;return t.restore(),n},t.jqplot.CanvasFontRenderer.prototype.draw=function(t,i){var h=0,n=.72*this.height;t.save();var e,s;-Math.PI/2<=this.angle&&this.angle<=0||3*Math.PI/2<=this.angle&&this.angle<=2*Math.PI?(e=0,s=-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,s=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,s=-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,s=-Math.cos(this.angle)*this.height),t.strokeStyle=this.fillStyle,t.fillStyle=this.fillStyle;var o=this.fontSize+" "+this.fontFamily;t.font=o,t.translate(e,s),t.rotate(this.angle),t.fillText(i,h,n),t.restore()}}(jQuery);
assets/jqplot/plugins/jqplot.dateAxisRenderer.js ADDED
@@ -0,0 +1,741 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jqPlot
3
+ * Pure JavaScript plotting plugin using jQuery
4
+ *
5
+ * Version: 1.0.9
6
+ * Revision: d96a669
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(d[j][0]).getTime();
208
+ sd[j][0] = new $.jsDate(d[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(d[j][1]).getTime();
231
+ sd[j][1] = new $.jsDate(d[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 ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){function i(t,i,e){for(var s,a,n,r=Number.MAX_VALUE,h=0,l=m.length;h<l;h++)s=Math.abs(e-m[h]),s<r&&(r=s,a=m[h],n=o[h]);return[a,n]}t.jqplot.DateAxisRenderer=function(){t.jqplot.LinearAxisRenderer.call(this),this.date=new t.jsDate};var e=1e3,s=60*e,a=60*s,n=24*a,r=7*n,h=30.4368499*n,l=365.242199*n,o=["%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"],m=[.1*e,.2*e,.5*e,e,2*e,5*e,10*e,15*e,30*e,s,2*s,5*s,10*s,15*s,30*s,a,2*a,4*a,6*a,8*a,12*a,n,2*n,3*n,4*n,5*n,r,2*r];t.jqplot.DateAxisRenderer.prototype=new t.jqplot.LinearAxisRenderer,t.jqplot.DateAxisRenderer.prototype.constructor=t.jqplot.DateAxisRenderer,t.jqplot.DateTickFormatter=function(i,e){return i||(i="%Y/%m/%d"),t.jsDate.strftime(e,i)},t.jqplot.DateAxisRenderer.prototype.init=function(i){this.tickOptions.formatter=t.jqplot.DateTickFormatter,this.tickInset=0,this.drawBaseline=!0,this.baselineWidth=null,this.baselineColor=null,this.daTickInterval=null,this._daTickInterval=null,t.extend(!0,this,i);for(var e,s,a,n,r,h,l,o=this._dataBounds,m=0;m<this._series.length;m++){e={intervals:[],frequencies:{},sortedIntervals:[],min:null,max:null,mean:null},s=0,a=this._series[m],n=a.data,r=a._plotData,h=a._stackData,l=0;for(var c=0;c<n.length;c++)"xaxis"==this.name||"x2axis"==this.name?(n[c][0]=new t.jsDate(n[c][0]).getTime(),r[c][0]=new t.jsDate(n[c][0]).getTime(),h[c][0]=new t.jsDate(n[c][0]).getTime(),(null!=n[c][0]&&n[c][0]<o.min||null==o.min)&&(o.min=n[c][0]),(null!=n[c][0]&&n[c][0]>o.max||null==o.max)&&(o.max=n[c][0]),c>0&&(l=Math.abs(n[c][0]-n[c-1][0]),e.intervals.push(l),e.frequencies.hasOwnProperty(l)?e.frequencies[l]+=1:e.frequencies[l]=1),s+=l):(n[c][1]=new t.jsDate(n[c][1]).getTime(),r[c][1]=new t.jsDate(n[c][1]).getTime(),h[c][1]=new t.jsDate(n[c][1]).getTime(),(null!=n[c][1]&&n[c][1]<o.min||null==o.min)&&(o.min=n[c][1]),(null!=n[c][1]&&n[c][1]>o.max||null==o.max)&&(o.max=n[c][1]),c>0&&(l=Math.abs(n[c][1]-n[c-1][1]),e.intervals.push(l),e.frequencies.hasOwnProperty(l)?e.frequencies[l]+=1:e.frequencies[l]=1)),s+=l;if(a.renderer.bands){if(a.renderer.bands.hiData.length)for(var u=a.renderer.bands.hiData,c=0,k=u.length;c<k;c++)"xaxis"===this.name||"x2axis"===this.name?(u[c][0]=new t.jsDate(u[c][0]).getTime(),(null!=u[c][0]&&u[c][0]>o.max||null==o.max)&&(o.max=u[c][0])):(u[c][1]=new t.jsDate(u[c][1]).getTime(),(null!=u[c][1]&&u[c][1]>o.max||null==o.max)&&(o.max=u[c][1]));if(a.renderer.bands.lowData.length)for(var u=a.renderer.bands.lowData,c=0,k=u.length;c<k;c++)"xaxis"===this.name||"x2axis"===this.name?(u[c][0]=new t.jsDate(u[c][0]).getTime(),(null!=u[c][0]&&u[c][0]<o.min||null==o.min)&&(o.min=u[c][0])):(u[c][1]=new t.jsDate(u[c][1]).getTime(),(null!=u[c][1]&&u[c][1]<o.min||null==o.min)&&(o.min=u[c][1]))}for(var v in e.frequencies)e.sortedIntervals.push({interval:v,frequency:e.frequencies[v]});e.sortedIntervals.sort(function(t,i){return i.frequency-t.frequency}),e.min=t.jqplot.arrayMin(e.intervals),e.max=t.jqplot.arrayMax(e.intervals),e.mean=s/n.length,this._intervalStats.push(e),e=s=a=n=r=h=null}o=null},t.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},t.jqplot.DateAxisRenderer.prototype.createTicks=function(e){var s,a,r,o,m=this._ticks,c=this.ticks,u=this.name,k=this._dataBounds,v=(this._intervalStats,"x"===this.name.charAt(0)?this._plotDimensions.width:this._plotDimensions.height),d=30,T=1,g=null;if(null!=this.tickInterval)if(Number(this.tickInterval))g=[Number(this.tickInterval),"seconds"];else if("string"==typeof this.tickInterval){var w=this.tickInterval.split(" ");1==w.length?g=[1,w[0]]:2==w.length&&(g=[w[0],w[1]])}this.tickInterval;s=new t.jsDate(null!=this.min?this.min:k.min).getTime(),a=new t.jsDate(null!=this.max?this.max:k.max).getTime();var x=e.plugins.cursor;x&&x._zoom&&x._zoom.zooming&&(this.min=null,this.max=null);var f=a-s;if(null!=this.tickOptions&&this.tickOptions.formatString||(this._overrideFormatString=!0),c.length){for(o=0;o<c.length;o++){var p=c[o],M=new this.tickRenderer(this.tickOptions);p.constructor==Array?(M.value=new t.jsDate(p[0]).getTime(),M.label=p[1],this.showTicks?this.showTickMarks||(M.showMark=!1):(M.showLabel=!1,M.showMark=!1),M.setTick(M.value,this.name),this._ticks.push(M)):(M.value=new t.jsDate(p).getTime(),this.showTicks?this.showTickMarks||(M.showMark=!1):(M.showLabel=!1,M.showMark=!1),M.setTick(M.value,this.name),this._ticks.push(M))}this.numberTicks=c.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&&k.min==k.max){var _=t.extend(!0,{},this.tickOptions,{name:this.name,value:null}),D=3e5;this.min=k.min-D,this.max=k.max+D,this.numberTicks=3;for(var o=this.min;o<=this.max;o+=D){_.value=o;var M=new this.tickRenderer(_);this._overrideFormatString&&""!=this._autoFormatString&&(M.formatString=this._autoFormatString),M.showLabel=!1,M.showMark=!1,this._ticks.push(M)}this.showTicks&&(this._ticks[1].showLabel=!0),this.showTickMarks&&(this._ticks[1].showTickMarks=!0)}else if(null==this.min&&null==this.max){var b,j,I=t.extend(!0,{},this.tickOptions,{name:this.name,value:null});if(this.tickInterval||this.numberTicks)this.tickInterval?j=new t.jsDate(0).add(g[0],g[1]).getTime():this.numberTicks&&(b=this.numberTicks,j=(a-s)/(b-1));else{var S=Math.max(v,d+1),q=115;this.tickRenderer===t.jqplot.CanvasAxisTickRenderer&&this.tickOptions.angle&&(q=115-40*Math.abs(Math.sin(this.tickOptions.angle/180*Math.PI))),b=Math.ceil((S-d)/q+1),j=(a-s)/(b-1)}if(j<=19*n){var F=i(s,a,j),y=F[0];this._autoFormatString=F[1],s=new t.jsDate(s),s=Math.floor((s.getTime()-s.getUtcOffset())/y)*y+s.getUtcOffset(),b=Math.ceil((a-s)/y)+1,this.min=s,this.max=s+(b-1)*y,this.max<a&&(this.max+=y,b+=1),this.tickInterval=y,this.numberTicks=b;for(var o=0;o<b;o++)I.value=this.min+o*y,M=new this.tickRenderer(I),this._overrideFormatString&&""!=this._autoFormatString&&(M.formatString=this._autoFormatString),this.showTicks?this.showTickMarks||(M.showMark=!1):(M.showLabel=!1,M.showMark=!1),this._ticks.push(M);T=this.tickInterval}else if(j<=9*h){this._autoFormatString="%v";var H=Math.round(j/h);H<1?H=1:H>6&&(H=6);var R=new t.jsDate(s).setDate(1).setHours(0,0,0,0),O=new t.jsDate(a),A=new t.jsDate(a).setDate(1).setHours(0,0,0,0);O.getTime()!==A.getTime()&&(A=A.add(1,"month"));var L=A.diff(R,"month");b=Math.ceil(L/H)+1,this.min=R.getTime(),this.max=R.clone().add((b-1)*H,"month").getTime(),this.numberTicks=b;for(var o=0;o<b;o++)0===o?I.value=R.getTime():I.value=R.add(H,"month").getTime(),M=new this.tickRenderer(I),this._overrideFormatString&&""!=this._autoFormatString&&(M.formatString=this._autoFormatString),this.showTicks?this.showTickMarks||(M.showMark=!1):(M.showLabel=!1,M.showMark=!1),this._ticks.push(M);T=H*h}else{this._autoFormatString="%v";var H=Math.round(j/l);H<1&&(H=1);var R=new t.jsDate(s).setMonth(0,1).setHours(0,0,0,0),A=new t.jsDate(a).add(1,"year").setMonth(0,1).setHours(0,0,0,0),N=A.diff(R,"year");b=Math.ceil(N/H)+1,this.min=R.getTime(),this.max=R.clone().add((b-1)*H,"year").getTime(),this.numberTicks=b;for(var o=0;o<b;o++)0===o?I.value=R.getTime():I.value=R.add(H,"year").getTime(),M=new this.tickRenderer(I),this._overrideFormatString&&""!=this._autoFormatString&&(M.formatString=this._autoFormatString),this.showTicks?this.showTickMarks||(M.showMark=!1):(M.showLabel=!1,M.showMark=!1),this._ticks.push(M);T=H*l}}else{if(v="xaxis"==u||"x2axis"==u?this._plotDimensions.width:this._plotDimensions.height,null!=this.min&&null!=this.max&&null!=this.numberTicks&&(this.tickInterval=null),null!=this.tickInterval&&null!=g&&(this.daTickInterval=g),s==a){var z=432e5;s-=z,a+=z}f=a-s;var B,P;2+parseInt(Math.max(0,v-100)/100,10);if(B=null!=this.min?new t.jsDate(this.min).getTime():s-f/2*(this.padMin-1),P=null!=this.max?new t.jsDate(this.max).getTime():a+f/2*(this.padMax-1),this.min=B,this.max=P,f=this.max-this.min,null==this.numberTicks)if(null!=this.daTickInterval){var U=new t.jsDate(this.max).diff(this.min,this.daTickInterval[1],!0);this.numberTicks=Math.ceil(U/this.daTickInterval[0])+1,this.max=new t.jsDate(this.min).add((this.numberTicks-1)*this.daTickInterval[0],this.daTickInterval[1]).getTime()}else v>200?this.numberTicks=parseInt(3+(v-200)/100,10):this.numberTicks=2;T=f/(this.numberTicks-1)/1e3,null==this.daTickInterval&&(this.daTickInterval=[T,"seconds"]);for(var o=0;o<this.numberTicks;o++){var s=new t.jsDate(this.min);r=s.add(o*this.daTickInterval[0],this.daTickInterval[1]).getTime();var M=new this.tickRenderer(this.tickOptions);this.showTicks?this.showTickMarks||(M.showMark=!1):(M.showLabel=!1,M.showMark=!1),M.setTick(r,this.name),this._ticks.push(M)}}this.tickInset&&(this.min=this.min-this.tickInset*T,this.max=this.max+this.tickInset*T),null==this._daTickInterval&&(this._daTickInterval=this.daTickInterval),m=null}}(jQuery);
assets/jqplot/plugins/jqplot.enhancedLegendRenderer.js ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jqPlot
3
+ * Pure JavaScript plotting plugin using jQuery
4
+ *
5
+ * Version: 1.0.9
6
+ * Revision: d96a669
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 ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){e.jqplot.EnhancedLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)},e.jqplot.EnhancedLegendRenderer.prototype=new e.jqplot.TableLegendRenderer,e.jqplot.EnhancedLegendRenderer.prototype.constructor=e.jqplot.EnhancedLegendRenderer,e.jqplot.EnhancedLegendRenderer.prototype.init=function(s){this.numberRows=null,this.numberColumns=null,this.seriesToggle="normal",this.seriesToggleReplot=!1,this.disableIEFading=!0,e.extend(!0,this,s),this.seriesToggle&&e.jqplot.postDrawHooks.push(t)},e.jqplot.EnhancedLegendRenderer.prototype.draw=function(t,n){if(this.show){var l,o=this._series,i="position:absolute;";i+=this.background?"background:"+this.background+";":"",i+=this.border?"border:"+this.border+";":"",i+=this.fontSize?"font-size:"+this.fontSize+";":"",i+=this.fontFamily?"font-family:"+this.fontFamily+";":"",i+=this.textColor?"color:"+this.textColor+";":"",i+=null!=this.marginTop?"margin-top:"+this.marginTop+";":"",i+=null!=this.marginBottom?"margin-bottom:"+this.marginBottom+";":"",i+=null!=this.marginLeft?"margin-left:"+this.marginLeft+";":"",i+=null!=this.marginRight?"margin-right:"+this.marginRight+";":"",this._elem=e('<table class="jqplot-table-legend" style="'+i+'"></table>'),this.seriesToggle&&this._elem.css("z-index","3");var d,a,r=!1,h=!1;this.numberRows?(d=this.numberRows,a=this.numberColumns?this.numberColumns:Math.ceil(o.length/d)):this.numberColumns?(a=this.numberColumns,d=Math.ceil(o.length/this.numberColumns)):(d=o.length,a=1);var p,g,c,m,u,b,f,w,q,j=0;for(p=o.length-1;p>=0;p--)(1==a&&o[p]._stack||o[p].renderer.constructor==e.jqplot.BezierCurveRenderer)&&(h=!0);for(p=0;p<d;p++){for(c=e(document.createElement("tr")),c.addClass("jqplot-table-legend"),h?c.prependTo(this._elem):c.appendTo(this._elem),g=0;g<a;g++){if(j<o.length&&(o[j].show||o[j].showLabel)&&(l=o[j],b=this.labels[j]||l.label.toString())){var C=l.color;if(r=h?p!=d-1:p>0,f=r?this.rowSpacing:"0",m=e(document.createElement("td")),m.addClass("jqplot-table-legend jqplot-table-legend-swatch"),m.css({textAlign:"center",paddingTop:f}),w=e(document.createElement("div")),w.addClass("jqplot-table-legend-swatch-outline"),q=e(document.createElement("div")),q.addClass("jqplot-table-legend-swatch"),q.css({backgroundColor:C,borderColor:C}),m.append(w.append(q)),u=e(document.createElement("td")),u.addClass("jqplot-table-legend jqplot-table-legend-label"),u.css("paddingTop",f),this.escapeHtml?u.text(b):u.html(b),h?(this.showLabels&&u.prependTo(c),this.showSwatches&&m.prependTo(c)):(this.showSwatches&&m.appendTo(c),this.showLabels&&u.appendTo(c)),this.seriesToggle){var v;"string"!=typeof this.seriesToggle&&"number"!=typeof this.seriesToggle||e.jqplot.use_excanvas&&this.disableIEFading||(v=this.seriesToggle),this.showSwatches&&(m.bind("click",{series:l,speed:v,plot:n,replot:this.seriesToggleReplot},s),m.addClass("jqplot-seriesToggle")),this.showLabels&&(u.bind("click",{series:l,speed:v,plot:n,replot:this.seriesToggleReplot},s),u.addClass("jqplot-seriesToggle")),!l.show&&l.showLabel&&(m.addClass("jqplot-series-hidden"),u.addClass("jqplot-series-hidden"))}r=!0}j++}m=u=w=q=null}}return this._elem};var s=function(s){var t=s.data,n=t.series,l=t.replot,o=t.plot,i=t.speed,d=n.index,a=!1;!n.canvas._elem.is(":hidden")&&n.show||(a=!0);var r=function(){if(l){var s={};if(e.isPlainObject(l)&&e.extend(!0,s,l),o.replot(s),a&&i){var t=o.series[d];t.shadowCanvas._elem&&t.shadowCanvas._elem.hide().fadeIn(i),t.canvas._elem.hide().fadeIn(i),t.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+t.index).hide().fadeIn(i)}}else{var t=o.series[d];t.canvas._elem.is(":hidden")||!t.show?("undefined"!=typeof o.options.legend.showSwatches&&o.options.legend.showSwatches!==!0||o.legend._elem.find("td").eq(2*d).addClass("jqplot-series-hidden"),"undefined"!=typeof o.options.legend.showLabels&&o.options.legend.showLabels!==!0||o.legend._elem.find("td").eq(2*d+1).addClass("jqplot-series-hidden")):("undefined"!=typeof o.options.legend.showSwatches&&o.options.legend.showSwatches!==!0||o.legend._elem.find("td").eq(2*d).removeClass("jqplot-series-hidden"),"undefined"!=typeof o.options.legend.showLabels&&o.options.legend.showLabels!==!0||o.legend._elem.find("td").eq(2*d+1).removeClass("jqplot-series-hidden"))}};n.toggleDisplay(s,r)},t=function(){if(this.legend.renderer.constructor==e.jqplot.EnhancedLegendRenderer&&this.legend.seriesToggle){var s=this.legend._elem.detach();this.eventCanvas._elem.after(s)}}}(jQuery);
assets/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jqPlot
3
+ * Pure JavaScript plotting plugin using jQuery
4
+ *
5
+ * Version: 1.0.9
6
+ * Revision: d96a669
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 ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){e.jqplot.EnhancedPieLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)},e.jqplot.EnhancedPieLegendRenderer.prototype=new e.jqplot.TableLegendRenderer,e.jqplot.EnhancedPieLegendRenderer.prototype.constructor=e.jqplot.EnhancedPieLegendRenderer,e.jqplot.EnhancedPieLegendRenderer.prototype.init=function(t){this.numberRows=null,this.numberColumns=null,this.seriesToggle="normal",this.seriesToggleReplot=!1,this.disableIEFading=!0,this.toolTips=[],e.extend(!0,this,t),this.seriesToggle&&e.jqplot.postDrawHooks.push(s)},e.jqplot.EnhancedPieLegendRenderer.prototype.draw=function(s,i){if(this.show){var o,n=this._series,l="position:absolute;";l+=this.background?"background:"+this.background+";":"",l+=this.border?"border:"+this.border+";":"",l+=this.fontSize?"font-size:"+this.fontSize+";":"",l+=this.fontFamily?"font-family:"+this.fontFamily+";":"",l+=this.textColor?"color:"+this.textColor+";":"",l+=null!=this.marginTop?"margin-top:"+this.marginTop+";":"",l+=null!=this.marginBottom?"margin-bottom:"+this.marginBottom+";":"",l+=null!=this.marginLeft?"margin-left:"+this.marginLeft+";":"",l+=null!=this.marginRight?"margin-right:"+this.marginRight+";":"",this._elem=e('<table class="jqplot-table-legend" style="'+l+'"></table>'),this.seriesToggle&&this._elem.css("z-index","3");var r,a,d=!1,h=!1,o=n[0],p=o.data.length,g=new e.jqplot.ColorGenerator(o.seriesColors);this.numberRows?(r=this.numberRows,a=this.numberColumns?this.numberColumns:Math.ceil(p/r)):this.numberColumns?(a=this.numberColumns,r=Math.ceil(p/this.numberColumns)):(r=p,a=1);var c,m,u,b,j,T,f,q,w,C=0;for(c=n.length-1;c>=0;c--)(1==a&&n[c]._stack||n[c].renderer.constructor==e.jqplot.BezierCurveRenderer)&&(h=!0);for(c=0;c<r;c++){for(u=e(document.createElement("tr")),u.addClass("jqplot-table-legend"),h?u.prependTo(this._elem):u.appendTo(this._elem),m=0;m<a;m++){if(C<p&&(T=this.labels[C]||o.data[C][0].toString(),tt=this.toolTips[C],T)){var R=g.next();if(d=h?c!=r-1:c>0,f=d?this.rowSpacing:"0",b=e(document.createElement("td")),b.addClass("jqplot-table-legend jqplot-table-legend-swatch"),b.css({textAlign:"center",paddingTop:f}),q=e(document.createElement("div")),q.addClass("jqplot-table-legend-swatch-outline"),void 0!==tt&&q.attr("title",tt),w=e(document.createElement("div")),w.addClass("jqplot-table-legend-swatch"),w.css({backgroundColor:R,borderColor:R}),b.append(q.append(w)),j=e(document.createElement("td")),j.addClass("jqplot-table-legend jqplot-table-legend-label"),j.css("paddingTop",f),void 0!==tt&&j.attr("title",tt),this.escapeHtml?j.text(T):j.html(T),h?(this.showLabels&&j.prependTo(u),this.showSwatches&&b.prependTo(u)):(this.showSwatches&&b.appendTo(u),this.showLabels&&j.appendTo(u)),this.seriesToggle){var v;"string"!=typeof this.seriesToggle&&"number"!=typeof this.seriesToggle||e.jqplot.use_excanvas&&this.disableIEFading||(v=this.seriesToggle),this.showSwatches&&(b.bind("click",{series:o,index:C,speed:v,plot:i,replot:this.seriesToggleReplot},t),b.addClass("jqplot-seriesToggle")),this.showLabels&&(j.bind("click",{series:o,index:C,speed:v,plot:i,replot:this.seriesToggleReplot},t),j.addClass("jqplot-seriesToggle")),o.showSlice[C]===!1&&o.showLabel&&(b.addClass("jqplot-series-hidden"),j.addClass("jqplot-series-hidden"))}d=!0}C++}b=j=q=w=null}}return this._elem};var t=function(t){var s=t.data,i=s.replot,o=s.plot,n=s.index;s.series.showSlice[n]=s.series.showSlice[n]===!1;var l={};e.isPlainObject(i)&&e.extend(!0,l,i),o.replot(l)},s=function(){if(this.legend.renderer.constructor==e.jqplot.EnhancedPieLegendRenderer&&this.legend.seriesToggle){var t=this.legend._elem.detach();this.eventCanvas._elem.after(t)}}}(jQuery);
assets/jqplot/plugins/jqplot.highlighter.js ADDED
@@ -0,0 +1,465 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jqPlot
3
+ * Pure JavaScript plotting plugin using jQuery
4
+ *
5
+ * Version: 1.0.9
6
+ * Revision: d96a669
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
+ mr.draw(s.gridData[neighbor.pointIndex][0], s.gridData[neighbor.pointIndex][1], hl.highlightCanvas._ctx);
227
+ }
228
+
229
+ function showTooltip(plot, series, neighbor) {
230
+ // neighbor looks like: {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}
231
+ // gridData should be x,y pixel coords on the grid.
232
+ // add the plot._gridPadding to that to get x,y in the target.
233
+ var hl = plot.plugins.highlighter;
234
+ var elem = hl._tooltipElem;
235
+ var serieshl = series.highlighter || {};
236
+
237
+ var opts = $.extend(true, {}, hl, serieshl);
238
+
239
+ if (opts.useAxesFormatters) {
240
+ var xf = series._xaxis._ticks[0].formatter;
241
+ var yf = series._yaxis._ticks[0].formatter;
242
+ var xfstr = series._xaxis._ticks[0].formatString;
243
+ var yfstr = series._yaxis._ticks[0].formatString;
244
+ var str;
245
+ var xstr = xf(xfstr, neighbor.data[0]);
246
+ var ystrs = [];
247
+ for (var i=1; i<opts.yvalues+1; i++) {
248
+ ystrs.push(yf(yfstr, neighbor.data[i]));
249
+ }
250
+ if (typeof opts.formatString === 'string') {
251
+ switch (opts.tooltipAxes) {
252
+ case 'both':
253
+ case 'xy':
254
+ ystrs.unshift(xstr);
255
+ ystrs.unshift(opts.formatString);
256
+ str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
257
+ break;
258
+ case 'yx':
259
+ ystrs.push(xstr);
260
+ ystrs.unshift(opts.formatString);
261
+ str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
262
+ break;
263
+ case 'x':
264
+ str = $.jqplot.sprintf.apply($.jqplot.sprintf, [opts.formatString, xstr]);
265
+ break;
266
+ case 'y':
267
+ ystrs.unshift(opts.formatString);
268
+ str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
269
+ break;
270
+ default: // same as xy
271
+ ystrs.unshift(xstr);
272
+ ystrs.unshift(opts.formatString);
273
+ str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs);
274
+ break;
275
+ }
276
+ }
277
+ else {
278
+ switch (opts.tooltipAxes) {
279
+ case 'both':
280
+ case 'xy':
281
+ str = xstr;
282
+ for (var i=0; i<ystrs.length; i++) {
283
+ str += opts.tooltipSeparator + ystrs[i];
284
+ }
285
+ break;
286
+ case 'yx':
287
+ str = '';
288
+ for (var i=0; i<ystrs.length; i++) {
289
+ str += ystrs[i] + opts.tooltipSeparator;
290
+ }
291
+ str += xstr;
292
+ break;
293
+ case 'x':
294
+ str = xstr;
295
+ break;
296
+ case 'y':
297
+ str = ystrs.join(opts.tooltipSeparator);
298
+ break;
299
+ default: // same as 'xy'
300
+ str = xstr;
301
+ for (var i=0; i<ystrs.length; i++) {
302
+ str += opts.tooltipSeparator + ystrs[i];
303
+ }
304
+ break;
305
+
306
+ }
307
+ }
308
+ }
309
+ else {
310
+ var str;
311
+ if (typeof opts.formatString === 'string') {
312
+ str = $.jqplot.sprintf.apply($.jqplot.sprintf, [opts.formatString].concat(neighbor.data));
313
+ }
314
+
315
+ else {
316
+ if (opts.tooltipAxes == 'both' || opts.tooltipAxes == 'xy') {
317
+ str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[0]) + opts.tooltipSeparator + $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[1]);
318
+ }
319
+ else if (opts.tooltipAxes == 'yx') {
320
+ str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[1]) + opts.tooltipSeparator + $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[0]);
321
+ }
322
+ else if (opts.tooltipAxes == 'x') {
323
+ str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[0]);
324
+ }
325
+ else if (opts.tooltipAxes == 'y') {
326
+ str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[1]);
327
+ }
328
+ }
329
+ }
330
+ if ($.isFunction(opts.tooltipContentEditor)) {
331
+ // args str, seriesIndex, pointIndex are essential so the hook can look up
332
+ // extra data for the point.
333
+ str = opts.tooltipContentEditor(str, neighbor.seriesIndex, neighbor.pointIndex, plot);
334
+ }
335
+ elem.html(str);
336
+ var gridpos = {x:neighbor.gridData[0], y:neighbor.gridData[1]};
337
+ var ms = 0;
338
+ var fact = 0.707;
339
+ if (series.markerRenderer.show == true) {
340
+ ms = (series.markerRenderer.size + opts.sizeAdjust)/2;
341
+ }
342
+
343
+ var loc = locations;
344
+ if (series.fillToZero && series.fill && neighbor.data[1] < 0) {
345
+ loc = oppositeLocations;
346
+ }
347
+
348
+ switch (loc[locationIndicies[opts.tooltipLocation]]) {
349
+ case 'nw':
350
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - fact * ms;
351
+ var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - fact * ms;
352
+ break;
353
+ case 'n':
354
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
355
+ var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - ms;
356
+ break;
357
+ case 'ne':
358
+ var x = gridpos.x + plot._gridPadding.left + opts.tooltipOffset + fact * ms;
359
+ var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - fact * ms;
360
+ break;
361
+ case 'e':
362
+ var x = gridpos.x + plot._gridPadding.left + opts.tooltipOffset + ms;
363
+ var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
364
+ break;
365
+ case 'se':
366
+ var x = gridpos.x + plot._gridPadding.left + opts.tooltipOffset + fact * ms;
367
+ var y = gridpos.y + plot._gridPadding.top + opts.tooltipOffset + fact * ms;
368
+ break;
369
+ case 's':
370
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
371
+ var y = gridpos.y + plot._gridPadding.top + opts.tooltipOffset + ms;
372
+ break;
373
+ case 'sw':
374
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - fact * ms;
375
+ var y = gridpos.y + plot._gridPadding.top + opts.tooltipOffset + fact * ms;
376
+ break;
377
+ case 'w':
378
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - ms;
379
+ var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
380
+ break;
381
+ default: // same as 'nw'
382
+ var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - fact * ms;
383
+ var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - fact * ms;
384
+ break;
385
+ }
386
+ elem.css('left', x);
387
+ elem.css('top', y);
388
+ if (opts.fadeTooltip) {
389
+ // Fix for stacked up animations. Thnanks Trevor!
390
+ elem.stop(true,true).fadeIn(opts.tooltipFadeSpeed);
391
+ }
392
+ else {
393
+ elem.show();
394
+ }
395
+ elem = null;
396
+
397
+ }
398
+
399
+ function handleMove(ev, gridpos, datapos, neighbor, plot) {
400
+ var hl = plot.plugins.highlighter;
401
+ var c = plot.plugins.cursor;
402
+ if (hl.show) {
403
+ if (neighbor == null && hl.isHighlighting) {
404
+ var evt = jQuery.Event('jqplotHighlighterUnhighlight');
405
+ plot.target.trigger(evt);
406
+
407
+ var ctx = hl.highlightCanvas._ctx;
408
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
409
+ if (hl.fadeTooltip) {
410
+ hl._tooltipElem.fadeOut(hl.tooltipFadeSpeed);
411
+ }
412
+ else {
413
+ hl._tooltipElem.hide();
414
+ }
415
+ if (hl.bringSeriesToFront) {
416
+ plot.restorePreviousSeriesOrder();
417
+ }
418
+ hl.isHighlighting = false;
419
+ hl.currentNeighbor = null;
420
+ ctx = null;
421
+ }
422
+ else if (neighbor != null && plot.series[neighbor.seriesIndex].showHighlight && !hl.isHighlighting) {
423
+ var evt = jQuery.Event('jqplotHighlighterHighlight');
424
+ evt.which = ev.which;
425
+ evt.pageX = ev.pageX;
426
+ evt.pageY = ev.pageY;
427
+ var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data, plot];
428
+ plot.target.trigger(evt, ins);
429
+
430
+ hl.isHighlighting = true;
431
+ hl.currentNeighbor = neighbor;
432
+ if (hl.showMarker) {
433
+ draw(plot, neighbor);
434
+ }
435
+ if (plot.series[neighbor.seriesIndex].show && hl.showTooltip && (!c || !c._zoom.started)) {
436
+ showTooltip(plot, plot.series[neighbor.seriesIndex], neighbor);
437
+ }
438
+ if (hl.bringSeriesToFront) {
439
+ plot.moveSeriesToFront(neighbor.seriesIndex);
440
+ }
441
+ }
442
+ // check to see if we're highlighting the wrong point.
443
+ else if (neighbor != null && hl.isHighlighting && hl.currentNeighbor != neighbor) {
444
+ // highlighting the wrong point.
445
+
446
+ // if new series allows highlighting, highlight new point.
447
+ if (plot.series[neighbor.seriesIndex].showHighlight) {
448
+ var ctx = hl.highlightCanvas._ctx;
449
+ ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
450
+ hl.isHighlighting = true;
451
+ hl.currentNeighbor = neighbor;
452
+ if (hl.showMarker) {
453
+ draw(plot, neighbor);
454
+ }
455
+ if (plot.series[neighbor.seriesIndex].show && hl.showTooltip && (!c || !c._zoom.started)) {
456
+ showTooltip(plot, plot.series[neighbor.seriesIndex], neighbor);
457
+ }
458
+ if (hl.bringSeriesToFront) {
459
+ plot.moveSeriesToFront(neighbor.seriesIndex);
460
+ }
461
+ }
462
+ }
463
+ }
464
+ }
465
+ })(jQuery);
assets/jqplot/plugins/jqplot.highlighter.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){function i(i,e){var o=i.plugins.highlighter,r=i.series[e.seriesIndex],s=r.markerRenderer,l=o.markerRenderer;l.style=s.style,l.lineWidth=s.lineWidth+o.lineWidthAdjust,l.size=s.size+o.sizeAdjust;var h=t.jqplot.getColorComponents(s.color),a=[h[0],h[1],h[2]],n=h[3]>=.6?.6*h[3]:h[3]*(2-h[3]);l.color="rgba("+a[0]+","+a[1]+","+a[2]+","+n+")",l.init(),l.draw(r.gridData[e.pointIndex][0],r.gridData[e.pointIndex][1],o.highlightCanvas._ctx)}function e(i,e,o){var h=i.plugins.highlighter,a=h._tooltipElem,n=e.highlighter||{},g=t.extend(!0,{},h,n);if(g.useAxesFormatters){for(var p,d=e._xaxis._ticks[0].formatter,f=e._yaxis._ticks[0].formatter,u=e._xaxis._ticks[0].formatString,c=e._yaxis._ticks[0].formatString,v=d(u,o.data[0]),x=[],m=1;m<g.yvalues+1;m++)x.push(f(c,o.data[m]));if("string"==typeof g.formatString)switch(g.tooltipAxes){case"both":case"xy":x.unshift(v),x.unshift(g.formatString),p=t.jqplot.sprintf.apply(t.jqplot.sprintf,x);break;case"yx":x.push(v),x.unshift(g.formatString),p=t.jqplot.sprintf.apply(t.jqplot.sprintf,x);break;case"x":p=t.jqplot.sprintf.apply(t.jqplot.sprintf,[g.formatString,v]);break;case"y":x.unshift(g.formatString),p=t.jqplot.sprintf.apply(t.jqplot.sprintf,x);break;default:x.unshift(v),x.unshift(g.formatString),p=t.jqplot.sprintf.apply(t.jqplot.sprintf,x)}else switch(g.tooltipAxes){case"both":case"xy":p=v;for(var m=0;m<x.length;m++)p+=g.tooltipSeparator+x[m];break;case"yx":p="";for(var m=0;m<x.length;m++)p+=x[m]+g.tooltipSeparator;p+=v;break;case"x":p=v;break;case"y":p=x.join(g.tooltipSeparator);break;default:p=v;for(var m=0;m<x.length;m++)p+=g.tooltipSeparator+x[m]}}else{var p;"string"==typeof g.formatString?p=t.jqplot.sprintf.apply(t.jqplot.sprintf,[g.formatString].concat(o.data)):"both"==g.tooltipAxes||"xy"==g.tooltipAxes?p=t.jqplot.sprintf(g.tooltipFormatString,o.data[0])+g.tooltipSeparator+t.jqplot.sprintf(g.tooltipFormatString,o.data[1]):"yx"==g.tooltipAxes?p=t.jqplot.sprintf(g.tooltipFormatString,o.data[1])+g.tooltipSeparator+t.jqplot.sprintf(g.tooltipFormatString,o.data[0]):"x"==g.tooltipAxes?p=t.jqplot.sprintf(g.tooltipFormatString,o.data[0]):"y"==g.tooltipAxes&&(p=t.jqplot.sprintf(g.tooltipFormatString,o.data[1]))}t.isFunction(g.tooltipContentEditor)&&(p=g.tooltipContentEditor(p,o.seriesIndex,o.pointIndex,i)),a.html(p);var j={x:o.gridData[0],y:o.gridData[1]},_=0,w=.707;1==e.markerRenderer.show&&(_=(e.markerRenderer.size+g.sizeAdjust)/2);var q=r;switch(e.fillToZero&&e.fill&&o.data[1]<0&&(q=l),q[s[g.tooltipLocation]]){case"nw":var y=j.x+i._gridPadding.left-a.outerWidth(!0)-g.tooltipOffset-w*_,S=j.y+i._gridPadding.top-g.tooltipOffset-a.outerHeight(!0)-w*_;break;case"n":var y=j.x+i._gridPadding.left-a.outerWidth(!0)/2,S=j.y+i._gridPadding.top-g.tooltipOffset-a.outerHeight(!0)-_;break;case"ne":var y=j.x+i._gridPadding.left+g.tooltipOffset+w*_,S=j.y+i._gridPadding.top-g.tooltipOffset-a.outerHeight(!0)-w*_;break;case"e":var y=j.x+i._gridPadding.left+g.tooltipOffset+_,S=j.y+i._gridPadding.top-a.outerHeight(!0)/2;break;case"se":var y=j.x+i._gridPadding.left+g.tooltipOffset+w*_,S=j.y+i._gridPadding.top+g.tooltipOffset+w*_;break;case"s":var y=j.x+i._gridPadding.left-a.outerWidth(!0)/2,S=j.y+i._gridPadding.top+g.tooltipOffset+_;break;case"sw":var y=j.x+i._gridPadding.left-a.outerWidth(!0)-g.tooltipOffset-w*_,S=j.y+i._gridPadding.top+g.tooltipOffset+w*_;break;case"w":var y=j.x+i._gridPadding.left-a.outerWidth(!0)-g.tooltipOffset-_,S=j.y+i._gridPadding.top-a.outerHeight(!0)/2;break;default:var y=j.x+i._gridPadding.left-a.outerWidth(!0)-g.tooltipOffset-w*_,S=j.y+i._gridPadding.top-g.tooltipOffset-a.outerHeight(!0)-w*_}a.css("left",y),a.css("top",S),g.fadeTooltip?a.stop(!0,!0).fadeIn(g.tooltipFadeSpeed):a.show(),a=null}function o(t,o,r,s,l){var h=l.plugins.highlighter,a=l.plugins.cursor;if(h.show)if(null==s&&h.isHighlighting){var n=jQuery.Event("jqplotHighlighterUnhighlight");l.target.trigger(n);var g=h.highlightCanvas._ctx;g.clearRect(0,0,g.canvas.width,g.canvas.height),h.fadeTooltip?h._tooltipElem.fadeOut(h.tooltipFadeSpeed):h._tooltipElem.hide(),h.bringSeriesToFront&&l.restorePreviousSeriesOrder(),h.isHighlighting=!1,h.currentNeighbor=null,g=null}else if(null!=s&&l.series[s.seriesIndex].showHighlight&&!h.isHighlighting){var n=jQuery.Event("jqplotHighlighterHighlight");n.which=t.which,n.pageX=t.pageX,n.pageY=t.pageY;var p=[s.seriesIndex,s.pointIndex,s.data,l];l.target.trigger(n,p),h.isHighlighting=!0,h.currentNeighbor=s,h.showMarker&&i(l,s),!l.series[s.seriesIndex].show||!h.showTooltip||a&&a._zoom.started||e(l,l.series[s.seriesIndex],s),h.bringSeriesToFront&&l.moveSeriesToFront(s.seriesIndex)}else if(null!=s&&h.isHighlighting&&h.currentNeighbor!=s&&l.series[s.seriesIndex].showHighlight){var g=h.highlightCanvas._ctx;g.clearRect(0,0,g.canvas.width,g.canvas.height),h.isHighlighting=!0,h.currentNeighbor=s,h.showMarker&&i(l,s),!l.series[s.seriesIndex].show||!h.showTooltip||a&&a._zoom.started||e(l,l.series[s.seriesIndex],s),h.bringSeriesToFront&&l.moveSeriesToFront(s.seriesIndex)}}t.jqplot.eventListenerHooks.push(["jqplotMouseMove",o]),t.jqplot.Highlighter=function(i){this.show=t.jqplot.config.enablePlugins,this.markerRenderer=new t.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,t.extend(!0,this,i)};var r=["nw","n","ne","e","se","s","sw","w"],s={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7},l=["se","s","sw","w","nw","n","ne","e"];t.jqplot.Highlighter.init=function(i,e,o){var r=o||{};this.plugins.highlighter=new t.jqplot.Highlighter(r.highlighter)},t.jqplot.Highlighter.parseOptions=function(t,i){this.showHighlight=!0},t.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 t.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 i=document.createElement("div");this.plugins.highlighter._tooltipElem=t(i),i=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)},t.jqplot.preInitHooks.push(t.jqplot.Highlighter.init),t.jqplot.preParseSeriesOptionsHooks.push(t.jqplot.Highlighter.parseOptions),t.jqplot.postDrawHooks.push(t.jqplot.Highlighter.postPlotDraw)}(jQuery);
assets/jqplot/plugins/jqplot.pieRenderer.js ADDED
@@ -0,0 +1,946 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jqPlot
3
+ * Pure JavaScript plotting plugin using jQuery
4
+ *
5
+ * Version: 1.0.9
6
+ * Revision: d96a669
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 ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){function t(e){return Math.sin((e-(e-Math.PI)/8/Math.PI)/2)}function i(e,i,s,r,n){var a=0,h=i-e,l=Math.abs(h),o=s;return 0==r&&(o+=n),o>0&&l>.01&&l<6.282&&(a=parseFloat(o)/2/t(h)),a}function s(t,i,s){s=s||{},s.axesDefaults=s.axesDefaults||{},s.legend=s.legend||{},s.seriesDefaults=s.seriesDefaults||{};var r=!1;if(s.seriesDefaults.renderer==e.jqplot.PieRenderer)r=!0;else if(s.series)for(var n=0;n<s.series.length;n++)s.series[n].renderer==e.jqplot.PieRenderer&&(r=!0);r&&(s.axesDefaults.renderer=e.jqplot.PieAxisRenderer,s.legend.renderer=s.legend.renderer||e.jqplot.PieLegendRenderer,s.legend.preDraw=!0,s.seriesDefaults.pointLabels={show:!1})}function r(t,i,s){for(var r=0;r<this.series.length;r++)this.series[r].renderer.constructor==e.jqplot.PieRenderer&&this.series[r].highlightMouseOver&&(this.series[r].highlightMouseDown=!1)}function n(t){for(var i=0;i<this.series.length;i++)this.series[i].seriesColors=this.seriesColors,this.series[i].colorGenerator=e.jqplot.colorGenerator}function a(e,t,i){if(e.series[t].showSlice[i]){var s=e.series[t],r=e.plugins.pieRenderer.highlightCanvas;r._ctx.clearRect(0,0,r._ctx.canvas.width,r._ctx.canvas.height),s._highlightedPoint=i,e.plugins.pieRenderer.highlightedSeriesIndex=t,s.renderer.drawSlice.call(s,r._ctx,s._sliceAngles[i][0],s._sliceAngles[i][1],s.highlightColorGenerator.get(i),!1)}}function h(e){var t=e.plugins.pieRenderer.highlightCanvas;t._ctx.clearRect(0,0,t._ctx.canvas.width,t._ctx.canvas.height);for(var i=0;i<e.series.length;i++)e.series[i]._highlightedPoint=null;e.plugins.pieRenderer.highlightedSeriesIndex=null,e.target.trigger("jqplotDataUnhighlight")}function l(e,t,i,s,r){if(s){var n=[s.seriesIndex,s.pointIndex,s.data],l=jQuery.Event("jqplotDataMouseOver");if(l.pageX=e.pageX,l.pageY=e.pageY,r.target.trigger(l,n),r.series[n[0]].highlightMouseOver&&(n[0]!=r.plugins.pieRenderer.highlightedSeriesIndex||n[1]!=r.series[n[0]]._highlightedPoint)){var o=jQuery.Event("jqplotDataHighlight");o.which=e.which,o.pageX=e.pageX,o.pageY=e.pageY,r.target.trigger(o,n),a(r,n[0],n[1])}}else null==s&&h(r)}function o(e,t,i,s,r){if(s){var n=[s.seriesIndex,s.pointIndex,s.data];if(r.series[n[0]].highlightMouseDown&&(n[0]!=r.plugins.pieRenderer.highlightedSeriesIndex||n[1]!=r.series[n[0]]._highlightedPoint)){var l=jQuery.Event("jqplotDataHighlight");l.which=e.which,l.pageX=e.pageX,l.pageY=e.pageY,r.target.trigger(l,n),a(r,n[0],n[1])}}else null==s&&h(r)}function d(e,t,i,s,r){var n=r.plugins.pieRenderer.highlightedSeriesIndex;null!=n&&r.series[n].highlightMouseDown&&h(r)}function g(e,t,i,s,r){if(s){var n=[s.seriesIndex,s.pointIndex,s.data],a=jQuery.Event("jqplotDataClick");a.which=e.which,a.pageX=e.pageX,a.pageY=e.pageY,r.target.trigger(a,n)}}function p(e,t,i,s,r){if(s){var n=[s.seriesIndex,s.pointIndex,s.data],a=r.plugins.pieRenderer.highlightedSeriesIndex;null!=a&&r.series[a].highlightMouseDown&&h(r);var l=jQuery.Event("jqplotDataRightClick");l.which=e.which,l.pageX=e.pageX,l.pageY=e.pageY,r.target.trigger(l,n)}}function c(){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 e.jqplot.GenericCanvas;var t=e(this.targetId+" .jqplot-data-label");t.length?e(t[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(e){h(e.data.plot)})}e.jqplot.PieRenderer=function(){e.jqplot.LineRenderer.call(this)},e.jqplot.PieRenderer.prototype=new e.jqplot.LineRenderer,e.jqplot.PieRenderer.prototype.constructor=e.jqplot.PieRenderer,e.jqplot.PieRenderer.prototype.init=function(t,i){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=e.jqplot.PieTickRenderer,this.showSlice=[],this._drawData=!0,this._type="pie",t.highlightMouseDown&&null==t.highlightMouseOver&&(t.highlightMouseOver=!1),e.extend(!0,this,t),this.sliceMargin<0&&(this.sliceMargin=0),this._diameter=null,this._radius=null,this._sliceAngles=[],this._highlightedPoint=null,0==this.highlightColors.length)for(var s=0;s<this.seriesColors.length;s++){for(var a=e.jqplot.getColorComponents(this.seriesColors[s]),h=[a[0],a[1],a[2]],u=h[0]+h[1]+h[2],f=0;f<3;f++)h[f]=u>570?.8*h[f]:h[f]+.3*(255-h[f]),h[f]=parseInt(h[f],10);this.highlightColors.push("rgb("+h[0]+","+h[1]+","+h[2]+")")}this.highlightColorGenerator=new e.jqplot.ColorGenerator(this.highlightColors),i.postParseOptionsHooks.addOnce(n),i.postInitHooks.addOnce(r),i.eventListenerHooks.addOnce("jqplotMouseMove",l),i.eventListenerHooks.addOnce("jqplotMouseDown",o),i.eventListenerHooks.addOnce("jqplotMouseUp",d),i.eventListenerHooks.addOnce("jqplotClick",g),i.eventListenerHooks.addOnce("jqplotRightClick",p),i.postDrawHooks.addOnce(c)},e.jqplot.PieRenderer.prototype.setGridData=function(e){var t=[],i=[],s=(this.startAngle/180*Math.PI,0);this._drawData=!1;for(var r=0;r<this.data.length;r++)0!=this.data[r][1]&&(this._drawData=!0,void 0===this.showSlice[r]&&(this.showSlice[r]=!0)),t.push(this.data[r][1]),i.push([this.data[r][0]]),r>0&&(t[r]+=t[r-1]),s+=this.data[r][1];for(var n=2*Math.PI/t[t.length-1],r=0;r<t.length;r++)i[r][1]=t[r]*n,i[r][2]=this.data[r][1]/s;this.gridData=i},e.jqplot.PieRenderer.prototype.makeGridData=function(e,t){var i=[],s=[],r=0;this.startAngle/180*Math.PI;this._drawData=!1;for(var n=0;n<e.length;n++)0!=this.data[n][1]&&(this._drawData=!0),i.push(e[n][1]),s.push([e[n][0]]),n>0&&(i[n]+=i[n-1]),r+=e[n][1];for(var a=2*Math.PI/i[i.length-1],n=0;n<i.length;n++)s[n][1]=i[n]*a,s[n][2]=e[n][1]/r;return s},e.jqplot.PieRenderer.prototype.drawSlice=function(e,t,s,r,n){function a(i){s>6.282+this.startAngle&&(s=6.282+this.startAngle,t>s&&(t=6.281+this.startAngle)),t>=s||(e.beginPath(),e.fillStyle=r,e.strokeStyle=r,e.lineWidth=o,e.arc(0,0,i,t,s,!1),e.lineTo(0,0),e.closePath(),l?e.fill():e.stroke())}if(this._drawData){var h=this._radius,l=this.fill,o=this.lineWidth,d=this.sliceMargin;0==this.fill&&(d+=this.lineWidth),e.save(),e.translate(this._center[0],this._center[1]);var g=i(t,s,this.sliceMargin,this.fill,this.lineWidth),p=g*Math.cos((t+s)/2),c=g*Math.sin((t+s)/2);if(s-t<=Math.PI?h-=g:h+=g,e.translate(p,c),n){for(var u=0,f=this.shadowDepth;u<f;u++)e.save(),e.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI),this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI)),a(h);for(var u=0,f=this.shadowDepth;u<f;u++)e.restore()}else a(h);e.restore()}},e.jqplot.PieRenderer.prototype.draw=function(t,s,r,n){var a,h,l=void 0!=r?r:{},o=0,d=0,g=1,p=new e.jqplot.ColorGenerator(this.seriesColors);if(r.legendInfo&&"insideGrid"==r.legendInfo.placement){var c=r.legendInfo;switch(c.location){case"nw":o=c.width+c.xoffset;break;case"w":o=c.width+c.xoffset;break;case"sw":o=c.width+c.xoffset;break;case"ne":o=c.width+c.xoffset,g=-1;break;case"e":o=c.width+c.xoffset,g=-1;break;case"se":o=c.width+c.xoffset,g=-1;break;case"n":d=c.height+c.yoffset;break;case"s":d=c.height+c.yoffset,g=-1}}var u=(void 0!=l.shadow?l.shadow:this.shadow,void 0!=l.fill?l.fill:this.fill,parseInt(t.canvas.style.width)),f=parseInt(t.canvas.style.height),v=u-o-2*this.padding,w=f-d-2*this.padding,m=Math.min(v,w),j=m;this._sliceAngles=[];var q=this.sliceMargin;0==this.fill&&(q+=this.lineWidth);for(var b,R,_,x,M=0,P=this.startAngle/180*Math.PI,a=0,C=s.length;a<C;a++)R=0==a?P:s[a-1][1]+P,_=s[a][1]+P,this._sliceAngles.push([R,_]),b=i(R,_,this.sliceMargin,this.fill,this.lineWidth),Math.abs(_-R)>Math.PI&&(M=Math.max(b,M));if(null!=this.diameter&&this.diameter>0?this._diameter=this.diameter-2*M:this._diameter=j-2*M,this._diameter<6)return void e.jqplot.log("Diameter of pie too small, not rendering.");this._radius=this._diameter/2;if(this._center=[(u-g*o)/2+g*o+M*Math.cos(P),(f-g*d)/2+g*d+M*Math.sin(P)],this.shadow)for(var a=0,C=s.length;a<C;a++)x="rgba(0,0,0,"+this.shadowAlpha+")",this.renderer.drawSlice.call(this,t,this._sliceAngles[a][0],this._sliceAngles[a][1],x,!0);for(var a=0;a<s.length;a++)if(h=p.next(),this.showSlice[a]&&(this.renderer.drawSlice.call(this,t,this._sliceAngles[a][0],this._sliceAngles[a][1],h,!1),this.showDataLabels&&100*s[a][2]>=this.dataLabelThreshold)){var L,D,k=(this._sliceAngles[a][0]+this._sliceAngles[a][1])/2;"label"==this.dataLabels?(L=this.dataLabelFormatString||"%s",D=e.jqplot.sprintf(L,s[a][0])):"value"==this.dataLabels?(L=this.dataLabelFormatString||"%d",D=e.jqplot.sprintf(L,this.data[a][1])):"percent"==this.dataLabels?(L=this.dataLabelFormatString||"%d%%",D=e.jqplot.sprintf(L,100*s[a][2])):this.dataLabels.constructor==Array&&(L=this.dataLabelFormatString||"%s",D=e.jqplot.sprintf(L,this.dataLabels[a]));var I=this._radius*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge,y=this._center[0]+Math.cos(k)*I+this.canvas._offsets.left,A=this._center[1]+Math.sin(k)*I+this.canvas._offsets.top,S=e('<div class="jqplot-pie-series jqplot-data-label" style="position:absolute;">'+D+"</div>").insertBefore(n.eventCanvas._elem);this.dataLabelCenterOn?(y-=S.width()/2,A-=S.height()/2):(y-=S.width()*Math.sin(k/2),A-=S.height()/2),y=Math.round(y),A=Math.round(A),S.css({left:y,top:A})}},e.jqplot.PieAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)},e.jqplot.PieAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer,e.jqplot.PieAxisRenderer.prototype.constructor=e.jqplot.PieAxisRenderer,e.jqplot.PieAxisRenderer.prototype.init=function(t){this.tickRenderer=e.jqplot.PieTickRenderer,e.extend(!0,this,t),this._dataBounds={min:0,max:100},this.min=0,this.max=100,this.showTicks=!1,this.ticks=[],this.showMark=!1,this.show=!1},e.jqplot.PieLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)},e.jqplot.PieLegendRenderer.prototype=new e.jqplot.TableLegendRenderer,e.jqplot.PieLegendRenderer.prototype.constructor=e.jqplot.PieLegendRenderer,e.jqplot.PieLegendRenderer.prototype.init=function(t){this.numberRows=null,this.numberColumns=null,this.width=null,e.extend(!0,this,t)},e.jqplot.PieLegendRenderer.prototype.draw=function(){if(this.show){var t=this._series;this._elem=e(document.createElement("table")),this._elem.addClass("jqplot-table-legend");var i={position:"absolute"};this.background&&(i.background=this.background),this.border&&(i.border=this.border),this.fontSize&&(i.fontSize=this.fontSize),this.fontFamily&&(i.fontFamily=this.fontFamily),this.textColor&&(i.textColor=this.textColor),null!=this.marginTop&&(i.marginTop=this.marginTop),null!=this.marginBottom&&(i.marginBottom=this.marginBottom),null!=this.marginLeft&&(i.marginLeft=this.marginLeft),null!=this.marginRight&&(i.marginRight=this.marginRight),this._elem.css(i);var s,r,n=!1,a=!1,h=t[0],l=new e.jqplot.ColorGenerator(h.seriesColors);if(h.show){var o=h.data;this.numberRows?(s=this.numberRows,r=this.numberColumns?this.numberColumns:Math.ceil(o.length/s)):this.numberColumns?(r=this.numberColumns,s=Math.ceil(o.length/this.numberColumns)):(s=o.length,r=1);var d,g,p,c,u,f,v,w,m,j,q,b=0;for(d=0;d<s;d++)for(p=e(document.createElement("tr")),p.addClass("jqplot-table-legend"),a?p.prependTo(this._elem):p.appendTo(this._elem),g=0;g<r;g++)b<o.length&&(v="",this.labels[b]?f=this.labels[b]:"object"==typeof o[b][0]?(f=o[b][0][0].toString(),v=o[b][0][1].toString()):f=o[b][0].toString(),m=l.next(),n=a?d!=s-1:d>0,w=n?this.rowSpacing:"0",c=e(document.createElement("td")),c.addClass("jqplot-table-legend jqplot-table-legend-swatch"),c.css({textAlign:"center",paddingTop:w}),j=e(document.createElement("div")),j.addClass("jqplot-table-legend-swatch-outline"),""!==v&&j.attr("title",v),q=e(document.createElement("div")),q.addClass("jqplot-table-legend-swatch"),q.css({backgroundColor:m,borderColor:m}),c.append(j.append(q)),u=e(document.createElement("td")),u.addClass("jqplot-table-legend jqplot-table-legend-label"),u.css("paddingTop",w),this.escapeHtml?u.text(f):u.html('<a title="'+v+'">'+f+"</a>"),a?(u.prependTo(p),c.prependTo(p)):(c.appendTo(p),u.appendTo(p)),n=!0),b++}}return this._elem},e.jqplot.PieRenderer.prototype.handleMove=function(e,t,i,s,r){if(s){var n=[s.seriesIndex,s.pointIndex,s.data];r.target.trigger("jqplotDataMouseOver",n),!r.series[n[0]].highlightMouseOver||n[0]==r.plugins.pieRenderer.highlightedSeriesIndex&&n[1]==r.series[n[0]]._highlightedPoint||(r.target.trigger("jqplotDataHighlight",n),a(r,n[0],n[1]))}else null==s&&h(r)},e.jqplot.preInitHooks.push(s),e.jqplot.PieTickRenderer=function(){e.jqplot.AxisTickRenderer.call(this)},e.jqplot.PieTickRenderer.prototype=new e.jqplot.AxisTickRenderer,e.jqplot.PieTickRenderer.prototype.constructor=e.jqplot.PieTickRenderer}(jQuery);
assets/jqvmap/jquery.vmap.js ADDED
@@ -0,0 +1,1281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * JQVMap: jQuery Vector Map Library
3
+ * @author JQVMap <me@peterschmalfeldt.com>
4
+ * @version 1.5.1
5
+ * @link http://jqvmap.com
6
+ * @license https://github.com/manifestinteractive/jqvmap/blob/master/LICENSE
7
+ * @builddate 2016/05/18
8
+ */
9
+
10
+ var VectorCanvas = function (width, height, params) {
11
+ this.mode = window.SVGAngle ? 'svg' : 'vml';
12
+ this.params = params;
13
+
14
+ if (this.mode === 'svg') {
15
+ this.createSvgNode = function (nodeName) {
16
+ return document.createElementNS(this.svgns, nodeName);
17
+ };
18
+ } else {
19
+ try {
20
+ if (!document.namespaces.rvml) {
21
+ document.namespaces.add('rvml', 'urn:schemas-microsoft-com:vml');
22
+ }
23
+ this.createVmlNode = function (tagName) {
24
+ return document.createElement('<rvml:' + tagName + ' class="rvml">');
25
+ };
26
+ } catch (e) {
27
+ this.createVmlNode = function (tagName) {
28
+ return document.createElement('<' + tagName + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');
29
+ };
30
+ }
31
+
32
+ document.createStyleSheet().addRule('.rvml', 'behavior:url(#default#VML)');
33
+ }
34
+
35
+ if (this.mode === 'svg') {
36
+ this.canvas = this.createSvgNode('svg');
37
+ } else {
38
+ this.canvas = this.createVmlNode('group');
39
+ this.canvas.style.position = 'absolute';
40
+ }
41
+
42
+ this.setSize(width, height);
43
+ };
44
+
45
+ VectorCanvas.prototype = {
46
+ svgns: 'http://www.w3.org/2000/svg',
47
+ mode: 'svg',
48
+ width: 0,
49
+ height: 0,
50
+ canvas: null
51
+ };
52
+
53
+ var ColorScale = function (colors, normalizeFunction, minValue, maxValue) {
54
+ if (colors) {
55
+ this.setColors(colors);
56
+ }
57
+ if (normalizeFunction) {
58
+ this.setNormalizeFunction(normalizeFunction);
59
+ }
60
+ if (minValue) {
61
+ this.setMin(minValue);
62
+ }
63
+ if (minValue) {
64
+ this.setMax(maxValue);
65
+ }
66
+ };
67
+
68
+ ColorScale.prototype = {
69
+ colors: []
70
+ };
71
+
72
+ var JQVMap = function (params) {
73
+ params = params || {};
74
+ var map = this;
75
+ var mapData = JQVMap.maps[params.map];
76
+ var mapPins;
77
+
78
+ if( !mapData){
79
+ throw new Error('Invalid "' + params.map + '" map parameter. Please make sure you have loaded this map file in your HTML.');
80
+ }
81
+
82
+ this.selectedRegions = [];
83
+ this.multiSelectRegion = params.multiSelectRegion;
84
+
85
+ this.container = params.container;
86
+
87
+ this.defaultWidth = mapData.width;
88
+ this.defaultHeight = mapData.height;
89
+
90
+ this.color = params.color;
91
+ this.selectedColor = params.selectedColor;
92
+ this.hoverColor = params.hoverColor;
93
+ this.hoverColors = params.hoverColors;
94
+ this.hoverOpacity = params.hoverOpacity;
95
+ this.setBackgroundColor(params.backgroundColor);
96
+
97
+ this.width = params.container.width();
98
+ this.height = params.container.height();
99
+
100
+ this.resize();
101
+
102
+ jQuery(window).resize(function () {
103
+ var newWidth = params.container.width();
104
+ var newHeight = params.container.height();
105
+
106
+ if(newWidth && newHeight){
107
+ map.width = newWidth;
108
+ map.height = newHeight;
109
+ map.resize();
110
+ map.canvas.setSize(map.width, map.height);
111
+ map.applyTransform();
112
+
113
+ var resizeEvent = jQuery.Event('resize.jqvmap');
114
+ jQuery(params.container).trigger(resizeEvent, [newWidth, newHeight]);
115
+
116
+ if(mapPins){
117
+ jQuery('.jqvmap-pin').remove();
118
+ map.pinHandlers = false;
119
+ map.placePins(mapPins.pins, mapPins.mode);
120
+ }
121
+ }
122
+ });
123
+
124
+ this.canvas = new VectorCanvas(this.width, this.height, params);
125
+ params.container.append(this.canvas.canvas);
126
+
127
+ this.makeDraggable();
128
+
129
+ this.rootGroup = this.canvas.createGroup(true);
130
+
131
+ this.index = JQVMap.mapIndex;
132
+ this.label = jQuery('<div/>').addClass('jqvmap-label').appendTo(jQuery('body')).hide();
133
+
134
+ if (params.enableZoom) {
135
+ jQuery('<div/>').addClass('jqvmap-zoomin').text('+').appendTo(params.container);
136
+ jQuery('<div/>').addClass('jqvmap-zoomout').html('&#x2212;').appendTo(params.container);
137
+ }
138
+
139
+ map.countries = [];
140
+
141
+ for (var key in mapData.paths) {
142
+ var path = this.canvas.createPath({
143
+ path: mapData.paths[key].path
144
+ });
145
+
146
+ path.setFill(this.color);
147
+ path.id = map.getCountryId(key);
148
+ map.countries[key] = path;
149
+
150
+ if (this.canvas.mode === 'svg') {
151
+ path.setAttribute('class', 'jqvmap-region');
152
+ } else {
153
+ jQuery(path).addClass('jqvmap-region');
154
+ }
155
+
156
+ jQuery(this.rootGroup).append(path);
157
+ }
158
+
159
+ jQuery(params.container).delegate(this.canvas.mode === 'svg' ? 'path' : 'shape', 'mouseover mouseout', function (e) {
160
+ var containerPath = e.target,
161
+ code = e.target.id.split('_').pop(),
162
+ labelShowEvent = jQuery.Event('labelShow.jqvmap'),
163
+ regionMouseOverEvent = jQuery.Event('regionMouseOver.jqvmap');
164
+
165
+ code = code.toLowerCase();
166
+
167
+ if (e.type === 'mouseover') {
168
+ jQuery(params.container).trigger(regionMouseOverEvent, [code, mapData.paths[code].name]);
169
+ if (!regionMouseOverEvent.isDefaultPrevented()) {
170
+ map.highlight(code, containerPath);
171
+ }
172
+ if (params.showTooltip) {
173
+ map.label.text(mapData.paths[code].name);
174
+ jQuery(params.container).trigger(labelShowEvent, [map.label, code]);
175
+
176
+ if (!labelShowEvent.isDefaultPrevented()) {
177
+ map.label.show();
178
+ map.labelWidth = map.label.width();
179
+ map.labelHeight = map.label.height();
180
+ }
181
+ }
182
+ } else {
183
+ map.unhighlight(code, containerPath);
184
+
185
+ map.label.hide();
186
+ jQuery(params.container).trigger('regionMouseOut.jqvmap', [code, mapData.paths[code].name]);
187
+ }
188
+ });
189
+
190
+ jQuery(params.container).delegate(this.canvas.mode === 'svg' ? 'path' : 'shape', 'click', function (regionClickEvent) {
191
+
192
+ var targetPath = regionClickEvent.target;
193
+ var code = regionClickEvent.target.id.split('_').pop();
194
+ var mapClickEvent = jQuery.Event('regionClick.jqvmap');
195
+
196
+ code = code.toLowerCase();
197
+
198
+ jQuery(params.container).trigger(mapClickEvent, [code, mapData.paths[code].name]);
199
+
200
+ if ( !params.multiSelectRegion && !mapClickEvent.isDefaultPrevented()) {
201
+ for (var keyPath in mapData.paths) {
202
+ map.countries[keyPath].currentFillColor = map.countries[keyPath].getOriginalFill();
203
+ map.countries[keyPath].setFill(map.countries[keyPath].getOriginalFill());
204
+ }
205
+ }
206
+
207
+ if ( !mapClickEvent.isDefaultPrevented()) {
208
+ if (map.isSelected(code)) {
209
+ map.deselect(code, targetPath);
210
+ } else {
211
+ map.select(code, targetPath);
212
+ }
213
+ }
214
+ });
215
+
216
+ if (params.showTooltip) {
217
+ params.container.mousemove(function (e) {
218
+ if (map.label.is(':visible')) {
219
+ var left = e.pageX - 15 - map.labelWidth;
220
+ var top = e.pageY - 15 - map.labelHeight;
221
+
222
+ if(left < 0) {
223
+ left = e.pageX + 15;
224
+ }
225
+ if(top < 0) {
226
+ top = e.pageY + 15;
227
+ }
228
+
229
+ map.label.css({
230
+ left: left,
231
+ top: top
232
+ });
233
+ }
234
+ });
235
+ }
236
+
237
+ this.setColors(params.colors);
238
+
239
+ this.canvas.canvas.appendChild(this.rootGroup);
240
+
241
+ this.applyTransform();
242
+
243
+ this.colorScale = new ColorScale(params.scaleColors, params.normalizeFunction, params.valueMin, params.valueMax);
244
+
245
+ if (params.values) {
246
+ this.values = params.values;
247
+ this.setValues(params.values);
248
+ }
249
+
250
+ if (params.selectedRegions) {
251
+ if (params.selectedRegions instanceof Array) {
252
+ for(var k in params.selectedRegions) {
253
+ this.select(params.selectedRegions[k].toLowerCase());
254
+ }
255
+ } else {
256
+ this.select(params.selectedRegions.toLowerCase());
257
+ }
258
+ }
259
+
260
+ this.bindZoomButtons();
261
+
262
+ if(params.pins) {
263
+ mapPins = {
264
+ pins: params.pins,
265
+ mode: params.pinMode
266
+ };
267
+
268
+ this.pinHandlers = false;
269
+ this.placePins(params.pins, params.pinMode);
270
+ }
271
+
272
+ if(params.showLabels){
273
+ this.pinHandlers = false;
274
+
275
+ var pins = {};
276
+ for (key in map.countries){
277
+ if (typeof map.countries[key] !== 'function') {
278
+ if( !params.pins || !params.pins[key] ){
279
+ pins[key] = key.toUpperCase();
280
+ }
281
+ }
282
+ }
283
+
284
+ mapPins = {
285
+ pins: pins,
286
+ mode: 'content'
287
+ };
288
+
289
+ this.placePins(pins, 'content');
290
+ }
291
+
292
+ JQVMap.mapIndex++;
293
+ };
294
+
295
+ JQVMap.prototype = {
296
+ transX: 0,
297
+ transY: 0,
298
+ scale: 1,
299
+ baseTransX: 0,
300
+ baseTransY: 0,
301
+ baseScale: 1,
302
+ width: 0,
303
+ height: 0,
304
+ countries: {},
305
+ countriesColors: {},
306
+ countriesData: {},
307
+ zoomStep: 1.4,
308
+ zoomMaxStep: 4,
309
+ zoomCurStep: 1
310
+ };
311
+
312
+ JQVMap.xlink = 'http://www.w3.org/1999/xlink';
313
+ JQVMap.mapIndex = 1;
314
+ JQVMap.maps = {};
315
+
316
+ (function(){
317
+
318
+ var apiParams = {
319
+ colors: 1,
320
+ values: 1,
321
+ backgroundColor: 1,
322
+ scaleColors: 1,
323
+ normalizeFunction: 1,
324
+ enableZoom: 1,
325
+ showTooltip: 1,
326
+ borderColor: 1,
327
+ borderWidth: 1,
328
+ borderOpacity: 1,
329
+ selectedRegions: 1,
330
+ multiSelectRegion: 1
331
+ };
332
+
333
+ var apiEvents = {
334
+ onLabelShow: 'labelShow',
335
+ onLoad: 'load',
336
+ onRegionOver: 'regionMouseOver',
337
+ onRegionOut: 'regionMouseOut',
338
+ onRegionClick: 'regionClick',
339
+ onRegionSelect: 'regionSelect',
340
+ onRegionDeselect: 'regionDeselect',
341
+ onResize: 'resize'
342
+ };
343
+
344
+ jQuery.fn.vectorMap = function (options) {
345
+
346
+ var defaultParams = {
347
+ map: 'world_en',
348
+ backgroundColor: '#a5bfdd',
349
+ color: '#f4f3f0',
350
+ hoverColor: '#c9dfaf',
351
+ hoverColors: {},
352
+ selectedColor: '#c9dfaf',
353
+ scaleColors: ['#b6d6ff', '#005ace'],
354
+ normalizeFunction: 'linear',
355
+ enableZoom: true,
356
+ showTooltip: true,
357
+ borderColor: '#818181',
358
+ borderWidth: 1,
359
+ borderOpacity: 0.25,
360
+ selectedRegions: null,
361
+ multiSelectRegion: false
362
+ }, map = this.data('mapObject');
363
+
364
+ if (options === 'addMap') {
365
+ JQVMap.maps[arguments[1]] = arguments[2];
366
+ } else if (options === 'set' && apiParams[arguments[1]]) {
367
+ map['set' + arguments[1].charAt(0).toUpperCase() + arguments[1].substr(1)].apply(map, Array.prototype.slice.call(arguments, 2));
368
+ } else if (typeof options === 'string' &&
369
+ typeof map[options] === 'function') {
370
+ return map[options].apply(map, Array.prototype.slice.call(arguments, 1));
371
+ } else {
372
+ jQuery.extend(defaultParams, options);
373
+ defaultParams.container = this;
374
+ this.css({ position: 'relative', overflow: 'hidden' });
375
+
376
+ map = new JQVMap(defaultParams);
377
+
378
+ this.data('mapObject', map);
379
+
380
+ this.unbind('.jqvmap');
381
+
382
+ for (var e in apiEvents) {
383
+ if (defaultParams[e]) {
384
+ this.bind(apiEvents[e] + '.jqvmap', defaultParams[e]);
385
+ }
386
+ }
387
+
388
+ var loadEvent = jQuery.Event('load.jqvmap');
389
+ jQuery(defaultParams.container).trigger(loadEvent, map);
390
+
391
+ return map;
392
+ }
393
+ };
394
+
395
+ })(jQuery);
396
+
397
+ ColorScale.arrayToRgb = function (ar) {
398
+ var rgb = '#';
399
+ var d;
400
+ for (var i = 0; i < ar.length; i++) {
401
+ d = ar[i].toString(16);
402
+ rgb += d.length === 1 ? '0' + d : d;
403
+ }
404
+ return rgb;
405
+ };
406
+
407
+ ColorScale.prototype.getColor = function (value) {
408
+ if (typeof this.normalize === 'function') {
409
+ value = this.normalize(value);
410
+ }
411
+
412
+ var lengthes = [];
413
+ var fullLength = 0;
414
+ var l;
415
+
416
+ for (var i = 0; i < this.colors.length - 1; i++) {
417
+ l = this.vectorLength(this.vectorSubtract(this.colors[i + 1], this.colors[i]));
418
+ lengthes.push(l);
419
+ fullLength += l;
420
+ }
421
+
422
+ var c = (this.maxValue - this.minValue) / fullLength;
423
+
424
+ for (i = 0; i < lengthes.length; i++) {
425
+ lengthes[i] *= c;
426
+ }
427
+
428
+ i = 0;
429
+ value -= this.minValue;
430
+
431
+ while (value - lengthes[i] >= 0) {
432
+ value -= lengthes[i];
433
+ i++;
434
+ }
435
+
436
+ var color;
437
+ if (i === this.colors.length - 1) {
438
+ color = this.vectorToNum(this.colors[i]).toString(16);
439
+ } else {
440
+ color = (this.vectorToNum(this.vectorAdd(this.colors[i], this.vectorMult(this.vectorSubtract(this.colors[i + 1], this.colors[i]), (value) / (lengthes[i]))))).toString(16);
441
+ }
442
+
443
+ while (color.length < 6) {
444
+ color = '0' + color;
445
+ }
446
+ return '#' + color;
447
+ };
448
+
449
+ ColorScale.rgbToArray = function (rgb) {
450
+ rgb = rgb.substr(1);
451
+ return [parseInt(rgb.substr(0, 2), 16), parseInt(rgb.substr(2, 2), 16), parseInt(rgb.substr(4, 2), 16)];
452
+ };
453
+
454
+ ColorScale.prototype.setColors = function (colors) {
455
+ for (var i = 0; i < colors.length; i++) {
456
+ colors[i] = ColorScale.rgbToArray(colors[i]);
457
+ }
458
+ this.colors = colors;
459
+ };
460
+
461
+ ColorScale.prototype.setMax = function (max) {
462
+ this.clearMaxValue = max;
463
+ if (typeof this.normalize === 'function') {
464
+ this.maxValue = this.normalize(max);
465
+ } else {
466
+ this.maxValue = max;
467
+ }
468
+ };
469
+
470
+ ColorScale.prototype.setMin = function (min) {
471
+ this.clearMinValue = min;
472
+
473
+ if (typeof this.normalize === 'function') {
474
+ this.minValue = this.normalize(min);
475
+ } else {
476
+ this.minValue = min;
477
+ }
478
+ };
479
+
480
+ ColorScale.prototype.setNormalizeFunction = function (f) {
481
+ if (f === 'polynomial') {
482
+ this.normalize = function (value) {
483
+ return Math.pow(value, 0.2);
484
+ };
485
+ } else if (f === 'linear') {
486
+ delete this.normalize;
487
+ } else {
488
+ this.normalize = f;
489
+ }
490
+ this.setMin(this.clearMinValue);
491
+ this.setMax(this.clearMaxValue);
492
+ };
493
+
494
+ ColorScale.prototype.vectorAdd = function (vector1, vector2) {
495
+ var vector = [];
496
+ for (var i = 0; i < vector1.length; i++) {
497
+ vector[i] = vector1[i] + vector2[i];
498
+ }
499
+ return vector;
500
+ };
501
+
502
+ ColorScale.prototype.vectorLength = function (vector) {
503
+ var result = 0;
504
+ for (var i = 0; i < vector.length; i++) {
505
+ result += vector[i] * vector[i];
506
+ }
507
+ return Math.sqrt(result);
508
+ };
509
+
510
+ ColorScale.prototype.vectorMult = function (vector, num) {
511
+ var result = [];
512
+ for (var i = 0; i < vector.length; i++) {
513
+ result[i] = vector[i] * num;
514
+ }
515
+ return result;
516
+ };
517
+
518
+ ColorScale.prototype.vectorSubtract = function (vector1, vector2) {
519
+ var vector = [];
520
+ for (var i = 0; i < vector1.length; i++) {
521
+ vector[i] = vector1[i] - vector2[i];
522
+ }
523
+ return vector;
524
+ };
525
+
526
+ ColorScale.prototype.vectorToNum = function (vector) {
527
+ var num = 0;
528
+ for (var i = 0; i < vector.length; i++) {
529
+ num += Math.round(vector[i]) * Math.pow(256, vector.length - i - 1);
530
+ }
531
+ return num;
532
+ };
533
+
534
+ JQVMap.prototype.applyTransform = function () {
535
+ var maxTransX, maxTransY, minTransX, minTransY;
536
+ if (this.defaultWidth * this.scale <= this.width) {
537
+ maxTransX = (this.width - this.defaultWidth * this.scale) / (2 * this.scale);
538
+ minTransX = (this.width - this.defaultWidth * this.scale) / (2 * this.scale);
539
+ } else {
540
+ maxTransX = 0;
541
+ minTransX = (this.width - this.defaultWidth * this.scale) / this.scale;
542
+ }
543
+
544
+ if (this.defaultHeight * this.scale <= this.height) {
545
+ maxTransY = (this.height - this.defaultHeight * this.scale) / (2 * this.scale);
546
+ minTransY = (this.height - this.defaultHeight * this.scale) / (2 * this.scale);
547
+ } else {
548
+ maxTransY = 0;
549
+ minTransY = (this.height - this.defaultHeight * this.scale) / this.scale;
550
+ }
551
+
552
+ if (this.transY > maxTransY) {
553
+ this.transY = maxTransY;
554
+ } else if (this.transY < minTransY) {
555
+ this.transY = minTransY;
556
+ }
557
+ if (this.transX > maxTransX) {
558
+ this.transX = maxTransX;
559
+ } else if (this.transX < minTransX) {
560
+ this.transX = minTransX;
561
+ }
562
+
563
+ this.canvas.applyTransformParams(this.scale, this.transX, this.transY);
564
+ };
565
+
566
+ JQVMap.prototype.bindZoomButtons = function () {
567
+ var map = this;
568
+ this.container.find('.jqvmap-zoomin').click(function(){
569
+ map.zoomIn();
570
+ });
571
+ this.container.find('.jqvmap-zoomout').click(function(){
572
+ map.zoomOut();
573
+ });
574
+ };
575
+
576
+ JQVMap.prototype.deselect = function (cc, path) {
577
+ cc = cc.toLowerCase();
578
+ path = path || jQuery('#' + this.getCountryId(cc))[0];
579
+
580
+ if (this.isSelected(cc)) {
581
+ this.selectedRegions.splice(this.selectIndex(cc), 1);
582
+
583
+ jQuery(this.container).trigger('regionDeselect.jqvmap', [cc]);
584
+ path.currentFillColor = path.getOriginalFill();
585
+ path.setFill(path.getOriginalFill());
586
+ } else {
587
+ for (var key in this.countries) {
588
+ this.selectedRegions.splice(this.selectedRegions.indexOf(key), 1);
589
+ this.countries[key].currentFillColor = this.color;
590
+ this.countries[key].setFill(this.color);
591
+ }
592
+ }
593
+ };
594
+
595
+ JQVMap.prototype.getCountryId = function (cc) {
596
+ return 'jqvmap' + this.index + '_' + cc;
597
+ };
598
+
599
+ JQVMap.prototype.getPin = function(cc){
600
+ var pinObj = jQuery('#' + this.getPinId(cc));
601
+ return pinObj.html();
602
+ };
603
+
604
+ JQVMap.prototype.getPinId = function (cc) {
605
+ return this.getCountryId(cc) + '_pin';
606
+ };
607
+
608
+ JQVMap.prototype.getPins = function(){
609
+ var pins = this.container.find('.jqvmap-pin');
610
+ var ret = {};
611
+ jQuery.each(pins, function(index, pinObj){
612
+ pinObj = jQuery(pinObj);
613
+ var cc = pinObj.attr('for').toLowerCase();
614
+ var pinContent = pinObj.html();
615
+ ret[cc] = pinContent;
616
+ });
617
+ return JSON.stringify(ret);
618
+ };
619
+
620
+ JQVMap.prototype.highlight = function (cc, path) {
621
+ path = path || jQuery('#' + this.getCountryId(cc))[0];
622
+ if (this.hoverOpacity) {
623
+ path.setOpacity(this.hoverOpacity);
624
+ } else if (this.hoverColors && (cc in this.hoverColors)) {
625
+ path.currentFillColor = path.getFill() + '';
626
+ path.setFill(this.hoverColors[cc]);
627
+ } else if (this.hoverColor) {
628
+ path.currentFillColor = path.getFill() + '';
629
+ path.setFill(this.hoverColor);
630
+ }
631
+ };
632
+
633
+ JQVMap.prototype.isSelected = function(cc) {
634
+ return this.selectIndex(cc) >= 0;
635
+ };
636
+
637
+ JQVMap.prototype.makeDraggable = function () {
638
+ var mouseDown = false;
639
+ var oldPageX, oldPageY;
640
+ var self = this;
641
+
642
+ self.isMoving = false;
643
+ self.isMovingTimeout = false;
644
+
645
+ var lastTouchCount;
646
+ var touchCenterX;
647
+ var touchCenterY;
648
+ var touchStartDistance;
649
+ var touchStartScale;
650
+ var touchX;
651
+ var touchY;
652
+
653
+ this.container.mousemove(function (e) {
654
+
655
+ if (mouseDown) {
656
+ self.transX -= (oldPageX - e.pageX) / self.scale;
657
+ self.transY -= (oldPageY - e.pageY) / self.scale;
658
+
659
+ self.applyTransform();
660
+
661
+ oldPageX = e.pageX;
662
+ oldPageY = e.pageY;
663
+
664
+ self.isMoving = true;
665
+ if (self.isMovingTimeout) {
666
+ clearTimeout(self.isMovingTimeout);
667
+ }
668
+
669
+ self.container.trigger('drag');
670
+ }
671
+
672
+ return false;
673
+
674
+ }).mousedown(function (e) {
675
+
676
+ mouseDown = true;
677
+ oldPageX = e.pageX;
678
+ oldPageY = e.pageY;
679
+
680
+ return false;
681
+
682
+ }).mouseup(function () {
683
+
684
+ mouseDown = false;
685
+
686
+ clearTimeout(self.isMovingTimeout);
687
+ self.isMovingTimeout = setTimeout(function () {
688
+ self.isMoving = false;
689
+ }, 100);
690
+
691
+ return false;
692
+
693
+ }).mouseout(function () {
694
+
695
+ if(mouseDown && self.isMoving){
696
+
697
+ clearTimeout(self.isMovingTimeout);
698
+ self.isMovingTimeout = setTimeout(function () {
699
+ mouseDown = false;
700
+ self.isMoving = false;
701
+ }, 100);
702
+
703
+ return false;
704
+ }
705
+ });
706
+
707
+ jQuery(this.container).bind('touchmove', function (e) {
708
+
709
+ var offset;
710
+ var scale;
711
+ var touches = e.originalEvent.touches;
712
+ var transformXOld;
713
+ var transformYOld;
714
+
715
+ if (touches.length === 1) {
716
+ if (lastTouchCount === 1) {
717
+
718
+ if(touchX === touches[0].pageX && touchY === touches[0].pageY){
719
+ return;
720
+ }
721
+
722
+ transformXOld = self.transX;
723
+ transformYOld = self.transY;
724
+
725
+ self.transX -= (touchX - touches[0].pageX) / self.scale;
726
+ self.transY -= (touchY - touches[0].pageY) / self.scale;
727
+
728
+ self.applyTransform();
729
+
730
+ if (transformXOld !== self.transX || transformYOld !== self.transY) {
731
+ e.preventDefault();
732
+ }
733
+
734
+ self.isMoving = true;
735
+ if (self.isMovingTimeout) {
736
+ clearTimeout(self.isMovingTimeout);
737
+ }
738
+ }
739
+
740
+ touchX = touches[0].pageX;
741
+ touchY = touches[0].pageY;
742
+
743
+ } else if (touches.length === 2) {
744
+
745
+ if (lastTouchCount === 2) {
746
+ scale = Math.sqrt(
747
+ Math.pow(touches[0].pageX - touches[1].pageX, 2) +
748
+ Math.pow(touches[0].pageY - touches[1].pageY, 2)
749
+ ) / touchStartDistance;
750
+
751
+ self.setScale(
752
+ touchStartScale * scale,
753
+ touchCenterX,
754
+ touchCenterY
755
+ );
756
+
757
+ e.preventDefault();
758
+
759
+ } else {
760
+
761
+ offset = jQuery(self.container).offset();
762
+ if (touches[0].pageX > touches[1].pageX) {
763
+ touchCenterX = touches[1].pageX + (touches[0].pageX - touches[1].pageX) / 2;
764
+ } else {
765
+ touchCenterX = touches[0].pageX + (touches[1].pageX - touches[0].pageX) / 2;
766
+ }
767
+
768
+ if (touches[0].pageY > touches[1].pageY) {
769
+ touchCenterY = touches[1].pageY + (touches[0].pageY - touches[1].pageY) / 2;
770
+ } else {
771
+ touchCenterY = touches[0].pageY + (touches[1].pageY - touches[0].pageY) / 2;
772
+ }
773
+
774
+ touchCenterX -= offset.left;
775
+ touchCenterY -= offset.top;
776
+ touchStartScale = self.scale;
777
+
778
+ touchStartDistance = Math.sqrt(
779
+ Math.pow(touches[0].pageX - touches[1].pageX, 2) +
780
+ Math.pow(touches[0].pageY - touches[1].pageY, 2)
781
+ );
782
+ }
783
+ }
784
+
785
+ lastTouchCount = touches.length;
786
+ });
787
+
788
+ jQuery(this.container).bind('touchstart', function () {
789
+ lastTouchCount = 0;
790
+ });
791
+
792
+ jQuery(this.container).bind('touchend', function () {
793
+ lastTouchCount = 0;
794
+ });
795
+ };
796
+
797
+ JQVMap.prototype.placePins = function(pins, pinMode){
798
+ var map = this;
799
+
800
+ if(!pinMode || (pinMode !== 'content' && pinMode !== 'id')) {
801
+ pinMode = 'content';
802
+ }
803
+
804
+ if(pinMode === 'content') {//treat pin as content
805
+ jQuery.each(pins, function(index, pin){
806
+ if(jQuery('#' + map.getCountryId(index)).length === 0){
807
+ return;
808
+ }
809
+
810
+ var pinIndex = map.getPinId(index);
811
+ var $pin = jQuery('#' + pinIndex);
812
+ if($pin.length > 0){
813
+ $pin.remove();
814
+ }
815
+ map.container.append('<div id="' + pinIndex + '" for="' + index + '" class="jqvmap-pin" style="position:absolute">' + pin + '</div>');
816
+ });
817
+ } else { //treat pin as id of an html content
818
+ jQuery.each(pins, function(index, pin){
819
+ if(jQuery('#' + map.getCountryId(index)).length === 0){
820
+ return;
821
+ }
822
+ var pinIndex = map.getPinId(index);
823
+ var $pin = jQuery('#' + pinIndex);
824
+ if($pin.length > 0){
825
+ $pin.remove();
826
+ }
827
+ map.container.append('<div id="' + pinIndex + '" for="' + index + '" class="jqvmap-pin" style="position:absolute"></div>');
828
+ $pin.append(jQuery('#' + pin));
829
+ });
830
+ }
831
+
832
+ this.positionPins();
833
+ if(!this.pinHandlers){
834
+ this.pinHandlers = true;
835
+ var positionFix = function(){
836
+ map.positionPins();
837
+ };
838
+ this.container.bind('zoomIn', positionFix)
839
+ .bind('zoomOut', positionFix)
840
+ .bind('drag', positionFix);
841
+ }
842
+ };
843
+
844
+ JQVMap.prototype.positionPins = function(){
845
+ var map = this;
846
+ var pins = this.container.find('.jqvmap-pin');
847
+ jQuery.each(pins, function(index, pinObj){
848
+ pinObj = jQuery(pinObj);
849
+ var countryId = map.getCountryId(pinObj.attr('for').toLowerCase());
850
+ var countryObj = jQuery('#' + countryId);
851
+
852
+ var bbox = document.getElementById(countryId).getBBox();
853
+ var position = countryObj.position();
854
+
855
+ var scale = map.scale;
856
+
857
+ var left = position.left + (bbox.width / 2) * scale - pinObj.width() / 2,
858
+ top = position.top + (bbox.height / 2) * scale - pinObj.height() / 2;
859
+
860
+ pinObj.css('left', left).css('top', top);
861
+ });
862
+ };
863
+
864
+ JQVMap.prototype.removePin = function(cc) {
865
+ cc = cc.toLowerCase();
866
+ jQuery('#' + this.getPinId(cc)).remove();
867
+ };
868
+
869
+ JQVMap.prototype.removePins = function(){
870
+ this.container.find('.jqvmap-pin').remove();
871
+ };
872
+
873
+ JQVMap.prototype.reset = function () {
874
+ for (var key in this.countries) {
875
+ this.countries[key].setFill(this.color);
876
+ }
877
+ this.scale = this.baseScale;
878
+ this.transX = this.baseTransX;
879
+ this.transY = this.baseTransY;
880
+ this.applyTransform();
881
+ };
882
+
883
+ JQVMap.prototype.resize = function () {
884
+ var curBaseScale = this.baseScale;
885
+ if (this.width / this.height > this.defaultWidth / this.defaultHeight) {
886
+ this.baseScale = this.height / this.defaultHeight;
887
+ this.baseTransX = Math.abs(this.width - this.defaultWidth * this.baseScale) / (2 * this.baseScale);
888
+ } else {
889
+ this.baseScale = this.width / this.defaultWidth;
890
+ this.baseTransY = Math.abs(this.height - this.defaultHeight * this.baseScale) / (2 * this.baseScale);
891
+ }
892
+ this.scale *= this.baseScale / curBaseScale;
893
+ this.transX *= this.baseScale / curBaseScale;
894
+ this.transY *= this.baseScale / curBaseScale;
895
+ };
896
+
897
+ JQVMap.prototype.select = function (cc, path) {
898
+ cc = cc.toLowerCase();
899
+ path = path || jQuery('#' + this.getCountryId(cc))[0];
900
+
901
+ if (!this.isSelected(cc)) {
902
+ if (this.multiSelectRegion) {
903
+ this.selectedRegions.push(cc);
904
+ } else {
905
+ this.selectedRegions = [cc];
906
+ }
907
+
908
+ jQuery(this.container).trigger('regionSelect.jqvmap', [cc]);
909
+ if (this.selectedColor && path) {
910
+ path.currentFillColor = this.selectedColor;
911
+ path.setFill(this.selectedColor);
912
+ }
913
+ }
914
+ };
915
+
916
+ JQVMap.prototype.selectIndex = function (cc) {
917
+ cc = cc.toLowerCase();
918
+ for (var i = 0; i < this.selectedRegions.length; i++) {
919
+ if (cc === this.selectedRegions[i]) {
920
+ return i;
921
+ }
922
+ }
923
+ return -1;
924
+ };
925
+
926
+ JQVMap.prototype.setBackgroundColor = function (backgroundColor) {
927
+ this.container.css('background-color', backgroundColor);
928
+ };
929
+
930
+ JQVMap.prototype.setColors = function (key, color) {
931
+ if (typeof key === 'string') {
932
+ this.countries[key].setFill(color);
933
+ this.countries[key].setAttribute('original', color);
934
+ } else {
935
+ var colors = key;
936
+
937
+ for (var code in colors) {
938
+ if (this.countries[code]) {
939
+ this.countries[code].setFill(colors[code]);
940
+ this.countries[code].setAttribute('original', colors[code]);
941
+ }
942
+ }
943
+ }
944
+ };
945
+
946
+ JQVMap.prototype.setNormalizeFunction = function (f) {
947
+ this.colorScale.setNormalizeFunction(f);
948
+
949
+ if (this.values) {
950
+ this.setValues(this.values);
951
+ }
952
+ };
953
+
954
+ JQVMap.prototype.setScale = function (scale) {
955
+ this.scale = scale;
956
+ this.applyTransform();
957
+ };
958
+
959
+ JQVMap.prototype.setScaleColors = function (colors) {
960
+ this.colorScale.setColors(colors);
961
+
962
+ if (this.values) {
963
+ this.setValues(this.values);
964
+ }
965
+ };
966
+
967
+ JQVMap.prototype.setValues = function (values) {
968
+ var max = 0,
969
+ min = Number.MAX_VALUE,
970
+ val;
971
+
972
+ for (var cc in values) {
973
+ cc = cc.toLowerCase();
974
+ val = parseFloat(values[cc]);
975
+
976
+ if (isNaN(val)) {
977
+ continue;
978
+ }
979
+ if (val > max) {
980
+ max = values[cc];
981
+ }
982
+ if (val < min) {
983
+ min = val;
984
+ }
985
+ }
986
+
987
+ if (min === max) {
988
+ max++;
989
+ }
990
+
991
+ this.colorScale.setMin(min);
992
+ this.colorScale.setMax(max);
993
+
994
+ var colors = {};
995
+ for (cc in values) {
996
+ cc = cc.toLowerCase();
997
+ val = parseFloat(values[cc]);
998
+ colors[cc] = isNaN(val) ? this.color : this.colorScale.getColor(val);
999
+ }
1000
+ this.setColors(colors);
1001
+ this.values = values;
1002
+ };
1003
+
1004
+ JQVMap.prototype.unhighlight = function (cc, path) {
1005
+ cc = cc.toLowerCase();
1006
+ path = path || jQuery('#' + this.getCountryId(cc))[0];
1007
+ path.setOpacity(1);
1008
+ if (path.currentFillColor) {
1009
+ path.setFill(path.currentFillColor);
1010
+ }
1011
+ };
1012
+
1013
+ JQVMap.prototype.zoomIn = function () {
1014
+ var map = this;
1015
+ var sliderDelta = (jQuery('#zoom').innerHeight() - 6 * 2 - 15 * 2 - 3 * 2 - 7 - 6) / (this.zoomMaxStep - this.zoomCurStep);
1016
+
1017
+ if (map.zoomCurStep < map.zoomMaxStep) {
1018
+ map.transX -= (map.width / map.scale - map.width / (map.scale * map.zoomStep)) / 2;
1019
+ map.transY -= (map.height / map.scale - map.height / (map.scale * map.zoomStep)) / 2;
1020
+ map.setScale(map.scale * map.zoomStep);
1021
+ map.zoomCurStep++;
1022
+
1023
+ var $slider = jQuery('#zoomSlider');
1024
+
1025
+ $slider.css('top', parseInt($slider.css('top'), 10) - sliderDelta);
1026
+
1027
+ map.container.trigger('zoomIn');
1028
+ }
1029
+ };
1030
+
1031
+ JQVMap.prototype.zoomOut = function () {
1032
+ var map = this;
1033
+ var sliderDelta = (jQuery('#zoom').innerHeight() - 6 * 2 - 15 * 2 - 3 * 2 - 7 - 6) / (this.zoomMaxStep - this.zoomCurStep);
1034
+
1035
+ if (map.zoomCurStep > 1) {
1036
+ map.transX += (map.width / (map.scale / map.zoomStep) - map.width / map.scale) / 2;
1037
+ map.transY += (map.height / (map.scale / map.zoomStep) - map.height / map.scale) / 2;
1038
+ map.setScale(map.scale / map.zoomStep);
1039
+ map.zoomCurStep--;
1040
+
1041
+ var $slider = jQuery('#zoomSlider');
1042
+
1043
+ $slider.css('top', parseInt($slider.css('top'), 10) + sliderDelta);
1044
+
1045
+ map.container.trigger('zoomOut');
1046
+ }
1047
+ };
1048
+
1049
+ VectorCanvas.prototype.applyTransformParams = function (scale, transX, transY) {
1050
+ if (this.mode === 'svg') {
1051
+ this.rootGroup.setAttribute('transform', 'scale(' + scale + ') translate(' + transX + ', ' + transY + ')');
1052
+ } else {
1053
+ this.rootGroup.coordorigin = (this.width - transX) + ',' + (this.height - transY);
1054
+ this.rootGroup.coordsize = this.width / scale + ',' + this.height / scale;
1055
+ }
1056
+ };
1057
+
1058
+ VectorCanvas.prototype.createGroup = function (isRoot) {
1059
+ var node;
1060
+ if (this.mode === 'svg') {
1061
+ node = this.createSvgNode('g');
1062
+ } else {
1063
+ node = this.createVmlNode('group');
1064
+ node.style.width = this.width + 'px';
1065
+ node.style.height = this.height + 'px';
1066
+ node.style.left = '0px';
1067
+ node.style.top = '0px';
1068
+ node.coordorigin = '0 0';
1069
+ node.coordsize = this.width + ' ' + this.height;
1070
+ }
1071
+
1072
+ if (isRoot) {
1073
+ this.rootGroup = node;
1074
+ }
1075
+ return node;
1076
+ };
1077
+
1078
+ VectorCanvas.prototype.createPath = function (config) {
1079
+ var node;
1080
+ if (this.mode === 'svg') {
1081
+ node = this.createSvgNode('path');
1082
+ node.setAttribute('d', config.path);
1083
+
1084
+ if (this.params.borderColor !== null) {
1085
+ node.setAttribute('stroke', this.params.borderColor);
1086
+ }
1087
+ if (this.params.borderWidth > 0) {
1088
+ node.setAttribute('stroke-width', this.params.borderWidth);
1089
+ node.setAttribute('stroke-linecap', 'round');
1090
+ node.setAttribute('stroke-linejoin', 'round');
1091
+ }
1092
+ if (this.params.borderOpacity > 0) {
1093
+ node.setAttribute('stroke-opacity', this.params.borderOpacity);
1094
+ }
1095
+
1096
+ node.setFill = function (color) {
1097
+ this.setAttribute('fill', color);
1098
+ if (this.getAttribute('original') === null) {
1099
+ this.setAttribute('original', color);
1100
+ }
1101
+ };
1102
+
1103
+ node.getFill = function () {
1104
+ return this.getAttribute('fill');
1105
+ };
1106
+
1107
+ node.getOriginalFill = function () {
1108
+ return this.getAttribute('original');
1109
+ };
1110
+
1111
+ node.setOpacity = function (opacity) {
1112
+ this.setAttribute('fill-opacity', opacity);
1113
+ };
1114
+ } else {
1115
+ node = this.createVmlNode('shape');
1116
+ node.coordorigin = '0 0';
1117
+ node.coordsize = this.width + ' ' + this.height;
1118
+ node.style.width = this.width + 'px';
1119
+ node.style.height = this.height + 'px';
1120
+ node.fillcolor = JQVMap.defaultFillColor;
1121
+ node.stroked = false;
1122
+ node.path = VectorCanvas.pathSvgToVml(config.path);
1123
+
1124
+ var scale = this.createVmlNode('skew');
1125
+ scale.on = true;
1126
+ scale.matrix = '0.01,0,0,0.01,0,0';
1127
+ scale.offset = '0,0';
1128
+
1129
+ node.appendChild(scale);
1130
+
1131
+ var fill = this.createVmlNode('fill');
1132
+ node.appendChild(fill);
1133
+
1134
+ node.setFill = function (color) {
1135
+ this.getElementsByTagName('fill')[0].color = color;
1136
+ if (this.getAttribute('original') === null) {
1137
+ this.setAttribute('original', color);
1138
+ }
1139
+ };
1140
+
1141
+ node.getFill = function () {
1142
+ return this.getElementsByTagName('fill')[0].color;
1143
+ };
1144
+ node.getOriginalFill = function () {
1145
+ return this.getAttribute('original');
1146
+ };
1147
+ node.setOpacity = function (opacity) {
1148
+ this.getElementsByTagName('fill')[0].opacity = parseInt(opacity * 100, 10) + '%';
1149
+ };
1150
+ }
1151
+ return node;
1152
+ };
1153
+
1154
+ VectorCanvas.prototype.pathSvgToVml = function (path) {
1155
+ var result = '';
1156
+ var cx = 0, cy = 0, ctrlx, ctrly;
1157
+
1158
+ return path.replace(/([MmLlHhVvCcSs])((?:-?(?:\d+)?(?:\.\d+)?,?\s?)+)/g, function (segment, letter, coords) {
1159
+ coords = coords.replace(/(\d)-/g, '$1,-').replace(/\s+/g, ',').split(',');
1160
+ if (!coords[0]) {
1161
+ coords.shift();
1162
+ }
1163
+
1164
+ for (var i = 0, l = coords.length; i < l; i++) {
1165
+ coords[i] = Math.round(100 * coords[i]);
1166
+ }
1167
+
1168
+ switch (letter) {
1169
+ case 'm':
1170
+ cx += coords[0];
1171
+ cy += coords[1];
1172
+ result = 't' + coords.join(',');
1173
+ break;
1174
+
1175
+ case 'M':
1176
+ cx = coords[0];
1177
+ cy = coords[1];
1178
+ result = 'm' + coords.join(',');
1179
+ break;
1180
+
1181
+ case 'l':
1182
+ cx += coords[0];
1183
+ cy += coords[1];
1184
+ result = 'r' + coords.join(',');
1185
+ break;
1186
+
1187
+ case 'L':
1188
+ cx = coords[0];
1189
+ cy = coords[1];
1190
+ result = 'l' + coords.join(',');
1191
+ break;
1192
+
1193
+ case 'h':
1194
+ cx += coords[0];
1195
+ result = 'r' + coords[0] + ',0';
1196
+ break;
1197
+
1198
+ case 'H':
1199
+ cx = coords[0];
1200
+ result = 'l' + cx + ',' + cy;
1201
+ break;
1202
+
1203
+ case 'v':
1204
+ cy += coords[0];
1205
+ result = 'r0,' + coords[0];
1206
+ break;
1207
+
1208
+ case 'V':
1209
+ cy = coords[0];
1210
+ result = 'l' + cx + ',' + cy;
1211
+ break;
1212
+
1213
+ case 'c':
1214
+ ctrlx = cx + coords[coords.length - 4];
1215
+ ctrly = cy + coords[coords.length - 3];
1216
+ cx += coords[coords.length - 2];
1217
+ cy += coords[coords.length - 1];
1218
+ result = 'v' + coords.join(',');
1219
+ break;
1220
+
1221
+ case 'C':
1222
+ ctrlx = coords[coords.length - 4];
1223
+ ctrly = coords[coords.length - 3];
1224
+ cx = coords[coords.length - 2];
1225
+ cy = coords[coords.length - 1];
1226
+ result = 'c' + coords.join(',');
1227
+ break;
1228
+
1229
+ case 's':
1230
+ coords.unshift(cy - ctrly);
1231
+ coords.unshift(cx - ctrlx);
1232
+ ctrlx = cx + coords[coords.length - 4];
1233
+ ctrly = cy + coords[coords.length - 3];
1234
+ cx += coords[coords.length - 2];
1235
+ cy += coords[coords.length - 1];
1236
+ result = 'v' + coords.join(',');
1237
+ break;
1238
+
1239
+ case 'S':
1240
+ coords.unshift(cy + cy - ctrly);
1241
+ coords.unshift(cx + cx - ctrlx);
1242
+ ctrlx = coords[coords.length - 4];
1243
+ ctrly = coords[coords.length - 3];
1244
+ cx = coords[coords.length - 2];
1245
+ cy = coords[coords.length - 1];
1246
+ result = 'c' + coords.join(',');
1247
+ break;
1248
+
1249
+ default:
1250
+ break;
1251
+ }
1252
+
1253
+ return result;
1254
+
1255
+ }).replace(/z/g, '');
1256
+ };
1257
+
1258
+ VectorCanvas.prototype.setSize = function (width, height) {
1259
+ if (this.mode === 'svg') {
1260
+ this.canvas.setAttribute('width', width);
1261
+ this.canvas.setAttribute('height', height);
1262
+ } else {
1263
+ this.canvas.style.width = width + 'px';
1264
+ this.canvas.style.height = height + 'px';
1265
+ this.canvas.coordsize = width + ' ' + height;
1266
+ this.canvas.coordorigin = '0 0';
1267
+ if (this.rootGroup) {
1268
+ var paths = this.rootGroup.getElementsByTagName('shape');
1269
+ for (var i = 0, l = paths.length; i < l; i++) {
1270
+ paths[i].coordsize = width + ' ' + height;
1271
+ paths[i].style.width = width + 'px';
1272
+ paths[i].style.height = height + 'px';
1273
+ }
1274
+ this.rootGroup.coordsize = width + ' ' + height;
1275
+ this.rootGroup.style.width = width + 'px';
1276
+ this.rootGroup.style.height = height + 'px';
1277
+ }
1278
+ }
1279
+ this.width = width;
1280
+ this.height = height;
1281
+ };
assets/jqvmap/jquery.vmap.min.js CHANGED
@@ -1,12 +1,10 @@
1
  /*!
2
- * jQVMap Version 1.0
3
- *
4
- * http://jqvmap.com
5
- *
6
- * Copyright 2012, Peter Schmalfeldt <manifestinteractive@gmail.com>
7
- * Copyright 2011-2012, Kirill Lebedev
8
- * Licensed under the MIT license.
9
- *
10
- * Fork Me @ https://github.com/manifestinteractive/jqvmap
11
  */
12
- (function($){var apiParams={colors:1,values:1,backgroundColor:1,scaleColors:1,normalizeFunction:1,enableZoom:1,showTooltip:1,borderColor:1,borderWidth:1,borderOpacity:1,selectedRegion:1};var apiEvents={onLabelShow:'labelShow',onRegionOver:'regionMouseOver',onRegionOut:'regionMouseOut',onRegionClick:'regionClick'};$.fn.vectorMap=function(options){var defaultParams={map:'world_en',backgroundColor:'#a5bfdd',color:'#f4f3f0',hoverColor:'#c9dfaf',selectedColor:'#c9dfaf',scaleColors:['#b6d6ff','#005ace'],normalizeFunction:'linear',enableZoom:true,showTooltip:true,borderColor:'#818181',borderWidth:1,borderOpacity:0.25,selectedRegion:null},map;if(options==='addMap'){WorldMap.maps[arguments[1]]=arguments[2]}else if(options==='set'&&apiParams[arguments[1]]){this.data('mapObject')['set'+arguments[1].charAt(0).toUpperCase()+arguments[1].substr(1)].apply(this.data('mapObject'),Array.prototype.slice.call(arguments,2))}else{$.extend(defaultParams,options);defaultParams.container=this;this.css({position:'relative',overflow:'hidden'});map=new WorldMap(defaultParams);this.data('mapObject',map);for(var e in apiEvents){if(defaultParams[e]){this.bind(apiEvents[e]+'.jqvmap',defaultParams[e])}}}};var VectorCanvas=function(width,height,params){this.mode=window.SVGAngle?'svg':'vml';this.params=params;if(this.mode=='svg'){this.createSvgNode=function(nodeName){return document.createElementNS(this.svgns,nodeName)}}else{try{if(!document.namespaces.rvml){document.namespaces.add("rvml","urn:schemas-microsoft-com:vml")}this.createVmlNode=function(tagName){return document.createElement('<rvml:'+tagName+' class="rvml">')}}catch(e){this.createVmlNode=function(tagName){return document.createElement('<'+tagName+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)")}if(this.mode=='svg'){this.canvas=this.createSvgNode('svg')}else{this.canvas=this.createVmlNode('group');this.canvas.style.position='absolute'}this.setSize(width,height)};VectorCanvas.prototype={svgns:"http://www.w3.org/2000/svg",mode:'svg',width:0,height:0,canvas:null,setSize:function(width,height){if(this.mode=='svg'){this.canvas.setAttribute('width',width);this.canvas.setAttribute('height',height)}else{this.canvas.style.width=width+"px";this.canvas.style.height=height+"px";this.canvas.coordsize=width+' '+height;this.canvas.coordorigin="0 0";if(this.rootGroup){var pathes=this.rootGroup.getElementsByTagName('shape');for(var i=0,l=pathes.length;i<l;i++){pathes[i].coordsize=width+' '+height;pathes[i].style.width=width+'px';pathes[i].style.height=height+'px'}this.rootGroup.coordsize=width+' '+height;this.rootGroup.style.width=width+'px';this.rootGroup.style.height=height+'px'}}this.width=width;this.height=height},createPath:function(config){var node;if(this.mode=='svg'){node=this.createSvgNode('path');node.setAttribute('d',config.path);if(this.params.borderColor!==null){node.setAttribute('stroke',this.params.borderColor)}if(this.params.borderWidth>0){node.setAttribute('stroke-width',this.params.borderWidth);node.setAttribute('stroke-linecap','round');node.setAttribute('stroke-linejoin','round')}if(this.params.borderOpacity>0){node.setAttribute('stroke-opacity',this.params.borderOpacity)}node.setFill=function(color){this.setAttribute("fill",color);if(this.getAttribute("original")===null){this.setAttribute("original",color)}};node.getFill=function(color){return this.getAttribute("fill")};node.getOriginalFill=function(){return this.getAttribute("original")};node.setOpacity=function(opacity){this.setAttribute('fill-opacity',opacity)}}else{node=this.createVmlNode('shape');node.coordorigin="0 0";node.coordsize=this.width+' '+this.height;node.style.width=this.width+'px';node.style.height=this.height+'px';node.fillcolor=WorldMap.defaultFillColor;node.stroked=false;node.path=VectorCanvas.pathSvgToVml(config.path);var scale=this.createVmlNode('skew');scale.on=true;scale.matrix='0.01,0,0,0.01,0,0';scale.offset='0,0';node.appendChild(scale);var fill=this.createVmlNode('fill');node.appendChild(fill);node.setFill=function(color){this.getElementsByTagName('fill')[0].color=color};node.getFill=function(color){return this.getElementsByTagName('fill')[0].color};node.setOpacity=function(opacity){this.getElementsByTagName('fill')[0].opacity=parseInt(opacity*100,10)+'%'}}return node},createGroup:function(isRoot){var node;if(this.mode=='svg'){node=this.createSvgNode('g')}else{node=this.createVmlNode('group');node.style.width=this.width+'px';node.style.height=this.height+'px';node.style.left='0px';node.style.top='0px';node.coordorigin="0 0";node.coordsize=this.width+' '+this.height}if(isRoot){this.rootGroup=node}return node},applyTransformParams:function(scale,transX,transY){if(this.mode=='svg'){this.rootGroup.setAttribute('transform','scale('+scale+') translate('+transX+', '+transY+')')}else{this.rootGroup.coordorigin=(this.width-transX)+','+(this.height-transY);this.rootGroup.coordsize=this.width/scale+','+this.height/scale}}};VectorCanvas.pathSvgToVml=function(path){var result='';var cx=0,cy=0,ctrlx,ctrly;return path.replace(/([MmLlHhVvCcSs])((?:-?(?:\d+)?(?:\.\d+)?,?\s?)+)/g,function(segment,letter,coords,index){coords=coords.replace(/(\d)-/g,'$1,-').replace(/\s+/g,',').split(',');if(!coords[0]){coords.shift()}for(var i=0,l=coords.length;i<l;i++){coords[i]=Math.round(100*coords[i])}switch(letter){case'm':cx+=coords[0];cy+=coords[1];return't'+coords.join(',');break;case'M':cx=coords[0];cy=coords[1];return'm'+coords.join(',');break;case'l':cx+=coords[0];cy+=coords[1];return'r'+coords.join(',');break;case'L':cx=coords[0];cy=coords[1];return'l'+coords.join(',');break;case'h':cx+=coords[0];return'r'+coords[0]+',0';break;case'H':cx=coords[0];return'l'+cx+','+cy;break;case'v':cy+=coords[0];return'r0,'+coords[0];break;case'V':cy=coords[0];return'l'+cx+','+cy;break;case'c':ctrlx=cx+coords[coords.length-4];ctrly=cy+coords[coords.length-3];cx+=coords[coords.length-2];cy+=coords[coords.length-1];return'v'+coords.join(',');break;case'C':ctrlx=coords[coords.length-4];ctrly=coords[coords.length-3];cx=coords[coords.length-2];cy=coords[coords.length-1];return'c'+coords.join(',');break;case's':coords.unshift(cy-ctrly);coords.unshift(cx-ctrlx);ctrlx=cx+coords[coords.length-4];ctrly=cy+coords[coords.length-3];cx+=coords[coords.length-2];cy+=coords[coords.length-1];return'v'+coords.join(',');break;case'S':coords.unshift(cy+cy-ctrly);coords.unshift(cx+cx-ctrlx);ctrlx=coords[coords.length-4];ctrly=coords[coords.length-3];cx=coords[coords.length-2];cy=coords[coords.length-1];return'c'+coords.join(',');break;default:return false;break}return''}).replace(/z/g,'')};var WorldMap=function(params){params=params||{};var map=this;var mapData=WorldMap.maps[params.map];this.container=params.container;this.defaultWidth=mapData.width;this.defaultHeight=mapData.height;this.color=params.color;this.hoverColor=params.hoverColor;this.setBackgroundColor(params.backgroundColor);this.width=params.container.width();this.height=params.container.height();this.resize();jQuery(window).resize(function(){map.width=params.container.width();map.height=params.container.height();map.resize();map.canvas.setSize(map.width,map.height);map.applyTransform()});this.canvas=new VectorCanvas(this.width,this.height,params);params.container.append(this.canvas.canvas);this.makeDraggable();this.rootGroup=this.canvas.createGroup(true);this.index=WorldMap.mapIndex;this.label=jQuery('<div/>').addClass('jqvmap-label').appendTo(jQuery('body'));if(params.enableZoom){jQuery('<div/>').addClass('jqvmap-zoomin').text('+').appendTo(params.container);jQuery('<div/>').addClass('jqvmap-zoomout').html('&#x2212;').appendTo(params.container)}map.countries=[];for(var key in mapData.pathes){var path=this.canvas.createPath({path:mapData.pathes[key].path});path.setFill(this.color);path.id='jqvmap'+map.index+'_'+key;map.countries[key]=path;jQuery(this.rootGroup).append(path);path.setAttribute('class','jqvmap-region');if(params.selectedRegion!==null){if(key.toLowerCase()==params.selectedRegion.toLowerCase()){path.setFill(params.selectedColor)}}}jQuery(params.container).delegate(this.canvas.mode=='svg'?'path':'shape','mouseover mouseout',function(e){var path=e.target,code=e.target.id.split('_').pop(),labelShowEvent=$.Event('labelShow.jqvmap'),regionMouseOverEvent=$.Event('regionMouseOver.jqvmap');if(e.type=='mouseover'){jQuery(params.container).trigger(regionMouseOverEvent,[code,mapData.pathes[code].name]);if(!regionMouseOverEvent.isDefaultPrevented()){if(params.hoverOpacity){path.setOpacity(params.hoverOpacity)}else if(params.hoverColor){path.currentFillColor=path.getFill()+'';path.setFill(params.hoverColor)}}if(params.showTooltip){map.label.text(mapData.pathes[code].name);jQuery(params.container).trigger(labelShowEvent,[map.label,code]);if(!labelShowEvent.isDefaultPrevented()){map.label.show();map.labelWidth=map.label.width();map.labelHeight=map.label.height()}}}else{path.setOpacity(1);if(path.currentFillColor){path.setFill(path.currentFillColor)}map.label.hide();jQuery(params.container).trigger('regionMouseOut.jqvmap',[code,mapData.pathes[code].name])}});jQuery(params.container).delegate(this.canvas.mode=='svg'?'path':'shape','click',function(e){for(var key in mapData.pathes){map.countries[key].currentFillColor=map.countries[key].getOriginalFill();map.countries[key].setFill(map.countries[key].getOriginalFill())}var path=e.target;var code=e.target.id.split('_').pop();jQuery(params.container).trigger('regionClick.jqvmap',[code,mapData.pathes[code].name]);path.currentFillColor=params.selectedColor;path.setFill(params.selectedColor)});if(params.showTooltip){params.container.mousemove(function(e){if(map.label.is(':visible')){map.label.css({left:e.pageX-15-map.labelWidth,top:e.pageY-15-map.labelHeight})}})}this.setColors(params.colors);this.canvas.canvas.appendChild(this.rootGroup);this.applyTransform();this.colorScale=new ColorScale(params.scaleColors,params.normalizeFunction,params.valueMin,params.valueMax);if(params.values){this.values=params.values;this.setValues(params.values)}this.bindZoomButtons();WorldMap.mapIndex++};WorldMap.prototype={transX:0,transY:0,scale:1,baseTransX:0,baseTransY:0,baseScale:1,width:0,height:0,countries:{},countriesColors:{},countriesData:{},zoomStep:1.4,zoomMaxStep:4,zoomCurStep:1,setColors:function(key,color){if(typeof key=='string'){this.countries[key].setFill(color);this.countries[key].setAttribute("original",color)}else{var colors=key;for(var code in colors){if(this.countries[code]){this.countries[code].setFill(colors[code]);this.countries[code].setAttribute("original",colors[code])}}}},setValues:function(values){var max=0,min=Number.MAX_VALUE,val;for(var cc in values){val=parseFloat(values[cc]);if(val>max){max=values[cc]}if(val&&val<min){min=val}}this.colorScale.setMin(min);this.colorScale.setMax(max);var colors={};for(cc in values){val=parseFloat(values[cc]);if(val){colors[cc]=this.colorScale.getColor(val)}else{colors[cc]=this.color}}this.setColors(colors);this.values=values},setBackgroundColor:function(backgroundColor){this.container.css('background-color',backgroundColor)},setScaleColors:function(colors){this.colorScale.setColors(colors);if(this.values){this.setValues(this.values)}},setNormalizeFunction:function(f){this.colorScale.setNormalizeFunction(f);if(this.values){this.setValues(this.values)}},resize:function(){var curBaseScale=this.baseScale;if(this.width/this.height>this.defaultWidth/this.defaultHeight){this.baseScale=this.height/this.defaultHeight;this.baseTransX=Math.abs(this.width-this.defaultWidth*this.baseScale)/(2*this.baseScale)}else{this.baseScale=this.width/this.defaultWidth;this.baseTransY=Math.abs(this.height-this.defaultHeight*this.baseScale)/(2*this.baseScale)}this.scale*=this.baseScale/curBaseScale;this.transX*=this.baseScale/curBaseScale;this.transY*=this.baseScale/curBaseScale},reset:function(){this.countryTitle.reset();for(var key in this.countries){this.countries[key].setFill(WorldMap.defaultColor)}this.scale=this.baseScale;this.transX=this.baseTransX;this.transY=this.baseTransY;this.applyTransform()},applyTransform:function(){var maxTransX,maxTransY,minTransX,minTransY;if(this.defaultWidth*this.scale<=this.width){maxTransX=(this.width-this.defaultWidth*this.scale)/(2*this.scale);minTransX=(this.width-this.defaultWidth*this.scale)/(2*this.scale)}else{maxTransX=0;minTransX=(this.width-this.defaultWidth*this.scale)/this.scale}if(this.defaultHeight*this.scale<=this.height){maxTransY=(this.height-this.defaultHeight*this.scale)/(2*this.scale);minTransY=(this.height-this.defaultHeight*this.scale)/(2*this.scale)}else{maxTransY=0;minTransY=(this.height-this.defaultHeight*this.scale)/this.scale}if(this.transY>maxTransY){this.transY=maxTransY}else if(this.transY<minTransY){this.transY=minTransY}if(this.transX>maxTransX){this.transX=maxTransX}else if(this.transX<minTransX){this.transX=minTransX}this.canvas.applyTransformParams(this.scale,this.transX,this.transY)},makeDraggable:function(){var mouseDown=false;var oldPageX,oldPageY;var self=this;this.container.mousemove(function(e){if(mouseDown){var curTransX=self.transX;var curTransY=self.transY;self.transX-=(oldPageX-e.pageX)/self.scale;self.transY-=(oldPageY-e.pageY)/self.scale;self.applyTransform();oldPageX=e.pageX;oldPageY=e.pageY}return false}).mousedown(function(e){mouseDown=true;oldPageX=e.pageX;oldPageY=e.pageY;return false}).mouseup(function(){mouseDown=false;return false})},bindZoomButtons:function(){var map=this;var sliderDelta=(jQuery('#zoom').innerHeight()-6*2-15*2-3*2-7-6)/(this.zoomMaxStep-this.zoomCurStep);this.container.find('.jqvmap-zoomin').click(function(){if(map.zoomCurStep<map.zoomMaxStep){var curTransX=map.transX;var curTransY=map.transY;var curScale=map.scale;map.transX-=(map.width/map.scale-map.width/ (map.scale * map.zoomStep)) /2;map.transY-=(map.height/map.scale-map.height/ (map.scale * map.zoomStep)) /2;map.setScale(map.scale*map.zoomStep);map.zoomCurStep++;jQuery('#zoomSlider').css('top',parseInt(jQuery('#zoomSlider').css('top'),10)-sliderDelta)}});this.container.find('.jqvmap-zoomout').click(function(){if(map.zoomCurStep>1){var curTransX=map.transX;var curTransY=map.transY;var curScale=map.scale;map.transX+=(map.width/(map.scale/ map.zoomStep) - map.width/map.scale)/2;map.transY+=(map.height/(map.scale/ map.zoomStep) - map.height/map.scale)/2;map.setScale(map.scale/map.zoomStep);map.zoomCurStep--;jQuery('#zoomSlider').css('top',parseInt(jQuery('#zoomSlider').css('top'),10)+sliderDelta)}})},setScale:function(scale){this.scale=scale;this.applyTransform()},getCountryPath:function(cc){return jQuery('#'+cc)[0]}};WorldMap.xlink="http://www.w3.org/1999/xlink";WorldMap.mapIndex=1;WorldMap.maps={};var ColorScale=function(colors,normalizeFunction,minValue,maxValue){if(colors){this.setColors(colors)}if(normalizeFunction){this.setNormalizeFunction(normalizeFunction)}if(minValue){this.setMin(minValue)}if(minValue){this.setMax(maxValue)}};ColorScale.prototype={colors:[],setMin:function(min){this.clearMinValue=min;if(typeof this.normalize==='function'){this.minValue=this.normalize(min)}else{this.minValue=min}},setMax:function(max){this.clearMaxValue=max;if(typeof this.normalize==='function'){this.maxValue=this.normalize(max)}else{this.maxValue=max}},setColors:function(colors){for(var i=0;i<colors.length;i++){colors[i]=ColorScale.rgbToArray(colors[i])}this.colors=colors},setNormalizeFunction:function(f){if(f==='polynomial'){this.normalize=function(value){return Math.pow(value,0.2)}}else if(f==='linear'){delete this.normalize}else{this.normalize=f}this.setMin(this.clearMinValue);this.setMax(this.clearMaxValue)},getColor:function(value){if(typeof this.normalize==='function'){value=this.normalize(value)}var lengthes=[];var fullLength=0;var l;for(var i=0;i<this.colors.length-1;i++){l=this.vectorLength(this.vectorSubtract(this.colors[i+1],this.colors[i]));lengthes.push(l);fullLength+=l}var c=(this.maxValue-this.minValue)/fullLength;for(i=0;i<lengthes.length;i++){lengthes[i]*=c}i=0;value-=this.minValue;while(value-lengthes[i]>=0){value-=lengthes[i];i++}var color;if(i==this.colors.length-1){color=this.vectorToNum(this.colors[i]).toString(16)}else{color=(this.vectorToNum(this.vectorAdd(this.colors[i],this.vectorMult(this.vectorSubtract(this.colors[i+1],this.colors[i]),(value)/(lengthes[i]))))).toString(16)}while(color.length<6){color='0'+color}return'#'+color},vectorToNum:function(vector){var num=0;for(var i=0;i<vector.length;i++){num+=Math.round(vector[i])*Math.pow(256,vector.length-i-1)}return num},vectorSubtract:function(vector1,vector2){var vector=[];for(var i=0;i<vector1.length;i++){vector[i]=vector1[i]-vector2[i]}return vector},vectorAdd:function(vector1,vector2){var vector=[];for(var i=0;i<vector1.length;i++){vector[i]=vector1[i]+vector2[i]}return vector},vectorMult:function(vector,num){var result=[];for(var i=0;i<vector.length;i++){result[i]=vector[i]*num}return result},vectorLength:function(vector){var result=0;for(var i=0;i<vector.length;i++){result+=vector[i]*vector[i]}return Math.sqrt(result)}};ColorScale.arrayToRgb=function(ar){var rgb='#';var d;for(var i=0;i<ar.length;i++){d=ar[i].toString(16);rgb+=d.length==1?'0'+d:d}return rgb};ColorScale.rgbToArray=function(rgb){rgb=rgb.substr(1);return[parseInt(rgb.substr(0,2),16),parseInt(rgb.substr(2,2),16),parseInt(rgb.substr(4,2),16)]}})(jQuery);
 
1
  /*!
2
+ * JQVMap: jQuery Vector Map Library
3
+ * @author JQVMap <me@peterschmalfeldt.com>
4
+ * @version 1.5.1
5
+ * @link http://jqvmap.com
6
+ * @license https://github.com/manifestinteractive/jqvmap/blob/master/LICENSE
7
+ * @builddate 2016/05/18
 
 
 
8
  */
9
+
10
+ var VectorCanvas=function(a,b,c){if(this.mode=window.SVGAngle?"svg":"vml",this.params=c,"svg"===this.mode)this.createSvgNode=function(a){return document.createElementNS(this.svgns,a)};else{try{document.namespaces.rvml||document.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),this.createVmlNode=function(a){return document.createElement("<rvml:"+a+' class="rvml">')}}catch(d){this.createVmlNode=function(a){return document.createElement("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}document.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)")}"svg"===this.mode?this.canvas=this.createSvgNode("svg"):(this.canvas=this.createVmlNode("group"),this.canvas.style.position="absolute"),this.setSize(a,b)};VectorCanvas.prototype={svgns:"http://www.w3.org/2000/svg",mode:"svg",width:0,height:0,canvas:null};var ColorScale=function(a,b,c,d){a&&this.setColors(a),b&&this.setNormalizeFunction(b),c&&this.setMin(c),c&&this.setMax(d)};ColorScale.prototype={colors:[]};var JQVMap=function(a){a=a||{};var b,c=this,d=JQVMap.maps[a.map];if(!d)throw new Error('Invalid "'+a.map+'" map parameter. Please make sure you have loaded this map file in your HTML.');this.selectedRegions=[],this.multiSelectRegion=a.multiSelectRegion,this.container=a.container,this.defaultWidth=d.width,this.defaultHeight=d.height,this.color=a.color,this.selectedColor=a.selectedColor,this.hoverColor=a.hoverColor,this.hoverColors=a.hoverColors,this.hoverOpacity=a.hoverOpacity,this.setBackgroundColor(a.backgroundColor),this.width=a.container.width(),this.height=a.container.height(),this.resize(),jQuery(window).resize(function(){var d=a.container.width(),e=a.container.height();if(d&&e){c.width=d,c.height=e,c.resize(),c.canvas.setSize(c.width,c.height),c.applyTransform();var f=jQuery.Event("resize.jqvmap");jQuery(a.container).trigger(f,[d,e]),b&&(jQuery(".jqvmap-pin").remove(),c.pinHandlers=!1,c.placePins(b.pins,b.mode))}}),this.canvas=new VectorCanvas(this.width,this.height,a),a.container.append(this.canvas.canvas),this.makeDraggable(),this.rootGroup=this.canvas.createGroup(!0),this.index=JQVMap.mapIndex,this.label=jQuery("<div/>").addClass("jqvmap-label").appendTo(jQuery("body")).hide(),a.enableZoom&&(jQuery("<div/>").addClass("jqvmap-zoomin").text("+").appendTo(a.container),jQuery("<div/>").addClass("jqvmap-zoomout").html("&#x2212;").appendTo(a.container)),c.countries=[];for(var e in d.paths){var f=this.canvas.createPath({path:d.paths[e].path});f.setFill(this.color),f.id=c.getCountryId(e),c.countries[e]=f,"svg"===this.canvas.mode?f.setAttribute("class","jqvmap-region"):jQuery(f).addClass("jqvmap-region"),jQuery(this.rootGroup).append(f)}if(jQuery(a.container).delegate("svg"===this.canvas.mode?"path":"shape","mouseover mouseout",function(b){var e=b.target,f=b.target.id.split("_").pop(),g=jQuery.Event("labelShow.jqvmap"),h=jQuery.Event("regionMouseOver.jqvmap");f=f.toLowerCase(),"mouseover"===b.type?(jQuery(a.container).trigger(h,[f,d.paths[f].name]),h.isDefaultPrevented()||c.highlight(f,e),a.showTooltip&&(c.label.text(d.paths[f].name),jQuery(a.container).trigger(g,[c.label,f]),g.isDefaultPrevented()||(c.label.show(),c.labelWidth=c.label.width(),c.labelHeight=c.label.height()))):(c.unhighlight(f,e),c.label.hide(),jQuery(a.container).trigger("regionMouseOut.jqvmap",[f,d.paths[f].name]))}),jQuery(a.container).delegate("svg"===this.canvas.mode?"path":"shape","click",function(b){var e=b.target,f=b.target.id.split("_").pop(),g=jQuery.Event("regionClick.jqvmap");if(f=f.toLowerCase(),jQuery(a.container).trigger(g,[f,d.paths[f].name]),!a.multiSelectRegion&&!g.isDefaultPrevented())for(var h in d.paths)c.countries[h].currentFillColor=c.countries[h].getOriginalFill(),c.countries[h].setFill(c.countries[h].getOriginalFill());g.isDefaultPrevented()||(c.isSelected(f)?c.deselect(f,e):c.select(f,e))}),a.showTooltip&&a.container.mousemove(function(a){if(c.label.is(":visible")){var b=a.pageX-15-c.labelWidth,d=a.pageY-15-c.labelHeight;0>b&&(b=a.pageX+15),0>d&&(d=a.pageY+15),c.label.css({left:b,top:d})}}),this.setColors(a.colors),this.canvas.canvas.appendChild(this.rootGroup),this.applyTransform(),this.colorScale=new ColorScale(a.scaleColors,a.normalizeFunction,a.valueMin,a.valueMax),a.values&&(this.values=a.values,this.setValues(a.values)),a.selectedRegions)if(a.selectedRegions instanceof Array)for(var g in a.selectedRegions)this.select(a.selectedRegions[g].toLowerCase());else this.select(a.selectedRegions.toLowerCase());if(this.bindZoomButtons(),a.pins&&(b={pins:a.pins,mode:a.pinMode},this.pinHandlers=!1,this.placePins(a.pins,a.pinMode)),a.showLabels){this.pinHandlers=!1;var h={};for(e in c.countries)"function"!=typeof c.countries[e]&&(a.pins&&a.pins[e]||(h[e]=e.toUpperCase()));b={pins:h,mode:"content"},this.placePins(h,"content")}JQVMap.mapIndex++};JQVMap.prototype={transX:0,transY:0,scale:1,baseTransX:0,baseTransY:0,baseScale:1,width:0,height:0,countries:{},countriesColors:{},countriesData:{},zoomStep:1.4,zoomMaxStep:4,zoomCurStep:1},JQVMap.xlink="http://www.w3.org/1999/xlink",JQVMap.mapIndex=1,JQVMap.maps={},function(){var a={colors:1,values:1,backgroundColor:1,scaleColors:1,normalizeFunction:1,enableZoom:1,showTooltip:1,borderColor:1,borderWidth:1,borderOpacity:1,selectedRegions:1,multiSelectRegion:1},b={onLabelShow:"labelShow",onLoad:"load",onRegionOver:"regionMouseOver",onRegionOut:"regionMouseOut",onRegionClick:"regionClick",onRegionSelect:"regionSelect",onRegionDeselect:"regionDeselect",onResize:"resize"};jQuery.fn.vectorMap=function(c){var d={map:"world_en",backgroundColor:"#a5bfdd",color:"#f4f3f0",hoverColor:"#c9dfaf",hoverColors:{},selectedColor:"#c9dfaf",scaleColors:["#b6d6ff","#005ace"],normalizeFunction:"linear",enableZoom:!0,showTooltip:!0,borderColor:"#818181",borderWidth:1,borderOpacity:.25,selectedRegions:null,multiSelectRegion:!1},e=this.data("mapObject");if("addMap"===c)JQVMap.maps[arguments[1]]=arguments[2];else{if("set"!==c||!a[arguments[1]]){if("string"==typeof c&&"function"==typeof e[c])return e[c].apply(e,Array.prototype.slice.call(arguments,1));jQuery.extend(d,c),d.container=this,this.css({position:"relative",overflow:"hidden"}),e=new JQVMap(d),this.data("mapObject",e),this.unbind(".jqvmap");for(var f in b)d[f]&&this.bind(b[f]+".jqvmap",d[f]);var g=jQuery.Event("load.jqvmap");return jQuery(d.container).trigger(g,e),e}e["set"+arguments[1].charAt(0).toUpperCase()+arguments[1].substr(1)].apply(e,Array.prototype.slice.call(arguments,2))}}}(jQuery),ColorScale.arrayToRgb=function(a){for(var b,c="#",d=0;d<a.length;d++)b=a[d].toString(16),c+=1===b.length?"0"+b:b;return c},ColorScale.prototype.getColor=function(a){"function"==typeof this.normalize&&(a=this.normalize(a));for(var b,c=[],d=0,e=0;e<this.colors.length-1;e++)b=this.vectorLength(this.vectorSubtract(this.colors[e+1],this.colors[e])),c.push(b),d+=b;var f=(this.maxValue-this.minValue)/d;for(e=0;e<c.length;e++)c[e]*=f;for(e=0,a-=this.minValue;a-c[e]>=0;)a-=c[e],e++;var g;for(g=e===this.colors.length-1?this.vectorToNum(this.colors[e]).toString(16):this.vectorToNum(this.vectorAdd(this.colors[e],this.vectorMult(this.vectorSubtract(this.colors[e+1],this.colors[e]),a/c[e]))).toString(16);g.length<6;)g="0"+g;return"#"+g},ColorScale.rgbToArray=function(a){return a=a.substr(1),[parseInt(a.substr(0,2),16),parseInt(a.substr(2,2),16),parseInt(a.substr(4,2),16)]},ColorScale.prototype.setColors=function(a){for(var b=0;b<a.length;b++)a[b]=ColorScale.rgbToArray(a[b]);this.colors=a},ColorScale.prototype.setMax=function(a){this.clearMaxValue=a,"function"==typeof this.normalize?this.maxValue=this.normalize(a):this.maxValue=a},ColorScale.prototype.setMin=function(a){this.clearMinValue=a,"function"==typeof this.normalize?this.minValue=this.normalize(a):this.minValue=a},ColorScale.prototype.setNormalizeFunction=function(a){"polynomial"===a?this.normalize=function(a){return Math.pow(a,.2)}:"linear"===a?delete this.normalize:this.normalize=a,this.setMin(this.clearMinValue),this.setMax(this.clearMaxValue)},ColorScale.prototype.vectorAdd=function(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=a[d]+b[d];return c},ColorScale.prototype.vectorLength=function(a){for(var b=0,c=0;c<a.length;c++)b+=a[c]*a[c];return Math.sqrt(b)},ColorScale.prototype.vectorMult=function(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=a[d]*b;return c},ColorScale.prototype.vectorSubtract=function(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=a[d]-b[d];return c},ColorScale.prototype.vectorToNum=function(a){for(var b=0,c=0;c<a.length;c++)b+=Math.round(a[c])*Math.pow(256,a.length-c-1);return b},JQVMap.prototype.applyTransform=function(){var a,b,c,d;this.defaultWidth*this.scale<=this.width?(a=(this.width-this.defaultWidth*this.scale)/(2*this.scale),c=(this.width-this.defaultWidth*this.scale)/(2*this.scale)):(a=0,c=(this.width-this.defaultWidth*this.scale)/this.scale),this.defaultHeight*this.scale<=this.height?(b=(this.height-this.defaultHeight*this.scale)/(2*this.scale),d=(this.height-this.defaultHeight*this.scale)/(2*this.scale)):(b=0,d=(this.height-this.defaultHeight*this.scale)/this.scale),this.transY>b?this.transY=b:this.transY<d&&(this.transY=d),this.transX>a?this.transX=a:this.transX<c&&(this.transX=c),this.canvas.applyTransformParams(this.scale,this.transX,this.transY)},JQVMap.prototype.bindZoomButtons=function(){var a=this;this.container.find(".jqvmap-zoomin").click(function(){a.zoomIn()}),this.container.find(".jqvmap-zoomout").click(function(){a.zoomOut()})},JQVMap.prototype.deselect=function(a,b){if(a=a.toLowerCase(),b=b||jQuery("#"+this.getCountryId(a))[0],this.isSelected(a))this.selectedRegions.splice(this.selectIndex(a),1),jQuery(this.container).trigger("regionDeselect.jqvmap",[a]),b.currentFillColor=b.getOriginalFill(),b.setFill(b.getOriginalFill());else for(var c in this.countries)this.selectedRegions.splice(this.selectedRegions.indexOf(c),1),this.countries[c].currentFillColor=this.color,this.countries[c].setFill(this.color)},JQVMap.prototype.getCountryId=function(a){return"jqvmap"+this.index+"_"+a},JQVMap.prototype.getPin=function(a){var b=jQuery("#"+this.getPinId(a));return b.html()},JQVMap.prototype.getPinId=function(a){return this.getCountryId(a)+"_pin"},JQVMap.prototype.getPins=function(){var a=this.container.find(".jqvmap-pin"),b={};return jQuery.each(a,function(a,c){c=jQuery(c);var d=c.attr("for").toLowerCase(),e=c.html();b[d]=e}),JSON.stringify(b)},JQVMap.prototype.highlight=function(a,b){b=b||jQuery("#"+this.getCountryId(a))[0],this.hoverOpacity?b.setOpacity(this.hoverOpacity):this.hoverColors&&a in this.hoverColors?(b.currentFillColor=b.getFill()+"",b.setFill(this.hoverColors[a])):this.hoverColor&&(b.currentFillColor=b.getFill()+"",b.setFill(this.hoverColor))},JQVMap.prototype.isSelected=function(a){return this.selectIndex(a)>=0},JQVMap.prototype.makeDraggable=function(){var a,b,c=!1,d=this;d.isMoving=!1,d.isMovingTimeout=!1;var e,f,g,h,i,j,k;this.container.mousemove(function(e){return c&&(d.transX-=(a-e.pageX)/d.scale,d.transY-=(b-e.pageY)/d.scale,d.applyTransform(),a=e.pageX,b=e.pageY,d.isMoving=!0,d.isMovingTimeout&&clearTimeout(d.isMovingTimeout),d.container.trigger("drag")),!1}).mousedown(function(d){return c=!0,a=d.pageX,b=d.pageY,!1}).mouseup(function(){return c=!1,clearTimeout(d.isMovingTimeout),d.isMovingTimeout=setTimeout(function(){d.isMoving=!1},100),!1}).mouseout(function(){return c&&d.isMoving?(clearTimeout(d.isMovingTimeout),d.isMovingTimeout=setTimeout(function(){c=!1,d.isMoving=!1},100),!1):void 0}),jQuery(this.container).bind("touchmove",function(a){var b,c,l,m,n=a.originalEvent.touches;if(1===n.length){if(1===e){if(j===n[0].pageX&&k===n[0].pageY)return;l=d.transX,m=d.transY,d.transX-=(j-n[0].pageX)/d.scale,d.transY-=(k-n[0].pageY)/d.scale,d.applyTransform(),(l!==d.transX||m!==d.transY)&&a.preventDefault(),d.isMoving=!0,d.isMovingTimeout&&clearTimeout(d.isMovingTimeout)}j=n[0].pageX,k=n[0].pageY}else 2===n.length&&(2===e?(c=Math.sqrt(Math.pow(n[0].pageX-n[1].pageX,2)+Math.pow(n[0].pageY-n[1].pageY,2))/h,d.setScale(i*c,f,g),a.preventDefault()):(b=jQuery(d.container).offset(),f=n[0].pageX>n[1].pageX?n[1].pageX+(n[0].pageX-n[1].pageX)/2:n[0].pageX+(n[1].pageX-n[0].pageX)/2,g=n[0].pageY>n[1].pageY?n[1].pageY+(n[0].pageY-n[1].pageY)/2:n[0].pageY+(n[1].pageY-n[0].pageY)/2,f-=b.left,g-=b.top,i=d.scale,h=Math.sqrt(Math.pow(n[0].pageX-n[1].pageX,2)+Math.pow(n[0].pageY-n[1].pageY,2))));e=n.length}),jQuery(this.container).bind("touchstart",function(){e=0}),jQuery(this.container).bind("touchend",function(){e=0})},JQVMap.prototype.placePins=function(a,b){var c=this;if((!b||"content"!==b&&"id"!==b)&&(b="content"),"content"===b?jQuery.each(a,function(a,b){if(0!==jQuery("#"+c.getCountryId(a)).length){var d=c.getPinId(a),e=jQuery("#"+d);e.length>0&&e.remove(),c.container.append('<div id="'+d+'" for="'+a+'" class="jqvmap-pin" style="position:absolute">'+b+"</div>")}}):jQuery.each(a,function(a,b){if(0!==jQuery("#"+c.getCountryId(a)).length){var d=c.getPinId(a),e=jQuery("#"+d);e.length>0&&e.remove(),c.container.append('<div id="'+d+'" for="'+a+'" class="jqvmap-pin" style="position:absolute"></div>'),e.append(jQuery("#"+b))}}),this.positionPins(),!this.pinHandlers){this.pinHandlers=!0;var d=function(){c.positionPins()};this.container.bind("zoomIn",d).bind("zoomOut",d).bind("drag",d)}},JQVMap.prototype.positionPins=function(){var a=this,b=this.container.find(".jqvmap-pin");jQuery.each(b,function(b,c){c=jQuery(c);var d=a.getCountryId(c.attr("for").toLowerCase()),e=jQuery("#"+d),f=document.getElementById(d).getBBox(),g=e.position(),h=a.scale,i=g.left+f.width/2*h-c.width()/2,j=g.top+f.height/2*h-c.height()/2;c.css("left",i).css("top",j)})},JQVMap.prototype.removePin=function(a){a=a.toLowerCase(),jQuery("#"+this.getPinId(a)).remove()},JQVMap.prototype.removePins=function(){this.container.find(".jqvmap-pin").remove()},JQVMap.prototype.reset=function(){for(var a in this.countries)this.countries[a].setFill(this.color);this.scale=this.baseScale,this.transX=this.baseTransX,this.transY=this.baseTransY,this.applyTransform()},JQVMap.prototype.resize=function(){var a=this.baseScale;this.width/this.height>this.defaultWidth/this.defaultHeight?(this.baseScale=this.height/this.defaultHeight,this.baseTransX=Math.abs(this.width-this.defaultWidth*this.baseScale)/(2*this.baseScale)):(this.baseScale=this.width/this.defaultWidth,this.baseTransY=Math.abs(this.height-this.defaultHeight*this.baseScale)/(2*this.baseScale)),this.scale*=this.baseScale/a,this.transX*=this.baseScale/a,this.transY*=this.baseScale/a},JQVMap.prototype.select=function(a,b){a=a.toLowerCase(),b=b||jQuery("#"+this.getCountryId(a))[0],this.isSelected(a)||(this.multiSelectRegion?this.selectedRegions.push(a):this.selectedRegions=[a],jQuery(this.container).trigger("regionSelect.jqvmap",[a]),this.selectedColor&&b&&(b.currentFillColor=this.selectedColor,b.setFill(this.selectedColor)))},JQVMap.prototype.selectIndex=function(a){a=a.toLowerCase();for(var b=0;b<this.selectedRegions.length;b++)if(a===this.selectedRegions[b])return b;return-1},JQVMap.prototype.setBackgroundColor=function(a){this.container.css("background-color",a)},JQVMap.prototype.setColors=function(a,b){if("string"==typeof a)this.countries[a].setFill(b),this.countries[a].setAttribute("original",b);else{var c=a;for(var d in c)this.countries[d]&&(this.countries[d].setFill(c[d]),this.countries[d].setAttribute("original",c[d]))}},JQVMap.prototype.setNormalizeFunction=function(a){this.colorScale.setNormalizeFunction(a),this.values&&this.setValues(this.values)},JQVMap.prototype.setScale=function(a){this.scale=a,this.applyTransform()},JQVMap.prototype.setScaleColors=function(a){this.colorScale.setColors(a),this.values&&this.setValues(this.values)},JQVMap.prototype.setValues=function(a){var b,c=0,d=Number.MAX_VALUE;for(var e in a)e=e.toLowerCase(),b=parseFloat(a[e]),isNaN(b)||(b>c&&(c=a[e]),d>b&&(d=b));d===c&&c++,this.colorScale.setMin(d),this.colorScale.setMax(c);var f={};for(e in a)e=e.toLowerCase(),b=parseFloat(a[e]),f[e]=isNaN(b)?this.color:this.colorScale.getColor(b);this.setColors(f),this.values=a},JQVMap.prototype.unhighlight=function(a,b){a=a.toLowerCase(),b=b||jQuery("#"+this.getCountryId(a))[0],b.setOpacity(1),b.currentFillColor&&b.setFill(b.currentFillColor)},JQVMap.prototype.zoomIn=function(){var a=this,b=(jQuery("#zoom").innerHeight()-12-30-6-7-6)/(this.zoomMaxStep-this.zoomCurStep);if(a.zoomCurStep<a.zoomMaxStep){a.transX-=(a.width/a.scale-a.width/(a.scale*a.zoomStep))/2,a.transY-=(a.height/a.scale-a.height/(a.scale*a.zoomStep))/2,a.setScale(a.scale*a.zoomStep),a.zoomCurStep++;var c=jQuery("#zoomSlider");c.css("top",parseInt(c.css("top"),10)-b),a.container.trigger("zoomIn")}},JQVMap.prototype.zoomOut=function(){var a=this,b=(jQuery("#zoom").innerHeight()-12-30-6-7-6)/(this.zoomMaxStep-this.zoomCurStep);if(a.zoomCurStep>1){a.transX+=(a.width/(a.scale/a.zoomStep)-a.width/a.scale)/2,a.transY+=(a.height/(a.scale/a.zoomStep)-a.height/a.scale)/2,a.setScale(a.scale/a.zoomStep),a.zoomCurStep--;var c=jQuery("#zoomSlider");c.css("top",parseInt(c.css("top"),10)+b),a.container.trigger("zoomOut")}},VectorCanvas.prototype.applyTransformParams=function(a,b,c){"svg"===this.mode?this.rootGroup.setAttribute("transform","scale("+a+") translate("+b+", "+c+")"):(this.rootGroup.coordorigin=this.width-b+","+(this.height-c),this.rootGroup.coordsize=this.width/a+","+this.height/a)},VectorCanvas.prototype.createGroup=function(a){var b;return"svg"===this.mode?b=this.createSvgNode("g"):(b=this.createVmlNode("group"),b.style.width=this.width+"px",b.style.height=this.height+"px",b.style.left="0px",b.style.top="0px",b.coordorigin="0 0",b.coordsize=this.width+" "+this.height),a&&(this.rootGroup=b),b},VectorCanvas.prototype.createPath=function(a){var b;if("svg"===this.mode)b=this.createSvgNode("path"),b.setAttribute("d",a.path),null!==this.params.borderColor&&b.setAttribute("stroke",this.params.borderColor),this.params.borderWidth>0&&(b.setAttribute("stroke-width",this.params.borderWidth),b.setAttribute("stroke-linecap","round"),b.setAttribute("stroke-linejoin","round")),this.params.borderOpacity>0&&b.setAttribute("stroke-opacity",this.params.borderOpacity),b.setFill=function(a){this.setAttribute("fill",a),null===this.getAttribute("original")&&this.setAttribute("original",a)},b.getFill=function(){return this.getAttribute("fill")},b.getOriginalFill=function(){return this.getAttribute("original")},b.setOpacity=function(a){this.setAttribute("fill-opacity",a)};else{b=this.createVmlNode("shape"),b.coordorigin="0 0",b.coordsize=this.width+" "+this.height,b.style.width=this.width+"px",b.style.height=this.height+"px",b.fillcolor=JQVMap.defaultFillColor,b.stroked=!1,b.path=VectorCanvas.pathSvgToVml(a.path);var c=this.createVmlNode("skew");c.on=!0,c.matrix="0.01,0,0,0.01,0,0",c.offset="0,0",b.appendChild(c);var d=this.createVmlNode("fill");b.appendChild(d),b.setFill=function(a){this.getElementsByTagName("fill")[0].color=a,null===this.getAttribute("original")&&this.setAttribute("original",a)},b.getFill=function(){return this.getElementsByTagName("fill")[0].color},b.getOriginalFill=function(){return this.getAttribute("original")},b.setOpacity=function(a){this.getElementsByTagName("fill")[0].opacity=parseInt(100*a,10)+"%"}}return b},VectorCanvas.prototype.pathSvgToVml=function(a){var b,c,d="",e=0,f=0;return a.replace(/([MmLlHhVvCcSs])((?:-?(?:\d+)?(?:\.\d+)?,?\s?)+)/g,function(a,g,h){h=h.replace(/(\d)-/g,"$1,-").replace(/\s+/g,",").split(","),h[0]||h.shift();for(var i=0,j=h.length;j>i;i++)h[i]=Math.round(100*h[i]);switch(g){case"m":e+=h[0],f+=h[1],d="t"+h.join(",");break;case"M":e=h[0],f=h[1],d="m"+h.join(",");break;case"l":e+=h[0],f+=h[1],d="r"+h.join(",");break;case"L":e=h[0],f=h[1],d="l"+h.join(",");break;case"h":e+=h[0],d="r"+h[0]+",0";break;case"H":e=h[0],d="l"+e+","+f;break;case"v":f+=h[0],d="r0,"+h[0];break;case"V":f=h[0],d="l"+e+","+f;break;case"c":b=e+h[h.length-4],c=f+h[h.length-3],e+=h[h.length-2],f+=h[h.length-1],d="v"+h.join(",");break;case"C":b=h[h.length-4],c=h[h.length-3],e=h[h.length-2],f=h[h.length-1],d="c"+h.join(",");break;case"s":h.unshift(f-c),h.unshift(e-b),b=e+h[h.length-4],c=f+h[h.length-3],e+=h[h.length-2],f+=h[h.length-1],d="v"+h.join(",");break;case"S":h.unshift(f+f-c),h.unshift(e+e-b),b=h[h.length-4],c=h[h.length-3],e=h[h.length-2],f=h[h.length-1],d="c"+h.join(",")}return d}).replace(/z/g,"")},VectorCanvas.prototype.setSize=function(a,b){if("svg"===this.mode)this.canvas.setAttribute("width",a),this.canvas.setAttribute("height",b);else if(this.canvas.style.width=a+"px",this.canvas.style.height=b+"px",this.canvas.coordsize=a+" "+b,this.canvas.coordorigin="0 0",this.rootGroup){for(var c=this.rootGroup.getElementsByTagName("shape"),d=0,e=c.length;e>d;d++)c[d].coordsize=a+" "+b,c[d].style.width=a+"px",c[d].style.height=b+"px";this.rootGroup.coordsize=a+" "+b,this.rootGroup.style.width=a+"px",this.rootGroup.style.height=b+"px"}this.width=a,this.height=b};
assets/jqvmap/jqvmap.css CHANGED
@@ -1,56 +1,50 @@
1
- /*!
2
- * jQVMap Version 1.0
3
- *
4
- * http://jqvmap.com
5
- *
6
- * Copyright 2012, Peter Schmalfeldt <manifestinteractive@gmail.com>
7
- * Licensed under the MIT license.
8
- *
9
- * Fork Me @ https://github.com/manifestinteractive/jqvmap
10
- */
11
- .jqvmap-label
12
- {
13
- position: absolute;
14
- display: none;
15
- -webkit-border-radius: 3px;
16
- -moz-border-radius: 3px;
17
- border-radius: 3px;
18
- background: #292929;
19
- color: white;
20
- font-family: sans-serif, Verdana;
21
- font-size: smaller;
22
- padding: 3px;
23
- }
24
- .jqvmap-zoomin, .jqvmap-zoomout
25
- {
26
- position: absolute;
27
- left: 10px;
28
- -webkit-border-radius: 3px;
29
- -moz-border-radius: 3px;
30
- border-radius: 3px;
31
- background: #000000;
32
- padding: 3px;
33
- color: white;
34
- width: 10px;
35
- height: 10px;
36
- cursor: pointer;
37
- line-height: 10px;
38
- text-align: center;
39
- }
40
- .jqvmap-zoomin
41
- {
42
- top: 10px;
43
- }
44
- .jqvmap-zoomout
45
- {
46
- top: 30px;
47
- }
48
- .jqvmap-region
49
- {
50
- cursor: pointer;
51
- }
52
- .jqvmap-ajax_response
53
- {
54
- width: 100%;
55
- height: 500px;
56
- }
1
+ .jqvmap-label
2
+ {
3
+ position: absolute;
4
+ display: none;
5
+ -webkit-border-radius: 3px;
6
+ -moz-border-radius: 3px;
7
+ border-radius: 3px;
8
+ background: #292929;
9
+ color: white;
10
+ font-family: sans-serif, Verdana;
11
+ font-size: smaller;
12
+ padding: 3px;
13
+ pointer-events:none;
14
+ }
15
+ .jqvmap-pin {
16
+ pointer-events:none;
17
+ }
18
+ .jqvmap-zoomin, .jqvmap-zoomout
19
+ {
20
+ position: absolute;
21
+ left: 10px;
22
+ -webkit-border-radius: 3px;
23
+ -moz-border-radius: 3px;
24
+ border-radius: 3px;
25
+ background: #000000;
26
+ padding: 3px;
27
+ color: white;
28
+ width: 10px;
29
+ height: 10px;
30
+ cursor: pointer;
31
+ line-height: 10px;
32
+ text-align: center;
33
+ }
34
+ .jqvmap-zoomin
35
+ {
36
+ top: 10px;
37
+ }
38
+ .jqvmap-zoomout
39
+ {
40
+ top: 30px;
41
+ }
42
+ .jqvmap-region
43
+ {
44
+ cursor: pointer;
45
+ }
46
+ .jqvmap-ajax_response
47
+ {
48
+ width: 100%;
49
+ height: 500px;
50
+ }
 
 
 
 
 
 
assets/jqvmap/jqvmap.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .jqvmap-label,.jqvmap-pin{pointer-events:none}.jqvmap-label{position:absolute;display:none;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;background:#292929;color:#fff;font-family:sans-serif,Verdana;font-size:smaller;padding:3px}.jqvmap-zoomin,.jqvmap-zoomout{position:absolute;left:10px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;background:#000;padding:3px;color:#fff;width:10px;height:10px;cursor:pointer;line-height:10px;text-align:center}.jqvmap-zoomin{top:10px}.jqvmap-zoomout{top:30px}.jqvmap-region{cursor:pointer}.jqvmap-ajax_response{width:100%;height:500px}
assets/jqvmap/maps/continents/jquery.vmap.africa.js DELETED
@@ -1,2 +0,0 @@
1
- /** Add World Map Data Points */
2
- jQuery.fn.vectorMap('addMap', 'africa_en', {"width":950,"height":550,"pathes":{"dz":{"path":"m 419.83634,8.1546547 -9.8215,-3.2979062 -40.87478,7.6790665 -8.90675,6.764318 5.44034,28.092384 -16.24881,0.649952 -9.77336,15.719217 -23.27792,5.584776 0.0722,11.434346 76.6703,58.616072 13.07126,1.10732 43.59495,-34.06231 -4.35709,-5.48849 -8.18458,-1.107324 -4.91075,-8.232729 V 57.551031 l -3.27383,-3.297906 0.55366,-8.786393 -8.71418,-8.786392 -1.08325,-9.340056 3.80342,-2.744243 -1.63691,-9.893719 -2.14244,-6.5476673 0,0 z","name":"Algeria"},"ma":{"path":"m 358.23531,19.68529 h -27.80352 l -5.44034,12.084299 -12.54167,6.042149 -10.3511,28.020167 -20.17259,12.084298 -28.33311,46.676207 27.80352,-0.55366 1.08325,-13.72122 h 7.07726 V 91.637419 h 24.52968 l 0.55367,-24.168597 23.44642,-5.488487 9.82151,-15.935868 15.26184,-0.553663 -4.93482,-25.805514 0,0 z","name":"Morocco"},"mr":{"path":"m 253.78556,126.51819 5.24776,6.86061 -1.08325,29.65708 7.63092,-5.48848 5.44034,-1.10733 7.63093,2.74425 8.71417,12.08429 8.18459,-5.48848 39.79152,-0.55367 -9.8215,-66.463638 10.54367,-0.04815 -19.643,-15.045192 0.0241,9.773357 -24.8667,0.02407 -0.12036,18.656033 -7.14947,-0.0241 -0.91475,13.76936 -29.60894,0.64995 0,0 z","name":"Mauritania"},"sn":{"path":"m 270.94912,158.2455 -4.59781,1.13139 -9.48449,6.90876 -2.16651,3.85157 -0.67403,3.82749 3.44234,2.47945 11.67507,-0.14443 7.51056,-2.02208 0.84253,3.68307 -0.69809,4.88667 0.1685,0.0722 -18.65604,0.28887 3.00904,7.22169 1.63692,-4.4293 22.36317,1.87764 0.14444,0.14443 2.33501,0.0963 7.14948,0.28887 0.28887,-4.21266 -8.64196,-10.37516 -9.62893,-13.09534 -6.01807,-2.47944 z","name":"Senegal"},"gm":{"path":"m 258.57595,178.70696 -0.31294,2.67202 16.65804,-0.24072 0.84253,-2.47945 -0.36109,-2.50352 -4.79039,1.94986 -12.03615,0.60181 0,0 z","name":"Gambia"},"gw":{"path":"m 262.69231,193.60772 3.37013,6.66802 9.46042,-8.13644 0.0963,-2.50352 -11.14547,-1.61284 -1.78136,5.58478 0,0 z","name":"Guinea-Bissau"},"gn":{"path":"m 267.07347,201.81637 7.31799,11.26584 9.53263,-8.28087 9.77336,-0.4333 8.13644,10.80846 6.90875,4.54967 2.59981,-5.05518 2.31094,-1.29991 -0.16851,-11.12141 -4.59781,-13.19162 -14.10637,1.5647 -17.45242,-1.39619 -0.0963,4.47744 -10.15852,8.11237 0,0 z","name":"Guinea"},"sl":{"path":"m 275.52286,214.3099 13.60085,13.14348 9.70114,-11.77136 -6.06622,-9.50856 -8.35309,0.84253 -8.88268,7.29391 0,0 z","name":"Sierra Leone"},"lr":{"path":"m 290.54398,228.89772 26.43139,17.66907 -0.62588,-13.3842 -7.99201,-9.41227 -7.79942,-6.90875 -10.01408,12.03615 0,0 z","name":"Liberia"},"ci":{"path":"m 319.19002,247.09638 10.30295,-7.29391 12.80647,-2.23872 13.07126,2.81646 -6.66803,-10.0863 -1.94986,-6.16251 1.94986,-18.22274 -11.67507,0.55367 -5.29591,-5.05519 -11.1214,0.28887 -5.29591,0.84253 0.55366,12.32502 -2.79238,1.1314 -3.34606,6.16251 8.61789,10.0863 0.84253,14.85261 0,0 z","name":"Cote d'Ivoire"},"ml":{"path":"m 288.83484,172.68888 7.41427,-5.07926 41.21179,-0.24072 -9.53263,-66.29514 10.88068,-0.31294 52.64614,40.17669 7.07726,1.01103 -2.67203,22.3391 -33.09942,3.00904 -25.54072,19.06527 -4.64595,13.04719 -17.7413,0.74624 -4.52559,-13.02312 -13.60085,0.9629 0.52959,-4.2608 -8.40124,-11.14548 0,0 z","name":"Mali"},"bf":{"path":"m 363.77194,168.9336 8.76232,-0.6981 14.37116,20.31703 -13.33605,10.06223 -9.653,-2.47945 -12.97497,0.1685 -2.09429,7.60685 -10.88069,0.52959 -2.98496,-4.06822 3.85157,-12.37316 24.93891,-19.06527 0,0 z","name":"Burkina Faso"},"ne":{"path":"m 388.56641,187.51742 6.13844,-0.14443 5.53663,-8.30495 9.29191,-1.66099 9.89372,6.04215 21.11142,0.60181 16.32102,-6.64396 6.13844,-5.27183 0.45737,-6.93283 11.38621,-11.48249 3.00903,-25.34814 -7.48648,-15.69514 -19.16156,-4.67003 -44.34119,34.56783 -6.28287,-0.60181 -2.6961,24.0001 -22.62797,2.26279 13.31198,19.28192 0,0 z","name":"Niger"},"gh":{"path":"m 348.72674,223.74625 2.6961,6.33101 7.02912,11.02512 3.89971,-0.14443 10.63996,-6.04215 -0.74624,-34.39933 -8.23273,-2.40723 -11.53064,0.31294 -3.75528,25.32407 0,0 z","name":"Ghana"},"tg":{"path":"m 374.91741,233.85661 6.45138,-3.77935 -0.14443,-24.91484 -4.18858,-6.78839 -2.6961,2.2628 0.57773,33.21978 0,0 z","name":"Togo"},"bj":{"path":"m 383.31865,229.61989 h 5.10333 l 0.28887,-14.49153 6.45138,-9.36413 -0.28887,-16.29695 -5.84957,-0.14444 -10.03816,7.84758 4.18859,7.992 0.14443,24.45747 0,0 z","name":"Benin"},"ng":{"path":"m 390.20333,229.33102 9.43635,0.45737 11.3862,12.68611 5.53663,1.51656 4.33301,-2.11837 6.59582,-0.91474 2.23872,-9.19563 8.97897,-5.89771 9.72521,-0.45738 17.81351,-32.76241 -0.28887,-7.3902 -8.23273,-6.33101 -16.46545,7.24576 -22.02617,-0.31294 -10.49552,-6.64395 -7.48649,1.66098 -3.89971,6.7884 -0.28887,19.16155 -6.28287,8.90676 -0.57774,13.60085 0,0 z","name":"Nigeria"},"tn":{"path":"m 422.31579,7.7694978 13.31199,-5.3681247 4.38116,2.8405323 0.1685,3.4664124 -2.04614,2.6720262 0.31294,4.742245 2.04614,1.107326 v 8.521597 l -2.35908,3.947858 0.31294,2.527593 8.93082,3.153472 -7.19762,11.193623 -2.81646,-0.168506 -0.48144,9.003043 -3.1294,0.481446 -2.67203,-2.359086 0.62588,-9.147477 -8.76232,-8.521597 -1.10733,-7.414271 4.23673,-3.321978 -3.75528,-17.3561342 0,0 z","name":"Tunisia"},"ly":{"path":"m 434.68896,57.599175 3.75528,-0.62588 1.10732,-8.666031 h 1.87764 l 7.67907,-12.613889 18.9449,5.512559 5.17555,8.04015 18.63197,8.521597 9.70114,-4.092292 -0.93882,-4.092292 -4.23673,-4.092293 0.48145,-2.840532 6.88468,-5.825498 h 13.62492 l 5.17555,6.932824 10.9529,1.588773 1.42027,88.802739 -8.13644,-0.31294 -49.15566,-25.56479 -5.31998,3.00904 -20.19666,-5.05518 -5.48849,-7.245767 -7.99201,-1.107326 -4.06822,-7.245765 0.12037,-33.027207 0,0 z","name":"Libya"},"eg":{"path":"m 535.50378,45.635238 6.42731,0.168506 12.5176,3.466413 5.94586,0.168506 7.36612,-6.162511 h 3.44234 l 6.2588,3.466412 h 7.91979 l 1.42027,-0.09629 5.00704,14.39524 1.42027,4.645956 1.32397,6.956897 -2.35908,1.733206 -4.06822,-2.046146 -4.6941,-15.309988 -4.23673,-0.31294 -0.31294,5.199618 2.81646,9.003044 22.55575,27.923877 0.48145,11.988012 -6.57174,7.58278 -61.7214,-0.6981 -0.93882,-72.072493 0,0 z","name":"Egypt"},"td":{"path":"m 465.35708,173.07404 0.31294,-7.10133 11.41027,-11.09734 3.05718,-27.24985 -7.60685,-14.53967 5.31998,-2.72018 51.51474,26.84063 -0.31294,26.3351 -9.07526,7.72721 v 13.57679 l 5.94586,11.50656 h -10.49552 l -17.38021,17.18763 -0.45737,5.19962 -12.83054,-0.16851 -0.16851,2.35909 -7.31798,-0.9629 -5.00704,-9.46041 -3.75528,-1.85357 0.48144,-2.88868 4.71818,-3.61085 v -16.89876 l -6.5236,-1.01103 -7.87164,-5.84957 6.04215,-5.31998 0,0 0,0 z","name":"Chad"},"sd":{"path":"m 531.21891,164.48022 0.4333,-28.47754 5.92179,0.16851 -0.67402,-15.81551 62.10655,0.55367 8.88268,-8.9549 19.16156,30.64404 -10.49553,12.37317 v 18.89676 l -16.5136,35.50666 -5.68107,2.50352 1.80543,9.89372 h 7.07726 l 9.60485,13.93786 -7.70314,0.98697 -1.97393,3.58677 -0.19258,5.17555 -23.10941,-0.40923 -2.35909,-3.58678 -16.15252,-0.91474 -29.65708,-30.52369 2.96089,-1.78135 0.79439,-7.17355 -7.10133,-4.18858 -6.47545,-12.7824 0.36108,-11.89172 8.97897,-7.72721 0,0 z","name":"Sudan"},"cm":{"path":"m 429.32083,241.15052 7.75128,7.12541 -0.55366,11.02511 42.5117,-0.98696 3.46641,-3.89971 -12.18059,-13.11941 -1.80542,-4.74225 7.75128,-14.5156 -5.27183,-9.62892 -4.42931,-2.38316 v -4.88668 l 5.1274,-3.34605 0.28887,-15.2137 -4.06822,-0.45737 -0.0722,7.992 -17.86165,33.34015 -10.92883,0.55366 -7.48648,5.15148 -2.23873,7.992 0,0 z","name":"Cameroon"},"er":{"path":"m 619.22727,169.94464 -0.60181,-14.17859 9.53263,-11.12141 2.57574,1.97393 4.6941,15.69515 22.53168,16.77839 -4.09229,5.03112 -16.48953,-14.17859 h -18.15052 l 0,0 z","name":"Eritrea"},"dj":{"path":"m 654.78207,186.4101 -1.37212,8.08829 9.53263,-0.14443 0.14443,-11.89172 -3.49048,-2.14244 -4.81446,6.0903 0,0 z","name":"Djibouti"},"et":{"path":"m 601.84706,211.01199 17.52464,-38.99713 17.40428,0.0963 15.43035,13.40828 -1.08325,11.04919 h 11.96393 l 1.22769,6.64396 19.35414,11.57878 11.93986,0.6018 -22.70018,24.38525 -31.17364,9.60485 h -7.72721 l -13.76936,-11.74728 -5.44035,-2.28687 -10.54367,-15.52664 -6.95689,0.0963 -0.81846,-7.1254 5.36812,-1.78136 0,0 z","name":"Ethiopia"},"so":{"path":"m 665.03687,194.8354 9.8215,6.6921 2.91275,-0.14443 24.38525,-8.37716 2.76832,8.93082 -1.94986,7.53464 -5.27184,4.18858 -13.16755,-0.84253 -18.84862,-11.57878 -0.64995,-6.40324 0,0 m 39.06936,-2.38316 10.5196,-4.04414 3.7312,2.23872 -0.40923,9.34006 -9.70114,27.63501 -52.5017,56.23291 -6.09029,-4.18858 -0.40923,-23.7353 7.89571,-9.07526 16.75433,-5.17555 24.57783,-25.94994 6.4273,-5.72921 1.80543,-8.37717 -2.59981,-9.17155 0,0 z","name":"Somalia"},"cf":{"path":"m 472.26583,240.59686 11.21769,12.13244 4.42931,-5.72921 7.05318,0.28887 1.51656,-5.58477 6.93282,-4.33302 14.39525,9.91779 8.30494,-8.23273 32.23282,1.42027 -29.8978,-30.8607 4.02007,-2.50352 0.55366,-5.44034 -6.78839,-3.20162 h -9.96593 l -16.05623,15.9118 -0.55367,6.54767 -12.73425,-0.40923 -0.40923,2.79238 -8.30494,-0.84253 -7.48649,14.22674 1.54063,3.89971 0,0 z","name":"Central African Republic"},"gq":{"path":"m 426.96174,248.68516 -1.10732,4.74224 3.32198,1.80542 3.17754,-2.38315 -1.10732,-4.88668 -4.28488,0.72217 0,0 m 9.99001,12.71017 -0.14443,3.34606 10.92883,0.55366 -0.14444,-3.77935 -10.63996,-0.12037 0,0 z","name":"Equatorial Guinea"},"ga":{"path":"m 449.9508,261.2509 -0.28887,5.99401 -13.57678,-0.28887 -8.30495,16.05623 19.52264,21.35213 4.83854,-4.04414 -0.14444,-4.18858 -3.32197,-1.54063 v -2.93682 l 7.48648,-4.74225 6.64396,5.03111 7.34206,0.14444 -0.14444,-25.25185 -11.62692,-0.55367 -0.14444,-5.2959 -8.28087,0.26479 0,0 z","name":"Gabon"},"cg":{"path":"m 461.04813,260.98611 -0.14443,3.49048 11.50656,0.28887 0.40923,29.87373 -10.5196,-0.28887 -6.09029,-4.74224 -4.71817,2.64795 -0.21665,1.32398 2.4313,1.17954 0.6981,6.13844 -6.49953,5.58478 1.3962,2.93682 7.19762,-5.58478 h 3.46641 l 1.10733,3.34605 4.57373,1.94986 14.68411,-12.42131 -0.28887,-9.07526 3.05719,-7.3902 9.41227,-6.98097 2.52759,-23.61493 -6.6921,0.0241 -7.75128,10.61589 -19.54672,0.6981 0,0 z","name":"Congo"},"ao":{"path":"m 450.33596,310.83986 4.18858,5.44034 5.41627,-5.1274 -1.58878,-5.31998 -1.34804,-0.0963 -6.66803,5.10333 0,0 m 4.98296,8.37716 8.20866,30.64405 -0.19258,9.67706 -12.01208,12.90276 -1.80542,20.96698 46.21883,0.40923 15.02112,5.44034 12.39724,-1.61284 -7.22169,-9.05119 0.0241,-25.85366 14.20266,-0.60181 v -10.08629 l -11.53064,-0.48145 -2.31094,-23.87973 -4.8626,0.0722 -2.62389,-2.35909 -2.8646,0.14444 -3.80343,7.36612 H 487.5277 l -3.39419,-3.41827 1.01103,-4.83853 -3.996,-5.84957 -25.82959,0.40923 0,0 z","name":"Angola"},"cd":{"path":"m 457.14842,316.80979 24.81855,-0.4333 5.03111,7.14947 -0.19258,5.27184 1.85357,1.68506 h 12.32502 l 3.53863,-6.9569 h 5.03111 l 2.04615,2.07022 6.90875,-0.19258 2.04615,24.26489 11.93986,0.38516 v 1.87764 l 32.08839,14.46745 1.49248,2.81646 h 6.71618 l -0.74625,-10.15851 -12.13244,-5.8255 0.74624,-7.70314 5.22369,-12.22873 11.93987,-0.38516 -10.2548,-34.03824 0.19257,-14.46746 16.22474,-25.37221 0.19258,-3.5627 -2.4313,-1.32398 0.0963,-6.88468 -2.96089,-0.2648 -2.98497,-3.80342 -48.98714,-2.21465 -8.97897,8.73825 -14.70818,-9.67707 -5.17555,3.17754 -3.75528,31.60694 -9.29191,7.17355 -2.79239,6.35509 0.50552,9.41227 -16.75433,13.69715 -4.45337,-2.02208 0.6018,2.62388 -4.95889,4.74225 0,0 z","name":"Congo"},"rw":{"path":"m 573.75468,278.75147 6.76432,6.23473 -0.28887,6.66803 -10.49553,0.21665 v -7.36613 l 4.02008,-5.75328 0,0 z","name":"Rwanda"},"bi":{"path":"m 569.87904,293.9411 10.27887,-0.21666 -2.67202,9.00305 -2.59981,2.26279 h -3.17755 l -2.26279,-6.09029 0.4333,-4.95889 0,0 z","name":"Burundi"},"ug":{"path":"m 574.91015,276.80161 7.29391,6.83654 4.57374,-2.91275 12.37316,-2.02208 2.11837,0.21666 0.79438,-4.6941 6.98097,-14.68411 -5.87364,-12.22874 -19.0412,0.12037 -0.12036,5.03111 2.55167,2.45537 -0.38516,5.03112 -11.26584,16.85061 0,0 z","name":"Uganda"},"ke":{"path":"m 605.07275,246.54272 6.40324,12.49353 -7.67907,16.10437 -1.01104,4.88668 38.34719,23.71122 11.89172,-18.68011 -6.01808,-4.88667 -0.12036,-24.6019 7.53463,-8.23273 -12.01208,3.996 -9.07526,0.12036 -14.20266,-11.98801 -4.47745,-1.92578 -8.30495,0.77031 -1.46841,2.45538 0.19258,5.77735 0,0 z","name":"Kenya"},"tz":{"path":"m 604.44687,354.62738 42.05432,-5.15147 -9.46041,-18.29495 -0.50552,-17.52464 3.05718,-8.37717 -40.00817,-25.13149 -12.54168,2.07022 -4.35708,3.22569 -0.38516,7.34205 -2.81646,10.18259 -2.93682,3.49049 -4.21266,0.38515 8.06423,27.94795 13.16755,6.18659 9.07526,0.26479 1.80542,13.3842 0,0 z","name":"Tanzania"},"zm":{"path":"m 517.73842,386.59541 7.63092,10.59181 11.8195,0.72217 4.18858,2.31095 12.37317,0.14443 10.66403,-14.9489 29.80152,-13.33606 2.59981,-11.74729 -3.46641,-16.82654 -15.55071,-8.85861 -10.37517,0.72217 -5.17554,11.45842 0.14443,5.22369 12.22873,5.94586 0.72217,12.92683 -10.5196,0.57773 -2.59981,-4.35709 -29.22378,-12.46945 -0.8666,9.58078 -13.81751,0.4333 -0.57773,21.9058 0,0 z","name":"Zambia"},"mw":{"path":"m 596.23821,373.83709 7.48649,7.8235 -0.14443,10.01408 1.44434,4.21265 9.94186,-10.73625 -1.15547,-13.649 -5.31998,-4.06822 -4.74225,-23.95194 -8.20865,-0.28887 3.73121,17.25984 -3.03312,13.38421 0,0 z","name":"Malawi"},"mz":{"path":"m 581.8189,455.39407 6.47545,5.36812 15.26185,-9.29191 2.45537,-13.79343 v -22.77241 l 24.48154,-20.02816 4.18858,0.14444 14.82854,-14.22674 -2.31094,-29.32007 -39.31008,4.9589 1.15547,8.85861 6.76432,5.22369 1.58877,15.95994 -13.23977,12.92683 -3.17754,-7.24577 0.57773,-9.58078 -7.63092,-8.28087 -18.72825,8.71417 17.42835,8.85861 0.57773,25.82959 -11.53063,17.11541 0.14443,20.58183 0,0 z","name":"Mozambique"},"zw":{"path":"m 542.07552,404.89036 21.59286,24.38525 16.56175,4.21265 11.09733,-17.40427 -0.8666,-23.06128 -18.00609,-9.29191 -6.76431,3.05719 -10.0863,15.3822 -13.96194,-0.14443 0.4333,2.8646 0,0 z","name":"Zimbabwe"},"na":{"path":"m 474.40826,476.28883 8.06423,0.57773 4.74224,4.79039 11.24177,0.14444 2.74424,-31.91988 v -20.89477 l 7.19762,-1.44434 2.74425,-21.9058 18.29495,-0.57773 6.47545,-5.36813 -10.9529,-0.4333 -14.82854,2.02208 -15.98401,-5.80143 h -44.91893 l 1.15547,12.75832 14.97298,22.05024 -2.59981,11.31398 0.14443,5.94586 11.50656,28.74234 0,0 z","name":"Namibia"},"bw":{"path":"m 503.19874,450.45924 5.17555,1.58877 -0.72217,14.80447 5.31998,0.72217 12.22873,-11.02511 14.68411,1.58877 3.89972,-9.86965 18.58382,-16.97098 -22.31503,-25.68515 -0.28887,-4.21265 -2.45538,-0.72217 -6.76431,6.23473 -17.57279,0.4333 -2.45537,21.9058 -6.90876,1.58877 -0.40923,19.61893 0,0 z","name":"Botswana"},"sz":{"path":"m 581.09673,457.12727 -6.04215,1.01104 -2.59981,7.10133 4.62189,4.21265 h 5.60885 l 4.74224,-6.81246 -6.33102,-5.51256 0,0 z","name":"Swaziland"},"ls":{"path":"m 548.69541,484.54563 7.34205,-5.65699 3.46641,0.14443 4.18858,5.22369 -0.4333,5.22369 -7.05318,2.59981 v 2.02208 l -7.77536,-0.43331 -1.87764,-5.65699 2.14244,-3.46641 0,0 z","name":"Lesotho"},"za":{"path":"m 564.94421,432.16429 -19.01712,17.57278 -4.52559,10.85661 -15.06927,-1.87764 -12.54167,11.14548 -8.32902,-0.81846 0.67403,-15.40627 -2.9609,-1.03511 -2.07022,31.51065 -14.78039,-0.14444 -4.45338,-5.24776 -6.5236,-0.0722 5.94586,17.06727 10.61589,10.03815 -7.58278,8.83454 4.91076,11.07326 11.36212,4.33302 9.05119,-7.70314 25.92588,0.14443 1.85357,-2.31094 11.50656,-2.02207 38.92492,-38.75642 -0.14443,-12.20466 -4.16451,5.3922 h -6.23473 l -7.58278,-6.35509 3.85157,-9.58078 6.61989,-1.34805 -0.60181,-19.69115 -14.66004,-3.39419 0,0 z m -9.1234,44.53377 3.63492,-0.14444 5.89771,6.40324 -0.1685,7.41427 -6.90876,3.49048 -0.4333,2.45538 -10.54367,0.12036 -3.2979,-7.94386 3.00903,-5.8255 8.81047,-5.96993 0,0 z","name":"South Africa"},"mg":{"path":"m 704.90061,358.23823 -5.1274,12.18059 -8.78639,15.50256 -15.38221,1.10733 -6.59581,7.75128 1.10733,23.63901 -9.53264,11.07326 1.10733,18.82455 8.06422,9.21969 9.53264,-1.10733 9.53263,-7.02911 -2.19058,-11.07326 21.97802,-38.03425 -4.40523,-4.79039 4.40523,-9.21969 4.76632,1.46841 1.46841,-3.68306 -4.40524,-18.82455 -2.57573,-7.75128 -2.9609,0.74624 0,0 z","name":"Madagascar"}}});
 
 
assets/jqvmap/maps/continents/jquery.vmap.asia.js DELETED
@@ -1,2 +0,0 @@
1
- /** Add World Map Data Points */
2
- jQuery.fn.vectorMap('addMap', 'asia_en', {"width":950,"height":550,"pathes":{"id":{"path":"m 615.27242,460.80117 -3.29462,12.37981 -17.87084,6.03301 -5.34842,-6.27548 -2.59577,0.71313 4.84924,18.71232 7.25958,0.81296 9.6842,3.66545 v 3.66545 l 4.43562,-0.81296 6.46089,-8.94255 v -7.31664 l 3.63692,-7.31663 4.03627,0.81296 -4.84923,-10.16912 -0.74165,-6.54647 -5.66219,0.58476 0,0 m -84.43367,-9.74124 -0.39934,3.25183 9.6842,16.27345 h 2.82396 l 20.18136,33.75921 8.07254,0.81296 4.03627,-11.79505 -6.46088,-4.06479 -1.21231,-6.50368 -36.7258,-31.73393 0,0 m 95.62969,44.98374 3.22331,3.9507 -2.09658,5.93318 v 1.12673 h 4.76366 l 1.68297,-14.83294 1.54034,0.42787 2.79544,13.54932 2.66708,0.71313 2.52445,-5.79056 -2.52445,-8.75714 -2.09658,-3.80807 6.58925,-4.80644 -1.54035,-2.12511 -6.304,4.09332 h -1.68296 l -3.08069,-4.52119 0.98411,-1.98248 5.19153,-2.53872 7.84434,2.3961 2.38183,-0.14263 5.89039,-5.5053 -2.38183,-2.39609 -5.46252,4.23594 h -3.50856 l -5.31989,-2.53871 -3.77955,0.14262 -4.20742,6.77466 -2.66707,11.72373 -1.42625,4.67808 0,0 m 35.17119,-26.5424 -2.66708,6.48941 4.20742,5.5053 h 1.39772 l 1.82559,-3.66545 0.98411,-1.26935 -1.82559,-1.98248 -2.66708,-0.98411 -1.25509,-4.09332 0,0 m 8.27222,21.32235 -5.74777,1.26936 -1.68297,1.83985 1.39772,2.39609 3.77955,-1.41198 2.38183,-1.41198 3.50856,2.82396 1.54034,-1.26935 -2.79544,-3.39447 -2.38182,-0.84148 0,0 m -95.30166,18.35576 -3.92217,2.68134 0.84149,2.25347 12.47964,2.82396 6.304,1.12674 2.66707,2.82396 7.14549,0.5705 3.36593,2.82396 3.08069,-0.71312 2.8097,-2.53871 -5.19153,-2.39609 -4.4784,-3.80808 -11.63816,-2.82396 -13.46375,-2.82397 0,0 m 40.79059,12.27997 -3.08068,1.69723 1.82559,1.98248 4.47841,-1.69723 -3.22332,-1.98248 0,0 m 5.3199,-1.26936 0.55623,2.68134 3.22331,0.84149 1.2551,-1.55461 -1.39772,-2.12511 -3.63692,0.15689 0,0 m 7.71598,7.05991 -3.92217,0.5705 3.50856,2.96659 h 2.79544 l -2.38183,-3.53709 0,0 m 1.11247,-4.66382 -0.84149,1.69723 6.30401,0.98411 4.90628,-2.82396 -2.79544,-0.84149 -4.47841,1.26936 -1.68297,-1.41198 -1.41198,1.12673 0,0 m 57.39207,-40.47681 -5.94744,0.67033 -3.82233,2.79544 1.58313,3.19479 6.47515,1.19804 v 1.19805 l -4.09332,3.32315 1.98248,6.91728 1.98248,0.12836 1.71149,-6.78892 h 3.16626 l 1.32641,6.6463 15.44623,12.77915 0.39935,9.98371 5.2771,5.71924 2.38183,-0.12836 0.52771,-35.25676 -8.97108,-6.24695 -8.45763,5.71924 -3.0379,1.86838 -5.02038,-3.19479 -0.12836,-10.11207 -2.78118,-0.41361 0,0 z","name":"Indonesia"},"ye":{"path":"m 355.61037,425.50163 3.0379,3.39446 4.10758,-2.48167 1.4833,-0.49918 -1.88265,-1.8256 -3.6084,1.06969 -3.13773,0.3423 0,0 m -39.40714,-14.86147 2.0538,6.10433 v 5.9617 l 4.9348,4.4784 34.77184,-14.1626 0.32804,-3.89365 -5.57662,-10.01224 -13.99146,4.46415 -8.02975,7.90139 -9.31338,-5.5053 -5.17727,4.66382 0,0 z","name":"Yemen"},"my":{"path":"m 590.2561,472.95278 4.30725,4.97759 16.51591,-5.71924 3.2661,-12.608 7.35942,-0.52771 6.73188,-4.87776 -8.72862,-6.36105 -1.99674,-3.4943 -4.30726,7.94419 1.58313,4.56398 -2.62429,3.80807 -4.94906,-1.26936 -11.99472,8.79993 0.31377,5.09169 -5.47677,-0.32803 0,0 m -44.82687,-24.91649 2.86676,6.43236 0.64181,8.35779 3.83659,5.94744 9.25633,5.6194 3.50856,0.32804 -0.64181,-5.79055 -3.0379,-7.38795 -4.44988,-9.456 -0.37083,1.65444 -5.36268,-0.24246 -3.85086,-5.53382 -2.39609,0.0713 0,0 z","name":"Malaysia"},"bn":{"path":"m 612.5483,453.45602 -4.10759,4.97759 3.36594,1.05542 1.8969,-2.65281 -1.15525,-3.3802 0,0 z","name":"Brunei Darussalam"},"tl":{"path":"m 650.15836,523.58445 -7.28811,6.0758 0.69886,1.55461 3.08069,-0.5705 3.63692,-3.39446 7.14549,-0.98411 -1.39772,-2.39609 -5.87613,-0.28525 0,0 z","name":"Timor-Leste"},"ph":{"path":"m 626.24024,422.47799 -1.22657,2.33904 -0.6846,2.88101 -6.81744,8.65731 0.41361,1.7828 2.86675,-0.41361 8.85698,-9.89814 -3.40873,-5.34841 0,0 m 11.03913,-3.29463 -0.14262,7.14549 2.59576,2.61002 0.95559,5.07743 2.59576,0.55624 1.22657,-3.16626 -2.03953,-1.51182 -0.54197,-8.92829 -4.64956,-1.78281 0,0 m 7.37369,2.75265 -0.14263,6.31827 1.49756,2.4674 2.59576,-3.02364 -0.68459,-5.49104 -3.2661,-0.27099 0,0 m 1.62592,-5.5053 2.59576,3.43725 1.22657,3.29463 h 2.32478 l -0.41361,-5.63367 -2.59577,-1.78281 -3.13773,0.6846 0,0 m 5.0489,12.92178 0.54197,4.12184 -4.77791,3.85086 -3.9507,0.41361 -4.22169,4.53546 0.14263,2.06805 3.9507,-1.24083 2.72412,-1.7828 2.32478,5.90465 4.09332,2.88101 1.64018,-0.55623 1.49756,-1.78281 -3.2661,-3.29462 1.91117,-1.51182 2.18215,1.7828 1.49756,-2.4674 -1.49756,-3.02364 -0.27098,-6.73187 -4.5212,-3.16626 0,0 m -22.22089,-41.90306 -3.67971,2.61002 -0.41361,8.2437 5.7335,11.1247 1.91117,1.51182 2.45314,-1.65444 4.22169,0.68459 0.81295,3.70824 3.13774,0.27099 1.49756,-2.0538 -1.91117,-2.61002 -2.32478,-2.19642 -4.90628,-0.54197 -2.59576,-4.26447 2.99511,-4.53546 0.27099,-3.97922 -2.03953,-5.07743 -5.16301,-1.24083 0,0 m 1.91117,24.58845 1.08395,3.85086 1.91116,1.24083 1.3692,-1.7828 -2.18216,-3.02364 -2.18215,-0.28525 0,0 z","name":"Philippines"},"cn":{"path":"m 584.10898,383.45594 -3.40872,0.95558 -2.45314,3.02364 2.03953,3.97922 2.99511,0.27099 3.40872,-3.02364 0.81296,-3.97922 -3.39446,-1.22657 0,0 m -127.54903,-142.76706 -4.93481,12.40832 -6.80319,-0.35656 -7.174,15.70295 6.09006,7.75877 -12.55095,17.32887 -6.44663,-1.08394 -4.30725,5.41972 1.06968,3.25184 5.02038,0.35656 2.51019,5.77629 5.02038,1.08395 15.4177,19.86758 v 10.11208 l 7.53057,4.69234 8.24369,-1.44051 10.39733,6.13285 12.55095,3.6084 6.09006,-0.72738 6.81745,-0.72739 14.33375,-9.38469 4.66382,0.72739 1.78281,4.23595 3.9507,1.18378 5.37694,7.94418 -3.57988,7.94418 2.15363,5.41973 6.09007,2.16789 1.06968,6.50368 7.17401,0.72738 1.06968,-3.25184 10.39732,-5.41973 6.44663,0.35657 7.53057,8.30074 5.02038,-2.16789 3.22331,0.35656 1.44051,3.97922 2.51019,0.35656 3.57987,-5.04891 14.33376,-5.41972 12.90751,-15.53181 4.30726,-14.80441 -0.35656,-9.75551 -5.37694,-1.08395 3.22331,-3.6084 -0.71312,-5.77629 -13.62064,-13.72047 v -6.86023 l 3.93644,-5.04891 3.93643,-1.81133 0.35656,-3.97922 H 598.2288 l -1.79707,5.41973 -4.66382,-1.08395 -5.7335,-6.13285 3.57988,-9.38469 5.02038,-5.41973 4.66382,0.35656 -0.71313,8.30075 2.51019,2.16789 6.09007,-6.13285 2.15363,-0.35656 -0.71313,-4.69235 5.73351,-6.86023 4.30725,0.35656 2.51019,-7.94418 2.93807,-1.55461 0.29951,-4.94907 -2.85249,-2.99511 -0.24246,-7.81582 5.49104,-0.35656 -0.35656,-20.15284 -3.85086,2.31052 -1.44051,5.16301 -6.43236,-0.0143 -18.64101,-10.48289 -13.46375,-16.23066 -13.66342,-0.14263 -3.48004,3.02364 4.42136,10.12633 -1.54035,9.49879 -5.5053,2.28199 -3.09495,-0.24246 -0.2282,9.39895 3.22331,0.72739 5.73351,-2.52446 7.53057,3.6084 v 3.6084 l -5.37694,0.35656 -4.30726,9.38469 -3.93644,0.35656 -13.97719,18.41282 -14.69032,6.50367 -10.04076,0.72739 -6.80319,-4.69235 -9.6842,5.06317 -10.39732,-3.25184 -2.51019,-6.86023 -17.55707,-1.08395 -9.31337,-15.16098 h -3.93644 l -3.16626,-7.03138 -3.76528,-0.29951 z","name":"China"},"tw":{"path":"m 623.51612,352.27824 -5.04891,3.85086 -0.27099,7.41647 4.36431,5.07743 1.08395,-0.95558 -0.12836,-15.38918 0,0 z","name":"Taiwan"},"jp":{"path":"m 646.00799,306.7953 -2.32478,2.33905 0.95558,3.29462 2.03953,0.14262 1.3692,7.14549 1.64018,1.7828 2.86675,-2.61002 1.22657,-4.67808 -3.55135,-5.07743 -4.22168,-2.33905 0,0 m 12.55095,-4.66381 -3.9507,3.70823 -0.14262,4.26447 0.95558,1.24083 5.31989,-4.53545 -0.41361,-4.53546 -1.76854,-0.14262 0,0 m -5.46252,-8.79993 -6.96007,7.9727 1.22657,1.92543 3.40873,0.41361 6.40383,-4.94906 4.50694,-0.82723 4.09332,4.80645 3.13773,-1.09821 1.22657,-4.67808 5.86187,-0.14263 5.7335,-6.87449 -2.99511,-11.40996 -1.3692,-6.04728 2.99512,-2.4674 -6.81745,-10.29748 -1.76854,0.14262 -3.67971,4.12185 v 3.43725 l 1.64018,1.92543 0.54197,9.07091 -4.22168,5.22006 -2.45314,-1.51182 -1.91117,4.26447 -0.41361,3.97922 1.49755,2.33904 -0.95558,1.78281 -3.13774,-2.61003 h -2.18215 l -1.91117,1.09821 -1.49756,0.41361 0,0 m 11.738,-62.09868 -2.18216,1.92543 1.09821,4.12184 1.91117,1.92543 -0.14263,6.31827 -2.45314,0.95558 -1.91117,4.26447 5.59088,7.68746 3.67971,-1.24084 0.6846,-1.92543 -3.9507,-3.56561 2.45314,-3.16626 2.59577,0.41361 2.03953,2.19642 0.14262,-4.53546 5.59088,-4.53546 3.13774,-0.82722 -2.59577,-4.39283 -1.22657,-1.92543 -2.03953,1.36919 -1.76854,2.19642 -3.82233,-0.82722 -3.9507,-2.61003 -2.88101,-3.82233 0,0 z","name":"Japan"},"ru":{"path":"m 222.95538,214.51729 -2.13937,-0.21393 -3.85086,4.60676 v 2.15363 l 1.28362,0.49919 2.49593,0.0713 4.13611,-3.3802 0.57049,-1.15526 -2.49592,-2.5815 0,0 m 462.45974,12.45112 -3.82233,5.36267 0.27098,2.61003 1.91117,-0.82722 4.49267,-5.63367 -2.85249,-1.51181 0,0 m 5.04891,-7.83009 -1.3692,3.70824 0.14263,2.4674 2.32478,-1.51182 2.18215,-4.39283 v -1.64018 l -3.28036,1.36919 0,0 m 8.04402,-32.70378 -1.76855,2.19642 0.14263,3.43724 1.64018,-0.14262 2.72413,-4.80644 -2.73839,-0.6846 0,0 m -3.2661,8.38632 v 6.04727 l 1.91116,0.6846 1.3692,-2.19642 v -4.66382 l -3.28036,0.12837 0,0 m -55.78042,-21.85007 -0.12836,8.79993 11.03913,17.04362 3.95069,14.83294 6.96008,13.19276 2.72412,0.95559 2.32478,-1.92543 1.08395,-3.16627 -9.95519,-10.85372 0.27099,-5.63366 2.18215,-0.95558 0.54198,-3.29463 -19.49677,-27.61209 -1.49755,-1.38346 0,0 m 76.91736,-27.3411 -2.72413,0.27098 1.64018,2.33904 3.40873,2.33905 0.95558,-1.09821 -3.28036,-3.85086 0,0 m 5.30563,1.65444 0.41361,2.33904 4.22168,1.24083 0.41361,-1.65444 -5.0489,-1.92543 0,0 m -439.95361,-93.832618 2.45314,0.984108 -1.72576,2.966589 v 4.207421 l -3.67971,2.224941 h -3.92217 l -2.21068,-2.724127 0.24246,-2.966588 1.72576,-2.224942 h 3.43725 l 3.67971,-2.467402 0,0 m 9.32764,-2.724127 v 2.966588 l 2.45314,1.98248 3.43724,-0.242462 2.95233,-2.724126 v -1.98248 h -2.6956 l -2.21068,0.741647 -1.72576,-1.98248 -2.21067,1.240833 0,0 m 14.00572,0.256724 1.72575,3.708235 3.43725,0.242462 2.45314,-0.984109 -1.22657,-3.465774 -3.19479,-0.741647 -3.19478,1.240833 0,0 m 13.99145,-4.949068 -2.6956,-0.499186 -2.45314,2.481666 1.22657,2.224941 0.74165,3.465774 3.19479,-2.467403 0.74164,-2.724127 -0.75591,-2.481665 0,0 m 14.97557,26.228634 -0.74165,3.465774 -5.64793,4.949068 -12.0375,2.724127 -9.82682,16.330498 -1.72576,4.706608 9.82683,2.48166 1.46903,-5.93317 2.95232,-9.156492 7.61615,-3.964959 6.38957,-4.949068 4.66382,-1.98248 h 2.45314 v -6.674824 l -5.3912,-1.996742 0,0 m -31.67689,36.126775 6.63204,0.74164 2.21068,7.6732 5.64792,5.93317 -1.96821,3.96496 h -3.43725 l -3.19479,-3.70823 -7.11696,-0.24246 -2.95232,-3.96496 v -2.72413 l 4.42135,-1.24083 -0.24246,-6.43236 0,0 m 103.64518,-84.376623 -3.19479,-1.982479 h -3.67971 l -0.74164,2.224941 -3.92218,2.224941 -2.95232,0.984109 -0.48492,2.966588 6.87449,0.499186 8.10107,-6.917286 0,0 m 7.60188,0.741647 -1.72575,3.708236 -3.43725,-0.242462 -5.40547,3.96496 -1.46903,4.949068 h 3.43725 l 1.96822,-3.223313 4.66382,3.465774 4.42135,-1.982479 3.19479,-2.724127 -1.22657,-4.207421 -1.72575,-2.966589 -2.69561,-0.741647 0,0 m 7.13123,2.724127 1.72575,6.931548 2.6956,6.432362 2.95233,-5.191529 5.64793,-1.240833 v -3.708236 l -3.67971,-2.724126 -9.3419,-0.499186 0,0 m 134.75157,-11.096181 3.83659,3.223312 2.72413,-1.126733 0.7987,-4.521195 -5.59088,-3.865122 -3.67971,2.424615 -8.95681,0.81296 v 4.036271 l -9.44174,0.156887 v 6.603512 l 11.03913,8.215168 2.88101,-2.09658 -0.64181,-5.804814 7.04565,-1.768543 -1.44051,-2.73839 -2.55297,-2.581502 3.97922,-0.969846 0,0 m 10.24043,-3.865123 2.55298,4.834969 9.92666,-1.126733 2.72413,-3.551349 -0.64181,-3.0664252 -2.72413,-1.1267331 -2.55298,1.9396923 -7.35942,1.611656 -1.92543,0.484923 0,0 m -0.64181,18.854951 -4.96333,-1.28362 -2.86675,3.066426 -1.28362,4.193158 6.71761,-0.64181 5.12022,-2.581502 -2.72413,-2.752652 0,0 m 128.63298,-27.8830777 -4.16463,-1.2836199 -4.79218,1.768543 -2.39609,3.5513486 3.0379,4.036272 8.00123,-3.5513489 1.59739,-1.7685431 -1.28362,-2.7526517 0,0 m -26.68503,98.6533297 2.51019,8.67156 5.02038,1.44051 5.02038,-7.94418 -2.86675,-5.419732 1.06968,-4.692344 h 7.53058 l -1.79707,3.608399 0.71312,13.007347 -10.75388,26.72782 1.06968,5.77629 -0.35656,9.75551 20.06726,29.25228 3.93643,1.08394 0.35656,-23.83254 3.93644,-3.6084 -4.30726,-9.38469 3.57987,-3.97922 -7.88713,-10.46863 -4.30726,0.35656 -1.42624,-17.32887 11.11044,-2.89528 0.71313,-5.06317 5.7335,-1.4405 3.22331,2.89527 3.93643,-15.88836 6.80319,-11.55258 5.37694,-2.895276 4.66382,0.356561 v -5.419729 l -7.53057,-1.440506 -10.39732,-8.671566 5.02038,-5.77629 -4.30726,-9.755512 3.57987,-3.608398 4.30726,5.77629 10.75389,3.979221 11.82356,1.083946 1.44051,-5.048905 -6.09007,-6.132851 6.80319,-9.384688 -15.4177,-5.419729 -3.93644,7.944182 -5.02038,-6.503675 -28.31095,-9.755512 -26.8847,4.692344 -3.93644,2.167892 v 2.167891 l 5.7335,2.895277 -0.71312,6.860235 -10.39732,-4.335783 -22.93401,9.028127 -3.93644,-8.300742 h -15.77426 l -7.17401,7.58762 -25.4442,-5.77629 -23.29057,4.692344 -2.86675,7.216797 3.57987,1.083946 -0.35656,5.419728 -22.57745,2.524453 1.44051,7.216797 -20.79464,-3.608399 5.02038,-9.384688 -21.15121,-1.083946 1.79707,9.755512 -6.80318,3.251837 -5.73351,-5.419728 -23.29057,3.979221 -8.95681,8.300743 -0.35656,5.048905 -5.73351,0.356561 -0.71312,-5.77629 18.28445,-15.888362 V 44.380597 l -11.82356,-3.251837 -15.4177,5.048905 -6.44663,-6.503674 h -2.86675 l -3.57987,7.216796 2.86675,3.251838 -20.43808,11.196018 -17.55707,13.36391 -10.75389,14.804417 v 6.132851 l 11.46701,4.692349 -5.7335,4.33578 -12.18013,-4.33578 -5.02038,4.33578 -7.53057,-8.671568 -1.44051,3.251837 8.24369,26.000431 2.15363,0.72739 5.73351,-2.89528 2.86675,2.16789 v 4.69235 l -5.37694,-2.16789 -3.22332,2.52445 2.15363,4.69234 -1.79707,12.27997 -11.11044,1.08394 -0.71312,-3.97922 6.44662,-3.97922 1.44051,-10.83946 -7.17401,-9.38469 -2.51019,-16.24492 -11.467,-1.81133 -1.06969,5.77629 2.15363,2.89528 -4.66382,3.97922 1.79707,10.83946 6.80319,2.89527 1.4405,7.94418 -6.81745,-4.33578 -17.55706,-3.25184 -2.15363,5.77629 -13.9772,5.04891 -2.15363,-3.6084 -18.28445,10.11207 -0.35656,6.86024 -7.17401,1.08394 2.15363,-5.0489 v -5.04891 l -7.17401,-2.52445 -4.66382,1.81133 3.93643,7.58762 2.86676,5.04891 v 3.97922 l -5.37695,-1.08395 -1.06968,-1.08394 -5.37694,5.77629 2.86675,5.0489 -12.18013,-0.35656 3.93644,5.06317 -1.06969,2.16789 h -6.44662 l -4.66382,-3.25184 -1.06968,-9.02812 -7.53057,-2.89528 v -3.6084 l 15.77426,3.25184 8.60025,0.72738 3.57988,-5.41973 -3.22331,-5.77629 -22.93401,-9.02812 -7.91566,1.96821 -2.70987,2.32478 0.84149,5.34842 3.36594,0.58476 -0.78444,8.41484 10.38306,24.38878 -7.50205,11.89488 -0.51344,2.68134 3.80807,2.68134 -3.43725,2.26773 -2.28199,0.0428 0.42787,10.4829 3.152,4.46415 0.0428,4.33578 4.03627,0.37082 6.17564,2.35331 6.5322,8.98534 0.0713,2.36756 -2.1251,3.63692 4.87775,-0.27098 4.7494,1.36919 6.4181,9.08518 15.80278,1.44051 -0.68459,10.81093 -5.44826,4.66382 1.12674,1.82559 -5.37694,5.77629 -1.42625,5.41973 3.22331,4.69234 10.39733,3.6084 4.30725,-2.52445 27.59783,10.46863 1.06969,-2.89527 -5.73351,-5.41973 v -6.86024 l -3.57987,-1.08394 0.71312,-5.77629 5.7335,-6.86024 -10.28322,-7.70172 0.71312,-10.71109 10.99635,-7.23106 12.90751,0.72738 2.15363,3.97922 13.26407,0.72739 9.6842,-5.41973 -5.02038,-5.41973 1.06969,-10.11207 25.08763,-12.27997 19.29709,8.70009 6.44663,-5.77629 18.99757,18.05626 14.33376,-1.44051 5.02038,5.04891 13.62063,1.4405 8.95682,-12.27996 11.467,5.06317 6.09006,1.08394 6.09007,-5.41973 -5.37694,-3.60839 4.66382,-7.2168 13.26407,4.33578 2.86675,5.77629 5.7335,0.35656 3.57988,-2.52445 9.6842,-0.35656 1.06968,2.52445 11.11044,0.72739 7.53057,-7.94418 15.41771,1.81133 4.66381,-1.81133 1.42625,-8.67157 -4.66382,-10.46863 4.66382,-3.97923 h 14.69032 l 13.97719,16.61575 17.91363,10.11207 h 5.37694 l 0.71312,-4.33578 6.44663,-3.97922 0.71312,23.47598 -5.7335,0.35656 v 5.77629 l 3.22331,3.97922 -0.59902,5.16301 2.38183,0.98411 1.4405,-3.6084 2.15363,0.72738 1.42625,1.44051 6.44662,-1.44051 6.44663,-18.78363 0.71312,-23.47599 -8.24369,-18.78364 -10.39733,-12.63652 -5.02038,0.72738 v 3.97922 l -12.18012,-4.69234 4.66382,-10.11207 3.93643,-26.72782 16.48739,-5.04891 7.88713,-5.0489 h 8.60025 l -2.15363,2.89527 2.15363,3.6084 7.53057,-7.94418 4.30726,0.35656 -0.71312,-4.69234 -6.81745,-1.44051 4.66382,-16.97231 6.14711,-5.81907 0,0 z","name":"Russian Federation"},"mv":{"path":"m 436.59252,455.60965 0.42788,3.72249 2.38183,0.87001 0.42787,-3.28036 -3.23758,-1.31214 0,0 m 3.0379,7.87286 -0.21393,4.59251 1.74002,0.87001 1.52608,-3.06643 -3.05217,-2.39609 0,0 m 0.44214,8.97108 -1.52608,1.52608 1.74002,1.52608 2.16789,-1.52608 -2.38183,-1.52608 0,0 z","name":"Maldives"},"lk":{"path":"m 471.02206,437.48208 0.35657,3.87938 0.35656,2.82397 -2.09658,0.35656 1.05542,6.34679 3.152,1.76854 4.89202,-2.82396 -1.39772,-6.68909 0.35656,-2.4674 -4.54972,-4.22169 -2.12511,1.0269 0,0 z","name":"Sri Lanka"},"mn":{"path":"m 461.40918,240.8315 8.30074,-11.01061 9.96945,4.60677 6.77466,1.81133 8.30074,-7.61614 -5.63366,-4.15037 3.70823,-5.23432 11.06766,3.90791 3.83659,6.28974 6.93155,0.18541 3.62266,-2.6956 7.45926,-0.29951 1.62592,2.76691 12.39406,0.62755 7.84435,-8.00123 10.85372,1.14099 -0.62755,10.89651 4.74939,1.08395 5.83334,-2.65282 6.17564,3.05216 -0.14262,1.54035 -4.47841,0.12836 -4.66382,9.78404 -3.62266,0.35656 -14.09129,18.41281 -14.39081,6.34679 -8.9996,0.69886 -7.47352,-4.82071 -9.55584,5.10596 -9.41321,-2.9238 -2.66708,-6.83171 -17.82806,-1.2551 -9.12796,-15.47475 -4.43562,-0.28525 -2.29625,-5.49104 0,0 z","name":"Mongolia"},"kp":{"path":"m 610.42319,275.20399 2.62429,1.09821 0.7987,9.18501 5.20579,0.29951 4.90628,-5.74776 -1.69723,-1.51182 0.19967,-6.16138 4.50694,-5.44825 -2.29626,-4.13611 1.49756,-1.71149 0.82722,-4.27873 -2.61003,-1.18379 -2.22494,1.12674 -2.75265,8.35779 -4.44988,-0.38509 -5.14874,6.0758 0.61328,4.42136 0,0 z","name":"North Korea"},"kr":{"path":"m 624.77121,280.80913 8.81419,7.18827 1.49756,6.96008 -0.29951,3.73676 -4.30726,4.84923 -3.70824,0.19967 -4.20742,-9.08518 -1.59739,-4.33578 1.69723,-1.31214 -0.39935,-1.81133 -2.09658,-0.94132 4.60677,-5.44826 0,0 z","name":"South Korea"},"kz":{"path":"m 322.90658,267.14571 5.84761,-2.49593 6.53219,-0.2282 0.4564,9.98371 h -3.82233 l -2.9238,4.76366 3.82233,6.34679 5.63367,3.18052 0.51344,3.63693 2.06806,-0.6846 1.91117,-2.26773 3.152,0.6846 1.58313,3.18052 h 4.05053 v -4.07906 l -2.48166,-7.25958 -1.12674,-5.89039 7.20254,-3.18052 9.6842,1.58313 6.0758,6.11859 13.73473,-1.35494 7.65893,10.88225 8.99961,0.4564 2.48166,-4.07906 3.152,-0.6846 0.4564,-4.53546 4.72087,-0.2282 2.48166,2.95233 2.48167,-5.89039 21.3794,2.95233 3.59414,-4.76366 -6.0758,-7.48778 8.10107,-17.68543 6.5322,0.45639 4.50693,-10.88224 -8.9996,-0.9128 -5.17727,-4.99185 -14.26245,1.65444 -18.37002,-17.75674 -6.47515,5.74776 -19.63939,-8.91402 -24.08927,11.79504 -0.67033,8.38631 5.63366,6.57499 -10.98208,6.20416 -14.24818,-0.31377 -2.98085,-4.37857 -11.16749,-0.61329 -10.58274,6.80319 -0.2282,9.29911 9.85535,7.91566 0,0 z","name":"Kazakhstan"},"tm":{"path":"m 347.38094,294.20157 -0.88427,3.75102 h -5.91892 v 5.07743 l 6.36105,4.19316 -1.96822,5.74776 v 2.65282 l 2.63856,0.44213 3.50856,-4.63529 7.90139,-1.76854 16.88673,6.40383 0.21394,4.6353 9.42748,0.88427 10.52568,-11.0534 -1.31214,-3.53708 -7.01713,-1.54035 -19.73922,-12.82193 -0.88427,-4.6353 h -7.45926 l -3.29462,6.1899 h -3.29463 l -5.69071,0.0143 0,0 z","name":"Turkmenistan"},"uz":{"path":"m 397.39933,310.56059 4.39283,0.2282 v -7.51631 l -4.16463,-2.42461 7.01712,-8.84272 h 2.85249 l 2.85249,3.32315 7.45926,-2.86675 -10.31175,-3.53709 -0.39935,-2.13936 -2.45314,0.59902 -2.41035,4.19316 -10.39733,-0.3423 -7.6304,-10.79667 -13.4067,1.32641 -6.38957,-6.33253 -8.84272,-1.49756 -6.4181,2.61003 3.7225,12.3798 0.0428,4.16464 2.70986,0.0571 3.32315,-6.33253 8.84271,0.1141 1.31215,4.86349 18.95479,12.57948 7.33089,1.68297 2.01101,4.50693 0,0 z","name":"Uzbekistan"},"tj":{"path":"m 399.21066,300.26311 5.86186,-7.27385 h 2.21068 l 0.77017,1.62592 -2.70986,1.96821 v 1.62592 l 1.7828,1.28362 8.57173,0.51345 2.79544,-1.19804 1.26936,0.25672 0.85575,2.73839 5.09169,0.51345 2.55298,5.3912 -0.77018,1.62592 -1.01263,0.0856 -1.01263,-2.05379 -2.21068,-0.17115 -3.82234,0.51345 -0.25672,3.59414 -3.82233,-0.25673 0.17114,-4.53545 -2.79543,-2.73839 -4.25021,3.50856 0.0856,2.31051 -3.73676,1.28362 h -2.21068 l 0.17115,-7.95844 -3.57987,-2.65281 0,0 z","name":"Tajikistan"},"kg":{"path":"m 408.6524,282.24964 -0.44214,3.6084 0.35656,2.22494 12.40833,4.16463 -10.89651,4.39283 -1.24083,-1.02689 -2.35331,1.51182 0.1141,0.82722 1.2551,0.5705 7.64467,0.19967 3.87938,-1.16952 4.9776,-6.27547 6.23269,1.08394 7.5163,-10.41158 -20.11004,-2.73839 -2.78118,6.74613 -3.50856,-3.76528 -3.05216,0.0571 0,0 z","name":"Kyrgyz Republic"},"af":{"path":"m 376.29091,321.95628 2.26773,17.77101 5.64793,1.24083 0.52771,3.19479 -4.05054,3.3802 7.54484,6.09006 14.66179,-5.2771 1.16952,-6.24695 9.2278,-5.76203 3.53709,-13.34965 2.63855,-2.83823 -2.73839,-4.76365 8.92829,-5.51957 -1.141,-1.59739 -4.12184,0.25672 -0.37083,3.79381 -5.53382,-0.0571 -0.0998,-5.06316 -1.78281,-2.12511 -2.99511,2.72413 0.0856,2.49593 -4.52119,1.71149 -8.34353,-0.52771 -10.83946,11.3529 -9.69846,-0.88427 0,0 z","name":"Afghanistan"},"pk":{"path":"m 389.14137,354.46039 3.70824,5.50531 -0.35656,2.83822 -4.93481,1.95396 -0.35656,4.62103 h 5.64793 l 1.93969,-1.5974 h 10.75388 l 9.69847,8.52895 1.24083,-4.09332 h 7.23106 l 0.17115,-5.14875 -7.40221,-7.10269 1.58313,-3.90791 7.58762,-0.52771 10.22617,-21.32236 -5.64793,-4.43562 -2.11084,-7.45926 13.749,-1.24083 -8.11533,-11.55258 -4.32152,-1.16952 -1.76855,2.13937 -1.3264,0.0998 -8.11533,5.14875 2.65281,4.44988 -2.99511,3.19479 -3.70824,13.67768 -9.17075,5.86187 -1.24083,6.40383 -14.61901,5.13448 0,0 z","name":"Pakistan"},"in":{"path":"m 457.38717,444.55625 6.5322,-3.19479 3.87938,-14.03424 -0.17115,-17.22903 22.22089,-23.98943 v -5.69072 l 4.57824,-1.78281 -0.17114,-6.57498 -4.93481,-9.59863 2.82396,-5.14874 6.17564,5.69072 7.92992,0.35656 v 3.19478 l -2.4674,2.66708 0.52771,1.42625 4.23594,0.17115 0.88428,4.79218 h 1.24083 l 3.18052,-5.69072 1.58313,-14.91851 5.29137,-3.73677 0.17115,-5.14874 -2.11084,-4.09332 -3.35168,-0.17115 -13.12144,8.67157 0.82722,5.57661 -9.21354,-0.0285 -3.25184,-3.97922 -1.76854,0.2282 0.59902,5.53382 -19.92463,-1.42624 -12.35128,-5.5053 -0.65607,-6.77466 -8.22943,-5.10596 -0.0998,-10.51142 -5.64793,-6.46089 -12.97882,1.24083 1.41198,5.64793 6.36105,5.14874 -10.99634,22.50614 -7.35942,0.55624 -1.21231,2.70986 7.24532,6.70335 -0.35656,6.77466 -7.40221,-0.1141 -0.7987,3.36594 6.14712,-0.27099 0.17115,2.66708 -4.4071,2.31051 2.82396,5.33416 5.46252,1.7828 3.35167,-2.48166 1.58314,-4.43562 1.93969,-0.88427 2.29625,2.31051 -0.69886,5.69072 -1.58313,2.66708 0.35656,4.62103 23.4332,48.63493 0,0 z","name":"India"},"np":{"path":"m 457.68668,344.07733 0.65607,6.09007 11.52406,5.22005 18.46986,1.3692 -0.69886,-4.46415 -12.33701,-3.39446 -10.46864,-6.23269 -7.14548,1.41198 0,0 z","name":"Nepal"},"bt":{"path":"m 492.21606,351.9502 2.21067,3.02364 7.47353,0.0571 -0.75591,-4.13611 -8.92829,1.05542 0,0 z","name":"Bhutan"},"bd":{"path":"m 492.45852,359.12421 -1.86838,3.3802 4.84923,9.21354 0.14262,7.18827 0.88427,1.92543 5.69072,0.0998 3.22331,-3.09495 2.33904,1.41198 0.47066,4.37857 1.86838,-1.16952 0.1141,-5.59088 -1.56887,-0.18541 -0.9841,-4.74939 -3.96496,-0.14263 -0.98411,-2.63855 2.42461,-3.23758 0.0428,-1.59739 h -7.04565 l -5.63366,-5.19153 0,0 z","name":"Bangladesh"},"mm":{"path":"m 540.76542,431.2066 -3.9507,-6.33252 2.86675,-4.02201 -2.70986,-4.97759 -2.55298,-0.48493 -0.48493,-8.35779 -3.82233,-7.40221 -1.11247,1.76855 -2.55298,4.33578 -3.19479,0.48492 -1.59739,-2.09658 -0.7987,-5.63366 -2.39609,-4.50694 -9.75551,-9.19927 2.39609,-1.58313 0.44214,-6.66056 3.56561,-5.99023 1.54034,-14.90425 5.16301,-3.52283 0.17115,-5.43399 3.09495,1.0269 4.87775,7.05991 -3.62266,7.75877 2.43888,6.09006 6.03301,2.36756 1.09821,6.63204 8.10107,1.2551 -2.2392,3.86512 -10.21191,4.02201 -1.11247,6.58925 7.50204,9.64141 0.31377,5.14874 -1.75428,1.76854 0.15689,1.61166 5.59088,8.20091 0.15689,8.51468 -1.64018,2.96658 0,0 z","name":"Myanmar"},"th":{"path":"m 541.6069,383.88381 4.62103,5.94744 v 7.23106 l 1.59739,0.7987 7.34516,-3.53709 1.44051,0.48493 8.7714,10.12633 -0.31377,6.91729 -2.86675,-0.48493 -2.55298,-1.61165 -1.91117,0.15688 -3.35167,5.61941 0.64181,3.05216 2.70986,1.44051 -0.15688,3.3802 -1.91117,0.96984 -6.54646,-4.50693 v -4.02201 l -2.70987,-0.15689 -1.11247,1.76855 -0.5705,17.9992 4.23595,7.73025 7.50205,7.23106 -0.31378,2.09657 -3.99348,-0.15688 -3.66545,-5.46252 h -3.8366 l -4.79218,-3.86512 -1.44051,-4.02201 2.06806,-3.3802 0.71312,-3.05216 2.25347,-3.99349 -0.0998,-9.18501 -5.5053,-7.95844 -0.2282,-0.96985 1.7828,-1.79707 -0.41361,-6.31826 -7.33089,-9.28485 0.85574,-5.34842 9.08518,-3.8366 0,0 z","name":"Thailand"},"kh":{"path":"m 556.51115,425.2449 5.83334,6.23269 10.85372,-8.04402 0.95559,-12.69357 -5.60514,3.86512 -2.90954,-1.62592 -3.9507,-0.52771 -2.21068,-1.55461 -1.06968,0.0571 -2.89528,4.7494 0.47066,2.19641 2.93807,1.64018 -0.35656,4.46415 -2.0538,1.24083 0,0 z","name":"Cambodia"},"la":{"path":"m 549.36567,373.12993 -3.45151,1.75428 -2.86675,8.35779 4.79218,6.10433 -0.7987,6.74614 0.7987,0.32803 7.9727,-3.86512 10.69684,11.95193 -0.25673,7.53057 2.32478,1.25509 5.74777,-4.66382 -0.47066,-3.69397 -16.58723,-15.76 0.15689,-2.41035 2.06805,-1.44051 -1.4405,-4.02201 -6.86024,-1.12673 -1.82559,-7.04565 0,0 z","name":"Lao People's Democratic Republic"},"vn":{"path":"m 563.04335,432.3476 1.69723,2.66708 0.31378,3.05216 4.46414,0.48492 5.41973,-7.23106 5.10596,-1.4405 2.70986,-7.38795 -1.26936,-11.89488 -5.26284,-7.23106 -5.54809,-4.43562 -7.05991,-12.12307 5.06317,-8.4719 -7.24532,-8.315 -5.80482,-0.25673 -5.22005,2.80971 1.5546,6.71761 6.96008,1.22657 1.86838,5.17726 -2.45314,1.5974 0.15688,1.28362 16.3305,15.97394 0.64181,4.69234 -0.98411,14.83294 -11.43848,8.27222 0,0 z","name":"Vietnam"},"ir":{"path":"m 312.86582,308.97746 -1.74002,1.81133 0.17115,2.86675 2.1679,3.0379 7.68745,8.41484 -1.16952,3.36594 h -1.34067 l -0.67033,3.36594 4.35004,5.56235 4.00775,0.3423 8.02976,11.11044 4.50693,0.3423 3.50856,2.52445 0.17115,5.04891 13.87736,8.0868 h 5.17726 l 3.18053,-2.6956 4.00775,-0.17115 2.33904,5.39121 14.98982,2.08231 0.44214,-5.5053 4.96333,-1.79707 0.2282,-1.96822 -3.9507,-5.3912 -8.79992,-7.07417 4.62103,-4.20742 -0.32804,-1.85412 -5.79055,-0.89853 -2.45314,-19.53955 -0.28525,-4.49267 -15.70295,-6.00449 -6.96007,1.56887 -3.89365,4.77792 -3.45151,-0.2282 -0.99837,0.84148 -7.68746,-0.49918 -9.69846,-7.07418 -3.6084,-3.95069 -1.65444,0.39935 -2.98086,3.40872 -5.26284,-0.99837 0,0 z","name":"Iran"},"tr":{"path":"m 297.24845,296.48356 -3.18053,3.36593 -11.6952,-0.34229 -7.01713,-4.20743 -6.84597,-0.17114 -7.85861,5.56235 -7.35942,0.3423 -0.67033,4.20742 h -8.35779 l -3.33742,3.0379 v 1.68297 l 2.01101,1.68297 v 1.85411 l -0.84148,2.19642 0.84148,1.85412 2.68134,-1.34067 2.68134,2.86675 -0.67034,2.02527 -0.99837,1.35493 1.49756,1.68297 7.35942,1.51182 5.17727,-2.19642 v -3.19479 l 2.51019,0.49919 6.01875,3.53708 6.51794,-1.01263 2.83822,-2.6956 1.83986,0.67033 v 3.0379 h 2.51019 l 2.16789,-4.20742 19.05462,-2.02526 8.31501,-1.01264 -2.19642,-2.88101 -0.0428,-3.89365 1.6687,-1.99674 -6.0758,-4.87776 0.32804,-4.20742 h -3.33742 l -5.53382,-2.70986 0,0 m -50.8884,0.72738 -0.2282,5.06317 4.42135,-1.35493 2.02527,-1.35493 -0.59902,-2.19642 -2.09658,-1.66871 -3.52282,1.51182 0,0 z","name":"Turkey"},"om":{"path":"m 353.84182,398.67397 10.53995,-6.0758 1.86838,-8.91403 -2.31052,-1.32641 0.95559,-9.55583 2.011,-1.16953 2.15363,3.3802 12.82194,6.70335 v 3.7225 l -15.5318,22.8627 -7.14549,0.24246 -5.36268,-9.86961 0,0 z","name":"Oman"},"ae":{"path":"m 347.60914,375.99668 1.24083,4.96333 14.06277,1.24084 0.98411,-10.18339 2.70986,-1.48329 0.74165,-3.7225 -4.43562,1.24083 -4.93481,7.45926 -10.36879,0.48492 0,0 z","name":"United Arab Emirates"},"qa":{"path":"m 345.64092,367.55332 -0.74165,5.71924 2.19642,1.6687 1.99674,-0.18541 0.74165,-7.20253 -1.72576,-1.24084 -2.4674,1.24084 0,0 z","name":"Qatar"},"kw":{"path":"m 332.3198,350.65232 -3.20905,-1.74002 -2.22495,2.23921 0.24247,4.4784 5.17726,1.98248 0.0143,-6.96007 0,0 z","name":"Kuwait"},"sa":{"path":"m 333.33243,359.30962 9.99797,13.93441 3.22332,2.56724 1.4405,6.24695 15.38918,1.21231 1.74002,0.9128 -1.72576,7.70172 -10.11207,5.9617 -14.79016,4.4784 -7.88713,7.70172 -9.37042,-5.46251 -5.67646,4.96333 -7.90139,-12.90751 -5.41973,-2.48167 -1.96822,-2.98085 v -6.46089 l -19.72496,-23.8468 -0.74164,-4.22169 h 5.67645 l 6.90302,-5.9617 0.24246,-2.98085 -1.96821,-1.98248 3.95069,-3.22331 8.38632,0.49918 14.30523,11.92341 8.44337,-0.38509 0.54197,2.08232 7.04565,2.70986 0,0 z","name":"Saudi Arabia"},"sy":{"path":"m 280.09073,324.92287 -0.49919,3.62266 4.02201,1.68297 -0.17115,10.04076 4.02201,-0.0856 4.02201,-3.0379 1.51182,-0.25673 9.12796,-7.25958 1.83986,-10.53995 -18.24167,1.85412 -1.92543,4.22168 -3.70823,-0.24246 0,0 z","name":"Syrian Arab Republic"},"iq":{