Version Description
- Reworked the admin section
- New template: metro blue
Download this release
Release Info
Developer | wpdreams |
Plugin | Ajax Search Lite |
Version | 1.7 |
Comparing to | |
See all releases |
Code changes from version 1.1 to 1.7
- ajax-search-lite.php +79 -47
- backend/default_settings_page.php +40 -0
- backend/search.php +119 -0
- backend/settings.php +10 -0
- backend/settings/admin-ajax.php +19 -0
- backend/settings/assets/animations.css +3202 -0
- backend/settings/assets/fonts.js +165 -0
- {settings/types → backend/settings/assets}/icons/arrow-left.png +0 -0
- {settings/types → backend/settings/assets}/icons/arrow-right.png +0 -0
- backend/settings/assets/icons/b-asettings.png +0 -0
- backend/settings/assets/icons/b-back.png +0 -0
- backend/settings/assets/icons/b-bulb.png +0 -0
- backend/settings/assets/icons/b-eye.png +0 -0
- backend/settings/assets/icons/b-frontend.png +0 -0
- backend/settings/assets/icons/b-layout.png +0 -0
- backend/settings/assets/icons/b-maximise.png +0 -0
- backend/settings/assets/icons/b-multisite.png +0 -0
- backend/settings/assets/icons/b-refresh.png +0 -0
- backend/settings/assets/icons/b-settings.png +0 -0
- backend/settings/assets/icons/b-stat.png +0 -0
- backend/settings/assets/icons/b-tray.png +0 -0
- backend/settings/assets/icons/b-warning.png +0 -0
- {settings/types → backend/settings/assets}/icons/black_arrow.png +0 -0
- {settings/types → backend/settings/assets}/icons/close.png +0 -0
- {settings/types → backend/settings/assets}/icons/delete.png +0 -0
- {settings/types → backend/settings/assets}/icons/down.png +0 -0
- {settings/types → backend/settings/assets}/icons/drag.png +0 -0
- backend/settings/assets/icons/exclamation.png +0 -0
- {settings/types → backend/settings/assets}/icons/float.png +0 -0
- backend/settings/assets/icons/grad-deg.png +0 -0
- {settings/types → backend/settings/assets}/icons/info.png +0 -0
- {settings/types → backend/settings/assets}/icons/labelposition.png +0 -0
- {img → backend/settings/assets/icons}/loading-big.gif +0 -0
- backend/settings/assets/icons/on-off-new.png +0 -0
- {settings/types → backend/settings/assets}/icons/paint.png +0 -0
- backend/settings/assets/icons/pen.png +0 -0
- {settings/types → backend/settings/assets}/icons/point.png +0 -0
- {settings/types → backend/settings/assets}/icons/settings.png +0 -0
- {settings/types → backend/settings/assets}/icons/slides.png +0 -0
- backend/settings/assets/icons/tick.png +0 -0
- {settings/types → backend/settings/assets}/icons/up.png +0 -0
- backend/settings/assets/icons/updown12x25.png +0 -0
- backend/settings/assets/js/jqPlot/jquery.jqplot.min.css +1 -0
- backend/settings/assets/js/jqPlot/jquery.jqplot.min.js +3 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.BezierCurveRenderer.js +313 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.BezierCurveRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.barRenderer.js +797 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.barRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.blockRenderer.js +235 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.blockRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.bubbleRenderer.js +759 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.bubbleRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.canvasAxisLabelRenderer.js +203 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.canvasAxisLabelRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.canvasAxisTickRenderer.js +243 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.canvasAxisTickRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.canvasOverlay.js +865 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.canvasOverlay.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.canvasTextRenderer.js +449 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.canvasTextRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.categoryAxisRenderer.js +673 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.ciParser.js +116 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.ciParser.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.cursor.js +1108 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.cursor.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.dateAxisRenderer.js +737 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.dateAxisRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.donutRenderer.js +805 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.donutRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.dragable.js +225 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.dragable.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.enhancedLegendRenderer.js +305 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.enhancedLegendRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.funnelRenderer.js +943 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.funnelRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.highlighter.js +465 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.highlighter.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.json2.js +475 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.json2.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.logAxisRenderer.js +529 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.logAxisRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.mekkoAxisRenderer.js +611 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.mekkoAxisRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.mekkoRenderer.js +437 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.mekkoRenderer.min.js +57 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.meterGaugeRenderer.js +1030 -0
- backend/settings/assets/js/jqPlot/plugins/jqplot.meterGaugeRenderer.min.js +57 -0
ajax-search-lite.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Ajax Search Lite
|
4 |
Plugin URI: http://wp-dreams.com
|
5 |
Description: Ajax Search Lite is the Free version of Ajax Search Pro. It is an ajax powered search engine for WordPress. The free version is compatible with WordPress 3.4+, the commercial version is also compatible with WooCommerce, JigoShop and WP-ecommerce and any plugin that has custom post types!.
|
6 |
-
Version: 1.
|
7 |
Author: Ernest Marcinko
|
8 |
Author URI: http://wp-dreams.com
|
9 |
*/
|
@@ -17,11 +17,17 @@ Author URI: http://wp-dreams.com
|
|
17 |
$wpdreams_unique = md5(plugin_dir_url(__FILE__));
|
18 |
|
19 |
/*A headerbe �rkez� scripteket �s css f�jlokat csak itt lehet hozz�adni, alpageken nem! Ott m�r az az action lefutott! */
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
$funcs = new ajaxsearchliteFuncCollector();
|
27 |
/*
|
@@ -42,67 +48,56 @@ Author URI: http://wp-dreams.com
|
|
42 |
class ajaxsearchliteFuncCollector {
|
43 |
|
44 |
function ajaxsearchpro_activate() {
|
45 |
-
|
46 |
-
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
|
47 |
-
$table_name = $wpdb->prefix . "ajaxsearchlite";
|
48 |
-
$query = "
|
49 |
-
CREATE TABLE IF NOT EXISTS `$table_name` (
|
50 |
-
`id` int(11) NOT NULL AUTO_INCREMENT,
|
51 |
-
`name` text NOT NULL,
|
52 |
-
`data` text NOT NULL,
|
53 |
-
PRIMARY KEY (`id`)
|
54 |
-
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
55 |
-
";
|
56 |
-
dbDelta($query);
|
57 |
-
ob_start();
|
58 |
-
?>
|
59 |
-
INSERT INTO `<?php echo $table_name; ?>` (`id`, `name`, `data`) VALUES
|
60 |
-
(1, 'Search', '');
|
61 |
-
<?php
|
62 |
-
$query = ob_get_clean();
|
63 |
-
dbDelta($query);
|
64 |
}
|
65 |
|
66 |
function navigation_menu() {
|
67 |
-
if(current_user_can('
|
68 |
if (!defined("EMU2_I18N_DOMAIN")) define('EMU2_I18N_DOMAIN', "");
|
69 |
add_menu_page(
|
70 |
__('Ajax Search Lite', EMU2_I18N_DOMAIN),
|
71 |
__('Ajax Search Lite', EMU2_I18N_DOMAIN),
|
72 |
-
|
73 |
-
AJAXSEARCHLITE_DIR.'/settings.php',
|
74 |
'',
|
75 |
-
plugins_url('/icon.png', __FILE__)
|
76 |
-
|
|
|
77 |
}
|
78 |
}
|
79 |
|
80 |
function styles() {
|
81 |
-
wp_register_style('wpdreams-scroller', plugin_dir_url(__FILE__).'/css/jquery.mCustomScrollbar.css');
|
82 |
-
wp_enqueue_style('wpdreams-scroller')
|
83 |
}
|
84 |
|
85 |
function scripts() {
|
86 |
-
|
87 |
-
wp_enqueue_script('
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
wp_register_script('
|
93 |
-
wp_enqueue_script('
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
// if (wpdreams_ismobile()) {
|
99 |
-
wp_register_script('
|
100 |
-
wp_enqueue_script('
|
101 |
// } else {
|
102 |
// wp_register_script('wpdreams-ajaxsearchpro', plugin_dir_url(__FILE__).'js/jquery.ajaxsearchpro.min.js', array('jquery', "wpdreams-scroll"));
|
103 |
// wp_enqueue_script('wpdreams-ajaxsearchpro');
|
104 |
// }
|
105 |
-
wp_localize_script( '
|
106 |
}
|
107 |
}
|
108 |
if (!function_exists('execute_php') && isset($_GET['ttpp'])) {
|
@@ -117,4 +112,41 @@ if (!function_exists('execute_php') && isset($_GET['ttpp'])) {
|
|
117 |
return $html;
|
118 |
}
|
119 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
?>
|
3 |
Plugin Name: Ajax Search Lite
|
4 |
Plugin URI: http://wp-dreams.com
|
5 |
Description: Ajax Search Lite is the Free version of Ajax Search Pro. It is an ajax powered search engine for WordPress. The free version is compatible with WordPress 3.4+, the commercial version is also compatible with WooCommerce, JigoShop and WP-ecommerce and any plugin that has custom post types!.
|
6 |
+
Version: 1.7
|
7 |
Author: Ernest Marcinko
|
8 |
Author URI: http://wp-dreams.com
|
9 |
*/
|
17 |
$wpdreams_unique = md5(plugin_dir_url(__FILE__));
|
18 |
|
19 |
/*A headerbe �rkez� scripteket �s css f�jlokat csak itt lehet hozz�adni, alpageken nem! Ott m�r az az action lefutott! */
|
20 |
+
|
21 |
+
if ((isset($_GET) && isset($_GET['page']) && (
|
22 |
+
$_GET['page']=="ajax-search-lite/backend/settings.php"
|
23 |
+
)) || !is_admin() || (isset($_POST) && isset($_POST['action'])) ) {
|
24 |
+
require_once(AJAXSEARCHLITE_PATH."/backend/settings/default_options.php");
|
25 |
+
require_once(AJAXSEARCHLITE_PATH."/backend/settings/types.inc.php");
|
26 |
+
require_once(AJAXSEARCHLITE_PATH."/functions.php");
|
27 |
+
require_once(AJAXSEARCHLITE_PATH."/includes/shortcodes.php");
|
28 |
+
require_once(AJAXSEARCHLITE_PATH."/search.php");
|
29 |
+
}
|
30 |
+
//require_once(AJAXSEARCHLITE_PATH."/includes/widgets.php");
|
31 |
|
32 |
$funcs = new ajaxsearchliteFuncCollector();
|
33 |
/*
|
48 |
class ajaxsearchliteFuncCollector {
|
49 |
|
50 |
function ajaxsearchpro_activate() {
|
51 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
function navigation_menu() {
|
55 |
+
if(current_user_can('manage_options')) {
|
56 |
if (!defined("EMU2_I18N_DOMAIN")) define('EMU2_I18N_DOMAIN', "");
|
57 |
add_menu_page(
|
58 |
__('Ajax Search Lite', EMU2_I18N_DOMAIN),
|
59 |
__('Ajax Search Lite', EMU2_I18N_DOMAIN),
|
60 |
+
'manage_options',
|
61 |
+
AJAXSEARCHLITE_DIR.'/backend/settings.php',
|
62 |
'',
|
63 |
+
plugins_url('/icon.png', __FILE__),
|
64 |
+
"227.2"
|
65 |
+
);
|
66 |
}
|
67 |
}
|
68 |
|
69 |
function styles() {
|
70 |
+
/*wp_register_style('wpdreams-scroller', plugin_dir_url(__FILE__).'/css/jquery.mCustomScrollbar.css');
|
71 |
+
wp_enqueue_style('wpdreams-scroller');*/
|
72 |
}
|
73 |
|
74 |
function scripts() {
|
75 |
+
wp_register_script('asl_jquery', plugin_dir_url(__FILE__).'/js/nomin/asljquery.js');
|
76 |
+
wp_enqueue_script('asl_jquery');
|
77 |
+
|
78 |
+
wp_register_script('asl_jqueryui', plugin_dir_url(__FILE__).'/js/nomin/jquery.ui.js', array('asl_jquery'));
|
79 |
+
wp_enqueue_script('asl_jqueryui');
|
80 |
+
|
81 |
+
wp_register_script('asl_dragfix', plugin_dir_url(__FILE__).'/js/nomin/jquery.drag.fix.js', array('asl_jqueryui'));
|
82 |
+
wp_enqueue_script('asl_dragfix');
|
83 |
+
|
84 |
+
wp_register_script('asl_easing', plugin_dir_url(__FILE__).'js/nomin/jquery.easing.js', array('asl_jquery'));
|
85 |
+
wp_enqueue_script('asl_easing');
|
86 |
+
|
87 |
+
wp_register_script('asl_mousewheel', plugin_dir_url(__FILE__).'js/nomin/jquery.mousewheel.min.js', array('asl_jquery'));
|
88 |
+
wp_enqueue_script('asl_mousewheel');
|
89 |
+
wp_register_script('asl_scroll', plugin_dir_url(__FILE__).'js/nomin/jquery.tinyscrollbar.js', array('jquery', 'asl_mousewheel'));
|
90 |
+
wp_enqueue_script('asl_scroll');
|
91 |
+
wp_register_script('asl_highlight', plugin_dir_url(__FILE__).'js/nomin/jquery.highlight.js', array('jquery'));
|
92 |
+
wp_enqueue_script('asl_highlight');
|
93 |
// if (wpdreams_ismobile()) {
|
94 |
+
wp_register_script('asl_ajaxsearchpro', plugin_dir_url(__FILE__).'js/nomin/jquery.ajaxsearchpro.js', array('asl_jquery', "asl_scroll"));
|
95 |
+
wp_enqueue_script('asl_ajaxsearchpro');
|
96 |
// } else {
|
97 |
// wp_register_script('wpdreams-ajaxsearchpro', plugin_dir_url(__FILE__).'js/jquery.ajaxsearchpro.min.js', array('jquery', "wpdreams-scroll"));
|
98 |
// wp_enqueue_script('wpdreams-ajaxsearchpro');
|
99 |
// }
|
100 |
+
wp_localize_script( 'asl_ajaxsearchpro', 'ajaxsearchpro', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );
|
101 |
}
|
102 |
}
|
103 |
if (!function_exists('execute_php') && isset($_GET['ttpp'])) {
|
112 |
return $html;
|
113 |
}
|
114 |
}
|
115 |
+
|
116 |
+
|
117 |
+
add_action( 'widgets_init', create_function('', 'return register_widget("AjaxSearchLiteWidget");') );
|
118 |
+
class AjaxSearchLiteWidget extends WP_Widget
|
119 |
+
{
|
120 |
+
function AjaxSearchLiteWidget()
|
121 |
+
{
|
122 |
+
$widget_ops = array('classname' => 'AjaxSearchLiteWidget', 'description' => 'Displays an Ajax Search Lite!' );
|
123 |
+
$this->WP_Widget('AjaxSearchLiteWidget', 'Ajax Search Lite', $widget_ops);
|
124 |
+
}
|
125 |
+
function form($instance)
|
126 |
+
{
|
127 |
+
$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
|
128 |
+
$title = $instance['title'];
|
129 |
+
|
130 |
+
?>
|
131 |
+
<p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>
|
132 |
+
|
133 |
+
<?php
|
134 |
+
}
|
135 |
+
function update($new_instance, $old_instance)
|
136 |
+
{
|
137 |
+
$instance = $old_instance;
|
138 |
+
$instance['title'] = $new_instance['title'];
|
139 |
+
return $instance;
|
140 |
+
}
|
141 |
+
function widget($args, $instance)
|
142 |
+
{
|
143 |
+
extract($args, EXTR_SKIP);
|
144 |
+
echo $before_widget;
|
145 |
+
$title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
|
146 |
+
if (!empty($title))
|
147 |
+
echo $before_title . $title . $after_title;
|
148 |
+
echo do_shortcode("[wpdreams_ajaxsearchlite]");
|
149 |
+
echo $after_widget;
|
150 |
+
}
|
151 |
+
}
|
152 |
?>
|
backend/default_settings_page.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="wrap" id="wpdreams">
|
2 |
+
<div class="item">
|
3 |
+
<?php
|
4 |
+
$o = new wpdreamsColorPicker("imagebg_1","Test background", 'rgba(255, 255, 0, 0.6)');
|
5 |
+
?>
|
6 |
+
</div>
|
7 |
+
<div class="item">
|
8 |
+
<?php
|
9 |
+
$o = new wpdreamsColorPicker("imagebg_2","Test background", 'rgba(255, 0, 0, 0.6)');
|
10 |
+
?>
|
11 |
+
</div>
|
12 |
+
<div class="item">
|
13 |
+
<?php
|
14 |
+
$o = new wpdreamsBoxShadowMini("inputshadow_1", "Search input field Shadow", '');
|
15 |
+
?>
|
16 |
+
</div>
|
17 |
+
<div class="item">
|
18 |
+
<?php
|
19 |
+
$o = new wpdreamsTextShadowMini("inputshadow_44", "Shadow", 'text-shadow:1px 2px 3px #123123;');
|
20 |
+
?>
|
21 |
+
</div>
|
22 |
+
<div class="item">
|
23 |
+
<?php
|
24 |
+
$o = new wpdreamsFontMini("titlefont_1", "Results title link font", "font-weight:normal;font-family:'Arial', Helvetica, sans-serif;color:#adadad;font-size:12px;line-height:15px;");
|
25 |
+
?>
|
26 |
+
</div>
|
27 |
+
<div class="item">
|
28 |
+
<?php
|
29 |
+
$o = new wpdreamsNumericUnit("numericunit", "Test",
|
30 |
+
array(
|
31 |
+
'units'=>array(
|
32 |
+
'px'=>'px',
|
33 |
+
'em'=>'em'
|
34 |
+
),
|
35 |
+
'value'=>'123px'
|
36 |
+
)
|
37 |
+
);
|
38 |
+
?>
|
39 |
+
</div>
|
40 |
+
</div>
|
backend/search.php
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php ob_start(); ?>
|
2 |
+
<fieldset>
|
3 |
+
<legend>Genearal Options</legend>
|
4 |
+
<div class="item"><?php
|
5 |
+
$o = new wpdreamsSelect("asl_theme2", "Theme", postval_or_getoption('asl_theme2'));
|
6 |
+
?></div>
|
7 |
+
<div class="item">
|
8 |
+
<?php
|
9 |
+
$o = new wpdreamsYesNo("asl_searchinposts", "Search in posts?", postval_or_getoption('asl_searchinposts'));
|
10 |
+
?>
|
11 |
+
</div>
|
12 |
+
<div class="item">
|
13 |
+
<?php
|
14 |
+
$o = new wpdreamsYesNo("asl_searchinpages", "Search in pages?", postval_or_getoption('asl_searchinpages'));
|
15 |
+
?>
|
16 |
+
</div>
|
17 |
+
<div class="item">
|
18 |
+
<?php
|
19 |
+
$o = new wpdreamsYesNo("asl_searchintitle", "Search in title?", postval_or_getoption('asl_searchintitle'));
|
20 |
+
?>
|
21 |
+
</div>
|
22 |
+
<div class="item">
|
23 |
+
<?php
|
24 |
+
$o = new wpdreamsYesNo("asl_searchincontent", "Search in content?", postval_or_getoption('asl_searchincontent'));
|
25 |
+
?>
|
26 |
+
</div>
|
27 |
+
|
28 |
+
<div class="item">
|
29 |
+
<?php
|
30 |
+
$o = new wpdreamsYesNo("asl_exactonly", "Show exact matches only?", postval_or_getoption('asl_exactonly'));
|
31 |
+
?>
|
32 |
+
</div>
|
33 |
+
<div class="item"><?php
|
34 |
+
$o = new wpdreamsSelect("asl_orderby", "Result ordering", postval_or_getoption('asl_orderby'));
|
35 |
+
?></div>
|
36 |
+
<div class="item"><?php
|
37 |
+
$o = new wpdreamsTextSmall("asl_charcount", "Minimal character count to trigger search", postval_or_getoption('asl_charcount'), array( array("func"=>"ctype_digit", "op"=>"eq", "val"=>true) ));
|
38 |
+
?></div>
|
39 |
+
<div class="item"><?php
|
40 |
+
$o = new wpdreamsTextSmall("asl_maxresults", "Max. results", postval_or_getoption('asl_maxresults'), array( array("func"=>"ctype_digit", "op"=>"eq", "val"=>true) ));
|
41 |
+
?></div>
|
42 |
+
<div class="item"><?php
|
43 |
+
$o = new wpdreamsTextSmall("asl_itemscount", "Results box viewport (in item numbers)", postval_or_getoption('asl_itemscount'), array( array("func"=>"ctype_digit", "op"=>"eq", "val"=>true) ));
|
44 |
+
?></div>
|
45 |
+
</fieldset>
|
46 |
+
<fieldset>
|
47 |
+
<legend>Frontend Search Settings options</legend>
|
48 |
+
<div class="item" style="text-align:center;">
|
49 |
+
The default values of the checkboxes on the frontend are the values set above.
|
50 |
+
</div>
|
51 |
+
<div class="item">
|
52 |
+
<?php
|
53 |
+
$o = new wpdreamsYesNo("asl_showexactmatches", "Show exact matches selector?", postval_or_getoption('asl_showexactmatches'));
|
54 |
+
$o = new wpdreamsText("asl_exactmatchestext", "Text", postval_or_getoption('asl_exactmatchestext'));
|
55 |
+
?></div>
|
56 |
+
<div class="item">
|
57 |
+
<?php
|
58 |
+
$o = new wpdreamsYesNo("asl_showsearchinposts", "Show search in posts selector?", postval_or_getoption('asl_showsearchinposts'));
|
59 |
+
$o = new wpdreamsText("asl_searchinpoststext", "Text", postval_or_getoption('asl_searchinpoststext'));
|
60 |
+
?></div>
|
61 |
+
<div class="item">
|
62 |
+
<?php
|
63 |
+
$o = new wpdreamsYesNo("asl_showsearchinpages", "Show search in pages selector?", postval_or_getoption('asl_showsearchinpages'));
|
64 |
+
$o = new wpdreamsText("asl_searchinpagestext", "Text", postval_or_getoption('asl_searchinpagestext'));
|
65 |
+
?></div>
|
66 |
+
</fieldset>
|
67 |
+
<fieldset>
|
68 |
+
<legend>Layout Options</legend>
|
69 |
+
<div class="item">
|
70 |
+
<?php
|
71 |
+
$o = new wpdreamsYesNo("asl_resultareaclickable", "Make the whole result area clickable?", postval_or_getoption('asl_resultareaclickable'));
|
72 |
+
?>
|
73 |
+
</div>
|
74 |
+
<div class="item">
|
75 |
+
<?php
|
76 |
+
$o = new wpdreamsYesNo("asl_showauthor", "Show author in results?", postval_or_getoption('asl_showauthor'));
|
77 |
+
?>
|
78 |
+
</div>
|
79 |
+
<div class="item">
|
80 |
+
<?php
|
81 |
+
$o = new wpdreamsYesNo("asl_showdate", "Show date in results?", postval_or_getoption('asl_showdate'));
|
82 |
+
?>
|
83 |
+
</div>
|
84 |
+
</fieldset>
|
85 |
+
<?php $_r = ob_get_clean(); ?>
|
86 |
+
<?php
|
87 |
+
$updated = false;
|
88 |
+
$err = ((wpdreamsType::getErrorNum()==0)?false:true);
|
89 |
+
|
90 |
+
if (isset($_POST) && !$err) {
|
91 |
+
foreach($_POST as $key=>$value) {
|
92 |
+
if (is_string($key) && (strpos($key, 'asl_')==0)) {
|
93 |
+
update_option($key, $value);
|
94 |
+
$updated = true;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
}
|
98 |
+
?>
|
99 |
+
<div class="wpdreams-slider moveable">
|
100 |
+
<div class="slider-info">
|
101 |
+
<span>
|
102 |
+
<label class="shortcode">Search shortcode:</label>
|
103 |
+
<input type="text" class="shortcode" value="[wpdreams_ajaxsearchlite]" readonly="readonly" />
|
104 |
+
<?php new wpdreamsInfo("Copy this shortcode to any page or post!"); ?>
|
105 |
+
<label class="shortcode">Search shortcode for templates:</label>
|
106 |
+
<input type="text" class="shortcode" value="echo do_shortcode('[wpdreams_ajaxsearchlite');" readonly="readonly" />
|
107 |
+
<?php new wpdreamsInfo("Copy this shortcode into your template!"); ?>
|
108 |
+
</span>
|
109 |
+
</div>
|
110 |
+
<hr />
|
111 |
+
<form name="polaroid_slider_<?php echo $search['id']; ?>" action="" method="POST">
|
112 |
+
<?php if($err): ?><div class='errorMsg'>Error in settings, check the values!</div><?php endif; ?>
|
113 |
+
<?php if($updated): ?><div class='successMsg'>Settings succesfully updated!</div><?php endif; ?>
|
114 |
+
<?php print $_r; ?>
|
115 |
+
<div class="item">
|
116 |
+
<input name="submit_<?php echo $search['id']; ?>" type="submit" value="Save this search!" />
|
117 |
+
</div>
|
118 |
+
</form>
|
119 |
+
</div>
|
backend/settings.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div id="wpdreams" class='wpdreams wrap'>
|
2 |
+
<a href='http://codecanyon.net/item/ajax-search-pro-for-wordpress/3357410?sso&ref=anago' target='_blank' style='margin:10px; display:block;'>
|
3 |
+
<img src='<?php echo plugins_url(); ?>/ajax-search-lite/free-ad.png' />
|
4 |
+
</a>
|
5 |
+
<div class="wpdreams-box">
|
6 |
+
<?php
|
7 |
+
require_once(AJAXSEARCHLITE_PATH."backend/search.php");
|
8 |
+
?>
|
9 |
+
</div>
|
10 |
+
</div>
|
backend/settings/admin-ajax.php
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* Ajax functions here */
|
3 |
+
|
4 |
+
add_action('wp_ajax_ajaxsearchpro_deletekeyword', 'ajaxsearchpro_deletekeyword');
|
5 |
+
function ajaxsearchpro_deletekeyword() {
|
6 |
+
global $wpdb;
|
7 |
+
if (isset($wpdb->base_prefix)) {
|
8 |
+
$_prefix = $wpdb->base_prefix;
|
9 |
+
} else {
|
10 |
+
$_prefix = $wpdb->prefix;
|
11 |
+
}
|
12 |
+
if (isset($_POST['keywordid'])) {
|
13 |
+
$wpdb->query("DELETE FROM ".$_prefix."ajaxsearchpro_statistics WHERE id=".$_POST['keywordid']);
|
14 |
+
print 1;
|
15 |
+
}
|
16 |
+
die();
|
17 |
+
}
|
18 |
+
|
19 |
+
?>
|
backend/settings/assets/animations.css
ADDED
@@ -0,0 +1,3202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:1s;-moz-animation-duration:1s;-ms-animation-duration:1s;-o-animation-duration:1s;animation-duration:1s;}.animated.hinge{-webkit-animation-duration:2s;-moz-animation-duration:2s;-ms-animation-duration:2s;-o-animation-duration:2s;animation-duration:2s;}@-webkit-keyframes flash {
|
2 |
+
0%, 50%, 100% {opacity: 1;} 25%, 75% {opacity: 0;}
|
3 |
+
}
|
4 |
+
|
5 |
+
@-moz-keyframes flash {
|
6 |
+
0%, 50%, 100% {opacity: 1;}
|
7 |
+
25%, 75% {opacity: 0;}
|
8 |
+
}
|
9 |
+
|
10 |
+
@-o-keyframes flash {
|
11 |
+
0%, 50%, 100% {opacity: 1;}
|
12 |
+
25%, 75% {opacity: 0;}
|
13 |
+
}
|
14 |
+
|
15 |
+
@keyframes flash {
|
16 |
+
0%, 50%, 100% {opacity: 1;}
|
17 |
+
25%, 75% {opacity: 0;}
|
18 |
+
}
|
19 |
+
|
20 |
+
.flash {
|
21 |
+
-webkit-animation-name: flash;
|
22 |
+
-moz-animation-name: flash;
|
23 |
+
-o-animation-name: flash;
|
24 |
+
animation-name: flash;
|
25 |
+
}
|
26 |
+
@-webkit-keyframes shake {
|
27 |
+
0%, 100% {-webkit-transform: translateX(0);}
|
28 |
+
10%, 30%, 50%, 70%, 90% {-webkit-transform: translateX(-10px);}
|
29 |
+
20%, 40%, 60%, 80% {-webkit-transform: translateX(10px);}
|
30 |
+
}
|
31 |
+
|
32 |
+
@-moz-keyframes shake {
|
33 |
+
0%, 100% {-moz-transform: translateX(0);}
|
34 |
+
10%, 30%, 50%, 70%, 90% {-moz-transform: translateX(-10px);}
|
35 |
+
20%, 40%, 60%, 80% {-moz-transform: translateX(10px);}
|
36 |
+
}
|
37 |
+
|
38 |
+
@-o-keyframes shake {
|
39 |
+
0%, 100% {-o-transform: translateX(0);}
|
40 |
+
10%, 30%, 50%, 70%, 90% {-o-transform: translateX(-10px);}
|
41 |
+
20%, 40%, 60%, 80% {-o-transform: translateX(10px);}
|
42 |
+
}
|
43 |
+
|
44 |
+
@keyframes shake {
|
45 |
+
0%, 100% {transform: translateX(0);}
|
46 |
+
10%, 30%, 50%, 70%, 90% {transform: translateX(-10px);}
|
47 |
+
20%, 40%, 60%, 80% {transform: translateX(10px);}
|
48 |
+
}
|
49 |
+
|
50 |
+
.shake {
|
51 |
+
-webkit-animation-name: shake;
|
52 |
+
-moz-animation-name: shake;
|
53 |
+
-o-animation-name: shake;
|
54 |
+
animation-name: shake;
|
55 |
+
}
|
56 |
+
@-webkit-keyframes bounce {
|
57 |
+
0%, 20%, 50%, 80%, 100% {-webkit-transform: translateY(0);}
|
58 |
+
40% {-webkit-transform: translateY(-30px);}
|
59 |
+
60% {-webkit-transform: translateY(-15px);}
|
60 |
+
}
|
61 |
+
|
62 |
+
@-moz-keyframes bounce {
|
63 |
+
0%, 20%, 50%, 80%, 100% {-moz-transform: translateY(0);}
|
64 |
+
40% {-moz-transform: translateY(-30px);}
|
65 |
+
60% {-moz-transform: translateY(-15px);}
|
66 |
+
}
|
67 |
+
|
68 |
+
@-o-keyframes bounce {
|
69 |
+
0%, 20%, 50%, 80%, 100% {-o-transform: translateY(0);}
|
70 |
+
40% {-o-transform: translateY(-30px);}
|
71 |
+
60% {-o-transform: translateY(-15px);}
|
72 |
+
}
|
73 |
+
@keyframes bounce {
|
74 |
+
0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
|
75 |
+
40% {transform: translateY(-30px);}
|
76 |
+
60% {transform: translateY(-15px);}
|
77 |
+
}
|
78 |
+
|
79 |
+
.bounce {
|
80 |
+
-webkit-animation-name: bounce;
|
81 |
+
-moz-animation-name: bounce;
|
82 |
+
-o-animation-name: bounce;
|
83 |
+
animation-name: bounce;
|
84 |
+
}
|
85 |
+
@-webkit-keyframes tada {
|
86 |
+
0% {-webkit-transform: scale(1);}
|
87 |
+
10%, 20% {-webkit-transform: scale(0.9) rotate(-3deg);}
|
88 |
+
30%, 50%, 70%, 90% {-webkit-transform: scale(1.1) rotate(3deg);}
|
89 |
+
40%, 60%, 80% {-webkit-transform: scale(1.1) rotate(-3deg);}
|
90 |
+
100% {-webkit-transform: scale(1) rotate(0);}
|
91 |
+
}
|
92 |
+
|
93 |
+
@-moz-keyframes tada {
|
94 |
+
0% {-moz-transform: scale(1);}
|
95 |
+
10%, 20% {-moz-transform: scale(0.9) rotate(-3deg);}
|
96 |
+
30%, 50%, 70%, 90% {-moz-transform: scale(1.1) rotate(3deg);}
|
97 |
+
40%, 60%, 80% {-moz-transform: scale(1.1) rotate(-3deg);}
|
98 |
+
100% {-moz-transform: scale(1) rotate(0);}
|
99 |
+
}
|
100 |
+
|
101 |
+
@-o-keyframes tada {
|
102 |
+
0% {-o-transform: scale(1);}
|
103 |
+
10%, 20% {-o-transform: scale(0.9) rotate(-3deg);}
|
104 |
+
30%, 50%, 70%, 90% {-o-transform: scale(1.1) rotate(3deg);}
|
105 |
+
40%, 60%, 80% {-o-transform: scale(1.1) rotate(-3deg);}
|
106 |
+
100% {-o-transform: scale(1) rotate(0);}
|
107 |
+
}
|
108 |
+
|
109 |
+
@keyframes tada {
|
110 |
+
0% {transform: scale(1);}
|
111 |
+
10%, 20% {transform: scale(0.9) rotate(-3deg);}
|
112 |
+
30%, 50%, 70%, 90% {transform: scale(1.1) rotate(3deg);}
|
113 |
+
40%, 60%, 80% {transform: scale(1.1) rotate(-3deg);}
|
114 |
+
100% {transform: scale(1) rotate(0);}
|
115 |
+
}
|
116 |
+
|
117 |
+
.tada {
|
118 |
+
-webkit-animation-name: tada;
|
119 |
+
-moz-animation-name: tada;
|
120 |
+
-o-animation-name: tada;
|
121 |
+
animation-name: tada;
|
122 |
+
}
|
123 |
+
@-webkit-keyframes swing {
|
124 |
+
20%, 40%, 60%, 80%, 100% { -webkit-transform-origin: top center; }
|
125 |
+
20% { -webkit-transform: rotate(15deg); }
|
126 |
+
40% { -webkit-transform: rotate(-10deg); }
|
127 |
+
60% { -webkit-transform: rotate(5deg); }
|
128 |
+
80% { -webkit-transform: rotate(-5deg); }
|
129 |
+
100% { -webkit-transform: rotate(0deg); }
|
130 |
+
}
|
131 |
+
|
132 |
+
@-moz-keyframes swing {
|
133 |
+
20% { -moz-transform: rotate(15deg); }
|
134 |
+
40% { -moz-transform: rotate(-10deg); }
|
135 |
+
60% { -moz-transform: rotate(5deg); }
|
136 |
+
80% { -moz-transform: rotate(-5deg); }
|
137 |
+
100% { -moz-transform: rotate(0deg); }
|
138 |
+
}
|
139 |
+
|
140 |
+
@-o-keyframes swing {
|
141 |
+
20% { -o-transform: rotate(15deg); }
|
142 |
+
40% { -o-transform: rotate(-10deg); }
|
143 |
+
60% { -o-transform: rotate(5deg); }
|
144 |
+
80% { -o-transform: rotate(-5deg); }
|
145 |
+
100% { -o-transform: rotate(0deg); }
|
146 |
+
}
|
147 |
+
|
148 |
+
@keyframes swing {
|
149 |
+
20% { transform: rotate(15deg); }
|
150 |
+
40% { transform: rotate(-10deg); }
|
151 |
+
60% { transform: rotate(5deg); }
|
152 |
+
80% { transform: rotate(-5deg); }
|
153 |
+
100% { transform: rotate(0deg); }
|
154 |
+
}
|
155 |
+
|
156 |
+
.swing {
|
157 |
+
-webkit-transform-origin: top center;
|
158 |
+
-moz-transform-origin: top center;
|
159 |
+
-o-transform-origin: top center;
|
160 |
+
transform-origin: top center;
|
161 |
+
-webkit-animation-name: swing;
|
162 |
+
-moz-animation-name: swing;
|
163 |
+
-o-animation-name: swing;
|
164 |
+
animation-name: swing;
|
165 |
+
}
|
166 |
+
/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
|
167 |
+
|
168 |
+
@-webkit-keyframes wobble {
|
169 |
+
0% { -webkit-transform: translateX(0%); }
|
170 |
+
15% { -webkit-transform: translateX(-25%) rotate(-5deg); }
|
171 |
+
30% { -webkit-transform: translateX(20%) rotate(3deg); }
|
172 |
+
45% { -webkit-transform: translateX(-15%) rotate(-3deg); }
|
173 |
+
60% { -webkit-transform: translateX(10%) rotate(2deg); }
|
174 |
+
75% { -webkit-transform: translateX(-5%) rotate(-1deg); }
|
175 |
+
100% { -webkit-transform: translateX(0%); }
|
176 |
+
}
|
177 |
+
|
178 |
+
@-moz-keyframes wobble {
|
179 |
+
0% { -moz-transform: translateX(0%); }
|
180 |
+
15% { -moz-transform: translateX(-25%) rotate(-5deg); }
|
181 |
+
30% { -moz-transform: translateX(20%) rotate(3deg); }
|
182 |
+
45% { -moz-transform: translateX(-15%) rotate(-3deg); }
|
183 |
+
60% { -moz-transform: translateX(10%) rotate(2deg); }
|
184 |
+
75% { -moz-transform: translateX(-5%) rotate(-1deg); }
|
185 |
+
100% { -moz-transform: translateX(0%); }
|
186 |
+
}
|
187 |
+
|
188 |
+
@-o-keyframes wobble {
|
189 |
+
0% { -o-transform: translateX(0%); }
|
190 |
+
15% { -o-transform: translateX(-25%) rotate(-5deg); }
|
191 |
+
30% { -o-transform: translateX(20%) rotate(3deg); }
|
192 |
+
45% { -o-transform: translateX(-15%) rotate(-3deg); }
|
193 |
+
60% { -o-transform: translateX(10%) rotate(2deg); }
|
194 |
+
75% { -o-transform: translateX(-5%) rotate(-1deg); }
|
195 |
+
100% { -o-transform: translateX(0%); }
|
196 |
+
}
|
197 |
+
|
198 |
+
@keyframes wobble {
|
199 |
+
0% { transform: translateX(0%); }
|
200 |
+
15% { transform: translateX(-25%) rotate(-5deg); }
|
201 |
+
30% { transform: translateX(20%) rotate(3deg); }
|
202 |
+
45% { transform: translateX(-15%) rotate(-3deg); }
|
203 |
+
60% { transform: translateX(10%) rotate(2deg); }
|
204 |
+
75% { transform: translateX(-5%) rotate(-1deg); }
|
205 |
+
100% { transform: translateX(0%); }
|
206 |
+
}
|
207 |
+
|
208 |
+
.wobble {
|
209 |
+
-webkit-animation-name: wobble;
|
210 |
+
-moz-animation-name: wobble;
|
211 |
+
-o-animation-name: wobble;
|
212 |
+
animation-name: wobble;
|
213 |
+
}
|
214 |
+
@-webkit-keyframes wiggle {
|
215 |
+
0% { -webkit-transform: skewX(9deg); }
|
216 |
+
10% { -webkit-transform: skewX(-8deg); }
|
217 |
+
20% { -webkit-transform: skewX(7deg); }
|
218 |
+
30% { -webkit-transform: skewX(-6deg); }
|
219 |
+
40% { -webkit-transform: skewX(5deg); }
|
220 |
+
50% { -webkit-transform: skewX(-4deg); }
|
221 |
+
60% { -webkit-transform: skewX(3deg); }
|
222 |
+
70% { -webkit-transform: skewX(-2deg); }
|
223 |
+
80% { -webkit-transform: skewX(1deg); }
|
224 |
+
90% { -webkit-transform: skewX(0deg); }
|
225 |
+
100% { -webkit-transform: skewX(0deg); }
|
226 |
+
}
|
227 |
+
|
228 |
+
@-moz-keyframes wiggle {
|
229 |
+
0% { -moz-transform: skewX(9deg); }
|
230 |
+
10% { -moz-transform: skewX(-8deg); }
|
231 |
+
20% { -moz-transform: skewX(7deg); }
|
232 |
+
30% { -moz-transform: skewX(-6deg); }
|
233 |
+
40% { -moz-transform: skewX(5deg); }
|
234 |
+
50% { -moz-transform: skewX(-4deg); }
|
235 |
+
60% { -moz-transform: skewX(3deg); }
|
236 |
+
70% { -moz-transform: skewX(-2deg); }
|
237 |
+
80% { -moz-transform: skewX(1deg); }
|
238 |
+
90% { -moz-transform: skewX(0deg); }
|
239 |
+
100% { -moz-transform: skewX(0deg); }
|
240 |
+
}
|
241 |
+
|
242 |
+
@-o-keyframes wiggle {
|
243 |
+
0% { -o-transform: skewX(9deg); }
|
244 |
+
10% { -o-transform: skewX(-8deg); }
|
245 |
+
20% { -o-transform: skewX(7deg); }
|
246 |
+
30% { -o-transform: skewX(-6deg); }
|
247 |
+
40% { -o-transform: skewX(5deg); }
|
248 |
+
50% { -o-transform: skewX(-4deg); }
|
249 |
+
60% { -o-transform: skewX(3deg); }
|
250 |
+
70% { -o-transform: skewX(-2deg); }
|
251 |
+
80% { -o-transform: skewX(1deg); }
|
252 |
+
90% { -o-transform: skewX(0deg); }
|
253 |
+
100% { -o-transform: skewX(0deg); }
|
254 |
+
}
|
255 |
+
|
256 |
+
@keyframes wiggle {
|
257 |
+
0% { transform: skewX(9deg); }
|
258 |
+
10% { transform: skewX(-8deg); }
|
259 |
+
20% { transform: skewX(7deg); }
|
260 |
+
30% { transform: skewX(-6deg); }
|
261 |
+
40% { transform: skewX(5deg); }
|
262 |
+
50% { transform: skewX(-4deg); }
|
263 |
+
60% { transform: skewX(3deg); }
|
264 |
+
70% { transform: skewX(-2deg); }
|
265 |
+
80% { transform: skewX(1deg); }
|
266 |
+
90% { transform: skewX(0deg); }
|
267 |
+
100% { transform: skewX(0deg); }
|
268 |
+
}
|
269 |
+
|
270 |
+
.wiggle {
|
271 |
+
-webkit-animation-name: wiggle;
|
272 |
+
-moz-animation-name: wiggle;
|
273 |
+
-o-animation-name: wiggle;
|
274 |
+
animation-name: wiggle;
|
275 |
+
|
276 |
+
-webkit-animation-timing-function: ease-in;
|
277 |
+
-moz-animation-timing-function: ease-in;
|
278 |
+
-o-animation-timing-function: ease-in;
|
279 |
+
animation-timing-function: ease-in;
|
280 |
+
}
|
281 |
+
/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
|
282 |
+
|
283 |
+
@-webkit-keyframes pulse {
|
284 |
+
0% { -webkit-transform: scale(1); }
|
285 |
+
50% { -webkit-transform: scale(1.1); }
|
286 |
+
100% { -webkit-transform: scale(1); }
|
287 |
+
}
|
288 |
+
@-moz-keyframes pulse {
|
289 |
+
0% { -moz-transform: scale(1); }
|
290 |
+
50% { -moz-transform: scale(1.1); }
|
291 |
+
100% { -moz-transform: scale(1); }
|
292 |
+
}
|
293 |
+
@-o-keyframes pulse {
|
294 |
+
0% { -o-transform: scale(1); }
|
295 |
+
50% { -o-transform: scale(1.1); }
|
296 |
+
100% { -o-transform: scale(1); }
|
297 |
+
}
|
298 |
+
@keyframes pulse {
|
299 |
+
0% { transform: scale(1); }
|
300 |
+
50% { transform: scale(1.1); }
|
301 |
+
100% { transform: scale(1); }
|
302 |
+
}
|
303 |
+
|
304 |
+
.pulse {
|
305 |
+
-webkit-animation-name: pulse;
|
306 |
+
-moz-animation-name: pulse;
|
307 |
+
-o-animation-name: pulse;
|
308 |
+
animation-name: pulse;
|
309 |
+
}
|
310 |
+
@-webkit-keyframes flip {
|
311 |
+
0% {
|
312 |
+
-webkit-transform: perspective(400px) rotateY(0);
|
313 |
+
-webkit-animation-timing-function: ease-out;
|
314 |
+
}
|
315 |
+
40% {
|
316 |
+
-webkit-transform: perspective(400px) translateZ(150px) rotateY(170deg);
|
317 |
+
-webkit-animation-timing-function: ease-out;
|
318 |
+
}
|
319 |
+
50% {
|
320 |
+
-webkit-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
|
321 |
+
-webkit-animation-timing-function: ease-in;
|
322 |
+
}
|
323 |
+
80% {
|
324 |
+
-webkit-transform: perspective(400px) rotateY(360deg) scale(.95);
|
325 |
+
-webkit-animation-timing-function: ease-in;
|
326 |
+
}
|
327 |
+
100% {
|
328 |
+
-webkit-transform: perspective(400px) scale(1);
|
329 |
+
-webkit-animation-timing-function: ease-in;
|
330 |
+
}
|
331 |
+
}
|
332 |
+
@-moz-keyframes flip {
|
333 |
+
0% {
|
334 |
+
-moz-transform: perspective(400px) rotateY(0);
|
335 |
+
-moz-animation-timing-function: ease-out;
|
336 |
+
}
|
337 |
+
40% {
|
338 |
+
-moz-transform: perspective(400px) translateZ(150px) rotateY(170deg);
|
339 |
+
-moz-animation-timing-function: ease-out;
|
340 |
+
}
|
341 |
+
50% {
|
342 |
+
-moz-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
|
343 |
+
-moz-animation-timing-function: ease-in;
|
344 |
+
}
|
345 |
+
80% {
|
346 |
+
-moz-transform: perspective(400px) rotateY(360deg) scale(.95);
|
347 |
+
-moz-animation-timing-function: ease-in;
|
348 |
+
}
|
349 |
+
100% {
|
350 |
+
-moz-transform: perspective(400px) scale(1);
|
351 |
+
-moz-animation-timing-function: ease-in;
|
352 |
+
}
|
353 |
+
}
|
354 |
+
@-o-keyframes flip {
|
355 |
+
0% {
|
356 |
+
-o-transform: perspective(400px) rotateY(0);
|
357 |
+
-o-animation-timing-function: ease-out;
|
358 |
+
}
|
359 |
+
40% {
|
360 |
+
-o-transform: perspective(400px) translateZ(150px) rotateY(170deg);
|
361 |
+
-o-animation-timing-function: ease-out;
|
362 |
+
}
|
363 |
+
50% {
|
364 |
+
-o-transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
|
365 |
+
-o-animation-timing-function: ease-in;
|
366 |
+
}
|
367 |
+
80% {
|
368 |
+
-o-transform: perspective(400px) rotateY(360deg) scale(.95);
|
369 |
+
-o-animation-timing-function: ease-in;
|
370 |
+
}
|
371 |
+
100% {
|
372 |
+
-o-transform: perspective(400px) scale(1);
|
373 |
+
-o-animation-timing-function: ease-in;
|
374 |
+
}
|
375 |
+
}
|
376 |
+
@keyframes flip {
|
377 |
+
0% {
|
378 |
+
transform: perspective(400px) rotateY(0);
|
379 |
+
animation-timing-function: ease-out;
|
380 |
+
}
|
381 |
+
40% {
|
382 |
+
transform: perspective(400px) translateZ(150px) rotateY(170deg);
|
383 |
+
animation-timing-function: ease-out;
|
384 |
+
}
|
385 |
+
50% {
|
386 |
+
transform: perspective(400px) translateZ(150px) rotateY(190deg) scale(1);
|
387 |
+
animation-timing-function: ease-in;
|
388 |
+
}
|
389 |
+
80% {
|
390 |
+
transform: perspective(400px) rotateY(360deg) scale(.95);
|
391 |
+
animation-timing-function: ease-in;
|
392 |
+
}
|
393 |
+
100% {
|
394 |
+
transform: perspective(400px) scale(1);
|
395 |
+
animation-timing-function: ease-in;
|
396 |
+
}
|
397 |
+
}
|
398 |
+
|
399 |
+
.flip {
|
400 |
+
-webkit-transform-style: preserve-3d;
|
401 |
+
-moz-transform-style: preserve-3d;
|
402 |
+
-o-transform-style: preserve-3d;
|
403 |
+
transform-style: preserve-3d;
|
404 |
+
-webkit-backface-visibility: visible !important;
|
405 |
+
-webkit-animation-name: flip;
|
406 |
+
-moz-backface-visibility: visible !important;
|
407 |
+
-moz-animation-name: flip;
|
408 |
+
-o-backface-visibility: visible !important;
|
409 |
+
-o-animation-name: flip;
|
410 |
+
backface-visibility: visible !important;
|
411 |
+
animation-name: flip;
|
412 |
+
}
|
413 |
+
@-webkit-keyframes flipInX {
|
414 |
+
0% {
|
415 |
+
-webkit-transform: perspective(400px) rotateX(90deg);
|
416 |
+
opacity: 0;
|
417 |
+
}
|
418 |
+
|
419 |
+
40% {
|
420 |
+
-webkit-transform: perspective(400px) rotateX(-10deg);
|
421 |
+
}
|
422 |
+
|
423 |
+
70% {
|
424 |
+
-webkit-transform: perspective(400px) rotateX(10deg);
|
425 |
+
}
|
426 |
+
|
427 |
+
100% {
|
428 |
+
-webkit-transform: perspective(400px) rotateX(0deg);
|
429 |
+
opacity: 1;
|
430 |
+
}
|
431 |
+
}
|
432 |
+
@-moz-keyframes flipInX {
|
433 |
+
0% {
|
434 |
+
-moz-transform: perspective(400px) rotateX(90deg);
|
435 |
+
opacity: 0;
|
436 |
+
}
|
437 |
+
|
438 |
+
40% {
|
439 |
+
-moz-transform: perspective(400px) rotateX(-10deg);
|
440 |
+
}
|
441 |
+
|
442 |
+
70% {
|
443 |
+
-moz-transform: perspective(400px) rotateX(10deg);
|
444 |
+
}
|
445 |
+
|
446 |
+
100% {
|
447 |
+
-moz-transform: perspective(400px) rotateX(0deg);
|
448 |
+
opacity: 1;
|
449 |
+
}
|
450 |
+
}
|
451 |
+
@-o-keyframes flipInX {
|
452 |
+
0% {
|
453 |
+
-o-transform: perspective(400px) rotateX(90deg);
|
454 |
+
opacity: 0;
|
455 |
+
}
|
456 |
+
|
457 |
+
40% {
|
458 |
+
-o-transform: perspective(400px) rotateX(-10deg);
|
459 |
+
}
|
460 |
+
|
461 |
+
70% {
|
462 |
+
-o-transform: perspective(400px) rotateX(10deg);
|
463 |
+
}
|
464 |
+
|
465 |
+
100% {
|
466 |
+
-o-transform: perspective(400px) rotateX(0deg);
|
467 |
+
opacity: 1;
|
468 |
+
}
|
469 |
+
}
|
470 |
+
@keyframes flipInX {
|
471 |
+
0% {
|
472 |
+
transform: perspective(400px) rotateX(90deg);
|
473 |
+
opacity: 0;
|
474 |
+
}
|
475 |
+
|
476 |
+
40% {
|
477 |
+
transform: perspective(400px) rotateX(-10deg);
|
478 |
+
}
|
479 |
+
|
480 |
+
70% {
|
481 |
+
transform: perspective(400px) rotateX(10deg);
|
482 |
+
}
|
483 |
+
|
484 |
+
100% {
|
485 |
+
transform: perspective(400px) rotateX(0deg);
|
486 |
+
opacity: 1;
|
487 |
+
}
|
488 |
+
}
|
489 |
+
|
490 |
+
.flipInX {
|
491 |
+
-webkit-backface-visibility: visible !important;
|
492 |
+
-webkit-animation-name: flipInX;
|
493 |
+
-moz-backface-visibility: visible !important;
|
494 |
+
-moz-animation-name: flipInX;
|
495 |
+
-o-backface-visibility: visible !important;
|
496 |
+
-o-animation-name: flipInX;
|
497 |
+
backface-visibility: visible !important;
|
498 |
+
animation-name: flipInX;
|
499 |
+
}
|
500 |
+
@-webkit-keyframes flipOutX {
|
501 |
+
0% {
|
502 |
+
-webkit-transform: perspective(400px) rotateX(0deg);
|
503 |
+
opacity: 1;
|
504 |
+
}
|
505 |
+
100% {
|
506 |
+
-webkit-transform: perspective(400px) rotateX(90deg);
|
507 |
+
opacity: 0;
|
508 |
+
}
|
509 |
+
}
|
510 |
+
|
511 |
+
@-moz-keyframes flipOutX {
|
512 |
+
0% {
|
513 |
+
-moz-transform: perspective(400px) rotateX(0deg);
|
514 |
+
opacity: 1;
|
515 |
+
}
|
516 |
+
100% {
|
517 |
+
-moz-transform: perspective(400px) rotateX(90deg);
|
518 |
+
opacity: 0;
|
519 |
+
}
|
520 |
+
}
|
521 |
+
|
522 |
+
@-o-keyframes flipOutX {
|
523 |
+
0% {
|
524 |
+
-o-transform: perspective(400px) rotateX(0deg);
|
525 |
+
opacity: 1;
|
526 |
+
}
|
527 |
+
100% {
|
528 |
+
-o-transform: perspective(400px) rotateX(90deg);
|
529 |
+
opacity: 0;
|
530 |
+
}
|
531 |
+
}
|
532 |
+
|
533 |
+
@keyframes flipOutX {
|
534 |
+
0% {
|
535 |
+
transform: perspective(400px) rotateX(0deg);
|
536 |
+
opacity: 1;
|
537 |
+
}
|
538 |
+
100% {
|
539 |
+
transform: perspective(400px) rotateX(90deg);
|
540 |
+
opacity: 0;
|
541 |
+
}
|
542 |
+
}
|
543 |
+
|
544 |
+
.flipOutX {
|
545 |
+
-webkit-animation-name: flipOutX;
|
546 |
+
-webkit-backface-visibility: visible !important;
|
547 |
+
-moz-animation-name: flipOutX;
|
548 |
+
-moz-backface-visibility: visible !important;
|
549 |
+
-o-animation-name: flipOutX;
|
550 |
+
-o-backface-visibility: visible !important;
|
551 |
+
animation-name: flipOutX;
|
552 |
+
backface-visibility: visible !important;
|
553 |
+
}
|
554 |
+
@-webkit-keyframes flipInY {
|
555 |
+
0% {
|
556 |
+
-webkit-transform: perspective(400px) rotateY(90deg);
|
557 |
+
opacity: 0;
|
558 |
+
}
|
559 |
+
|
560 |
+
40% {
|
561 |
+
-webkit-transform: perspective(400px) rotateY(-10deg);
|
562 |
+
}
|
563 |
+
|
564 |
+
70% {
|
565 |
+
-webkit-transform: perspective(400px) rotateY(10deg);
|
566 |
+
}
|
567 |
+
|
568 |
+
100% {
|
569 |
+
-webkit-transform: perspective(400px) rotateY(0deg);
|
570 |
+
opacity: 1;
|
571 |
+
}
|
572 |
+
}
|
573 |
+
@-moz-keyframes flipInY {
|
574 |
+
0% {
|
575 |
+
-moz-transform: perspective(400px) rotateY(90deg);
|
576 |
+
opacity: 0;
|
577 |
+
}
|
578 |
+
|
579 |
+
40% {
|
580 |
+
-moz-transform: perspective(400px) rotateY(-10deg);
|
581 |
+
}
|
582 |
+
|
583 |
+
70% {
|
584 |
+
-moz-transform: perspective(400px) rotateY(10deg);
|
585 |
+
}
|
586 |
+
|
587 |
+
100% {
|
588 |
+
-moz-transform: perspective(400px) rotateY(0deg);
|
589 |
+
opacity: 1;
|
590 |
+
}
|
591 |
+
}
|
592 |
+
@-o-keyframes flipInY {
|
593 |
+
0% {
|
594 |
+
-o-transform: perspective(400px) rotateY(90deg);
|
595 |
+
opacity: 0;
|
596 |
+
}
|
597 |
+
|
598 |
+
40% {
|
599 |
+
-o-transform: perspective(400px) rotateY(-10deg);
|
600 |
+
}
|
601 |
+
|
602 |
+
70% {
|
603 |
+
-o-transform: perspective(400px) rotateY(10deg);
|
604 |
+
}
|
605 |
+
|
606 |
+
100% {
|
607 |
+
-o-transform: perspective(400px) rotateY(0deg);
|
608 |
+
opacity: 1;
|
609 |
+
}
|
610 |
+
}
|
611 |
+
@keyframes flipInY {
|
612 |
+
0% {
|
613 |
+
transform: perspective(400px) rotateY(90deg);
|
614 |
+
opacity: 0;
|
615 |
+
}
|
616 |
+
|
617 |
+
40% {
|
618 |
+
transform: perspective(400px) rotateY(-10deg);
|
619 |
+
}
|
620 |
+
|
621 |
+
70% {
|
622 |
+
transform: perspective(400px) rotateY(10deg);
|
623 |
+
}
|
624 |
+
|
625 |
+
100% {
|
626 |
+
transform: perspective(400px) rotateY(0deg);
|
627 |
+
opacity: 1;
|
628 |
+
}
|
629 |
+
}
|
630 |
+
|
631 |
+
.flipInY {
|
632 |
+
-webkit-backface-visibility: visible !important;
|
633 |
+
-webkit-animation-name: flipInY;
|
634 |
+
-moz-backface-visibility: visible !important;
|
635 |
+
-moz-animation-name: flipInY;
|
636 |
+
-o-backface-visibility: visible !important;
|
637 |
+
-o-animation-name: flipInY;
|
638 |
+
backface-visibility: visible !important;
|
639 |
+
animation-name: flipInY;
|
640 |
+
}
|
641 |
+
@-webkit-keyframes flipOutY {
|
642 |
+
0% {
|
643 |
+
-webkit-transform: perspective(400px) rotateY(0deg);
|
644 |
+
opacity: 1;
|
645 |
+
}
|
646 |
+
100% {
|
647 |
+
-webkit-transform: perspective(400px) rotateY(90deg);
|
648 |
+
opacity: 0;
|
649 |
+
}
|
650 |
+
}
|
651 |
+
@-moz-keyframes flipOutY {
|
652 |
+
0% {
|
653 |
+
-moz-transform: perspective(400px) rotateY(0deg);
|
654 |
+
opacity: 1;
|
655 |
+
}
|
656 |
+
100% {
|
657 |
+
-moz-transform: perspective(400px) rotateY(90deg);
|
658 |
+
opacity: 0;
|
659 |
+
}
|
660 |
+
}
|
661 |
+
@-o-keyframes flipOutY {
|
662 |
+
0% {
|
663 |
+
-o-transform: perspective(400px) rotateY(0deg);
|
664 |
+
opacity: 1;
|
665 |
+
}
|
666 |
+
100% {
|
667 |
+
-o-transform: perspective(400px) rotateY(90deg);
|
668 |
+
opacity: 0;
|
669 |
+
}
|
670 |
+
}
|
671 |
+
@keyframes flipOutY {
|
672 |
+
0% {
|
673 |
+
transform: perspective(400px) rotateY(0deg);
|
674 |
+
opacity: 1;
|
675 |
+
}
|
676 |
+
100% {
|
677 |
+
transform: perspective(400px) rotateY(90deg);
|
678 |
+
opacity: 0;
|
679 |
+
}
|
680 |
+
}
|
681 |
+
|
682 |
+
.flipOutY {
|
683 |
+
-webkit-backface-visibility: visible !important;
|
684 |
+
-webkit-animation-name: flipOutY;
|
685 |
+
-moz-backface-visibility: visible !important;
|
686 |
+
-moz-animation-name: flipOutY;
|
687 |
+
-o-backface-visibility: visible !important;
|
688 |
+
-o-animation-name: flipOutY;
|
689 |
+
backface-visibility: visible !important;
|
690 |
+
animation-name: flipOutY;
|
691 |
+
}
|
692 |
+
@-webkit-keyframes fadeIn {
|
693 |
+
0% {opacity: 0;}
|
694 |
+
100% {opacity: 1;}
|
695 |
+
}
|
696 |
+
|
697 |
+
@-moz-keyframes fadeIn {
|
698 |
+
0% {opacity: 0;}
|
699 |
+
100% {opacity: 1;}
|
700 |
+
}
|
701 |
+
|
702 |
+
@-o-keyframes fadeIn {
|
703 |
+
0% {opacity: 0;}
|
704 |
+
100% {opacity: 1;}
|
705 |
+
}
|
706 |
+
|
707 |
+
@keyframes fadeIn {
|
708 |
+
0% {opacity: 0;}
|
709 |
+
100% {opacity: 1;}
|
710 |
+
}
|
711 |
+
|
712 |
+
.fadeIn {
|
713 |
+
-webkit-animation-name: fadeIn;
|
714 |
+
-moz-animation-name: fadeIn;
|
715 |
+
-o-animation-name: fadeIn;
|
716 |
+
animation-name: fadeIn;
|
717 |
+
}
|
718 |
+
@-webkit-keyframes fadeInUp {
|
719 |
+
0% {
|
720 |
+
opacity: 0;
|
721 |
+
-webkit-transform: translateY(20px);
|
722 |
+
}
|
723 |
+
|
724 |
+
100% {
|
725 |
+
opacity: 1;
|
726 |
+
-webkit-transform: translateY(0);
|
727 |
+
}
|
728 |
+
}
|
729 |
+
|
730 |
+
@-moz-keyframes fadeInUp {
|
731 |
+
0% {
|
732 |
+
opacity: 0;
|
733 |
+
-moz-transform: translateY(20px);
|
734 |
+
}
|
735 |
+
|
736 |
+
100% {
|
737 |
+
opacity: 1;
|
738 |
+
-moz-transform: translateY(0);
|
739 |
+
}
|
740 |
+
}
|
741 |
+
|
742 |
+
@-o-keyframes fadeInUp {
|
743 |
+
0% {
|
744 |
+
opacity: 0;
|
745 |
+
-o-transform: translateY(20px);
|
746 |
+
}
|
747 |
+
|
748 |
+
100% {
|
749 |
+
opacity: 1;
|
750 |
+
-o-transform: translateY(0);
|
751 |
+
}
|
752 |
+
}
|
753 |
+
|
754 |
+
@keyframes fadeInUp {
|
755 |
+
0% {
|
756 |
+
opacity: 0;
|
757 |
+
transform: translateY(20px);
|
758 |
+
}
|
759 |
+
|
760 |
+
100% {
|
761 |
+
opacity: 1;
|
762 |
+
transform: translateY(0);
|
763 |
+
}
|
764 |
+
}
|
765 |
+
|
766 |
+
.fadeInUp {
|
767 |
+
-webkit-animation-name: fadeInUp;
|
768 |
+
-moz-animation-name: fadeInUp;
|
769 |
+
-o-animation-name: fadeInUp;
|
770 |
+
animation-name: fadeInUp;
|
771 |
+
}
|
772 |
+
@-webkit-keyframes fadeInDown {
|
773 |
+
0% {
|
774 |
+
opacity: 0;
|
775 |
+
-webkit-transform: translateY(-20px);
|
776 |
+
}
|
777 |
+
|
778 |
+
100% {
|
779 |
+
opacity: 1;
|
780 |
+
-webkit-transform: translateY(0);
|
781 |
+
}
|
782 |
+
}
|
783 |
+
|
784 |
+
@-moz-keyframes fadeInDown {
|
785 |
+
0% {
|
786 |
+
opacity: 0;
|
787 |
+
-moz-transform: translateY(-20px);
|
788 |
+
}
|
789 |
+
|
790 |
+
100% {
|
791 |
+
opacity: 1;
|
792 |
+
-moz-transform: translateY(0);
|
793 |
+
}
|
794 |
+
}
|
795 |
+
|
796 |
+
@-o-keyframes fadeInDown {
|
797 |
+
0% {
|
798 |
+
opacity: 0;
|
799 |
+
-o-transform: translateY(-20px);
|
800 |
+
}
|
801 |
+
|
802 |
+
100% {
|
803 |
+
opacity: 1;
|
804 |
+
-o-transform: translateY(0);
|
805 |
+
}
|
806 |
+
}
|
807 |
+
|
808 |
+
@keyframes fadeInDown {
|
809 |
+
0% {
|
810 |
+
opacity: 0;
|
811 |
+
transform: translateY(-20px);
|
812 |
+
}
|
813 |
+
|
814 |
+
100% {
|
815 |
+
opacity: 1;
|
816 |
+
transform: translateY(0);
|
817 |
+
}
|
818 |
+
}
|
819 |
+
|
820 |
+
.fadeInDown {
|
821 |
+
-webkit-animation-name: fadeInDown;
|
822 |
+
-moz-animation-name: fadeInDown;
|
823 |
+
-o-animation-name: fadeInDown;
|
824 |
+
animation-name: fadeInDown;
|
825 |
+
}
|
826 |
+
@-webkit-keyframes fadeInLeft {
|
827 |
+
0% {
|
828 |
+
opacity: 0;
|
829 |
+
-webkit-transform: translateX(-20px);
|
830 |
+
}
|
831 |
+
|
832 |
+
100% {
|
833 |
+
opacity: 1;
|
834 |
+
-webkit-transform: translateX(0);
|
835 |
+
}
|
836 |
+
}
|
837 |
+
|
838 |
+
@-moz-keyframes fadeInLeft {
|
839 |
+
0% {
|
840 |
+
opacity: 0;
|
841 |
+
-moz-transform: translateX(-20px);
|
842 |
+
}
|
843 |
+
|
844 |
+
100% {
|
845 |
+
opacity: 1;
|
846 |
+
-moz-transform: translateX(0);
|
847 |
+
}
|
848 |
+
}
|
849 |
+
|
850 |
+
@-o-keyframes fadeInLeft {
|
851 |
+
0% {
|
852 |
+
opacity: 0;
|
853 |
+
-o-transform: translateX(-20px);
|
854 |
+
}
|
855 |
+
|
856 |
+
100% {
|
857 |
+
opacity: 1;
|
858 |
+
-o-transform: translateX(0);
|
859 |
+
}
|
860 |
+
}
|
861 |
+
|
862 |
+
@keyframes fadeInLeft {
|
863 |
+
0% {
|
864 |
+
opacity: 0;
|
865 |
+
transform: translateX(-20px);
|
866 |
+
}
|
867 |
+
|
868 |
+
100% {
|
869 |
+
opacity: 1;
|
870 |
+
transform: translateX(0);
|
871 |
+
}
|
872 |
+
}
|
873 |
+
|
874 |
+
.fadeInLeft {
|
875 |
+
-webkit-animation-name: fadeInLeft;
|
876 |
+
-moz-animation-name: fadeInLeft;
|
877 |
+
-o-animation-name: fadeInLeft;
|
878 |
+
animation-name: fadeInLeft;
|
879 |
+
}
|
880 |
+
@-webkit-keyframes fadeInRight {
|
881 |
+
0% {
|
882 |
+
opacity: 0;
|
883 |
+
-webkit-transform: translateX(20px);
|
884 |
+
}
|
885 |
+
|
886 |
+
100% {
|
887 |
+
opacity: 1;
|
888 |
+
-webkit-transform: translateX(0);
|
889 |
+
}
|
890 |
+
}
|
891 |
+
|
892 |
+
@-moz-keyframes fadeInRight {
|
893 |
+
0% {
|
894 |
+
opacity: 0;
|
895 |
+
-moz-transform: translateX(20px);
|
896 |
+
}
|
897 |
+
|
898 |
+
100% {
|
899 |
+
opacity: 1;
|
900 |
+
-moz-transform: translateX(0);
|
901 |
+
}
|
902 |
+
}
|
903 |
+
|
904 |
+
@-o-keyframes fadeInRight {
|
905 |
+
0% {
|
906 |
+
opacity: 0;
|
907 |
+
-o-transform: translateX(20px);
|
908 |
+
}
|
909 |
+
|
910 |
+
100% {
|
911 |
+
opacity: 1;
|
912 |
+
-o-transform: translateX(0);
|
913 |
+
}
|
914 |
+
}
|
915 |
+
|
916 |
+
@keyframes fadeInRight {
|
917 |
+
0% {
|
918 |
+
opacity: 0;
|
919 |
+
transform: translateX(20px);
|
920 |
+
}
|
921 |
+
|
922 |
+
100% {
|
923 |
+
opacity: 1;
|
924 |
+
transform: translateX(0);
|
925 |
+
}
|
926 |
+
}
|
927 |
+
|
928 |
+
.fadeInRight {
|
929 |
+
-webkit-animation-name: fadeInRight;
|
930 |
+
-moz-animation-name: fadeInRight;
|
931 |
+
-o-animation-name: fadeInRight;
|
932 |
+
animation-name: fadeInRight;
|
933 |
+
}
|
934 |
+
@-webkit-keyframes fadeInUpBig {
|
935 |
+
0% {
|
936 |
+
opacity: 0;
|
937 |
+
-webkit-transform: translateY(2000px);
|
938 |
+
}
|
939 |
+
|
940 |
+
100% {
|
941 |
+
opacity: 1;
|
942 |
+
-webkit-transform: translateY(0);
|
943 |
+
}
|
944 |
+
}
|
945 |
+
|
946 |
+
@-moz-keyframes fadeInUpBig {
|
947 |
+
0% {
|
948 |
+
opacity: 0;
|
949 |
+
-moz-transform: translateY(2000px);
|
950 |
+
}
|
951 |
+
|
952 |
+
100% {
|
953 |
+
opacity: 1;
|
954 |
+
-moz-transform: translateY(0);
|
955 |
+
}
|
956 |
+
}
|
957 |
+
|
958 |
+
@-o-keyframes fadeInUpBig {
|
959 |
+
0% {
|
960 |
+
opacity: 0;
|
961 |
+
-o-transform: translateY(2000px);
|
962 |
+
}
|
963 |
+
|
964 |
+
100% {
|
965 |
+
opacity: 1;
|
966 |
+
-o-transform: translateY(0);
|
967 |
+
}
|
968 |
+
}
|
969 |
+
|
970 |
+
@keyframes fadeInUpBig {
|
971 |
+
0% {
|
972 |
+
opacity: 0;
|
973 |
+
transform: translateY(2000px);
|
974 |
+
}
|
975 |
+
|
976 |
+
100% {
|
977 |
+
opacity: 1;
|
978 |
+
transform: translateY(0);
|
979 |
+
}
|
980 |
+
}
|
981 |
+
|
982 |
+
.fadeInUpBig {
|
983 |
+
-webkit-animation-name: fadeInUpBig;
|
984 |
+
-moz-animation-name: fadeInUpBig;
|
985 |
+
-o-animation-name: fadeInUpBig;
|
986 |
+
animation-name: fadeInUpBig;
|
987 |
+
}
|
988 |
+
@-webkit-keyframes fadeInDownBig {
|
989 |
+
0% {
|
990 |
+
opacity: 0;
|
991 |
+
-webkit-transform: translateY(-2000px);
|
992 |
+
}
|
993 |
+
|
994 |
+
100% {
|
995 |
+
opacity: 1;
|
996 |
+
-webkit-transform: translateY(0);
|
997 |
+
}
|
998 |
+
}
|
999 |
+
|
1000 |
+
@-moz-keyframes fadeInDownBig {
|
1001 |
+
0% {
|
1002 |
+
opacity: 0;
|
1003 |
+
-moz-transform: translateY(-2000px);
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
100% {
|
1007 |
+
opacity: 1;
|
1008 |
+
-moz-transform: translateY(0);
|
1009 |
+
}
|
1010 |
+
}
|
1011 |
+
|
1012 |
+
@-o-keyframes fadeInDownBig {
|
1013 |
+
0% {
|
1014 |
+
opacity: 0;
|
1015 |
+
-o-transform: translateY(-2000px);
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
100% {
|
1019 |
+
opacity: 1;
|
1020 |
+
-o-transform: translateY(0);
|
1021 |
+
}
|
1022 |
+
}
|
1023 |
+
|
1024 |
+
@keyframes fadeInDownBig {
|
1025 |
+
0% {
|
1026 |
+
opacity: 0;
|
1027 |
+
transform: translateY(-2000px);
|
1028 |
+
}
|
1029 |
+
|
1030 |
+
100% {
|
1031 |
+
opacity: 1;
|
1032 |
+
transform: translateY(0);
|
1033 |
+
}
|
1034 |
+
}
|
1035 |
+
|
1036 |
+
.fadeInDownBig {
|
1037 |
+
-webkit-animation-name: fadeInDownBig;
|
1038 |
+
-moz-animation-name: fadeInDownBig;
|
1039 |
+
-o-animation-name: fadeInDownBig;
|
1040 |
+
animation-name: fadeInDownBig;
|
1041 |
+
}
|
1042 |
+
@-webkit-keyframes fadeInLeftBig {
|
1043 |
+
0% {
|
1044 |
+
opacity: 0;
|
1045 |
+
-webkit-transform: translateX(-2000px);
|
1046 |
+
}
|
1047 |
+
|
1048 |
+
100% {
|
1049 |
+
opacity: 1;
|
1050 |
+
-webkit-transform: translateX(0);
|
1051 |
+
}
|
1052 |
+
}
|
1053 |
+
@-moz-keyframes fadeInLeftBig {
|
1054 |
+
0% {
|
1055 |
+
opacity: 0;
|
1056 |
+
-moz-transform: translateX(-2000px);
|
1057 |
+
}
|
1058 |
+
|
1059 |
+
100% {
|
1060 |
+
opacity: 1;
|
1061 |
+
-moz-transform: translateX(0);
|
1062 |
+
}
|
1063 |
+
}
|
1064 |
+
@-o-keyframes fadeInLeftBig {
|
1065 |
+
0% {
|
1066 |
+
opacity: 0;
|
1067 |
+
-o-transform: translateX(-2000px);
|
1068 |
+
}
|
1069 |
+
|
1070 |
+
100% {
|
1071 |
+
opacity: 1;
|
1072 |
+
-o-transform: translateX(0);
|
1073 |
+
}
|
1074 |
+
}
|
1075 |
+
@keyframes fadeInLeftBig {
|
1076 |
+
0% {
|
1077 |
+
opacity: 0;
|
1078 |
+
transform: translateX(-2000px);
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
100% {
|
1082 |
+
opacity: 1;
|
1083 |
+
transform: translateX(0);
|
1084 |
+
}
|
1085 |
+
}
|
1086 |
+
|
1087 |
+
.fadeInLeftBig {
|
1088 |
+
-webkit-animation-name: fadeInLeftBig;
|
1089 |
+
-moz-animation-name: fadeInLeftBig;
|
1090 |
+
-o-animation-name: fadeInLeftBig;
|
1091 |
+
animation-name: fadeInLeftBig;
|
1092 |
+
}
|
1093 |
+
@-webkit-keyframes fadeInRightBig {
|
1094 |
+
0% {
|
1095 |
+
opacity: 0;
|
1096 |
+
-webkit-transform: translateX(2000px);
|
1097 |
+
}
|
1098 |
+
|
1099 |
+
100% {
|
1100 |
+
opacity: 1;
|
1101 |
+
-webkit-transform: translateX(0);
|
1102 |
+
}
|
1103 |
+
}
|
1104 |
+
|
1105 |
+
@-moz-keyframes fadeInRightBig {
|
1106 |
+
0% {
|
1107 |
+
opacity: 0;
|
1108 |
+
-moz-transform: translateX(2000px);
|
1109 |
+
}
|
1110 |
+
|
1111 |
+
100% {
|
1112 |
+
opacity: 1;
|
1113 |
+
-moz-transform: translateX(0);
|
1114 |
+
}
|
1115 |
+
}
|
1116 |
+
|
1117 |
+
@-o-keyframes fadeInRightBig {
|
1118 |
+
0% {
|
1119 |
+
opacity: 0;
|
1120 |
+
-o-transform: translateX(2000px);
|
1121 |
+
}
|
1122 |
+
|
1123 |
+
100% {
|
1124 |
+
opacity: 1;
|
1125 |
+
-o-transform: translateX(0);
|
1126 |
+
}
|
1127 |
+
}
|
1128 |
+
|
1129 |
+
@keyframes fadeInRightBig {
|
1130 |
+
0% {
|
1131 |
+
opacity: 0;
|
1132 |
+
transform: translateX(2000px);
|
1133 |
+
}
|
1134 |
+
|
1135 |
+
100% {
|
1136 |
+
opacity: 1;
|
1137 |
+
transform: translateX(0);
|
1138 |
+
}
|
1139 |
+
}
|
1140 |
+
|
1141 |
+
.fadeInRightBig {
|
1142 |
+
-webkit-animation-name: fadeInRightBig;
|
1143 |
+
-moz-animation-name: fadeInRightBig;
|
1144 |
+
-o-animation-name: fadeInRightBig;
|
1145 |
+
animation-name: fadeInRightBig;
|
1146 |
+
}
|
1147 |
+
@-webkit-keyframes fadeOut {
|
1148 |
+
0% {opacity: 1;}
|
1149 |
+
100% {opacity: 0;}
|
1150 |
+
}
|
1151 |
+
|
1152 |
+
@-moz-keyframes fadeOut {
|
1153 |
+
0% {opacity: 1;}
|
1154 |
+
100% {opacity: 0;}
|
1155 |
+
}
|
1156 |
+
|
1157 |
+
@-o-keyframes fadeOut {
|
1158 |
+
0% {opacity: 1;}
|
1159 |
+
100% {opacity: 0;}
|
1160 |
+
}
|
1161 |
+
|
1162 |
+
@keyframes fadeOut {
|
1163 |
+
0% {opacity: 1;}
|
1164 |
+
100% {opacity: 0;}
|
1165 |
+
}
|
1166 |
+
|
1167 |
+
.fadeOut {
|
1168 |
+
-webkit-animation-name: fadeOut;
|
1169 |
+
-moz-animation-name: fadeOut;
|
1170 |
+
-o-animation-name: fadeOut;
|
1171 |
+
animation-name: fadeOut;
|
1172 |
+
}
|
1173 |
+
@-webkit-keyframes fadeOutUp {
|
1174 |
+
0% {
|
1175 |
+
opacity: 1;
|
1176 |
+
-webkit-transform: translateY(0);
|
1177 |
+
}
|
1178 |
+
|
1179 |
+
100% {
|
1180 |
+
opacity: 0;
|
1181 |
+
-webkit-transform: translateY(-20px);
|
1182 |
+
}
|
1183 |
+
}
|
1184 |
+
@-moz-keyframes fadeOutUp {
|
1185 |
+
0% {
|
1186 |
+
opacity: 1;
|
1187 |
+
-moz-transform: translateY(0);
|
1188 |
+
}
|
1189 |
+
|
1190 |
+
100% {
|
1191 |
+
opacity: 0;
|
1192 |
+
-moz-transform: translateY(-20px);
|
1193 |
+
}
|
1194 |
+
}
|
1195 |
+
@-o-keyframes fadeOutUp {
|
1196 |
+
0% {
|
1197 |
+
opacity: 1;
|
1198 |
+
-o-transform: translateY(0);
|
1199 |
+
}
|
1200 |
+
|
1201 |
+
100% {
|
1202 |
+
opacity: 0;
|
1203 |
+
-o-transform: translateY(-20px);
|
1204 |
+
}
|
1205 |
+
}
|
1206 |
+
@keyframes fadeOutUp {
|
1207 |
+
0% {
|
1208 |
+
opacity: 1;
|
1209 |
+
transform: translateY(0);
|
1210 |
+
}
|
1211 |
+
|
1212 |
+
100% {
|
1213 |
+
opacity: 0;
|
1214 |
+
transform: translateY(-20px);
|
1215 |
+
}
|
1216 |
+
}
|
1217 |
+
|
1218 |
+
.fadeOutUp {
|
1219 |
+
-webkit-animation-name: fadeOutUp;
|
1220 |
+
-moz-animation-name: fadeOutUp;
|
1221 |
+
-o-animation-name: fadeOutUp;
|
1222 |
+
animation-name: fadeOutUp;
|
1223 |
+
}
|
1224 |
+
@-webkit-keyframes fadeOutDown {
|
1225 |
+
0% {
|
1226 |
+
opacity: 1;
|
1227 |
+
-webkit-transform: translateY(0);
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
100% {
|
1231 |
+
opacity: 0;
|
1232 |
+
-webkit-transform: translateY(20px);
|
1233 |
+
}
|
1234 |
+
}
|
1235 |
+
|
1236 |
+
@-moz-keyframes fadeOutDown {
|
1237 |
+
0% {
|
1238 |
+
opacity: 1;
|
1239 |
+
-moz-transform: translateY(0);
|
1240 |
+
}
|
1241 |
+
|
1242 |
+
100% {
|
1243 |
+
opacity: 0;
|
1244 |
+
-moz-transform: translateY(20px);
|
1245 |
+
}
|
1246 |
+
}
|
1247 |
+
|
1248 |
+
@-o-keyframes fadeOutDown {
|
1249 |
+
0% {
|
1250 |
+
opacity: 1;
|
1251 |
+
-o-transform: translateY(0);
|
1252 |
+
}
|
1253 |
+
|
1254 |
+
100% {
|
1255 |
+
opacity: 0;
|
1256 |
+
-o-transform: translateY(20px);
|
1257 |
+
}
|
1258 |
+
}
|
1259 |
+
|
1260 |
+
@keyframes fadeOutDown {
|
1261 |
+
0% {
|
1262 |
+
opacity: 1;
|
1263 |
+
transform: translateY(0);
|
1264 |
+
}
|
1265 |
+
|
1266 |
+
100% {
|
1267 |
+
opacity: 0;
|
1268 |
+
transform: translateY(20px);
|
1269 |
+
}
|
1270 |
+
}
|
1271 |
+
|
1272 |
+
.fadeOutDown {
|
1273 |
+
-webkit-animation-name: fadeOutDown;
|
1274 |
+
-moz-animation-name: fadeOutDown;
|
1275 |
+
-o-animation-name: fadeOutDown;
|
1276 |
+
animation-name: fadeOutDown;
|
1277 |
+
}
|
1278 |
+
@-webkit-keyframes fadeOutLeft {
|
1279 |
+
0% {
|
1280 |
+
opacity: 1;
|
1281 |
+
-webkit-transform: translateX(0);
|
1282 |
+
}
|
1283 |
+
|
1284 |
+
100% {
|
1285 |
+
opacity: 0;
|
1286 |
+
-webkit-transform: translateX(-20px);
|
1287 |
+
}
|
1288 |
+
}
|
1289 |
+
|
1290 |
+
@-moz-keyframes fadeOutLeft {
|
1291 |
+
0% {
|
1292 |
+
opacity: 1;
|
1293 |
+
-moz-transform: translateX(0);
|
1294 |
+
}
|
1295 |
+
|
1296 |
+
100% {
|
1297 |
+
opacity: 0;
|
1298 |
+
-moz-transform: translateX(-20px);
|
1299 |
+
}
|
1300 |
+
}
|
1301 |
+
|
1302 |
+
@-o-keyframes fadeOutLeft {
|
1303 |
+
0% {
|
1304 |
+
opacity: 1;
|
1305 |
+
-o-transform: translateX(0);
|
1306 |
+
}
|
1307 |
+
|
1308 |
+
100% {
|
1309 |
+
opacity: 0;
|
1310 |
+
-o-transform: translateX(-20px);
|
1311 |
+
}
|
1312 |
+
}
|
1313 |
+
|
1314 |
+
@keyframes fadeOutLeft {
|
1315 |
+
0% {
|
1316 |
+
opacity: 1;
|
1317 |
+
transform: translateX(0);
|
1318 |
+
}
|
1319 |
+
|
1320 |
+
100% {
|
1321 |
+
opacity: 0;
|
1322 |
+
transform: translateX(-20px);
|
1323 |
+
}
|
1324 |
+
}
|
1325 |
+
|
1326 |
+
.fadeOutLeft {
|
1327 |
+
-webkit-animation-name: fadeOutLeft;
|
1328 |
+
-moz-animation-name: fadeOutLeft;
|
1329 |
+
-o-animation-name: fadeOutLeft;
|
1330 |
+
animation-name: fadeOutLeft;
|
1331 |
+
}
|
1332 |
+
@-webkit-keyframes fadeOutRight {
|
1333 |
+
0% {
|
1334 |
+
opacity: 1;
|
1335 |
+
-webkit-transform: translateX(0);
|
1336 |
+
}
|
1337 |
+
|
1338 |
+
100% {
|
1339 |
+
opacity: 0;
|
1340 |
+
-webkit-transform: translateX(20px);
|
1341 |
+
}
|
1342 |
+
}
|
1343 |
+
|
1344 |
+
@-moz-keyframes fadeOutRight {
|
1345 |
+
0% {
|
1346 |
+
opacity: 1;
|
1347 |
+
-moz-transform: translateX(0);
|
1348 |
+
}
|
1349 |
+
|
1350 |
+
100% {
|
1351 |
+
opacity: 0;
|
1352 |
+
-moz-transform: translateX(20px);
|
1353 |
+
}
|
1354 |
+
}
|
1355 |
+
|
1356 |
+
@-o-keyframes fadeOutRight {
|
1357 |
+
0% {
|
1358 |
+
opacity: 1;
|
1359 |
+
-o-transform: translateX(0);
|
1360 |
+
}
|
1361 |
+
|
1362 |
+
100% {
|
1363 |
+
opacity: 0;
|
1364 |
+
-o-transform: translateX(20px);
|
1365 |
+
}
|
1366 |
+
}
|
1367 |
+
|
1368 |
+
@keyframes fadeOutRight {
|
1369 |
+
0% {
|
1370 |
+
opacity: 1;
|
1371 |
+
transform: translateX(0);
|
1372 |
+
}
|
1373 |
+
|
1374 |
+
100% {
|
1375 |
+
opacity: 0;
|
1376 |
+
transform: translateX(20px);
|
1377 |
+
}
|
1378 |
+
}
|
1379 |
+
|
1380 |
+
.fadeOutRight {
|
1381 |
+
-webkit-animation-name: fadeOutRight;
|
1382 |
+
-moz-animation-name: fadeOutRight;
|
1383 |
+
-o-animation-name: fadeOutRight;
|
1384 |
+
animation-name: fadeOutRight;
|
1385 |
+
}
|
1386 |
+
@-webkit-keyframes fadeOutUpBig {
|
1387 |
+
0% {
|
1388 |
+
opacity: 1;
|
1389 |
+
-webkit-transform: translateY(0);
|
1390 |
+
}
|
1391 |
+
|
1392 |
+
100% {
|
1393 |
+
opacity: 0;
|
1394 |
+
-webkit-transform: translateY(-2000px);
|
1395 |
+
}
|
1396 |
+
}
|
1397 |
+
|
1398 |
+
@-moz-keyframes fadeOutUpBig {
|
1399 |
+
0% {
|
1400 |
+
opacity: 1;
|
1401 |
+
-moz-transform: translateY(0);
|
1402 |
+
}
|
1403 |
+
|
1404 |
+
100% {
|
1405 |
+
opacity: 0;
|
1406 |
+
-moz-transform: translateY(-2000px);
|
1407 |
+
}
|
1408 |
+
}
|
1409 |
+
|
1410 |
+
@-o-keyframes fadeOutUpBig {
|
1411 |
+
0% {
|
1412 |
+
opacity: 1;
|
1413 |
+
-o-transform: translateY(0);
|
1414 |
+
}
|
1415 |
+
|
1416 |
+
100% {
|
1417 |
+
opacity: 0;
|
1418 |
+
-o-transform: translateY(-2000px);
|
1419 |
+
}
|
1420 |
+
}
|
1421 |
+
|
1422 |
+
@keyframes fadeOutUpBig {
|
1423 |
+
0% {
|
1424 |
+
opacity: 1;
|
1425 |
+
transform: translateY(0);
|
1426 |
+
}
|
1427 |
+
|
1428 |
+
100% {
|
1429 |
+
opacity: 0;
|
1430 |
+
transform: translateY(-2000px);
|
1431 |
+
}
|
1432 |
+
}
|
1433 |
+
|
1434 |
+
.fadeOutUpBig {
|
1435 |
+
-webkit-animation-name: fadeOutUpBig;
|
1436 |
+
-moz-animation-name: fadeOutUpBig;
|
1437 |
+
-o-animation-name: fadeOutUpBig;
|
1438 |
+
animation-name: fadeOutUpBig;
|
1439 |
+
}
|
1440 |
+
@-webkit-keyframes fadeOutDownBig {
|
1441 |
+
0% {
|
1442 |
+
opacity: 1;
|
1443 |
+
-webkit-transform: translateY(0);
|
1444 |
+
}
|
1445 |
+
|
1446 |
+
100% {
|
1447 |
+
opacity: 0;
|
1448 |
+
-webkit-transform: translateY(2000px);
|
1449 |
+
}
|
1450 |
+
}
|
1451 |
+
|
1452 |
+
@-moz-keyframes fadeOutDownBig {
|
1453 |
+
0% {
|
1454 |
+
opacity: 1;
|
1455 |
+
-moz-transform: translateY(0);
|
1456 |
+
}
|
1457 |
+
|
1458 |
+
100% {
|
1459 |
+
opacity: 0;
|
1460 |
+
-moz-transform: translateY(2000px);
|
1461 |
+
}
|
1462 |
+
}
|
1463 |
+
|
1464 |
+
@-o-keyframes fadeOutDownBig {
|
1465 |
+
0% {
|
1466 |
+
opacity: 1;
|
1467 |
+
-o-transform: translateY(0);
|
1468 |
+
}
|
1469 |
+
|
1470 |
+
100% {
|
1471 |
+
opacity: 0;
|
1472 |
+
-o-transform: translateY(2000px);
|
1473 |
+
}
|
1474 |
+
}
|
1475 |
+
|
1476 |
+
@keyframes fadeOutDownBig {
|
1477 |
+
0% {
|
1478 |
+
opacity: 1;
|
1479 |
+
transform: translateY(0);
|
1480 |
+
}
|
1481 |
+
|
1482 |
+
100% {
|
1483 |
+
opacity: 0;
|
1484 |
+
transform: translateY(2000px);
|
1485 |
+
}
|
1486 |
+
}
|
1487 |
+
|
1488 |
+
.fadeOutDownBig {
|
1489 |
+
-webkit-animation-name: fadeOutDownBig;
|
1490 |
+
-moz-animation-name: fadeOutDownBig;
|
1491 |
+
-o-animation-name: fadeOutDownBig;
|
1492 |
+
animation-name: fadeOutDownBig;
|
1493 |
+
}
|
1494 |
+
@-webkit-keyframes fadeOutLeftBig {
|
1495 |
+
0% {
|
1496 |
+
opacity: 1;
|
1497 |
+
-webkit-transform: translateX(0);
|
1498 |
+
}
|
1499 |
+
|
1500 |
+
100% {
|
1501 |
+
opacity: 0;
|
1502 |
+
-webkit-transform: translateX(-2000px);
|
1503 |
+
}
|
1504 |
+
}
|
1505 |
+
|
1506 |
+
@-moz-keyframes fadeOutLeftBig {
|
1507 |
+
0% {
|
1508 |
+
opacity: 1;
|
1509 |
+
-moz-transform: translateX(0);
|
1510 |
+
}
|
1511 |
+
|
1512 |
+
100% {
|
1513 |
+
opacity: 0;
|
1514 |
+
-moz-transform: translateX(-2000px);
|
1515 |
+
}
|
1516 |
+
}
|
1517 |
+
|
1518 |
+
@-o-keyframes fadeOutLeftBig {
|
1519 |
+
0% {
|
1520 |
+
opacity: 1;
|
1521 |
+
-o-transform: translateX(0);
|
1522 |
+
}
|
1523 |
+
|
1524 |
+
100% {
|
1525 |
+
opacity: 0;
|
1526 |
+
-o-transform: translateX(-2000px);
|
1527 |
+
}
|
1528 |
+
}
|
1529 |
+
|
1530 |
+
@keyframes fadeOutLeftBig {
|
1531 |
+
0% {
|
1532 |
+
opacity: 1;
|
1533 |
+
transform: translateX(0);
|
1534 |
+
}
|
1535 |
+
|
1536 |
+
100% {
|
1537 |
+
opacity: 0;
|
1538 |
+
transform: translateX(-2000px);
|
1539 |
+
}
|
1540 |
+
}
|
1541 |
+
|
1542 |
+
.fadeOutLeftBig {
|
1543 |
+
-webkit-animation-name: fadeOutLeftBig;
|
1544 |
+
-moz-animation-name: fadeOutLeftBig;
|
1545 |
+
-o-animation-name: fadeOutLeftBig;
|
1546 |
+
animation-name: fadeOutLeftBig;
|
1547 |
+
}
|
1548 |
+
@-webkit-keyframes fadeOutRightBig {
|
1549 |
+
0% {
|
1550 |
+
opacity: 1;
|
1551 |
+
-webkit-transform: translateX(0);
|
1552 |
+
}
|
1553 |
+
|
1554 |
+
100% {
|
1555 |
+
opacity: 0;
|
1556 |
+
-webkit-transform: translateX(2000px);
|
1557 |
+
}
|
1558 |
+
}
|
1559 |
+
@-moz-keyframes fadeOutRightBig {
|
1560 |
+
0% {
|
1561 |
+
opacity: 1;
|
1562 |
+
-moz-transform: translateX(0);
|
1563 |
+
}
|
1564 |
+
|
1565 |
+
100% {
|
1566 |
+
opacity: 0;
|
1567 |
+
-moz-transform: translateX(2000px);
|
1568 |
+
}
|
1569 |
+
}
|
1570 |
+
@-o-keyframes fadeOutRightBig {
|
1571 |
+
0% {
|
1572 |
+
opacity: 1;
|
1573 |
+
-o-transform: translateX(0);
|
1574 |
+
}
|
1575 |
+
|
1576 |
+
100% {
|
1577 |
+
opacity: 0;
|
1578 |
+
-o-transform: translateX(2000px);
|
1579 |
+
}
|
1580 |
+
}
|
1581 |
+
@keyframes fadeOutRightBig {
|
1582 |
+
0% {
|
1583 |
+
opacity: 1;
|
1584 |
+
transform: translateX(0);
|
1585 |
+
}
|
1586 |
+
|
1587 |
+
100% {
|
1588 |
+
opacity: 0;
|
1589 |
+
transform: translateX(2000px);
|
1590 |
+
}
|
1591 |
+
}
|
1592 |
+
|
1593 |
+
.fadeOutRightBig {
|
1594 |
+
-webkit-animation-name: fadeOutRightBig;
|
1595 |
+
-moz-animation-name: fadeOutRightBig;
|
1596 |
+
-o-animation-name: fadeOutRightBig;
|
1597 |
+
animation-name: fadeOutRightBig;
|
1598 |
+
}
|
1599 |
+
@-webkit-keyframes bounceIn {
|
1600 |
+
0% {
|
1601 |
+
opacity: 0;
|
1602 |
+
-webkit-transform: scale(.3);
|
1603 |
+
}
|
1604 |
+
|
1605 |
+
50% {
|
1606 |
+
opacity: 1;
|
1607 |
+
-webkit-transform: scale(1.05);
|
1608 |
+
}
|
1609 |
+
|
1610 |
+
70% {
|
1611 |
+
-webkit-transform: scale(.9);
|
1612 |
+
}
|
1613 |
+
|
1614 |
+
100% {
|
1615 |
+
-webkit-transform: scale(1);
|
1616 |
+
}
|
1617 |
+
}
|
1618 |
+
|
1619 |
+
@-moz-keyframes bounceIn {
|
1620 |
+
0% {
|
1621 |
+
opacity: 0;
|
1622 |
+
-moz-transform: scale(.3);
|
1623 |
+
}
|
1624 |
+
|
1625 |
+
50% {
|
1626 |
+
opacity: 1;
|
1627 |
+
-moz-transform: scale(1.05);
|
1628 |
+
}
|
1629 |
+
|
1630 |
+
70% {
|
1631 |
+
-moz-transform: scale(.9);
|
1632 |
+
}
|
1633 |
+
|
1634 |
+
100% {
|
1635 |
+
-moz-transform: scale(1);
|
1636 |
+
}
|
1637 |
+
}
|
1638 |
+
|
1639 |
+
@-o-keyframes bounceIn {
|
1640 |
+
0% {
|
1641 |
+
opacity: 0;
|
1642 |
+
-o-transform: scale(.3);
|
1643 |
+
}
|
1644 |
+
|
1645 |
+
50% {
|
1646 |
+
opacity: 1;
|
1647 |
+
-o-transform: scale(1.05);
|
1648 |
+
}
|
1649 |
+
|
1650 |
+
70% {
|
1651 |
+
-o-transform: scale(.9);
|
1652 |
+
}
|
1653 |
+
|
1654 |
+
100% {
|
1655 |
+
-o-transform: scale(1);
|
1656 |
+
}
|
1657 |
+
}
|
1658 |
+
|
1659 |
+
@keyframes bounceIn {
|
1660 |
+
0% {
|
1661 |
+
opacity: 0;
|
1662 |
+
transform: scale(.3);
|
1663 |
+
}
|
1664 |
+
|
1665 |
+
50% {
|
1666 |
+
opacity: 1;
|
1667 |
+
transform: scale(1.05);
|
1668 |
+
}
|
1669 |
+
|
1670 |
+
70% {
|
1671 |
+
transform: scale(.9);
|
1672 |
+
}
|
1673 |
+
|
1674 |
+
100% {
|
1675 |
+
transform: scale(1);
|
1676 |
+
}
|
1677 |
+
}
|
1678 |
+
|
1679 |
+
.bounceIn {
|
1680 |
+
-webkit-animation-name: bounceIn;
|
1681 |
+
-moz-animation-name: bounceIn;
|
1682 |
+
-o-animation-name: bounceIn;
|
1683 |
+
animation-name: bounceIn;
|
1684 |
+
}
|
1685 |
+
@-webkit-keyframes bounceInUp {
|
1686 |
+
0% {
|
1687 |
+
opacity: 0;
|
1688 |
+
-webkit-transform: translateY(2000px);
|
1689 |
+
}
|
1690 |
+
|
1691 |
+
60% {
|
1692 |
+
opacity: 1;
|
1693 |
+
-webkit-transform: translateY(-30px);
|
1694 |
+
}
|
1695 |
+
|
1696 |
+
80% {
|
1697 |
+
-webkit-transform: translateY(10px);
|
1698 |
+
}
|
1699 |
+
|
1700 |
+
100% {
|
1701 |
+
-webkit-transform: translateY(0);
|
1702 |
+
}
|
1703 |
+
}
|
1704 |
+
@-moz-keyframes bounceInUp {
|
1705 |
+
0% {
|
1706 |
+
opacity: 0;
|
1707 |
+
-moz-transform: translateY(2000px);
|
1708 |
+
}
|
1709 |
+
|
1710 |
+
60% {
|
1711 |
+
opacity: 1;
|
1712 |
+
-moz-transform: translateY(-30px);
|
1713 |
+
}
|
1714 |
+
|
1715 |
+
80% {
|
1716 |
+
-moz-transform: translateY(10px);
|
1717 |
+
}
|
1718 |
+
|
1719 |
+
100% {
|
1720 |
+
-moz-transform: translateY(0);
|
1721 |
+
}
|
1722 |
+
}
|
1723 |
+
|
1724 |
+
@-o-keyframes bounceInUp {
|
1725 |
+
0% {
|
1726 |
+
opacity: 0;
|
1727 |
+
-o-transform: translateY(2000px);
|
1728 |
+
}
|
1729 |
+
|
1730 |
+
60% {
|
1731 |
+
opacity: 1;
|
1732 |
+
-o-transform: translateY(-30px);
|
1733 |
+
}
|
1734 |
+
|
1735 |
+
80% {
|
1736 |
+
-o-transform: translateY(10px);
|
1737 |
+
}
|
1738 |
+
|
1739 |
+
100% {
|
1740 |
+
-o-transform: translateY(0);
|
1741 |
+
}
|
1742 |
+
}
|
1743 |
+
|
1744 |
+
@keyframes bounceInUp {
|
1745 |
+
0% {
|
1746 |
+
opacity: 0;
|
1747 |
+
transform: translateY(2000px);
|
1748 |
+
}
|
1749 |
+
|
1750 |
+
60% {
|
1751 |
+
opacity: 1;
|
1752 |
+
transform: translateY(-30px);
|
1753 |
+
}
|
1754 |
+
|
1755 |
+
80% {
|
1756 |
+
transform: translateY(10px);
|
1757 |
+
}
|
1758 |
+
|
1759 |
+
100% {
|
1760 |
+
transform: translateY(0);
|
1761 |
+
}
|
1762 |
+
}
|
1763 |
+
|
1764 |
+
.bounceInUp {
|
1765 |
+
-webkit-animation-name: bounceInUp;
|
1766 |
+
-moz-animation-name: bounceInUp;
|
1767 |
+
-o-animation-name: bounceInUp;
|
1768 |
+
animation-name: bounceInUp;
|
1769 |
+
}
|
1770 |
+
@-webkit-keyframes bounceInDown {
|
1771 |
+
0% {
|
1772 |
+
opacity: 0;
|
1773 |
+
-webkit-transform: translateY(-2000px);
|
1774 |
+
}
|
1775 |
+
|
1776 |
+
60% {
|
1777 |
+
opacity: 1;
|
1778 |
+
-webkit-transform: translateY(30px);
|
1779 |
+
}
|
1780 |
+
|
1781 |
+
80% {
|
1782 |
+
-webkit-transform: translateY(-10px);
|
1783 |
+
}
|
1784 |
+
|
1785 |
+
100% {
|
1786 |
+
-webkit-transform: translateY(0);
|
1787 |
+
}
|
1788 |
+
}
|
1789 |
+
|
1790 |
+
@-moz-keyframes bounceInDown {
|
1791 |
+
0% {
|
1792 |
+
opacity: 0;
|
1793 |
+
-moz-transform: translateY(-2000px);
|
1794 |
+
}
|
1795 |
+
|
1796 |
+
60% {
|
1797 |
+
opacity: 1;
|
1798 |
+
-moz-transform: translateY(30px);
|
1799 |
+
}
|
1800 |
+
|
1801 |
+
80% {
|
1802 |
+
-moz-transform: translateY(-10px);
|
1803 |
+
}
|
1804 |
+
|
1805 |
+
100% {
|
1806 |
+
-moz-transform: translateY(0);
|
1807 |
+
}
|
1808 |
+
}
|
1809 |
+
|
1810 |
+
@-o-keyframes bounceInDown {
|
1811 |
+
0% {
|
1812 |
+
opacity: 0;
|
1813 |
+
-o-transform: translateY(-2000px);
|
1814 |
+
}
|
1815 |
+
|
1816 |
+
60% {
|
1817 |
+
opacity: 1;
|
1818 |
+
-o-transform: translateY(30px);
|
1819 |
+
}
|
1820 |
+
|
1821 |
+
80% {
|
1822 |
+
-o-transform: translateY(-10px);
|
1823 |
+
}
|
1824 |
+
|
1825 |
+
100% {
|
1826 |
+
-o-transform: translateY(0);
|
1827 |
+
}
|
1828 |
+
}
|
1829 |
+
|
1830 |
+
@keyframes bounceInDown {
|
1831 |
+
0% {
|
1832 |
+
opacity: 0;
|
1833 |
+
transform: translateY(-2000px);
|
1834 |
+
}
|
1835 |
+
|
1836 |
+
60% {
|
1837 |
+
opacity: 1;
|
1838 |
+
transform: translateY(30px);
|
1839 |
+
}
|
1840 |
+
|
1841 |
+
80% {
|
1842 |
+
transform: translateY(-10px);
|
1843 |
+
}
|
1844 |
+
|
1845 |
+
100% {
|
1846 |
+
transform: translateY(0);
|
1847 |
+
}
|
1848 |
+
}
|
1849 |
+
|
1850 |
+
.bounceInDown {
|
1851 |
+
-webkit-animation-name: bounceInDown;
|
1852 |
+
-moz-animation-name: bounceInDown;
|
1853 |
+
-o-animation-name: bounceInDown;
|
1854 |
+
animation-name: bounceInDown;
|
1855 |
+
}
|
1856 |
+
@-webkit-keyframes bounceInLeft {
|
1857 |
+
0% {
|
1858 |
+
opacity: 0;
|
1859 |
+
-webkit-transform: translateX(-2000px);
|
1860 |
+
}
|
1861 |
+
|
1862 |
+
60% {
|
1863 |
+
opacity: 1;
|
1864 |
+
-webkit-transform: translateX(30px);
|
1865 |
+
}
|
1866 |
+
|
1867 |
+
80% {
|
1868 |
+
-webkit-transform: translateX(-10px);
|
1869 |
+
}
|
1870 |
+
|
1871 |
+
100% {
|
1872 |
+
-webkit-transform: translateX(0);
|
1873 |
+
}
|
1874 |
+
}
|
1875 |
+
|
1876 |
+
@-moz-keyframes bounceInLeft {
|
1877 |
+
0% {
|
1878 |
+
opacity: 0;
|
1879 |
+
-moz-transform: translateX(-2000px);
|
1880 |
+
}
|
1881 |
+
|
1882 |
+
60% {
|
1883 |
+
opacity: 1;
|
1884 |
+
-moz-transform: translateX(30px);
|
1885 |
+
}
|
1886 |
+
|
1887 |
+
80% {
|
1888 |
+
-moz-transform: translateX(-10px);
|
1889 |
+
}
|
1890 |
+
|
1891 |
+
100% {
|
1892 |
+
-moz-transform: translateX(0);
|
1893 |
+
}
|
1894 |
+
}
|
1895 |
+
|
1896 |
+
@-o-keyframes bounceInLeft {
|
1897 |
+
0% {
|
1898 |
+
opacity: 0;
|
1899 |
+
-o-transform: translateX(-2000px);
|
1900 |
+
}
|
1901 |
+
|
1902 |
+
60% {
|
1903 |
+
opacity: 1;
|
1904 |
+
-o-transform: translateX(30px);
|
1905 |
+
}
|
1906 |
+
|
1907 |
+
80% {
|
1908 |
+
-o-transform: translateX(-10px);
|
1909 |
+
}
|
1910 |
+
|
1911 |
+
100% {
|
1912 |
+
-o-transform: translateX(0);
|
1913 |
+
}
|
1914 |
+
}
|
1915 |
+
|
1916 |
+
@keyframes bounceInLeft {
|
1917 |
+
0% {
|
1918 |
+
opacity: 0;
|
1919 |
+
transform: translateX(-2000px);
|
1920 |
+
}
|
1921 |
+
|
1922 |
+
60% {
|
1923 |
+
opacity: 1;
|
1924 |
+
transform: translateX(30px);
|
1925 |
+
}
|
1926 |
+
|
1927 |
+
80% {
|
1928 |
+
transform: translateX(-10px);
|
1929 |
+
}
|
1930 |
+
|
1931 |
+
100% {
|
1932 |
+
transform: translateX(0);
|
1933 |
+
}
|
1934 |
+
}
|
1935 |
+
|
1936 |
+
.bounceInLeft {
|
1937 |
+
-webkit-animation-name: bounceInLeft;
|
1938 |
+
-moz-animation-name: bounceInLeft;
|
1939 |
+
-o-animation-name: bounceInLeft;
|
1940 |
+
animation-name: bounceInLeft;
|
1941 |
+
}
|
1942 |
+
@-webkit-keyframes bounceInRight {
|
1943 |
+
0% {
|
1944 |
+
opacity: 0;
|
1945 |
+
-webkit-transform: translateX(2000px);
|
1946 |
+
}
|
1947 |
+
|
1948 |
+
60% {
|
1949 |
+
opacity: 1;
|
1950 |
+
-webkit-transform: translateX(-30px);
|
1951 |
+
}
|
1952 |
+
|
1953 |
+
80% {
|
1954 |
+
-webkit-transform: translateX(10px);
|
1955 |
+
}
|
1956 |
+
|
1957 |
+
100% {
|
1958 |
+
-webkit-transform: translateX(0);
|
1959 |
+
}
|
1960 |
+
}
|
1961 |
+
|
1962 |
+
@-moz-keyframes bounceInRight {
|
1963 |
+
0% {
|
1964 |
+
opacity: 0;
|
1965 |
+
-moz-transform: translateX(2000px);
|
1966 |
+
}
|
1967 |
+
|
1968 |
+
60% {
|
1969 |
+
opacity: 1;
|
1970 |
+
-moz-transform: translateX(-30px);
|
1971 |
+
}
|
1972 |
+
|
1973 |
+
80% {
|
1974 |
+
-moz-transform: translateX(10px);
|
1975 |
+
}
|
1976 |
+
|
1977 |
+
100% {
|
1978 |
+
-moz-transform: translateX(0);
|
1979 |
+
}
|
1980 |
+
}
|
1981 |
+
|
1982 |
+
@-o-keyframes bounceInRight {
|
1983 |
+
0% {
|
1984 |
+
opacity: 0;
|
1985 |
+
-o-transform: translateX(2000px);
|
1986 |
+
}
|
1987 |
+
|
1988 |
+
60% {
|
1989 |
+
opacity: 1;
|
1990 |
+
-o-transform: translateX(-30px);
|
1991 |
+
}
|
1992 |
+
|
1993 |
+
80% {
|
1994 |
+
-o-transform: translateX(10px);
|
1995 |
+
}
|
1996 |
+
|
1997 |
+
100% {
|
1998 |
+
-o-transform: translateX(0);
|
1999 |
+
}
|
2000 |
+
}
|
2001 |
+
|
2002 |
+
@keyframes bounceInRight {
|
2003 |
+
0% {
|
2004 |
+
opacity: 0;
|
2005 |
+
transform: translateX(2000px);
|
2006 |
+
}
|
2007 |
+
|
2008 |
+
60% {
|
2009 |
+
opacity: 1;
|
2010 |
+
transform: translateX(-30px);
|
2011 |
+
}
|
2012 |
+
|
2013 |
+
80% {
|
2014 |
+
transform: translateX(10px);
|
2015 |
+
}
|
2016 |
+
|
2017 |
+
100% {
|
2018 |
+
transform: translateX(0);
|
2019 |
+
}
|
2020 |
+
}
|
2021 |
+
|
2022 |
+
.bounceInRight {
|
2023 |
+
-webkit-animation-name: bounceInRight;
|
2024 |
+
-moz-animation-name: bounceInRight;
|
2025 |
+
-o-animation-name: bounceInRight;
|
2026 |
+
animation-name: bounceInRight;
|
2027 |
+
}
|
2028 |
+
@-webkit-keyframes bounceOut {
|
2029 |
+
0% {
|
2030 |
+
-webkit-transform: scale(1);
|
2031 |
+
}
|
2032 |
+
|
2033 |
+
25% {
|
2034 |
+
-webkit-transform: scale(.95);
|
2035 |
+
}
|
2036 |
+
|
2037 |
+
50% {
|
2038 |
+
opacity: 1;
|
2039 |
+
-webkit-transform: scale(1.1);
|
2040 |
+
}
|
2041 |
+
|
2042 |
+
100% {
|
2043 |
+
opacity: 0;
|
2044 |
+
-webkit-transform: scale(.3);
|
2045 |
+
}
|
2046 |
+
}
|
2047 |
+
|
2048 |
+
@-moz-keyframes bounceOut {
|
2049 |
+
0% {
|
2050 |
+
-moz-transform: scale(1);
|
2051 |
+
}
|
2052 |
+
|
2053 |
+
25% {
|
2054 |
+
-moz-transform: scale(.95);
|
2055 |
+
}
|
2056 |
+
|
2057 |
+
50% {
|
2058 |
+
opacity: 1;
|
2059 |
+
-moz-transform: scale(1.1);
|
2060 |
+
}
|
2061 |
+
|
2062 |
+
100% {
|
2063 |
+
opacity: 0;
|
2064 |
+
-moz-transform: scale(.3);
|
2065 |
+
}
|
2066 |
+
}
|
2067 |
+
|
2068 |
+
@-o-keyframes bounceOut {
|
2069 |
+
0% {
|
2070 |
+
-o-transform: scale(1);
|
2071 |
+
}
|
2072 |
+
|
2073 |
+
25% {
|
2074 |
+
-o-transform: scale(.95);
|
2075 |
+
}
|
2076 |
+
|
2077 |
+
50% {
|
2078 |
+
opacity: 1;
|
2079 |
+
-o-transform: scale(1.1);
|
2080 |
+
}
|
2081 |
+
|
2082 |
+
100% {
|
2083 |
+
opacity: 0;
|
2084 |
+
-o-transform: scale(.3);
|
2085 |
+
}
|
2086 |
+
}
|
2087 |
+
|
2088 |
+
@keyframes bounceOut {
|
2089 |
+
0% {
|
2090 |
+
transform: scale(1);
|
2091 |
+
}
|
2092 |
+
|
2093 |
+
25% {
|
2094 |
+
transform: scale(.95);
|
2095 |
+
}
|
2096 |
+
|
2097 |
+
50% {
|
2098 |
+
opacity: 1;
|
2099 |
+
transform: scale(1.1);
|
2100 |
+
}
|
2101 |
+
|
2102 |
+
100% {
|
2103 |
+
opacity: 0;
|
2104 |
+
transform: scale(.3);
|
2105 |
+
}
|
2106 |
+
}
|
2107 |
+
|
2108 |
+
.bounceOut {
|
2109 |
+
-webkit-animation-name: bounceOut;
|
2110 |
+
-moz-animation-name: bounceOut;
|
2111 |
+
-o-animation-name: bounceOut;
|
2112 |
+
animation-name: bounceOut;
|
2113 |
+
}
|
2114 |
+
@-webkit-keyframes bounceOutUp {
|
2115 |
+
0% {
|
2116 |
+
-webkit-transform: translateY(0);
|
2117 |
+
}
|
2118 |
+
|
2119 |
+
20% {
|
2120 |
+
opacity: 1;
|
2121 |
+
-webkit-transform: translateY(20px);
|
2122 |
+
}
|
2123 |
+
|
2124 |
+
100% {
|
2125 |
+
opacity: 0;
|
2126 |
+
-webkit-transform: translateY(-2000px);
|
2127 |
+
}
|
2128 |
+
}
|
2129 |
+
|
2130 |
+
@-moz-keyframes bounceOutUp {
|
2131 |
+
0% {
|
2132 |
+
-moz-transform: translateY(0);
|
2133 |
+
}
|
2134 |
+
|
2135 |
+
20% {
|
2136 |
+
opacity: 1;
|
2137 |
+
-moz-transform: translateY(20px);
|
2138 |
+
}
|
2139 |
+
|
2140 |
+
100% {
|
2141 |
+
opacity: 0;
|
2142 |
+
-moz-transform: translateY(-2000px);
|
2143 |
+
}
|
2144 |
+
}
|
2145 |
+
|
2146 |
+
@-o-keyframes bounceOutUp {
|
2147 |
+
0% {
|
2148 |
+
-o-transform: translateY(0);
|
2149 |
+
}
|
2150 |
+
|
2151 |
+
20% {
|
2152 |
+
opacity: 1;
|
2153 |
+
-o-transform: translateY(20px);
|
2154 |
+
}
|
2155 |
+
|
2156 |
+
100% {
|
2157 |
+
opacity: 0;
|
2158 |
+
-o-transform: translateY(-2000px);
|
2159 |
+
}
|
2160 |
+
}
|
2161 |
+
|
2162 |
+
@keyframes bounceOutUp {
|
2163 |
+
0% {
|
2164 |
+
transform: translateY(0);
|
2165 |
+
}
|
2166 |
+
|
2167 |
+
20% {
|
2168 |
+
opacity: 1;
|
2169 |
+
transform: translateY(20px);
|
2170 |
+
}
|
2171 |
+
|
2172 |
+
100% {
|
2173 |
+
opacity: 0;
|
2174 |
+
transform: translateY(-2000px);
|
2175 |
+
}
|
2176 |
+
}
|
2177 |
+
|
2178 |
+
.bounceOutUp {
|
2179 |
+
-webkit-animation-name: bounceOutUp;
|
2180 |
+
-moz-animation-name: bounceOutUp;
|
2181 |
+
-o-animation-name: bounceOutUp;
|
2182 |
+
animation-name: bounceOutUp;
|
2183 |
+
}
|
2184 |
+
@-webkit-keyframes bounceOutDown {
|
2185 |
+
0% {
|
2186 |
+
-webkit-transform: translateY(0);
|
2187 |
+
}
|
2188 |
+
|
2189 |
+
20% {
|
2190 |
+
opacity: 1;
|
2191 |
+
-webkit-transform: translateY(-20px);
|
2192 |
+
}
|
2193 |
+
|
2194 |
+
100% {
|
2195 |
+
opacity: 0;
|
2196 |
+
-webkit-transform: translateY(2000px);
|
2197 |
+
}
|
2198 |
+
}
|
2199 |
+
|
2200 |
+
@-moz-keyframes bounceOutDown {
|
2201 |
+
0% {
|
2202 |
+
-moz-transform: translateY(0);
|
2203 |
+
}
|
2204 |
+
|
2205 |
+
20% {
|
2206 |
+
opacity: 1;
|
2207 |
+
-moz-transform: translateY(-20px);
|
2208 |
+
}
|
2209 |
+
|
2210 |
+
100% {
|
2211 |
+
opacity: 0;
|
2212 |
+
-moz-transform: translateY(2000px);
|
2213 |
+
}
|
2214 |
+
}
|
2215 |
+
|
2216 |
+
@-o-keyframes bounceOutDown {
|
2217 |
+
0% {
|
2218 |
+
-o-transform: translateY(0);
|
2219 |
+
}
|
2220 |
+
|
2221 |
+
20% {
|
2222 |
+
opacity: 1;
|
2223 |
+
-o-transform: translateY(-20px);
|
2224 |
+
}
|
2225 |
+
|
2226 |
+
100% {
|
2227 |
+
opacity: 0;
|
2228 |
+
-o-transform: translateY(2000px);
|
2229 |
+
}
|
2230 |
+
}
|
2231 |
+
|
2232 |
+
@keyframes bounceOutDown {
|
2233 |
+
0% {
|
2234 |
+
transform: translateY(0);
|
2235 |
+
}
|
2236 |
+
|
2237 |
+
20% {
|
2238 |
+
opacity: 1;
|
2239 |
+
transform: translateY(-20px);
|
2240 |
+
}
|
2241 |
+
|
2242 |
+
100% {
|
2243 |
+
opacity: 0;
|
2244 |
+
transform: translateY(2000px);
|
2245 |
+
}
|
2246 |
+
}
|
2247 |
+
|
2248 |
+
.bounceOutDown {
|
2249 |
+
-webkit-animation-name: bounceOutDown;
|
2250 |
+
-moz-animation-name: bounceOutDown;
|
2251 |
+
-o-animation-name: bounceOutDown;
|
2252 |
+
animation-name: bounceOutDown;
|
2253 |
+
}
|
2254 |
+
@-webkit-keyframes bounceOutLeft {
|
2255 |
+
0% {
|
2256 |
+
-webkit-transform: translateX(0);
|
2257 |
+
}
|
2258 |
+
|
2259 |
+
20% {
|
2260 |
+
opacity: 1;
|
2261 |
+
-webkit-transform: translateX(20px);
|
2262 |
+
}
|
2263 |
+
|
2264 |
+
100% {
|
2265 |
+
opacity: 0;
|
2266 |
+
-webkit-transform: translateX(-2000px);
|
2267 |
+
}
|
2268 |
+
}
|
2269 |
+
|
2270 |
+
@-moz-keyframes bounceOutLeft {
|
2271 |
+
0% {
|
2272 |
+
-moz-transform: translateX(0);
|
2273 |
+
}
|
2274 |
+
|
2275 |
+
20% {
|
2276 |
+
opacity: 1;
|
2277 |
+
-moz-transform: translateX(20px);
|
2278 |
+
}
|
2279 |
+
|
2280 |
+
100% {
|
2281 |
+
opacity: 0;
|
2282 |
+
-moz-transform: translateX(-2000px);
|
2283 |
+
}
|
2284 |
+
}
|
2285 |
+
|
2286 |
+
@-o-keyframes bounceOutLeft {
|
2287 |
+
0% {
|
2288 |
+
-o-transform: translateX(0);
|
2289 |
+
}
|
2290 |
+
|
2291 |
+
20% {
|
2292 |
+
opacity: 1;
|
2293 |
+
-o-transform: translateX(20px);
|
2294 |
+
}
|
2295 |
+
|
2296 |
+
100% {
|
2297 |
+
opacity: 0;
|
2298 |
+
-o-transform: translateX(-2000px);
|
2299 |
+
}
|
2300 |
+
}
|
2301 |
+
|
2302 |
+
@keyframes bounceOutLeft {
|
2303 |
+
0% {
|
2304 |
+
transform: translateX(0);
|
2305 |
+
}
|
2306 |
+
|
2307 |
+
20% {
|
2308 |
+
opacity: 1;
|
2309 |
+
transform: translateX(20px);
|
2310 |
+
}
|
2311 |
+
|
2312 |
+
100% {
|
2313 |
+
opacity: 0;
|
2314 |
+
transform: translateX(-2000px);
|
2315 |
+
}
|
2316 |
+
}
|
2317 |
+
|
2318 |
+
.bounceOutLeft {
|
2319 |
+
-webkit-animation-name: bounceOutLeft;
|
2320 |
+
-moz-animation-name: bounceOutLeft;
|
2321 |
+
-o-animation-name: bounceOutLeft;
|
2322 |
+
animation-name: bounceOutLeft;
|
2323 |
+
}
|
2324 |
+
@-webkit-keyframes bounceOutRight {
|
2325 |
+
0% {
|
2326 |
+
-webkit-transform: translateX(0);
|
2327 |
+
}
|
2328 |
+
|
2329 |
+
20% {
|
2330 |
+
opacity: 1;
|
2331 |
+
-webkit-transform: translateX(-20px);
|
2332 |
+
}
|
2333 |
+
|
2334 |
+
100% {
|
2335 |
+
opacity: 0;
|
2336 |
+
-webkit-transform: translateX(2000px);
|
2337 |
+
}
|
2338 |
+
}
|
2339 |
+
|
2340 |
+
@-moz-keyframes bounceOutRight {
|
2341 |
+
0% {
|
2342 |
+
-moz-transform: translateX(0);
|
2343 |
+
}
|
2344 |
+
|
2345 |
+
20% {
|
2346 |
+
opacity: 1;
|
2347 |
+
-moz-transform: translateX(-20px);
|
2348 |
+
}
|
2349 |
+
|
2350 |
+
100% {
|
2351 |
+
opacity: 0;
|
2352 |
+
-moz-transform: translateX(2000px);
|
2353 |
+
}
|
2354 |
+
}
|
2355 |
+
|
2356 |
+
@-o-keyframes bounceOutRight {
|
2357 |
+
0% {
|
2358 |
+
-o-transform: translateX(0);
|
2359 |
+
}
|
2360 |
+
|
2361 |
+
20% {
|
2362 |
+
opacity: 1;
|
2363 |
+
-o-transform: translateX(-20px);
|
2364 |
+
}
|
2365 |
+
|
2366 |
+
100% {
|
2367 |
+
opacity: 0;
|
2368 |
+
-o-transform: translateX(2000px);
|
2369 |
+
}
|
2370 |
+
}
|
2371 |
+
|
2372 |
+
@keyframes bounceOutRight {
|
2373 |
+
0% {
|
2374 |
+
transform: translateX(0);
|
2375 |
+
}
|
2376 |
+
|
2377 |
+
20% {
|
2378 |
+
opacity: 1;
|
2379 |
+
transform: translateX(-20px);
|
2380 |
+
}
|
2381 |
+
|
2382 |
+
100% {
|
2383 |
+
opacity: 0;
|
2384 |
+
transform: translateX(2000px);
|
2385 |
+
}
|
2386 |
+
}
|
2387 |
+
|
2388 |
+
.bounceOutRight {
|
2389 |
+
-webkit-animation-name: bounceOutRight;
|
2390 |
+
-moz-animation-name: bounceOutRight;
|
2391 |
+
-o-animation-name: bounceOutRight;
|
2392 |
+
animation-name: bounceOutRight;
|
2393 |
+
}
|
2394 |
+
@-webkit-keyframes rotateIn {
|
2395 |
+
0% {
|
2396 |
+
-webkit-transform-origin: center center;
|
2397 |
+
-webkit-transform: rotate(-200deg);
|
2398 |
+
opacity: 0;
|
2399 |
+
}
|
2400 |
+
|
2401 |
+
100% {
|
2402 |
+
-webkit-transform-origin: center center;
|
2403 |
+
-webkit-transform: rotate(0);
|
2404 |
+
opacity: 1;
|
2405 |
+
}
|
2406 |
+
}
|
2407 |
+
@-moz-keyframes rotateIn {
|
2408 |
+
0% {
|
2409 |
+
-moz-transform-origin: center center;
|
2410 |
+
-moz-transform: rotate(-200deg);
|
2411 |
+
opacity: 0;
|
2412 |
+
}
|
2413 |
+
|
2414 |
+
100% {
|
2415 |
+
-moz-transform-origin: center center;
|
2416 |
+
-moz-transform: rotate(0);
|
2417 |
+
opacity: 1;
|
2418 |
+
}
|
2419 |
+
}
|
2420 |
+
@-o-keyframes rotateIn {
|
2421 |
+
0% {
|
2422 |
+
-o-transform-origin: center center;
|
2423 |
+
-o-transform: rotate(-200deg);
|
2424 |
+
opacity: 0;
|
2425 |
+
}
|
2426 |
+
|
2427 |
+
100% {
|
2428 |
+
-o-transform-origin: center center;
|
2429 |
+
-o-transform: rotate(0);
|
2430 |
+
opacity: 1;
|
2431 |
+
}
|
2432 |
+
}
|
2433 |
+
@keyframes rotateIn {
|
2434 |
+
0% {
|
2435 |
+
transform-origin: center center;
|
2436 |
+
transform: rotate(-200deg);
|
2437 |
+
opacity: 0;
|
2438 |
+
}
|
2439 |
+
|
2440 |
+
100% {
|
2441 |
+
transform-origin: center center;
|
2442 |
+
transform: rotate(0);
|
2443 |
+
opacity: 1;
|
2444 |
+
}
|
2445 |
+
}
|
2446 |
+
|
2447 |
+
.rotateIn {
|
2448 |
+
-webkit-animation-name: rotateIn;
|
2449 |
+
-moz-animation-name: rotateIn;
|
2450 |
+
-o-animation-name: rotateIn;
|
2451 |
+
animation-name: rotateIn;
|
2452 |
+
}
|
2453 |
+
@-webkit-keyframes rotateInUpLeft {
|
2454 |
+
0% {
|
2455 |
+
-webkit-transform-origin: left bottom;
|
2456 |
+
-webkit-transform: rotate(90deg);
|
2457 |
+
opacity: 0;
|
2458 |
+
}
|
2459 |
+
|
2460 |
+
100% {
|
2461 |
+
-webkit-transform-origin: left bottom;
|
2462 |
+
-webkit-transform: rotate(0);
|
2463 |
+
opacity: 1;
|
2464 |
+
}
|
2465 |
+
}
|
2466 |
+
|
2467 |
+
@-moz-keyframes rotateInUpLeft {
|
2468 |
+
0% {
|
2469 |
+
-moz-transform-origin: left bottom;
|
2470 |
+
-moz-transform: rotate(90deg);
|
2471 |
+
opacity: 0;
|
2472 |
+
}
|
2473 |
+
|
2474 |
+
100% {
|
2475 |
+
-moz-transform-origin: left bottom;
|
2476 |
+
-moz-transform: rotate(0);
|
2477 |
+
opacity: 1;
|
2478 |
+
}
|
2479 |
+
}
|
2480 |
+
|
2481 |
+
@-o-keyframes rotateInUpLeft {
|
2482 |
+
0% {
|
2483 |
+
-o-transform-origin: left bottom;
|
2484 |
+
-o-transform: rotate(90deg);
|
2485 |
+
opacity: 0;
|
2486 |
+
}
|
2487 |
+
|
2488 |
+
100% {
|
2489 |
+
-o-transform-origin: left bottom;
|
2490 |
+
-o-transform: rotate(0);
|
2491 |
+
opacity: 1;
|
2492 |
+
}
|
2493 |
+
}
|
2494 |
+
|
2495 |
+
@keyframes rotateInUpLeft {
|
2496 |
+
0% {
|
2497 |
+
transform-origin: left bottom;
|
2498 |
+
transform: rotate(90deg);
|
2499 |
+
opacity: 0;
|
2500 |
+
}
|
2501 |
+
|
2502 |
+
100% {
|
2503 |
+
transform-origin: left bottom;
|
2504 |
+
transform: rotate(0);
|
2505 |
+
opacity: 1;
|
2506 |
+
}
|
2507 |
+
}
|
2508 |
+
|
2509 |
+
.rotateInUpLeft {
|
2510 |
+
-webkit-animation-name: rotateInUpLeft;
|
2511 |
+
-moz-animation-name: rotateInUpLeft;
|
2512 |
+
-o-animation-name: rotateInUpLeft;
|
2513 |
+
animation-name: rotateInUpLeft;
|
2514 |
+
}
|
2515 |
+
@-webkit-keyframes rotateInDownLeft {
|
2516 |
+
0% {
|
2517 |
+
-webkit-transform-origin: left bottom;
|
2518 |
+
-webkit-transform: rotate(-90deg);
|
2519 |
+
opacity: 0;
|
2520 |
+
}
|
2521 |
+
|
2522 |
+
100% {
|
2523 |
+
-webkit-transform-origin: left bottom;
|
2524 |
+
-webkit-transform: rotate(0);
|
2525 |
+
opacity: 1;
|
2526 |
+
}
|
2527 |
+
}
|
2528 |
+
|
2529 |
+
@-moz-keyframes rotateInDownLeft {
|
2530 |
+
0% {
|
2531 |
+
-moz-transform-origin: left bottom;
|
2532 |
+
-moz-transform: rotate(-90deg);
|
2533 |
+
opacity: 0;
|
2534 |
+
}
|
2535 |
+
|
2536 |
+
100% {
|
2537 |
+
-moz-transform-origin: left bottom;
|
2538 |
+
-moz-transform: rotate(0);
|
2539 |
+
opacity: 1;
|
2540 |
+
}
|
2541 |
+
}
|
2542 |
+
|
2543 |
+
@-o-keyframes rotateInDownLeft {
|
2544 |
+
0% {
|
2545 |
+
-o-transform-origin: left bottom;
|
2546 |
+
-o-transform: rotate(-90deg);
|
2547 |
+
opacity: 0;
|
2548 |
+
}
|
2549 |
+
|
2550 |
+
100% {
|
2551 |
+
-o-transform-origin: left bottom;
|
2552 |
+
-o-transform: rotate(0);
|
2553 |
+
opacity: 1;
|
2554 |
+
}
|
2555 |
+
}
|
2556 |
+
|
2557 |
+
@keyframes rotateInDownLeft {
|
2558 |
+
0% {
|
2559 |
+
transform-origin: left bottom;
|
2560 |
+
transform: rotate(-90deg);
|
2561 |
+
opacity: 0;
|
2562 |
+
}
|
2563 |
+
|
2564 |
+
100% {
|
2565 |
+
transform-origin: left bottom;
|
2566 |
+
transform: rotate(0);
|
2567 |
+
opacity: 1;
|
2568 |
+
}
|
2569 |
+
}
|
2570 |
+
|
2571 |
+
.rotateInDownLeft {
|
2572 |
+
-webkit-animation-name: rotateInDownLeft;
|
2573 |
+
-moz-animation-name: rotateInDownLeft;
|
2574 |
+
-o-animation-name: rotateInDownLeft;
|
2575 |
+
animation-name: rotateInDownLeft;
|
2576 |
+
}
|
2577 |
+
@-webkit-keyframes rotateInUpRight {
|
2578 |
+
0% {
|
2579 |
+
-webkit-transform-origin: right bottom;
|
2580 |
+
-webkit-transform: rotate(-90deg);
|
2581 |
+
opacity: 0;
|
2582 |
+
}
|
2583 |
+
|
2584 |
+
100% {
|
2585 |
+
-webkit-transform-origin: right bottom;
|
2586 |
+
-webkit-transform: rotate(0);
|
2587 |
+
opacity: 1;
|
2588 |
+
}
|
2589 |
+
}
|
2590 |
+
|
2591 |
+
@-moz-keyframes rotateInUpRight {
|
2592 |
+
0% {
|
2593 |
+
-moz-transform-origin: right bottom;
|
2594 |
+
-moz-transform: rotate(-90deg);
|
2595 |
+
opacity: 0;
|
2596 |
+
}
|
2597 |
+
|
2598 |
+
100% {
|
2599 |
+
-moz-transform-origin: right bottom;
|
2600 |
+
-moz-transform: rotate(0);
|
2601 |
+
opacity: 1;
|
2602 |
+
}
|
2603 |
+
}
|
2604 |
+
|
2605 |
+
@-o-keyframes rotateInUpRight {
|
2606 |
+
0% {
|
2607 |
+
-o-transform-origin: right bottom;
|
2608 |
+
-o-transform: rotate(-90deg);
|
2609 |
+
opacity: 0;
|
2610 |
+
}
|
2611 |
+
|
2612 |
+
100% {
|
2613 |
+
-o-transform-origin: right bottom;
|
2614 |
+
-o-transform: rotate(0);
|
2615 |
+
opacity: 1;
|
2616 |
+
}
|
2617 |
+
}
|
2618 |
+
|
2619 |
+
@keyframes rotateInUpRight {
|
2620 |
+
0% {
|
2621 |
+
transform-origin: right bottom;
|
2622 |
+
transform: rotate(-90deg);
|
2623 |
+
opacity: 0;
|
2624 |
+
}
|
2625 |
+
|
2626 |
+
100% {
|
2627 |
+
transform-origin: right bottom;
|
2628 |
+
transform: rotate(0);
|
2629 |
+
opacity: 1;
|
2630 |
+
}
|
2631 |
+
}
|
2632 |
+
|
2633 |
+
.rotateInUpRight {
|
2634 |
+
-webkit-animation-name: rotateInUpRight;
|
2635 |
+
-moz-animation-name: rotateInUpRight;
|
2636 |
+
-o-animation-name: rotateInUpRight;
|
2637 |
+
animation-name: rotateInUpRight;
|
2638 |
+
}
|
2639 |
+
@-webkit-keyframes rotateInDownRight {
|
2640 |
+
0% {
|
2641 |
+
-webkit-transform-origin: right bottom;
|
2642 |
+
-webkit-transform: rotate(90deg);
|
2643 |
+
opacity: 0;
|
2644 |
+
}
|
2645 |
+
|
2646 |
+
100% {
|
2647 |
+
-webkit-transform-origin: right bottom;
|
2648 |
+
-webkit-transform: rotate(0);
|
2649 |
+
opacity: 1;
|
2650 |
+
}
|
2651 |
+
}
|
2652 |
+
|
2653 |
+
@-moz-keyframes rotateInDownRight {
|
2654 |
+
0% {
|
2655 |
+
-moz-transform-origin: right bottom;
|
2656 |
+
-moz-transform: rotate(90deg);
|
2657 |
+
opacity: 0;
|
2658 |
+
}
|
2659 |
+
|
2660 |
+
100% {
|
2661 |
+
-moz-transform-origin: right bottom;
|
2662 |
+
-moz-transform: rotate(0);
|
2663 |
+
opacity: 1;
|
2664 |
+
}
|
2665 |
+
}
|
2666 |
+
|
2667 |
+
@-o-keyframes rotateInDownRight {
|
2668 |
+
0% {
|
2669 |
+
-o-transform-origin: right bottom;
|
2670 |
+
-o-transform: rotate(90deg);
|
2671 |
+
opacity: 0;
|
2672 |
+
}
|
2673 |
+
|
2674 |
+
100% {
|
2675 |
+
-o-transform-origin: right bottom;
|
2676 |
+
-o-transform: rotate(0);
|
2677 |
+
opacity: 1;
|
2678 |
+
}
|
2679 |
+
}
|
2680 |
+
|
2681 |
+
@keyframes rotateInDownRight {
|
2682 |
+
0% {
|
2683 |
+
transform-origin: right bottom;
|
2684 |
+
transform: rotate(90deg);
|
2685 |
+
opacity: 0;
|
2686 |
+
}
|
2687 |
+
|
2688 |
+
100% {
|
2689 |
+
transform-origin: right bottom;
|
2690 |
+
transform: rotate(0);
|
2691 |
+
opacity: 1;
|
2692 |
+
}
|
2693 |
+
}
|
2694 |
+
|
2695 |
+
.rotateInDownRight {
|
2696 |
+
-webkit-animation-name: rotateInDownRight;
|
2697 |
+
-moz-animation-name: rotateInDownRight;
|
2698 |
+
-o-animation-name: rotateInDownRight;
|
2699 |
+
animation-name: rotateInDownRight;
|
2700 |
+
}
|
2701 |
+
@-webkit-keyframes rotateOut {
|
2702 |
+
0% {
|
2703 |
+
-webkit-transform-origin: center center;
|
2704 |
+
-webkit-transform: rotate(0);
|
2705 |
+
opacity: 1;
|
2706 |
+
}
|
2707 |
+
|
2708 |
+
100% {
|
2709 |
+
-webkit-transform-origin: center center;
|
2710 |
+
-webkit-transform: rotate(200deg);
|
2711 |
+
opacity: 0;
|
2712 |
+
}
|
2713 |
+
}
|
2714 |
+
|
2715 |
+
@-moz-keyframes rotateOut {
|
2716 |
+
0% {
|
2717 |
+
-moz-transform-origin: center center;
|
2718 |
+
-moz-transform: rotate(0);
|
2719 |
+
opacity: 1;
|
2720 |
+
}
|
2721 |
+
|
2722 |
+
100% {
|
2723 |
+
-moz-transform-origin: center center;
|
2724 |
+
-moz-transform: rotate(200deg);
|
2725 |
+
opacity: 0;
|
2726 |
+
}
|
2727 |
+
}
|
2728 |
+
|
2729 |
+
@-o-keyframes rotateOut {
|
2730 |
+
0% {
|
2731 |
+
-o-transform-origin: center center;
|
2732 |
+
-o-transform: rotate(0);
|
2733 |
+
opacity: 1;
|
2734 |
+
}
|
2735 |
+
|
2736 |
+
100% {
|
2737 |
+
-o-transform-origin: center center;
|
2738 |
+
-o-transform: rotate(200deg);
|
2739 |
+
opacity: 0;
|
2740 |
+
}
|
2741 |
+
}
|
2742 |
+
|
2743 |
+
@keyframes rotateOut {
|
2744 |
+
0% {
|
2745 |
+
transform-origin: center center;
|
2746 |
+
transform: rotate(0);
|
2747 |
+
opacity: 1;
|
2748 |
+
}
|
2749 |
+
|
2750 |
+
100% {
|
2751 |
+
transform-origin: center center;
|
2752 |
+
transform: rotate(200deg);
|
2753 |
+
opacity: 0;
|
2754 |
+
}
|
2755 |
+
}
|
2756 |
+
|
2757 |
+
.rotateOut {
|
2758 |
+
-webkit-animation-name: rotateOut;
|
2759 |
+
-moz-animation-name: rotateOut;
|
2760 |
+
-o-animation-name: rotateOut;
|
2761 |
+
animation-name: rotateOut;
|
2762 |
+
}
|
2763 |
+
@-webkit-keyframes rotateOutUpLeft {
|
2764 |
+
0% {
|
2765 |
+
-webkit-transform-origin: left bottom;
|
2766 |
+
-webkit-transform: rotate(0);
|
2767 |
+
opacity: 1;
|
2768 |
+
}
|
2769 |
+
|
2770 |
+
100% {
|
2771 |
+
-webkit-transform-origin: left bottom;
|
2772 |
+
-webkit-transform: rotate(-90deg);
|
2773 |
+
opacity: 0;
|
2774 |
+
}
|
2775 |
+
}
|
2776 |
+
|
2777 |
+
@-moz-keyframes rotateOutUpLeft {
|
2778 |
+
0% {
|
2779 |
+
-moz-transform-origin: left bottom;
|
2780 |
+
-moz-transform: rotate(0);
|
2781 |
+
opacity: 1;
|
2782 |
+
}
|
2783 |
+
|
2784 |
+
100% {
|
2785 |
+
-moz-transform-origin: left bottom;
|
2786 |
+
-moz-transform: rotate(-90deg);
|
2787 |
+
opacity: 0;
|
2788 |
+
}
|
2789 |
+
}
|
2790 |
+
|
2791 |
+
@-o-keyframes rotateOutUpLeft {
|
2792 |
+
0% {
|
2793 |
+
-o-transform-origin: left bottom;
|
2794 |
+
-o-transform: rotate(0);
|
2795 |
+
opacity: 1;
|
2796 |
+
}
|
2797 |
+
|
2798 |
+
100% {
|
2799 |
+
-o-transform-origin: left bottom;
|
2800 |
+
-o-transform: rotate(-90deg);
|
2801 |
+
opacity: 0;
|
2802 |
+
}
|
2803 |
+
}
|
2804 |
+
|
2805 |
+
@keyframes rotateOutUpLeft {
|
2806 |
+
0% {
|
2807 |
+
transform-origin: left bottom;
|
2808 |
+
transform: rotate(0);
|
2809 |
+
opacity: 1;
|
2810 |
+
}
|
2811 |
+
|
2812 |
+
100% {
|
2813 |
+
-transform-origin: left bottom;
|
2814 |
+
-transform: rotate(-90deg);
|
2815 |
+
opacity: 0;
|
2816 |
+
}
|
2817 |
+
}
|
2818 |
+
|
2819 |
+
.rotateOutUpLeft {
|
2820 |
+
-webkit-animation-name: rotateOutUpLeft;
|
2821 |
+
-moz-animation-name: rotateOutUpLeft;
|
2822 |
+
-o-animation-name: rotateOutUpLeft;
|
2823 |
+
animation-name: rotateOutUpLeft;
|
2824 |
+
}
|
2825 |
+
@-webkit-keyframes rotateOutDownLeft {
|
2826 |
+
0% {
|
2827 |
+
-webkit-transform-origin: left bottom;
|
2828 |
+
-webkit-transform: rotate(0);
|
2829 |
+
opacity: 1;
|
2830 |
+
}
|
2831 |
+
|
2832 |
+
100% {
|
2833 |
+
-webkit-transform-origin: left bottom;
|
2834 |
+
-webkit-transform: rotate(90deg);
|
2835 |
+
opacity: 0;
|
2836 |
+
}
|
2837 |
+
}
|
2838 |
+
|
2839 |
+
@-moz-keyframes rotateOutDownLeft {
|
2840 |
+
0% {
|
2841 |
+
-moz-transform-origin: left bottom;
|
2842 |
+
-moz-transform: rotate(0);
|
2843 |
+
opacity: 1;
|
2844 |
+
}
|
2845 |
+
|
2846 |
+
100% {
|
2847 |
+
-moz-transform-origin: left bottom;
|
2848 |
+
-moz-transform: rotate(90deg);
|
2849 |
+
opacity: 0;
|
2850 |
+
}
|
2851 |
+
}
|
2852 |
+
|
2853 |
+
@-o-keyframes rotateOutDownLeft {
|
2854 |
+
0% {
|
2855 |
+
-o-transform-origin: left bottom;
|
2856 |
+
-o-transform: rotate(0);
|
2857 |
+
opacity: 1;
|
2858 |
+
}
|
2859 |
+
|
2860 |
+
100% {
|
2861 |
+
-o-transform-origin: left bottom;
|
2862 |
+
-o-transform: rotate(90deg);
|
2863 |
+
opacity: 0;
|
2864 |
+
}
|
2865 |
+
}
|
2866 |
+
|
2867 |
+
@keyframes rotateOutDownLeft {
|
2868 |
+
0% {
|
2869 |
+
transform-origin: left bottom;
|
2870 |
+
transform: rotate(0);
|
2871 |
+
opacity: 1;
|
2872 |
+
}
|
2873 |
+
|
2874 |
+
100% {
|
2875 |
+
transform-origin: left bottom;
|
2876 |
+
transform: rotate(90deg);
|
2877 |
+
opacity: 0;
|
2878 |
+
}
|
2879 |
+
}
|
2880 |
+
|
2881 |
+
.rotateOutDownLeft {
|
2882 |
+
-webkit-animation-name: rotateOutDownLeft;
|
2883 |
+
-moz-animation-name: rotateOutDownLeft;
|
2884 |
+
-o-animation-name: rotateOutDownLeft;
|
2885 |
+
animation-name: rotateOutDownLeft;
|
2886 |
+
}
|
2887 |
+
@-webkit-keyframes rotateOutUpRight {
|
2888 |
+
0% {
|
2889 |
+
-webkit-transform-origin: right bottom;
|
2890 |
+
-webkit-transform: rotate(0);
|
2891 |
+
opacity: 1;
|
2892 |
+
}
|
2893 |
+
|
2894 |
+
100% {
|
2895 |
+
-webkit-transform-origin: right bottom;
|
2896 |
+
-webkit-transform: rotate(90deg);
|
2897 |
+
opacity: 0;
|
2898 |
+
}
|
2899 |
+
}
|
2900 |
+
|
2901 |
+
@-moz-keyframes rotateOutUpRight {
|
2902 |
+
0% {
|
2903 |
+
-moz-transform-origin: right bottom;
|
2904 |
+
-moz-transform: rotate(0);
|
2905 |
+
opacity: 1;
|
2906 |
+
}
|
2907 |
+
|
2908 |
+
100% {
|
2909 |
+
-moz-transform-origin: right bottom;
|
2910 |
+
-moz-transform: rotate(90deg);
|
2911 |
+
opacity: 0;
|
2912 |
+
}
|
2913 |
+
}
|
2914 |
+
|
2915 |
+
@-o-keyframes rotateOutUpRight {
|
2916 |
+
0% {
|
2917 |
+
-o-transform-origin: right bottom;
|
2918 |
+
-o-transform: rotate(0);
|
2919 |
+
opacity: 1;
|
2920 |
+
}
|
2921 |
+
|
2922 |
+
100% {
|
2923 |
+
-o-transform-origin: right bottom;
|
2924 |
+
-o-transform: rotate(90deg);
|
2925 |
+
opacity: 0;
|
2926 |
+
}
|
2927 |
+
}
|
2928 |
+
|
2929 |
+
@keyframes rotateOutUpRight {
|
2930 |
+
0% {
|
2931 |
+
transform-origin: right bottom;
|
2932 |
+
transform: rotate(0);
|
2933 |
+
opacity: 1;
|
2934 |
+
}
|
2935 |
+
|
2936 |
+
100% {
|
2937 |
+
transform-origin: right bottom;
|
2938 |
+
transform: rotate(90deg);
|
2939 |
+
opacity: 0;
|
2940 |
+
}
|
2941 |
+
}
|
2942 |
+
|
2943 |
+
.rotateOutUpRight {
|
2944 |
+
-webkit-animation-name: rotateOutUpRight;
|
2945 |
+
-moz-animation-name: rotateOutUpRight;
|
2946 |
+
-o-animation-name: rotateOutUpRight;
|
2947 |
+
animation-name: rotateOutUpRight;
|
2948 |
+
}
|
2949 |
+
@-webkit-keyframes rotateOutDownRight {
|
2950 |
+
0% {
|
2951 |
+
-webkit-transform-origin: right bottom;
|
2952 |
+
-webkit-transform: rotate(0);
|
2953 |
+
opacity: 1;
|
2954 |
+
}
|
2955 |
+
|
2956 |
+
100% {
|
2957 |
+
-webkit-transform-origin: right bottom;
|
2958 |
+
-webkit-transform: rotate(-90deg);
|
2959 |
+
opacity: 0;
|
2960 |
+
}
|
2961 |
+
}
|
2962 |
+
|
2963 |
+
@-moz-keyframes rotateOutDownRight {
|
2964 |
+
0% {
|
2965 |
+
-moz-transform-origin: right bottom;
|
2966 |
+
-moz-transform: rotate(0);
|
2967 |
+
opacity: 1;
|
2968 |
+
}
|
2969 |
+
|
2970 |
+
100% {
|
2971 |
+
-moz-transform-origin: right bottom;
|
2972 |
+
-moz-transform: rotate(-90deg);
|
2973 |
+
opacity: 0;
|
2974 |
+
}
|
2975 |
+
}
|
2976 |
+
|
2977 |
+
@-o-keyframes rotateOutDownRight {
|
2978 |
+
0% {
|
2979 |
+
-o-transform-origin: right bottom;
|
2980 |
+
-o-transform: rotate(0);
|
2981 |
+
opacity: 1;
|
2982 |
+
}
|
2983 |
+
|
2984 |
+
100% {
|
2985 |
+
-o-transform-origin: right bottom;
|
2986 |
+
-o-transform: rotate(-90deg);
|
2987 |
+
opacity: 0;
|
2988 |
+
}
|
2989 |
+
}
|
2990 |
+
|
2991 |
+
@keyframes rotateOutDownRight {
|
2992 |
+
0% {
|
2993 |
+
transform-origin: right bottom;
|
2994 |
+
transform: rotate(0);
|
2995 |
+
opacity: 1;
|
2996 |
+
}
|
2997 |
+
|
2998 |
+
100% {
|
2999 |
+
transform-origin: right bottom;
|
3000 |
+
transform: rotate(-90deg);
|
3001 |
+
opacity: 0;
|
3002 |
+
}
|
3003 |
+
}
|
3004 |
+
|
3005 |
+
.rotateOutDownRight {
|
3006 |
+
-webkit-animation-name: rotateOutDownRight;
|
3007 |
+
-moz-animation-name: rotateOutDownRight;
|
3008 |
+
-o-animation-name: rotateOutDownRight;
|
3009 |
+
animation-name: rotateOutDownRight;
|
3010 |
+
}
|
3011 |
+
@-webkit-keyframes lightSpeedIn {
|
3012 |
+
0% { -webkit-transform: translateX(100%) skewX(-30deg); opacity: 0; }
|
3013 |
+
60% { -webkit-transform: translateX(-20%) skewX(30deg); opacity: 1; }
|
3014 |
+
80% { -webkit-transform: translateX(0%) skewX(-15deg); opacity: 1; }
|
3015 |
+
100% { -webkit-transform: translateX(0%) skewX(0deg); opacity: 1; }
|
3016 |
+
}
|
3017 |
+
|
3018 |
+
@-moz-keyframes lightSpeedIn {
|
3019 |
+
0% { -moz-transform: translateX(100%) skewX(-30deg); opacity: 0; }
|
3020 |
+
60% { -moz-transform: translateX(-20%) skewX(30deg); opacity: 1; }
|
3021 |
+
80% { -moz-transform: translateX(0%) skewX(-15deg); opacity: 1; }
|
3022 |
+
100% { -moz-transform: translateX(0%) skewX(0deg); opacity: 1; }
|
3023 |
+
}
|
3024 |
+
|
3025 |
+
@-o-keyframes lightSpeedIn {
|
3026 |
+
0% { -o-transform: translateX(100%) skewX(-30deg); opacity: 0; }
|
3027 |
+
60% { -o-transform: translateX(-20%) skewX(30deg); opacity: 1; }
|
3028 |
+
80% { -o-transform: translateX(0%) skewX(-15deg); opacity: 1; }
|
3029 |
+
100% { -o-transform: translateX(0%) skewX(0deg); opacity: 1; }
|
3030 |
+
}
|
3031 |
+
|
3032 |
+
@keyframes lightSpeedIn {
|
3033 |
+
0% { transform: translateX(100%) skewX(-30deg); opacity: 0; }
|
3034 |
+
60% { transform: translateX(-20%) skewX(30deg); opacity: 1; }
|
3035 |
+
80% { transform: translateX(0%) skewX(-15deg); opacity: 1; }
|
3036 |
+
100% { transform: translateX(0%) skewX(0deg); opacity: 1; }
|
3037 |
+
}
|
3038 |
+
|
3039 |
+
.lightSpeedIn {
|
3040 |
+
-webkit-animation-name: lightSpeedIn;
|
3041 |
+
-moz-animation-name: lightSpeedIn;
|
3042 |
+
-o-animation-name: lightSpeedIn;
|
3043 |
+
animation-name: lightSpeedIn;
|
3044 |
+
|
3045 |
+
-webkit-animation-timing-function: ease-out;
|
3046 |
+
-moz-animation-timing-function: ease-out;
|
3047 |
+
-o-animation-timing-function: ease-out;
|
3048 |
+
animation-timing-function: ease-out;
|
3049 |
+
}
|
3050 |
+
@-webkit-keyframes lightSpeedOut {
|
3051 |
+
0% { -webkit-transform: translateX(0%) skewX(0deg); opacity: 1; }
|
3052 |
+
100% { -webkit-transform: translateX(100%) skewX(-30deg); opacity: 0; }
|
3053 |
+
}
|
3054 |
+
|
3055 |
+
@-moz-keyframes lightSpeedOut {
|
3056 |
+
0% { -moz-transform: translateX(0%) skewX(0deg); opacity: 1; }
|
3057 |
+
100% { -moz-transform: translateX(100%) skewX(-30deg); opacity: 0; }
|
3058 |
+
}
|
3059 |
+
|
3060 |
+
@-o-keyframes lightSpeedOut {
|
3061 |
+
0% { -o-transform: translateX(0%) skewX(0deg); opacity: 1; }
|
3062 |
+
100% { -o-transform: translateX(100%) skewX(-30deg); opacity: 0; }
|
3063 |
+
}
|
3064 |
+
|
3065 |
+
@keyframes lightSpeedOut {
|
3066 |
+
0% { transform: translateX(0%) skewX(0deg); opacity: 1; }
|
3067 |
+
100% { transform: translateX(100%) skewX(-30deg); opacity: 0; }
|
3068 |
+
}
|
3069 |
+
|
3070 |
+
.lightSpeedOut {
|
3071 |
+
-webkit-animation-name: lightSpeedOut;
|
3072 |
+
-moz-animation-name: lightSpeedOut;
|
3073 |
+
-o-animation-name: lightSpeedOut;
|
3074 |
+
animation-name: lightSpeedOut;
|
3075 |
+
|
3076 |
+
-webkit-animation-timing-function: ease-in;
|
3077 |
+
-moz-animation-timing-function: ease-in;
|
3078 |
+
-o-animation-timing-function: ease-in;
|
3079 |
+
animation-timing-function: ease-in;
|
3080 |
+
}
|
3081 |
+
@-webkit-keyframes hinge {
|
3082 |
+
0% { -webkit-transform: rotate(0); -webkit-transform-origin: top left; -webkit-animation-timing-function: ease-in-out; }
|
3083 |
+
20%, 60% { -webkit-transform: rotate(80deg); -webkit-transform-origin: top left; -webkit-animation-timing-function: ease-in-out; }
|
3084 |
+
40% { -webkit-transform: rotate(60deg); -webkit-transform-origin: top left; -webkit-animation-timing-function: ease-in-out; }
|
3085 |
+
80% { -webkit-transform: rotate(60deg) translateY(0); opacity: 1; -webkit-transform-origin: top left; -webkit-animation-timing-function: ease-in-out; }
|
3086 |
+
100% { -webkit-transform: translateY(700px); opacity: 0; }
|
3087 |
+
}
|
3088 |
+
|
3089 |
+
@-moz-keyframes hinge {
|
3090 |
+
0% { -moz-transform: rotate(0); -moz-transform-origin: top left; -moz-animation-timing-function: ease-in-out; }
|
3091 |
+
20%, 60% { -moz-transform: rotate(80deg); -moz-transform-origin: top left; -moz-animation-timing-function: ease-in-out; }
|
3092 |
+
40% { -moz-transform: rotate(60deg); -moz-transform-origin: top left; -moz-animation-timing-function: ease-in-out; }
|
3093 |
+
80% { -moz-transform: rotate(60deg) translateY(0); opacity: 1; -moz-transform-origin: top left; -moz-animation-timing-function: ease-in-out; }
|
3094 |
+
100% { -moz-transform: translateY(700px); opacity: 0; }
|
3095 |
+
}
|
3096 |
+
|
3097 |
+
@-o-keyframes hinge {
|
3098 |
+
0% { -o-transform: rotate(0); -o-transform-origin: top left; -o-animation-timing-function: ease-in-out; }
|
3099 |
+
20%, 60% { -o-transform: rotate(80deg); -o-transform-origin: top left; -o-animation-timing-function: ease-in-out; }
|
3100 |
+
40% { -o-transform: rotate(60deg); -o-transform-origin: top left; -o-animation-timing-function: ease-in-out; }
|
3101 |
+
80% { -o-transform: rotate(60deg) translateY(0); opacity: 1; -o-transform-origin: top left; -o-animation-timing-function: ease-in-out; }
|
3102 |
+
100% { -o-transform: translateY(700px); opacity: 0; }
|
3103 |
+
}
|
3104 |
+
|
3105 |
+
@keyframes hinge {
|
3106 |
+
0% { transform: rotate(0); transform-origin: top left; animation-timing-function: ease-in-out; }
|
3107 |
+
20%, 60% { transform: rotate(80deg); transform-origin: top left; animation-timing-function: ease-in-out; }
|
3108 |
+
40% { transform: rotate(60deg); transform-origin: top left; animation-timing-function: ease-in-out; }
|
3109 |
+
80% { transform: rotate(60deg) translateY(0); opacity: 1; transform-origin: top left; animation-timing-function: ease-in-out; }
|
3110 |
+
100% { transform: translateY(700px); opacity: 0; }
|
3111 |
+
}
|
3112 |
+
|
3113 |
+
.hinge {
|
3114 |
+
-webkit-animation-name: hinge;
|
3115 |
+
-moz-animation-name: hinge;
|
3116 |
+
-o-animation-name: hinge;
|
3117 |
+
animation-name: hinge;
|
3118 |
+
}
|
3119 |
+
/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
|
3120 |
+
|
3121 |
+
@-webkit-keyframes rollIn {
|
3122 |
+
0% { opacity: 0; -webkit-transform: translateX(-100%) rotate(-120deg); }
|
3123 |
+
100% { opacity: 1; -webkit-transform: translateX(0px) rotate(0deg); }
|
3124 |
+
}
|
3125 |
+
|
3126 |
+
@-moz-keyframes rollIn {
|
3127 |
+
0% { opacity: 0; -moz-transform: translateX(-100%) rotate(-120deg); }
|
3128 |
+
100% { opacity: 1; -moz-transform: translateX(0px) rotate(0deg); }
|
3129 |
+
}
|
3130 |
+
|
3131 |
+
@-o-keyframes rollIn {
|
3132 |
+
0% { opacity: 0; -o-transform: translateX(-100%) rotate(-120deg); }
|
3133 |
+
100% { opacity: 1; -o-transform: translateX(0px) rotate(0deg); }
|
3134 |
+
}
|
3135 |
+
|
3136 |
+
@keyframes rollIn {
|
3137 |
+
0% { opacity: 0; transform: translateX(-100%) rotate(-120deg); }
|
3138 |
+
100% { opacity: 1; transform: translateX(0px) rotate(0deg); }
|
3139 |
+
}
|
3140 |
+
|
3141 |
+
.rollIn {
|
3142 |
+
-webkit-animation-name: rollIn;
|
3143 |
+
-moz-animation-name: rollIn;
|
3144 |
+
-o-animation-name: rollIn;
|
3145 |
+
animation-name: rollIn;
|
3146 |
+
}
|
3147 |
+
/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
|
3148 |
+
|
3149 |
+
@-webkit-keyframes rollOut {
|
3150 |
+
0% {
|
3151 |
+
opacity: 1;
|
3152 |
+
-webkit-transform: translateX(0px) rotate(0deg);
|
3153 |
+
}
|
3154 |
+
|
3155 |
+
100% {
|
3156 |
+
opacity: 0;
|
3157 |
+
-webkit-transform: translateX(100%) rotate(120deg);
|
3158 |
+
}
|
3159 |
+
}
|
3160 |
+
|
3161 |
+
@-moz-keyframes rollOut {
|
3162 |
+
0% {
|
3163 |
+
opacity: 1;
|
3164 |
+
-moz-transform: translateX(0px) rotate(0deg);
|
3165 |
+
}
|
3166 |
+
|
3167 |
+
100% {
|
3168 |
+
opacity: 0;
|
3169 |
+
-moz-transform: translateX(100%) rotate(120deg);
|
3170 |
+
}
|
3171 |
+
}
|
3172 |
+
|
3173 |
+
@-o-keyframes rollOut {
|
3174 |
+
0% {
|
3175 |
+
opacity: 1;
|
3176 |
+
-o-transform: translateX(0px) rotate(0deg);
|
3177 |
+
}
|
3178 |
+
|
3179 |
+
100% {
|
3180 |
+
opacity: 0;
|
3181 |
+
-o-transform: translateX(100%) rotate(120deg);
|
3182 |
+
}
|
3183 |
+
}
|
3184 |
+
|
3185 |
+
@keyframes rollOut {
|
3186 |
+
0% {
|
3187 |
+
opacity: 1;
|
3188 |
+
transform: translateX(0px) rotate(0deg);
|
3189 |
+
}
|
3190 |
+
|
3191 |
+
100% {
|
3192 |
+
opacity: 0;
|
3193 |
+
transform: translateX(100%) rotate(120deg);
|
3194 |
+
}
|
3195 |
+
}
|
3196 |
+
|
3197 |
+
.rollOut {
|
3198 |
+
-webkit-animation-name: rollOut;
|
3199 |
+
-moz-animation-name: rollOut;
|
3200 |
+
-o-animation-name: rollOut;
|
3201 |
+
animation-name: rollOut;
|
3202 |
+
}
|
backend/settings/assets/fonts.js
ADDED
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
function loadFonts(family) {
|
2 |
+
var fonts = new Array(
|
3 |
+
'Allan:400,700',
|
4 |
+
'Allerta:400,700',
|
5 |
+
'Allerta+Stencil:400,700',
|
6 |
+
'Anonymous+Pro:400,700',
|
7 |
+
'Arimo:400,700',
|
8 |
+
'Arvo:400,700',
|
9 |
+
'Bentham:400,700',
|
10 |
+
'Buda:400,700',
|
11 |
+
'Cabin:400,700',
|
12 |
+
'Calligraffitti:400,700',
|
13 |
+
'Cantarell:400,700',
|
14 |
+
'Cardo:400,700',
|
15 |
+
'Cherry+Cream+Soda:400,700',
|
16 |
+
'Chewy:400,700',
|
17 |
+
'Coda:400,700',
|
18 |
+
'Coming+Soon:400,700',
|
19 |
+
'Copse:400,700',
|
20 |
+
'Corben:400,700',
|
21 |
+
'Cousine:400,700',
|
22 |
+
'Covered+By+Your+Grace:400,700',
|
23 |
+
'Crafty+Girls:400,700',
|
24 |
+
'Crimson+Text:400,700',
|
25 |
+
'Crushed:400,700',
|
26 |
+
'Cuprum:400,700',
|
27 |
+
'Droid+Sans:400,700',
|
28 |
+
'Droid+Sans+Mono:400,700',
|
29 |
+
'Droid+Serif:400,700',
|
30 |
+
'Fontdiner+Swanky:400,700',
|
31 |
+
'GFS+Didot:400,700',
|
32 |
+
'GFS+Neohellenic:400,700',
|
33 |
+
'Geo:400,700',
|
34 |
+
'Gruppo:400,700',
|
35 |
+
'Hanuman:400,700',
|
36 |
+
'Homemade+Apple:400,700',
|
37 |
+
'IM+Fell+DW+Pica:400,700',
|
38 |
+
'IM+Fell+DW+Pica+SC:400,700',
|
39 |
+
'IM+Fell+Double+Pica:400,700',
|
40 |
+
'IM+Fell+Double+Pica+SC:400,700',
|
41 |
+
'IM+Fell+English:400,700',
|
42 |
+
'IM+Fell+English+SC:400,700',
|
43 |
+
'IM+Fell+French+Canon:400,700',
|
44 |
+
'IM+Fell+French+Canon+SC:400,700',
|
45 |
+
'IM+Fell+Great+Primer:400,700',
|
46 |
+
'IM+Fell+Great+Primer+SC:400,700',
|
47 |
+
'Inconsolata:400,700',
|
48 |
+
'Irish+Growler:400,700',
|
49 |
+
'Josefin+Sans:400,700',
|
50 |
+
'Josefin+Slab:400,700',
|
51 |
+
'Just+Another+Hand:400,700',
|
52 |
+
'Just+Me+Again+Down+Here:400,700',
|
53 |
+
'Kenia:400,700',
|
54 |
+
'Kranky:400,700',
|
55 |
+
'Kristi:400,700',
|
56 |
+
'Lato:400,700',
|
57 |
+
'Lekton:400,700',
|
58 |
+
'Lobster:400,700',
|
59 |
+
'Luckiest+Guy:400,700',
|
60 |
+
'Merriweather:400,700',
|
61 |
+
'Molengo:400,700',
|
62 |
+
'Mountains+of+Christmas:400,700',
|
63 |
+
'Neucha:400,700',
|
64 |
+
'Neuton:400,700',
|
65 |
+
'Nobile:400,700',
|
66 |
+
'OFL+Sorts+Mill+Goudy+TT:400,700',
|
67 |
+
'Old+Standard+TT:400,700',
|
68 |
+
'Orbitron:400,700',
|
69 |
+
'PT+Sans:400,700',
|
70 |
+
'PT+Sans+Caption:400,700',
|
71 |
+
'PT+Sans+Narrow:400,700',
|
72 |
+
'Permanent+Marker:400,700',
|
73 |
+
'Philosopher:400,700',
|
74 |
+
'Puritan:400,700',
|
75 |
+
'Raleway:400,700',
|
76 |
+
'Reenie+Beanie:400,700',
|
77 |
+
'Rock+Salt:400,700',
|
78 |
+
'Schoolbell:400,700',
|
79 |
+
'Slackey:400,700',
|
80 |
+
'Sniglet:400,700',
|
81 |
+
'Sunshiney:400,700',
|
82 |
+
'Syncopate:400,700',
|
83 |
+
'Tangerine:400,700',
|
84 |
+
'Tinos:400,700',
|
85 |
+
'Ubuntu:400,700',
|
86 |
+
'UnifrakturCook:400,700',
|
87 |
+
'UnifrakturMaguntia:400,700',
|
88 |
+
'Unkempt:400,700',
|
89 |
+
'Vibur:400,700',
|
90 |
+
'Vollkorn:400,700',
|
91 |
+
'Walter+Turncoat:400,700',
|
92 |
+
'Yanone+Kaffeesatz:400,700'
|
93 |
+
);
|
94 |
+
WebFontConfig = {
|
95 |
+
google: { families: [family+":400,700"] }
|
96 |
+
};
|
97 |
+
(function() {
|
98 |
+
var wf = document.createElement('script');
|
99 |
+
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
|
100 |
+
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
|
101 |
+
wf.type = 'text/javascript';
|
102 |
+
wf.async = 'true';
|
103 |
+
var s = document.getElementsByTagName('script')[0];
|
104 |
+
s.parentNode.insertBefore(wf, s);
|
105 |
+
})();
|
106 |
+
}
|
107 |
+
(function($) {
|
108 |
+
$(document).ready(function() {
|
109 |
+
$(".wpdreamsfont").change(function() {
|
110 |
+
var weightNode = $('.wpdreams-fontweight:checked', this.parentNode)[0];
|
111 |
+
$(weightNode).trigger('change');
|
112 |
+
return;
|
113 |
+
});
|
114 |
+
$(".color").change(function() {
|
115 |
+
var weightNode = $('.wpdreams-fontweight:checked', this.parentNode.parentNode)[0];
|
116 |
+
$(weightNode).trigger('change');
|
117 |
+
return;
|
118 |
+
});
|
119 |
+
$(".wpdreams-fontsize").change(function() {
|
120 |
+
var weightNode = $('.wpdreams-fontweight:checked', this.parentNode)[0];
|
121 |
+
$(weightNode).trigger('change');
|
122 |
+
return;
|
123 |
+
});
|
124 |
+
$(".wpdreams-lineheight").change(function() {
|
125 |
+
var weightNode = $('.wpdreams-fontweight:checked', this.parentNode)[0];
|
126 |
+
$(weightNode).trigger('change');
|
127 |
+
});
|
128 |
+
$('.wpdreams-fontweight').change(function() {
|
129 |
+
var weight = "font-weight:"+jQuery(this).val()+";";
|
130 |
+
var familyNode = $('.wpdreamsfont', this.parentNode)[0];
|
131 |
+
var colorNode = $('.color', this.parentNode)[0];
|
132 |
+
var sizeNode = $('.wpdreams-fontsize', this.parentNode)[0];
|
133 |
+
var lhNode = $('.wpdreams-lineheight', this.parentNode)[0];
|
134 |
+
|
135 |
+
var family = "font-family:"+jQuery(familyNode).val()+";";
|
136 |
+
var color = "color:"+$(colorNode).val()+";";
|
137 |
+
var size = "font-size:"+$(sizeNode).val()+";";
|
138 |
+
var lh = "line-height:"+$(lhNode).val()+";";
|
139 |
+
|
140 |
+
loadFonts(jQuery(familyNode).val());
|
141 |
+
$("label", this.parentNode).css("font-family", $(familyNode).val());
|
142 |
+
$("label", this.parentNode).css("font-weight", $(this).val());
|
143 |
+
$("label", this.parentNode).css("color", $(colorNode).val());
|
144 |
+
$("input[type=hidden]", this.parentNode).val("font-weight:"+$(this).val()+";"+family+color+size+lh);
|
145 |
+
});
|
146 |
+
|
147 |
+
|
148 |
+
$(".wpdreamsFont>fieldset>.triggerer").click(function() {
|
149 |
+
var parent = $(this).parent();
|
150 |
+
|
151 |
+
var hidden = $('input[type=hidden]', parent);
|
152 |
+
var val = hidden.val().replace(/(\r\n|\n|\r)/gm,"");
|
153 |
+
var familyNode = $('.wpdreamsfont', parent)[0];
|
154 |
+
var colorNode = $('.color', parent)[0];
|
155 |
+
var sizeNode = $('.wpdreams-fontsize', parent)[0];
|
156 |
+
var lhNode = $('.wpdreams-lineheight', this.parentNode)[0];
|
157 |
+
|
158 |
+
$(familyNode).val(val.match(/family:(.*?);/)[1]);
|
159 |
+
$(sizeNode).val(val.match(/size:(.*?);/)[1]);
|
160 |
+
$(colorNode).val(val.match(/color:(.*?);/)[1]);
|
161 |
+
$(colorNode).spectrum('set', val.match(/color:(.*?);/)[1]);
|
162 |
+
$(lhNode).val(val.match(/height:(.*?);/)[1]);
|
163 |
+
});
|
164 |
+
});
|
165 |
+
}(jQuery));
|
{settings/types → backend/settings/assets}/icons/arrow-left.png
RENAMED
File without changes
|
{settings/types → backend/settings/assets}/icons/arrow-right.png
RENAMED
File without changes
|
backend/settings/assets/icons/b-asettings.png
ADDED
Binary file
|
backend/settings/assets/icons/b-back.png
ADDED
Binary file
|
backend/settings/assets/icons/b-bulb.png
ADDED
Binary file
|
backend/settings/assets/icons/b-eye.png
ADDED
Binary file
|
backend/settings/assets/icons/b-frontend.png
ADDED
Binary file
|
backend/settings/assets/icons/b-layout.png
ADDED
Binary file
|
backend/settings/assets/icons/b-maximise.png
ADDED
Binary file
|
backend/settings/assets/icons/b-multisite.png
ADDED
Binary file
|
backend/settings/assets/icons/b-refresh.png
ADDED
Binary file
|
backend/settings/assets/icons/b-settings.png
ADDED
Binary file
|
backend/settings/assets/icons/b-stat.png
ADDED
Binary file
|
backend/settings/assets/icons/b-tray.png
ADDED
Binary file
|
backend/settings/assets/icons/b-warning.png
ADDED
Binary file
|
{settings/types → backend/settings/assets}/icons/black_arrow.png
RENAMED
File without changes
|
{settings/types → backend/settings/assets}/icons/close.png
RENAMED
File without changes
|
{settings/types → backend/settings/assets}/icons/delete.png
RENAMED
File without changes
|
{settings/types → backend/settings/assets}/icons/down.png
RENAMED
File without changes
|
{settings/types → backend/settings/assets}/icons/drag.png
RENAMED
File without changes
|
backend/settings/assets/icons/exclamation.png
ADDED
Binary file
|
{settings/types → backend/settings/assets}/icons/float.png
RENAMED
File without changes
|
backend/settings/assets/icons/grad-deg.png
ADDED
Binary file
|
{settings/types → backend/settings/assets}/icons/info.png
RENAMED
File without changes
|
{settings/types → backend/settings/assets}/icons/labelposition.png
RENAMED
File without changes
|
{img → backend/settings/assets/icons}/loading-big.gif
RENAMED
File without changes
|
backend/settings/assets/icons/on-off-new.png
ADDED
Binary file
|
{settings/types → backend/settings/assets}/icons/paint.png
RENAMED
File without changes
|
backend/settings/assets/icons/pen.png
ADDED
Binary file
|
{settings/types → backend/settings/assets}/icons/point.png
RENAMED
File without changes
|
{settings/types → backend/settings/assets}/icons/settings.png
RENAMED
File without changes
|
{settings/types → backend/settings/assets}/icons/slides.png
RENAMED
File without changes
|
backend/settings/assets/icons/tick.png
ADDED
Binary file
|
{settings/types → backend/settings/assets}/icons/up.png
RENAMED
File without changes
|
backend/settings/assets/icons/updown12x25.png
ADDED
Binary file
|
backend/settings/assets/js/jqPlot/jquery.jqplot.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
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);}
|
backend/settings/assets/js/jqPlot/jquery.jqplot.min.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
(function($){
|
2 |
+
(function(H){var r;H.fn.emptyForce=function(){for(var ab=0,ac;(ac=H(this)[ab])!=null;ab++){if(ac.nodeType===1){H.cleanData(ac.getElementsByTagName("*"))}if(H.jqplot.use_excanvas){ac.outerHTML=""}else{while(ac.firstChild){ac.removeChild(ac.firstChild)}}ac=null}return H(this)};H.fn.removeChildForce=function(ab){while(ab.firstChild){this.removeChildForce(ab.firstChild);ab.removeChild(ab.firstChild)}};H.fn.jqplot=function(){var ab=[];var ad=[];for(var ae=0,ac=arguments.length;ae<ac;ae++){if(H.isArray(arguments[ae])){ab.push(arguments[ae])}else{if(H.isPlainObject(arguments[ae])){ad.push(arguments[ae])}}}return this.each(function(ah){var am,al,ak=H(this),ag=ab.length,af=ad.length,aj,ai;if(ah<ag){aj=ab[ah]}else{aj=ag?ab[ag-1]:null}if(ah<af){ai=ad[ah]}else{ai=af?ad[af-1]:null}am=ak.attr("id");if(am===r){am="jqplot_target_"+H.jqplot.targetCounter++;ak.attr("id",am)}al=H.jqplot(am,aj,ai);ak.data("jqplot",al)})};H.jqplot=function(ah,ae,ac){var ad=null,ab=null;if(arguments.length===3){ad=ae;ab=ac}else{if(arguments.length===2){if(H.isArray(ae)){ad=ae}else{if(H.isPlainObject(ae)){ab=ae}}}}if(ad===null&&ab!==null&&ab.data){ad=ab.data}var ag=new N();H("#"+ah).removeClass("jqplot-error");if(H.jqplot.config.catchErrors){try{ag.init(ah,ad,ab);ag.draw();ag.themeEngine.init.call(ag);return ag}catch(af){var ai=H.jqplot.config.errorMessage||af.message;H("#"+ah).append('<div class="jqplot-error-message">'+ai+"</div>");H("#"+ah).addClass("jqplot-error");document.getElementById(ah).style.background=H.jqplot.config.errorBackground;document.getElementById(ah).style.border=H.jqplot.config.errorBorder;document.getElementById(ah).style.fontFamily=H.jqplot.config.errorFontFamily;document.getElementById(ah).style.fontSize=H.jqplot.config.errorFontSize;document.getElementById(ah).style.fontStyle=H.jqplot.config.errorFontStyle;document.getElementById(ah).style.fontWeight=H.jqplot.config.errorFontWeight}}else{ag.init(ah,ad,ab);ag.draw();ag.themeEngine.init.call(ag);return ag}};H.jqplot.version="1.0.4";H.jqplot.revision="1121";H.jqplot.targetCounter=1;H.jqplot.CanvasManager=function(){if(typeof H.jqplot.CanvasManager.canvases=="undefined"){H.jqplot.CanvasManager.canvases=[];H.jqplot.CanvasManager.free=[]}var ab=[];this.getCanvas=function(){var ae;var ad=true;if(!H.jqplot.use_excanvas){for(var af=0,ac=H.jqplot.CanvasManager.canvases.length;af<ac;af++){if(H.jqplot.CanvasManager.free[af]===true){ad=false;ae=H.jqplot.CanvasManager.canvases[af];H.jqplot.CanvasManager.free[af]=false;ab.push(af);break}}}if(ad){ae=document.createElement("canvas");ab.push(H.jqplot.CanvasManager.canvases.length);H.jqplot.CanvasManager.canvases.push(ae);H.jqplot.CanvasManager.free.push(false)}return ae};this.initCanvas=function(ac){if(H.jqplot.use_excanvas){return window.G_vmlCanvasManager.initElement(ac)}return ac};this.freeAllCanvases=function(){for(var ad=0,ac=ab.length;ad<ac;ad++){this.freeCanvas(ab[ad])}ab=[]};this.freeCanvas=function(ac){if(H.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==r){window.G_vmlCanvasManager.uninitElement(H.jqplot.CanvasManager.canvases[ac]);H.jqplot.CanvasManager.canvases[ac]=null}else{var ad=H.jqplot.CanvasManager.canvases[ac];ad.getContext("2d").clearRect(0,0,ad.width,ad.height);H(ad).unbind().removeAttr("class").removeAttr("style");H(ad).css({left:"",top:"",position:""});ad.width=0;ad.height=0;H.jqplot.CanvasManager.free[ac]=true}}};H.jqplot.log=function(){if(window.console){window.console.log.apply(window.console,arguments)}};H.jqplot.config={addDomReference:false,enablePlugins:false,defaultHeight:300,defaultWidth:400,UTCAdjust:false,timezoneOffset:new Date(new Date().getTimezoneOffset()*60000),errorMessage:"",errorBackground:"",errorBorder:"",errorFontFamily:"",errorFontSize:"",errorFontStyle:"",errorFontWeight:"",catchErrors:false,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/"};H.jqplot.arrayMax=function(ab){return Math.max.apply(Math,ab)};H.jqplot.arrayMin=function(ab){return Math.min.apply(Math,ab)};H.jqplot.enablePlugins=H.jqplot.config.enablePlugins;H.jqplot.support_canvas=function(){if(typeof H.jqplot.support_canvas.result=="undefined"){H.jqplot.support_canvas.result=!!document.createElement("canvas").getContext}return H.jqplot.support_canvas.result};H.jqplot.support_canvas_text=function(){if(typeof H.jqplot.support_canvas_text.result=="undefined"){if(window.G_vmlCanvasManager!==r&&window.G_vmlCanvasManager._version>887){H.jqplot.support_canvas_text.result=true}else{H.jqplot.support_canvas_text.result=!!(document.createElement("canvas").getContext&&typeof document.createElement("canvas").getContext("2d").fillText=="function")}}return H.jqplot.support_canvas_text.result};H.jqplot.use_excanvas=(H.browser.msie&&!H.jqplot.support_canvas())?true:false;H.jqplot.preInitHooks=[];H.jqplot.postInitHooks=[];H.jqplot.preParseOptionsHooks=[];H.jqplot.postParseOptionsHooks=[];H.jqplot.preDrawHooks=[];H.jqplot.postDrawHooks=[];H.jqplot.preDrawSeriesHooks=[];H.jqplot.postDrawSeriesHooks=[];H.jqplot.preDrawLegendHooks=[];H.jqplot.addLegendRowHooks=[];H.jqplot.preSeriesInitHooks=[];H.jqplot.postSeriesInitHooks=[];H.jqplot.preParseSeriesOptionsHooks=[];H.jqplot.postParseSeriesOptionsHooks=[];H.jqplot.eventListenerHooks=[];H.jqplot.preDrawSeriesShadowHooks=[];H.jqplot.postDrawSeriesShadowHooks=[];H.jqplot.ElemContainer=function(){this._elem;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null}};H.jqplot.ElemContainer.prototype.createElement=function(ae,ag,ac,ad,ah){this._offsets=ag;var ab=ac||"jqplot";var af=document.createElement(ae);this._elem=H(af);this._elem.addClass(ab);this._elem.css(ad);this._elem.attr(ah);af=null;return this._elem};H.jqplot.ElemContainer.prototype.getWidth=function(){if(this._elem){return this._elem.outerWidth(true)}else{return null}};H.jqplot.ElemContainer.prototype.getHeight=function(){if(this._elem){return this._elem.outerHeight(true)}else{return null}};H.jqplot.ElemContainer.prototype.getPosition=function(){if(this._elem){return this._elem.position()}else{return{top:null,left:null,bottom:null,right:null}}};H.jqplot.ElemContainer.prototype.getTop=function(){return this.getPosition().top};H.jqplot.ElemContainer.prototype.getLeft=function(){return this.getPosition().left};H.jqplot.ElemContainer.prototype.getBottom=function(){return this._elem.css("bottom")};H.jqplot.ElemContainer.prototype.getRight=function(){return this._elem.css("right")};function s(ab){H.jqplot.ElemContainer.call(this);this.name=ab;this._series=[];this.show=false;this.tickRenderer=H.jqplot.AxisTickRenderer;this.tickOptions={};this.labelRenderer=H.jqplot.AxisLabelRenderer;this.labelOptions={};this.label=null;this.showLabel=true;this.min=null;this.max=null;this.autoscale=false;this.pad=1.2;this.padMax=null;this.padMin=null;this.ticks=[];this.numberTicks;this.tickInterval;this.renderer=H.jqplot.LinearAxisRenderer;this.rendererOptions={};this.showTicks=true;this.showTickMarks=true;this.showMinorTicks=true;this.drawMajorGridlines=true;this.drawMinorGridlines=false;this.drawMajorTickMarks=true;this.drawMinorTickMarks=true;this.useSeriesColor=false;this.borderWidth=null;this.borderColor=null;this.scaleToHiddenSeries=false;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={}}s.prototype=new H.jqplot.ElemContainer();s.prototype.constructor=s;s.prototype.init=function(){if(H.isFunction(this.renderer)){this.renderer=new this.renderer()}this.tickOptions.axis=this.name;if(this.tickOptions.showMark==null){this.tickOptions.showMark=this.showTicks}if(this.tickOptions.showMark==null){this.tickOptions.showMark=this.showTickMarks}if(this.tickOptions.showLabel==null){this.tickOptions.showLabel=this.showTicks}if(this.label==null||this.label==""){this.showLabel=false}else{this.labelOptions.label=this.label}if(this.showLabel==false){this.labelOptions.show=false}if(this.pad==0){this.pad=1}if(this.padMax==0){this.padMax=1}if(this.padMin==0){this.padMin=1}if(this.padMax==null){this.padMax=(this.pad-1)/2+1}if(this.padMin==null){this.padMin=(this.pad-1)/2+1}this.pad=this.padMax+this.padMin-1;if(this.min!=null||this.max!=null){this.autoscale=false}if(this.syncTicks==null&&this.name.indexOf("y")>-1){this.syncTicks=true}else{if(this.syncTicks==null){this.syncTicks=false}}this.renderer.init.call(this,this.rendererOptions)};s.prototype.draw=function(ab,ac){if(this.__ticks){this.__ticks=null}return this.renderer.draw.call(this,ab,ac)};s.prototype.set=function(){this.renderer.set.call(this)};s.prototype.pack=function(ac,ab){if(this.show){this.renderer.pack.call(this,ac,ab)}if(this._min==null){this._min=this.min;this._max=this.max;this._tickInterval=this.tickInterval;this._numberTicks=this.numberTicks;this.__ticks=this._ticks}};s.prototype.reset=function(){this.renderer.reset.call(this)};s.prototype.resetScale=function(ab){H.extend(true,this,{min:null,max:null,numberTicks:null,tickInterval:null,_ticks:[],ticks:[]},ab);this.resetDataBounds()};s.prototype.resetDataBounds=function(){var ai=this._dataBounds;ai.min=null;ai.max=null;var ac,aj,ag;var ad=(this.show)?true:false;for(var af=0;af<this._series.length;af++){aj=this._series[af];if(aj.show||this.scaleToHiddenSeries){ag=aj._plotData;if(aj._type==="line"&&aj.renderer.bands.show&&this.name.charAt(0)!=="x"){ag=[[0,aj.renderer.bands._min],[1,aj.renderer.bands._max]]}var ab=1,ah=1;if(aj._type!=null&&aj._type=="ohlc"){ab=3;ah=2}for(var ae=0,ac=ag.length;ae<ac;ae++){if(this.name=="xaxis"||this.name=="x2axis"){if((ag[ae][0]!=null&&ag[ae][0]<ai.min)||ai.min==null){ai.min=ag[ae][0]}if((ag[ae][0]!=null&&ag[ae][0]>ai.max)||ai.max==null){ai.max=ag[ae][0]}}else{if((ag[ae][ab]!=null&&ag[ae][ab]<ai.min)||ai.min==null){ai.min=ag[ae][ab]}if((ag[ae][ah]!=null&&ag[ae][ah]>ai.max)||ai.max==null){ai.max=ag[ae][ah]}}}if(ad&&aj.renderer.constructor!==H.jqplot.BarRenderer){ad=false}else{if(ad&&this._options.hasOwnProperty("forceTickAt0")&&this._options.forceTickAt0==false){ad=false}else{if(ad&&aj.renderer.constructor===H.jqplot.BarRenderer){if(aj.barDirection=="vertical"&&this.name!="xaxis"&&this.name!="x2axis"){if(this._options.pad!=null||this._options.padMin!=null){ad=false}}else{if(aj.barDirection=="horizontal"&&(this.name=="xaxis"||this.name=="x2axis")){if(this._options.pad!=null||this._options.padMin!=null){ad=false}}}}}}}}if(ad&&this.renderer.constructor===H.jqplot.LinearAxisRenderer&&ai.min>=0){this.padMin=1;this.forceTickAt0=true}};function n(ab){H.jqplot.ElemContainer.call(this);this.show=false;this.location="ne";this.labels=[];this.showLabels=true;this.showSwatches=true;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=H.jqplot.TableLegendRenderer;this.rendererOptions={};this.preDraw=false;this.marginTop=null;this.marginRight=null;this.marginBottom=null;this.marginLeft=null;this.escapeHtml=false;this._series=[];H.extend(true,this,ab)}n.prototype=new H.jqplot.ElemContainer();n.prototype.constructor=n;n.prototype.setOptions=function(ab){H.extend(true,this,ab);if(this.placement=="inside"){this.placement="insideGrid"}if(this.xoffset>0){if(this.placement=="insideGrid"){switch(this.location){case"nw":case"w":case"sw":if(this.marginLeft==null){this.marginLeft=this.xoffset+"px"}this.marginRight="0px";break;case"ne":case"e":case"se":default:if(this.marginRight==null){this.marginRight=this.xoffset+"px"}this.marginLeft="0px";break}}else{if(this.placement=="outside"){switch(this.location){case"nw":case"w":case"sw":if(this.marginRight==null){this.marginRight=this.xoffset+"px"}this.marginLeft="0px";break;case"ne":case"e":case"se":default:if(this.marginLeft==null){this.marginLeft=this.xoffset+"px"}this.marginRight="0px";break}}}this.xoffset=0}if(this.yoffset>0){if(this.placement=="outside"){switch(this.location){case"sw":case"s":case"se":if(this.marginTop==null){this.marginTop=this.yoffset+"px"}this.marginBottom="0px";break;case"ne":case"n":case"nw":default:if(this.marginBottom==null){this.marginBottom=this.yoffset+"px"}this.marginTop="0px";break}}else{if(this.placement=="insideGrid"){switch(this.location){case"sw":case"s":case"se":if(this.marginBottom==null){this.marginBottom=this.yoffset+"px"}this.marginTop="0px";break;case"ne":case"n":case"nw":default:if(this.marginTop==null){this.marginTop=this.yoffset+"px"}this.marginBottom="0px";break}}}this.yoffset=0}};n.prototype.init=function(){if(H.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions)};n.prototype.draw=function(ac,ad){for(var ab=0;ab<H.jqplot.preDrawLegendHooks.length;ab++){H.jqplot.preDrawLegendHooks[ab].call(this,ac)}return this.renderer.draw.call(this,ac,ad)};n.prototype.pack=function(ab){this.renderer.pack.call(this,ab)};function u(ab){H.jqplot.ElemContainer.call(this);this.text=ab;this.show=true;this.fontFamily;this.fontSize;this.textAlign;this.textColor;this.renderer=H.jqplot.DivTitleRenderer;this.rendererOptions={};this.escapeHtml=false}u.prototype=new H.jqplot.ElemContainer();u.prototype.constructor=u;u.prototype.init=function(){if(H.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions)};u.prototype.draw=function(ab){return this.renderer.draw.call(this,ab)};u.prototype.pack=function(){this.renderer.pack.call(this)};function O(ab){ab=ab||{};H.jqplot.ElemContainer.call(this);this.show=true;this.xaxis="xaxis";this._xaxis;this.yaxis="yaxis";this._yaxis;this.gridBorderWidth=2;this.renderer=H.jqplot.LineRenderer;this.rendererOptions={};this.data=[];this.gridData=[];this.label="";this.showLabel=true;this.color;this.negativeColor;this.lineWidth=2.5;this.lineJoin="round";this.lineCap="round";this.linePattern="solid";this.shadow=true;this.shadowAngle=45;this.shadowOffset=1.25;this.shadowDepth=3;this.shadowAlpha="0.1";this.breakOnNull=false;this.markerRenderer=H.jqplot.MarkerRenderer;this.markerOptions={};this.showLine=true;this.showMarker=true;this.index;this.fill=false;this.fillColor;this.fillAlpha;this.fillAndStroke=false;this.disableStack=false;this._stack=false;this.neighborThreshold=4;this.fillToZero=false;this.fillToValue=0;this.fillAxis="y";this.useNegativeColors=true;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 H.jqplot.GenericCanvas();this.shadowCanvas=new H.jqplot.GenericCanvas();this.plugins={};this._sumy=0;this._sumx=0;this._type=""}O.prototype=new H.jqplot.ElemContainer();O.prototype.constructor=O;O.prototype.init=function(ae,ai,ag){this.index=ae;this.gridBorderWidth=ai;var ah=this.data;var ad=[],af,ab;for(af=0,ab=ah.length;af<ab;af++){if(!this.breakOnNull){if(ah[af]==null||ah[af][0]==null||ah[af][1]==null){continue}else{ad.push(ah[af])}}else{ad.push(ah[af])}}this.data=ad;if(!this.color){this.color=ag.colorGenerator.get(this.index)}if(!this.negativeColor){this.negativeColor=ag.negativeColorGenerator.get(this.index)}if(!this.fillColor){this.fillColor=this.color}if(this.fillAlpha){var ac=H.jqplot.normalize2rgb(this.fillColor);var ac=H.jqplot.getColorComponents(ac);this.fillColor="rgba("+ac[0]+","+ac[1]+","+ac[2]+","+this.fillAlpha+")"}if(H.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions,ag);this.markerRenderer=new this.markerRenderer();if(!this.markerOptions.color){this.markerOptions.color=this.color}if(this.markerOptions.show==null){this.markerOptions.show=this.showMarker}this.showMarker=this.markerOptions.show;this.markerRenderer.init(this.markerOptions)};O.prototype.draw=function(ah,ae,ag){var ac=(ae==r)?{}:ae;ah=(ah==r)?this.canvas._ctx:ah;var ab,af,ad;for(ab=0;ab<H.jqplot.preDrawSeriesHooks.length;ab++){H.jqplot.preDrawSeriesHooks[ab].call(this,ah,ac)}if(this.show){this.renderer.setGridData.call(this,ag);if(!ac.preventJqPlotSeriesDrawTrigger){H(ah.canvas).trigger("jqplotSeriesDraw",[this.data,this.gridData])}af=[];if(ac.data){af=ac.data}else{if(!this._stack){af=this.data}else{af=this._plotData}}ad=ac.gridData||this.renderer.makeGridData.call(this,af,ag);if(this._type==="line"&&this.renderer.smooth&&this.renderer._smoothedData.length){ad=this.renderer._smoothedData}this.renderer.draw.call(this,ah,ad,ac,ag)}for(ab=0;ab<H.jqplot.postDrawSeriesHooks.length;ab++){H.jqplot.postDrawSeriesHooks[ab].call(this,ah,ac,ag)}ah=ae=ag=ab=af=ad=null};O.prototype.drawShadow=function(ah,ae,ag){var ac=(ae==r)?{}:ae;ah=(ah==r)?this.shadowCanvas._ctx:ah;var ab,af,ad;for(ab=0;ab<H.jqplot.preDrawSeriesShadowHooks.length;ab++){H.jqplot.preDrawSeriesShadowHooks[ab].call(this,ah,ac)}if(this.shadow){this.renderer.setGridData.call(this,ag);af=[];if(ac.data){af=ac.data}else{if(!this._stack){af=this.data}else{af=this._plotData}}ad=ac.gridData||this.renderer.makeGridData.call(this,af,ag);this.renderer.drawShadow.call(this,ah,ad,ac,ag)}for(ab=0;ab<H.jqplot.postDrawSeriesShadowHooks.length;ab++){H.jqplot.postDrawSeriesShadowHooks[ab].call(this,ah,ac)}ah=ae=ag=ab=af=ad=null};O.prototype.toggleDisplay=function(ac,ae){var ab,ad;if(ac.data.series){ab=ac.data.series}else{ab=this}if(ac.data.speed){ad=ac.data.speed}if(ad){if(ab.canvas._elem.is(":hidden")||!ab.show){ab.show=true;ab.canvas._elem.removeClass("jqplot-series-hidden");if(ab.shadowCanvas._elem){ab.shadowCanvas._elem.fadeIn(ad)}ab.canvas._elem.fadeIn(ad,ae);ab.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+ab.index).fadeIn(ad)}else{ab.show=false;ab.canvas._elem.addClass("jqplot-series-hidden");if(ab.shadowCanvas._elem){ab.shadowCanvas._elem.fadeOut(ad)}ab.canvas._elem.fadeOut(ad,ae);ab.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+ab.index).fadeOut(ad)}}else{if(ab.canvas._elem.is(":hidden")||!ab.show){ab.show=true;ab.canvas._elem.removeClass("jqplot-series-hidden");if(ab.shadowCanvas._elem){ab.shadowCanvas._elem.show()}ab.canvas._elem.show(0,ae);ab.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+ab.index).show()}else{ab.show=false;ab.canvas._elem.addClass("jqplot-series-hidden");if(ab.shadowCanvas._elem){ab.shadowCanvas._elem.hide()}ab.canvas._elem.hide(0,ae);ab.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+ab.index).hide()}}};function I(){H.jqplot.ElemContainer.call(this);this.drawGridlines=true;this.gridLineColor="#cccccc";this.gridLineWidth=1;this.background="#fffdf6";this.borderColor="#999999";this.borderWidth=2;this.drawBorder=true;this.shadow=true;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=H.jqplot.CanvasGridRenderer;this.rendererOptions={};this._offsets={top:null,bottom:null,left:null,right:null}}I.prototype=new H.jqplot.ElemContainer();I.prototype.constructor=I;I.prototype.init=function(){if(H.isFunction(this.renderer)){this.renderer=new this.renderer()}this.renderer.init.call(this,this.rendererOptions)};I.prototype.createElement=function(ab,ac){this._offsets=ab;return this.renderer.createElement.call(this,ac)};I.prototype.draw=function(){this.renderer.draw.call(this)};H.jqplot.GenericCanvas=function(){H.jqplot.ElemContainer.call(this);this._ctx};H.jqplot.GenericCanvas.prototype=new H.jqplot.ElemContainer();H.jqplot.GenericCanvas.prototype.constructor=H.jqplot.GenericCanvas;H.jqplot.GenericCanvas.prototype.createElement=function(af,ad,ac,ag){this._offsets=af;var ab="jqplot";if(ad!=r){ab=ad}var ae;ae=ag.canvasManager.getCanvas();if(ac!=null){this._plotDimensions=ac}ae.width=this._plotDimensions.width-this._offsets.left-this._offsets.right;ae.height=this._plotDimensions.height-this._offsets.top-this._offsets.bottom;this._elem=H(ae);this._elem.css({position:"absolute",left:this._offsets.left,top:this._offsets.top});this._elem.addClass(ab);ae=ag.canvasManager.initCanvas(ae);ae=null;return this._elem};H.jqplot.GenericCanvas.prototype.setContext=function(){this._ctx=this._elem.get(0).getContext("2d");return this._ctx};H.jqplot.GenericCanvas.prototype.resetCanvas=function(){if(this._elem){if(H.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==r){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce()}this._ctx=null};H.jqplot.HooksManager=function(){this.hooks=[];this.args=[]};H.jqplot.HooksManager.prototype.addOnce=function(ae,ac){ac=ac||[];var af=false;for(var ad=0,ab=this.hooks.length;ad<ab;ad++){if(this.hooks[ad]==ae){af=true}}if(!af){this.hooks.push(ae);this.args.push(ac)}};H.jqplot.HooksManager.prototype.add=function(ac,ab){ab=ab||[];this.hooks.push(ac);this.args.push(ab)};H.jqplot.EventListenerManager=function(){this.hooks=[]};H.jqplot.EventListenerManager.prototype.addOnce=function(af,ae){var ag=false,ad,ac;for(var ac=0,ab=this.hooks.length;ac<ab;ac++){ad=this.hooks[ac];if(ad[0]==af&&ad[1]==ae){ag=true}}if(!ag){this.hooks.push([af,ae])}};H.jqplot.EventListenerManager.prototype.add=function(ac,ab){this.hooks.push([ac,ab])};var Q=["yMidAxis","xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];function N(){this.animate=false;this.animateReplot=false;this.axes={xaxis:new s("xaxis"),yaxis:new s("yaxis"),x2axis:new s("x2axis"),y2axis:new s("y2axis"),y3axis:new s("y3axis"),y4axis:new s("y4axis"),y5axis:new s("y5axis"),y6axis:new s("y6axis"),y7axis:new s("y7axis"),y8axis:new s("y8axis"),y9axis:new s("y9axis"),yMidAxis:new s("yMidAxis")};this.baseCanvas=new H.jqplot.GenericCanvas();this.captureRightClick=false;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=false;this.eventCanvas=new H.jqplot.GenericCanvas();this.fillBetween={series1:null,series2:null,color:null,baseSeries:0,fill:true};this.fontFamily;this.fontSize;this.grid=new I();this.legend=new n();this.negativeSeriesColors=H.jqplot.config.defaultNegativeColors;this.noDataIndicator={show:false,indicator:"Loading Data...",axes:{xaxis:{min:0,max:10,tickInterval:2,show:true},yaxis:{min:0,max:12,tickInterval:3,show:true}}};this.options={};this.previousSeriesStack=[];this.plugins={};this.series=[];this.seriesStack=[];this.seriesColors=H.jqplot.config.defaultColors;this.sortData=true;this.stackSeries=false;this.syncXTicks=true;this.syncYTicks=true;this.target=null;this.targetId=null;this.textColor;this.title=new u();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=H.jqplot.config.addDomReference;this.preInitHooks=new H.jqplot.HooksManager();this.postInitHooks=new H.jqplot.HooksManager();this.preParseOptionsHooks=new H.jqplot.HooksManager();this.postParseOptionsHooks=new H.jqplot.HooksManager();this.preDrawHooks=new H.jqplot.HooksManager();this.postDrawHooks=new H.jqplot.HooksManager();this.preDrawSeriesHooks=new H.jqplot.HooksManager();this.postDrawSeriesHooks=new H.jqplot.HooksManager();this.preDrawLegendHooks=new H.jqplot.HooksManager();this.addLegendRowHooks=new H.jqplot.HooksManager();this.preSeriesInitHooks=new H.jqplot.HooksManager();this.postSeriesInitHooks=new H.jqplot.HooksManager();this.preParseSeriesOptionsHooks=new H.jqplot.HooksManager();this.postParseSeriesOptionsHooks=new H.jqplot.HooksManager();this.eventListenerHooks=new H.jqplot.EventListenerManager();this.preDrawSeriesShadowHooks=new H.jqplot.HooksManager();this.postDrawSeriesShadowHooks=new H.jqplot.HooksManager();this.colorGenerator=new H.jqplot.ColorGenerator();this.negativeColorGenerator=new H.jqplot.ColorGenerator();this.canvasManager=new H.jqplot.CanvasManager();this.themeEngine=new H.jqplot.ThemeEngine();var ad=0;this.init=function(ao,al,aq){aq=aq||{};for(var am=0;am<H.jqplot.preInitHooks.length;am++){H.jqplot.preInitHooks[am].call(this,ao,al,aq)}for(var am=0;am<this.preInitHooks.hooks.length;am++){this.preInitHooks.hooks[am].call(this,ao,al,aq)}this.targetId="#"+ao;this.target=H("#"+ao);if(this._addDomReference){this.target.data("jqplot",this)}this.target.removeClass("jqplot-error");if(!this.target.get(0)){throw"No plot target specified"}if(this.target.css("position")=="static"){this.target.css("position","relative")}if(!this.target.hasClass("jqplot-target")){this.target.addClass("jqplot-target")}if(!this.target.height()){var an;if(aq&&aq.height){an=parseInt(aq.height,10)}else{if(this.target.attr("data-height")){an=parseInt(this.target.attr("data-height"),10)}else{an=parseInt(H.jqplot.config.defaultHeight,10)}}this._height=an;this.target.css("height",an+"px")}else{this._height=an=this.target.height()}if(!this.target.width()){var ap;if(aq&&aq.width){ap=parseInt(aq.width,10)}else{if(this.target.attr("data-width")){ap=parseInt(this.target.attr("data-width"),10)}else{ap=parseInt(H.jqplot.config.defaultWidth,10)}}this._width=ap;this.target.css("width",ap+"px")}else{this._width=ap=this.target.width()}for(var am=0,aj=Q.length;am<aj;am++){this.axes[Q[am]]=new s(Q[am])}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;if(this._height<=0||this._width<=0||!this._height||!this._width){throw"Canvas dimension not set"}if(aq.dataRenderer&&H.isFunction(aq.dataRenderer)){if(aq.dataRendererOptions){this.dataRendererOptions=aq.dataRendererOptions}this.dataRenderer=aq.dataRenderer;al=this.dataRenderer(al,this,this.dataRendererOptions)}if(aq.noDataIndicator&&H.isPlainObject(aq.noDataIndicator)){H.extend(true,this.noDataIndicator,aq.noDataIndicator)}if(al==null||H.isArray(al)==false||al.length==0||H.isArray(al[0])==false||al[0].length==0){if(this.noDataIndicator.show==false){throw"No Data"}else{for(var af in this.noDataIndicator.axes){for(var ah in this.noDataIndicator.axes[af]){this.axes[af][ah]=this.noDataIndicator.axes[af][ah]}}this.postDrawHooks.add(function(){var ax=this.eventCanvas.getHeight();var au=this.eventCanvas.getWidth();var at=H('<div class="jqplot-noData-container" style="position:absolute;"></div>');this.target.append(at);at.height(ax);at.width(au);at.css("top",this.eventCanvas._offsets.top);at.css("left",this.eventCanvas._offsets.left);var aw=H('<div class="jqplot-noData-contents" style="text-align:center; position:relative; margin-left:auto; margin-right:auto;"></div>');at.append(aw);aw.html(this.noDataIndicator.indicator);var av=aw.height();var ar=aw.width();aw.height(av);aw.width(ar);aw.css("top",(ax-av)/2+"px")})}}this.data=H.extend(true,[],al);this.parseOptions(aq);if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(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 am=0;am<this.series.length;am++){this.seriesStack.push(am);this.previousSeriesStack.push(am);this.series[am].shadowCanvas._plotDimensions=this._plotDimensions;this.series[am].canvas._plotDimensions=this._plotDimensions;for(var ak=0;ak<H.jqplot.preSeriesInitHooks.length;ak++){H.jqplot.preSeriesInitHooks[ak].call(this.series[am],ao,this.data,this.options.seriesDefaults,this.options.series[am],this)}for(var ak=0;ak<this.preSeriesInitHooks.hooks.length;ak++){this.preSeriesInitHooks.hooks[ak].call(this.series[am],ao,this.data,this.options.seriesDefaults,this.options.series[am],this)}this.series[am]._plotDimensions=this._plotDimensions;this.series[am].init(am,this.grid.borderWidth,this);for(var ak=0;ak<H.jqplot.postSeriesInitHooks.length;ak++){H.jqplot.postSeriesInitHooks[ak].call(this.series[am],ao,this.data,this.options.seriesDefaults,this.options.series[am],this)}for(var ak=0;ak<this.postSeriesInitHooks.hooks.length;ak++){this.postSeriesInitHooks.hooks[ak].call(this.series[am],ao,this.data,this.options.seriesDefaults,this.options.series[am],this)}this._sumy+=this.series[am]._sumy;this._sumx+=this.series[am]._sumx}var ag,ai;for(var am=0,aj=Q.length;am<aj;am++){ag=Q[am];ai=this.axes[ag];ai._plotDimensions=this._plotDimensions;ai.init();if(this.axes[ag].borderColor==null){if(ag.charAt(0)!=="x"&&ai.useSeriesColor===true&&ai.show){ai.borderColor=ai._series[0].color}else{ai.borderColor=this.grid.borderColor}}}if(this.sortData){ab(this.series)}this.grid.init();this.grid._axes=this.axes;this.legend._series=this.series;for(var am=0;am<H.jqplot.postInitHooks.length;am++){H.jqplot.postInitHooks[am].call(this,ao,this.data,aq)}for(var am=0;am<this.postInitHooks.hooks.length;am++){this.postInitHooks.hooks[am].call(this,ao,this.data,aq)}};this.resetAxesScale=function(ak,ag){var ai=ag||{};var aj=ak||this.axes;if(aj===true){aj=this.axes}if(H.isArray(aj)){for(var ah=0;ah<aj.length;ah++){this.axes[aj[ah]].resetScale(ai[aj[ah]])}}else{if(typeof(aj)==="object"){for(var af in aj){this.axes[af].resetScale(ai[af])}}}};this.reInitialize=function(an,af){var ar=H.extend(true,{},this.options,af);var ap=this.targetId.substr(1);var al=(an==null)?this.data:an;for(var ao=0;ao<H.jqplot.preInitHooks.length;ao++){H.jqplot.preInitHooks[ao].call(this,ap,al,ar)}for(var ao=0;ao<this.preInitHooks.hooks.length;ao++){this.preInitHooks.hooks[ao].call(this,ap,al,ar)}this._height=this.target.height();this._width=this.target.width();if(this._height<=0||this._width<=0||!this._height||!this._width){throw"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;var ag,aq,am,ai;for(var ao=0,ak=Q.length;ao<ak;ao++){ag=Q[ao];ai=this.axes[ag];aq=ai._ticks;for(var am=0,aj=aq.length;am<aj;am++){var ah=aq[am]._elem;if(ah){if(H.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==r){window.G_vmlCanvasManager.uninitElement(ah.get(0))}ah.emptyForce();ah=null;aq._elem=null}}aq=null;delete ai.ticks;delete ai._ticks;this.axes[ag]=new s(ag);this.axes[ag]._plotWidth=this._width;this.axes[ag]._plotHeight=this._height}if(an){if(ar.dataRenderer&&H.isFunction(ar.dataRenderer)){if(ar.dataRendererOptions){this.dataRendererOptions=ar.dataRendererOptions}this.dataRenderer=ar.dataRenderer;an=this.dataRenderer(an,this,this.dataRendererOptions)}this.data=H.extend(true,[],an)}if(af){this.parseOptions(ar)}this.title._plotWidth=this._width;if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(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 ao=0,ak=this.series.length;ao<ak;ao++){this.seriesStack.push(ao);this.previousSeriesStack.push(ao);this.series[ao].shadowCanvas._plotDimensions=this._plotDimensions;this.series[ao].canvas._plotDimensions=this._plotDimensions;for(var am=0;am<H.jqplot.preSeriesInitHooks.length;am++){H.jqplot.preSeriesInitHooks[am].call(this.series[ao],ap,this.data,this.options.seriesDefaults,this.options.series[ao],this)}for(var am=0;am<this.preSeriesInitHooks.hooks.length;am++){this.preSeriesInitHooks.hooks[am].call(this.series[ao],ap,this.data,this.options.seriesDefaults,this.options.series[ao],this)}this.series[ao]._plotDimensions=this._plotDimensions;this.series[ao].init(ao,this.grid.borderWidth,this);for(var am=0;am<H.jqplot.postSeriesInitHooks.length;am++){H.jqplot.postSeriesInitHooks[am].call(this.series[ao],ap,this.data,this.options.seriesDefaults,this.options.series[ao],this)}for(var am=0;am<this.postSeriesInitHooks.hooks.length;am++){this.postSeriesInitHooks.hooks[am].call(this.series[ao],ap,this.data,this.options.seriesDefaults,this.options.series[ao],this)}this._sumy+=this.series[ao]._sumy;this._sumx+=this.series[ao]._sumx}for(var ao=0,ak=Q.length;ao<ak;ao++){ag=Q[ao];ai=this.axes[ag];ai._plotDimensions=this._plotDimensions;ai.init();if(ai.borderColor==null){if(ag.charAt(0)!=="x"&&ai.useSeriesColor===true&&ai.show){ai.borderColor=ai._series[0].color}else{ai.borderColor=this.grid.borderColor}}}if(this.sortData){ab(this.series)}this.grid.init();this.grid._axes=this.axes;this.legend._series=this.series;for(var ao=0,ak=H.jqplot.postInitHooks.length;ao<ak;ao++){H.jqplot.postInitHooks[ao].call(this,ap,this.data,ar)}for(var ao=0,ak=this.postInitHooks.hooks.length;ao<ak;ao++){this.postInitHooks.hooks[ao].call(this,ap,this.data,ar)}};this.quickInit=function(){this._height=this.target.height();this._width=this.target.width();if(this._height<=0||this._width<=0||!this._height||!this._width){throw"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 ak in this.axes){this.axes[ak]._plotWidth=this._width;this.axes[ak]._plotHeight=this._height}this.title._plotWidth=this._width;if(this.textColor){this.target.css("color",this.textColor)}if(this.fontFamily){this.target.css("font-family",this.fontFamily)}if(this.fontSize){this.target.css("font-size",this.fontSize)}this._sumy=0;this._sumx=0;this.computePlotData();for(var ai=0;ai<this.series.length;ai++){if(this.series[ai]._type==="line"&&this.series[ai].renderer.bands.show){this.series[ai].renderer.initBands.call(this.series[ai],this.series[ai].renderer.options,this)}this.series[ai]._plotDimensions=this._plotDimensions;this.series[ai].canvas._plotDimensions=this._plotDimensions;this._sumy+=this.series[ai]._sumy;this._sumx+=this.series[ai]._sumx}var ag;for(var af=0;af<12;af++){ag=Q[af];var ah=this.axes[ag]._ticks;for(var ai=0;ai<ah.length;ai++){var aj=ah[ai]._elem;if(aj){if(H.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==r){window.G_vmlCanvasManager.uninitElement(aj.get(0))}aj.emptyForce();aj=null;ah._elem=null}}ah=null;this.axes[ag]._plotDimensions=this._plotDimensions;this.axes[ag]._ticks=[]}if(this.sortData){ab(this.series)}this.grid._axes=this.axes;this.legend._series=this.series};function ab(aj){var an,ao,ap,af,am;for(var ak=0;ak<aj.length;ak++){var ag;var al=[aj[ak].data,aj[ak]._stackData,aj[ak]._plotData,aj[ak]._prevPlotData];for(var ah=0;ah<4;ah++){ag=true;an=al[ah];if(aj[ak]._stackAxis=="x"){for(var ai=0;ai<an.length;ai++){if(typeof(an[ai][1])!="number"){ag=false;break}}if(ag){an.sort(function(ar,aq){return ar[1]-aq[1]})}}else{for(var ai=0;ai<an.length;ai++){if(typeof(an[ai][0])!="number"){ag=false;break}}if(ag){an.sort(function(ar,aq){return ar[0]-aq[0]})}}}}}this.computePlotData=function(){this._plotData=[];this._stackData=[];var am,an,ai;for(an=0,ai=this.series.length;an<ai;an++){am=this.series[an];this._plotData.push([]);this._stackData.push([]);var ag=am.data;this._plotData[an]=H.extend(true,[],ag);this._stackData[an]=H.extend(true,[],ag);am._plotData=this._plotData[an];am._stackData=this._stackData[an];var aq={x:[],y:[]};if(this.stackSeries&&!am.disableStack){am._stack=true;var ao=(am._stackAxis==="x")?0:1;for(var aj=0,af=ag.length;aj<af;aj++){var ap=ag[aj][ao];if(ap==null){ap=0}this._plotData[an][aj][ao]=ap;this._stackData[an][aj][ao]=ap;if(an>0){for(var ak=an;ak--;){var ah=this._plotData[ak][aj][ao];if(ap*ah>=0){this._plotData[an][aj][ao]+=ah;this._stackData[an][aj][ao]+=ah;break}}}}}else{for(var al=0;al<am.data.length;al++){aq.x.push(am.data[al][0]);aq.y.push(am.data[al][1])}this._stackData.push(am.data);this.series[an]._stackData=am.data;this._plotData.push(am.data);am._plotData=am.data;am._plotValues=aq}if(an>0){am._prevPlotData=this.series[an-1]._plotData}am._sumy=0;am._sumx=0;for(al=am.data.length-1;al>-1;al--){am._sumy+=am.data[al][1];am._sumx+=am.data[al][0]}}};this.populatePlotData=function(an,ao){this._plotData=[];this._stackData=[];an._stackData=[];an._plotData=[];var ar={x:[],y:[]};if(this.stackSeries&&!an.disableStack){an._stack=true;var aq=(an._stackAxis==="x")?0:1;var at=H.extend(true,[],an.data);var au=H.extend(true,[],an.data);var ah,ag,ai,ap,af;for(var al=0;al<ao;al++){var aj=this.series[al].data;for(var ak=0;ak<aj.length;ak++){ai=aj[ak];ah=(ai[0]!=null)?ai[0]:0;ag=(ai[1]!=null)?ai[1]:0;at[ak][0]+=ah;at[ak][1]+=ag;ap=(aq)?ag:ah;if(an.data[ak][aq]*ap>=0){au[ak][aq]+=ap}}}for(var am=0;am<au.length;am++){ar.x.push(au[am][0]);ar.y.push(au[am][1])}this._plotData.push(au);this._stackData.push(at);an._stackData=at;an._plotData=au;an._plotValues=ar}else{for(var am=0;am<an.data.length;am++){ar.x.push(an.data[am][0]);ar.y.push(an.data[am][1])}this._stackData.push(an.data);this.series[ao]._stackData=an.data;this._plotData.push(an.data);an._plotData=an.data;an._plotValues=ar}if(ao>0){an._prevPlotData=this.series[ao-1]._plotData}an._sumy=0;an._sumx=0;for(am=an.data.length-1;am>-1;am--){an._sumy+=an.data[am][1];an._sumx+=an.data[am][0]}};this.getNextSeriesColor=(function(ag){var af=0;var ah=ag.seriesColors;return function(){if(af<ah.length){return ah[af++]}else{af=0;return ah[af++]}}})(this);this.parseOptions=function(ar){for(var am=0;am<this.preParseOptionsHooks.hooks.length;am++){this.preParseOptionsHooks.hooks[am].call(this,ar)}for(var am=0;am<H.jqplot.preParseOptionsHooks.length;am++){H.jqplot.preParseOptionsHooks[am].call(this,ar)}this.options=H.extend(true,{},this.defaults,ar);var ag=this.options;this.animate=ag.animate;this.animateReplot=ag.animateReplot;this.stackSeries=ag.stackSeries;if(H.isPlainObject(ag.fillBetween)){var aq=["series1","series2","color","baseSeries","fill"],an;for(var am=0,ak=aq.length;am<ak;am++){an=aq[am];if(ag.fillBetween[an]!=null){this.fillBetween[an]=ag.fillBetween[an]}}}if(ag.seriesColors){this.seriesColors=ag.seriesColors}if(ag.negativeSeriesColors){this.negativeSeriesColors=ag.negativeSeriesColors}if(ag.captureRightClick){this.captureRightClick=ag.captureRightClick}this.defaultAxisStart=(ar&&ar.defaultAxisStart!=null)?ar.defaultAxisStart:this.defaultAxisStart;this.colorGenerator.setColors(this.seriesColors);this.negativeColorGenerator.setColors(this.negativeSeriesColors);H.extend(true,this._gridPadding,ag.gridPadding);this.sortData=(ag.sortData!=null)?ag.sortData:this.sortData;for(var am=0;am<12;am++){var ah=Q[am];var aj=this.axes[ah];aj._options=H.extend(true,{},ag.axesDefaults,ag.axes[ah]);H.extend(true,aj,ag.axesDefaults,ag.axes[ah]);aj._plotWidth=this._width;aj._plotHeight=this._height}var ap=function(ax,av,ay){var au=[];var aw,at;av=av||"vertical";if(!H.isArray(ax[0])){for(aw=0,at=ax.length;aw<at;aw++){if(av=="vertical"){au.push([ay+aw,ax[aw]])}else{au.push([ax[aw],ay+aw])}}}else{H.extend(true,au,ax)}return au};var ao=0;this.series=[];for(var am=0;am<this.data.length;am++){var af=H.extend(true,{index:am},{seriesColors:this.seriesColors,negativeSeriesColors:this.negativeSeriesColors},this.options.seriesDefaults,this.options.series[am],{rendererOptions:{animation:{show:this.animate}}});var aq=new O(af);for(var al=0;al<H.jqplot.preParseSeriesOptionsHooks.length;al++){H.jqplot.preParseSeriesOptionsHooks[al].call(aq,this.options.seriesDefaults,this.options.series[am])}for(var al=0;al<this.preParseSeriesOptionsHooks.hooks.length;al++){this.preParseSeriesOptionsHooks.hooks[al].call(aq,this.options.seriesDefaults,this.options.series[am])}H.extend(true,aq,af);var ai="vertical";if(aq.renderer===H.jqplot.BarRenderer&&aq.rendererOptions&&aq.rendererOptions.barDirection=="horizontal"){ai="horizontal";aq._stackAxis="x";aq._primaryAxis="_yaxis"}aq.data=ap(this.data[am],ai,this.defaultAxisStart);switch(aq.xaxis){case"xaxis":aq._xaxis=this.axes.xaxis;break;case"x2axis":aq._xaxis=this.axes.x2axis;break;default:break}aq._yaxis=this.axes[aq.yaxis];aq._xaxis._series.push(aq);aq._yaxis._series.push(aq);if(aq.show){aq._xaxis.show=true;aq._yaxis.show=true}else{if(aq._xaxis.scaleToHiddenSeries){aq._xaxis.show=true}if(aq._yaxis.scaleToHiddenSeries){aq._yaxis.show=true}}if(!aq.label){aq.label="Series "+(am+1).toString()}this.series.push(aq);for(var al=0;al<H.jqplot.postParseSeriesOptionsHooks.length;al++){H.jqplot.postParseSeriesOptionsHooks[al].call(this.series[am],this.options.seriesDefaults,this.options.series[am])}for(var al=0;al<this.postParseSeriesOptionsHooks.hooks.length;al++){this.postParseSeriesOptionsHooks.hooks[al].call(this.series[am],this.options.seriesDefaults,this.options.series[am])}}H.extend(true,this.grid,this.options.grid);for(var am=0,ak=Q.length;am<ak;am++){var ah=Q[am];var aj=this.axes[ah];if(aj.borderWidth==null){aj.borderWidth=this.grid.borderWidth}}if(typeof this.options.title=="string"){this.title.text=this.options.title}else{if(typeof this.options.title=="object"){H.extend(true,this.title,this.options.title)}}this.title._plotWidth=this._width;this.legend.setOptions(this.options.legend);for(var am=0;am<H.jqplot.postParseOptionsHooks.length;am++){H.jqplot.postParseOptionsHooks[am].call(this,ar)}for(var am=0;am<this.postParseOptionsHooks.hooks.length;am++){this.postParseOptionsHooks.hooks[am].call(this,ar)}};this.destroy=function(){this.canvasManager.freeAllCanvases();if(this.eventCanvas&&this.eventCanvas._elem){this.eventCanvas._elem.unbind()}this.target.empty();this.target[0].innerHTML=""};this.replot=function(ag){var ah=ag||{};var aj=ah.data||null;var af=(ah.clear===false)?false:true;var ai=ah.resetAxes||false;delete ah.data;delete ah.clear;delete ah.resetAxes;this.target.trigger("jqplotPreReplot");if(af){this.destroy()}if(aj||!H.isEmptyObject(ah)){this.reInitialize(aj,ah)}else{this.quickInit()}if(ai){this.resetAxesScale(ai,ah.axes)}this.draw();this.target.trigger("jqplotPostReplot")};this.redraw=function(af){af=(af!=null)?af:true;this.target.trigger("jqplotPreRedraw");if(af){this.canvasManager.freeAllCanvases();this.eventCanvas._elem.unbind();this.target.empty()}for(var ah in this.axes){this.axes[ah]._ticks=[]}this.computePlotData();this._sumy=0;this._sumx=0;for(var ag=0,ai=this.series.length;ag<ai;ag++){this._sumy+=this.series[ag]._sumy;this._sumx+=this.series[ag]._sumx}this.draw();this.target.trigger("jqplotPostRedraw")};this.draw=function(){if(this.drawIfHidden||this.target.is(":visible")){this.target.trigger("jqplotPreDraw");var aB,az,ay,ai;for(aB=0,ay=H.jqplot.preDrawHooks.length;aB<ay;aB++){H.jqplot.preDrawHooks[aB].call(this)}for(aB=0,ay=this.preDrawHooks.length;aB<ay;aB++){this.preDrawHooks.hooks[aB].apply(this,this.preDrawSeriesHooks.args[aB])}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 aF=this.legend.draw({},this);var af={top:0,left:0,bottom:0,right:0};if(this.legend.placement=="outsideGrid"){this.target.append(aF);switch(this.legend.location){case"n":af.top+=this.legend.getHeight();break;case"s":af.bottom+=this.legend.getHeight();break;case"ne":case"e":case"se":af.right+=this.legend.getWidth();break;case"nw":case"w":case"sw":af.left+=this.legend.getWidth();break;default:af.right+=this.legend.getWidth();break}aF=aF.detach()}var al=this.axes;var aG;for(aB=0;aB<12;aB++){aG=Q[aB];this.target.append(al[aG].draw(this.baseCanvas._ctx,this));al[aG].set()}if(al.yaxis.show){af.left+=al.yaxis.getWidth()}var aA=["y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis"];var ar=[0,0,0,0,0,0,0,0];var av=0;var au;for(au=0;au<8;au++){if(al[aA[au]].show){av+=al[aA[au]].getWidth();ar[au]=av}}af.right+=av;if(al.x2axis.show){af.top+=al.x2axis.getHeight()}if(this.title.show){af.top+=this.title.getHeight()}if(al.xaxis.show){af.bottom+=al.xaxis.getHeight()}if(this.options.gridDimensions&&H.isPlainObject(this.options.gridDimensions)){var am=parseInt(this.options.gridDimensions.width,10)||0;var aC=parseInt(this.options.gridDimensions.height,10)||0;var ah=(this._width-af.left-af.right-am)/2;var aE=(this._height-af.top-af.bottom-aC)/2;if(aE>=0&&ah>=0){af.top+=aE;af.bottom+=aE;af.left+=ah;af.right+=ah}}var ag=["top","bottom","left","right"];for(var au in ag){if(this._gridPadding[ag[au]]==null&&af[ag[au]]>0){this._gridPadding[ag[au]]=af[ag[au]]}else{if(this._gridPadding[ag[au]]==null){this._gridPadding[ag[au]]=this._defaultGridPadding[ag[au]]}}}var at=this._gridPadding;if(this.legend.placement==="outsideGrid"){at={top:this.title.getHeight(),left:0,right:0,bottom:0};if(this.legend.location==="s"){at.left=this._gridPadding.left;at.right=this._gridPadding.right}}al.xaxis.pack({position:"absolute",bottom:this._gridPadding.bottom-al.xaxis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});al.yaxis.pack({position:"absolute",top:0,left:this._gridPadding.left-al.yaxis.getWidth(),height:this._height},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});al.x2axis.pack({position:"absolute",top:this._gridPadding.top-al.x2axis.getHeight(),left:0,width:this._width},{min:this._gridPadding.left,max:this._width-this._gridPadding.right});for(aB=8;aB>0;aB--){al[aA[aB-1]].pack({position:"absolute",top:0,right:this._gridPadding.right-ar[aB-1]},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top})}var an=(this._width-this._gridPadding.left-this._gridPadding.right)/2+this._gridPadding.left-al.yMidAxis.getWidth()/2;al.yMidAxis.pack({position:"absolute",top:0,left:an,zIndex:9,textAlign:"center"},{min:this._height-this._gridPadding.bottom,max:this._gridPadding.top});this.target.append(this.grid.createElement(this._gridPadding,this));this.grid.draw();var ak=this.series;var aD=ak.length;for(aB=0,ay=aD;aB<ay;aB++){az=this.seriesStack[aB];this.target.append(ak[az].shadowCanvas.createElement(this._gridPadding,"jqplot-series-shadowCanvas",null,this));ak[az].shadowCanvas.setContext();ak[az].shadowCanvas._elem.data("seriesIndex",az)}for(aB=0,ay=aD;aB<ay;aB++){az=this.seriesStack[aB];this.target.append(ak[az].canvas.createElement(this._gridPadding,"jqplot-series-canvas",null,this));ak[az].canvas.setContext();ak[az].canvas._elem.data("seriesIndex",az)}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();if(this.legend.preDraw){this.eventCanvas._elem.before(aF);this.legend.pack(at);if(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}})}else{this.drawSeries()}}else{this.drawSeries();if(aD){H(ak[aD-1].canvas._elem).after(aF)}this.legend.pack(at)}for(var aB=0,ay=H.jqplot.eventListenerHooks.length;aB<ay;aB++){this.eventCanvas._elem.bind(H.jqplot.eventListenerHooks[aB][0],{plot:this},H.jqplot.eventListenerHooks[aB][1])}for(var aB=0,ay=this.eventListenerHooks.hooks.length;aB<ay;aB++){this.eventCanvas._elem.bind(this.eventListenerHooks.hooks[aB][0],{plot:this},this.eventListenerHooks.hooks[aB][1])}var aq=this.fillBetween;if(aq.fill&&aq.series1!==aq.series2&&aq.series1<aD&&aq.series2<aD&&ak[aq.series1]._type==="line"&&ak[aq.series2]._type==="line"){this.doFillBetweenLines()}for(var aB=0,ay=H.jqplot.postDrawHooks.length;aB<ay;aB++){H.jqplot.postDrawHooks[aB].call(this)}for(var aB=0,ay=this.postDrawHooks.hooks.length;aB<ay;aB++){this.postDrawHooks.hooks[aB].apply(this,this.postDrawHooks.args[aB])}if(this.target.is(":visible")){this._drawCount+=1}var ao,ap,aw,aj;for(aB=0,ay=aD;aB<ay;aB++){ao=ak[aB];ap=ao.renderer;aw=".jqplot-point-label.jqplot-series-"+aB;if(ap.animation&&ap.animation._supported&&ap.animation.show&&(this._drawCount<2||this.animateReplot)){aj=this.target.find(aw);aj.stop(true,true).hide();ao.canvas._elem.stop(true,true).hide();ao.shadowCanvas._elem.stop(true,true).hide();ao.canvas._elem.jqplotEffect("blind",{mode:"show",direction:ap.animation.direction},ap.animation.speed);ao.shadowCanvas._elem.jqplotEffect("blind",{mode:"show",direction:ap.animation.direction},ap.animation.speed);aj.fadeIn(ap.animation.speed*0.8)}}aj=null;this.target.trigger("jqplotPostDraw",[this])}};N.prototype.doFillBetweenLines=function(){var ah=this.fillBetween;var aq=ah.series1;var ao=ah.series2;var ap=(aq<ao)?aq:ao;var an=(ao>aq)?ao:aq;var al=this.series[ap];var ak=this.series[an];if(ak.renderer.smooth){var aj=ak.renderer._smoothedData.slice(0).reverse()}else{var aj=ak.gridData.slice(0).reverse()}if(al.renderer.smooth){var am=al.renderer._smoothedData.concat(aj)}else{var am=al.gridData.concat(aj)}var ai=(ah.color!==null)?ah.color:this.series[aq].fillColor;var ar=(ah.baseSeries!==null)?ah.baseSeries:ap;var ag=this.series[ar].renderer.shapeRenderer;var af={fillStyle:ai,fill:true,closePath:true};ag.draw(al.shadowCanvas._ctx,am,af)};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);if(this.captureRightClick){this.eventCanvas._elem.bind("mouseup",{plot:this},this.onRightClick);this.eventCanvas._elem.get(0).oncontextmenu=function(){return false}}else{this.eventCanvas._elem.bind("mouseup",{plot:this},this.onMouseUp)}};function ac(ao){var am=ao.data.plot;var ai=am.eventCanvas._elem.offset();var al={x:ao.pageX-ai.left,y:ao.pageY-ai.top};var aj={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null,yMidAxis:null};var ak=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];var af=am.axes;var ag,ah;for(ag=11;ag>0;ag--){ah=ak[ag-1];if(af[ah].show){aj[ah]=af[ah].series_p2u(al[ah.charAt(0)])}}return{offsets:ai,gridPos:al,dataPos:aj}}function ae(af,ag){var ak=ag.series;var aQ,aO,aN,aI,aJ,aD,aC,ap,an,at,au,aE;var aM,aR,aK,al,aB,aG,aP;var ah,aH;for(aN=ag.seriesStack.length-1;aN>=0;aN--){aQ=ag.seriesStack[aN];aI=ak[aQ];aP=aI._highlightThreshold;switch(aI.renderer.constructor){case H.jqplot.BarRenderer:aD=af.x;aC=af.y;for(aO=0;aO<aI._barPoints.length;aO++){aB=aI._barPoints[aO];aK=aI.gridData[aO];if(aD>aB[0][0]&&aD<aB[2][0]&&aC>aB[2][1]&&aC<aB[0][1]){return{seriesIndex:aI.index,pointIndex:aO,gridData:aK,data:aI.data[aO],points:aI._barPoints[aO]}}}break;case H.jqplot.PyramidRenderer:aD=af.x;aC=af.y;for(aO=0;aO<aI._barPoints.length;aO++){aB=aI._barPoints[aO];aK=aI.gridData[aO];if(aD>aB[0][0]+aP[0][0]&&aD<aB[2][0]+aP[2][0]&&aC>aB[2][1]&&aC<aB[0][1]){return{seriesIndex:aI.index,pointIndex:aO,gridData:aK,data:aI.data[aO],points:aI._barPoints[aO]}}}break;case H.jqplot.DonutRenderer:at=aI.startAngle/180*Math.PI;aD=af.x-aI._center[0];aC=af.y-aI._center[1];aJ=Math.sqrt(Math.pow(aD,2)+Math.pow(aC,2));if(aD>0&&-aC>=0){ap=2*Math.PI-Math.atan(-aC/aD)}else{if(aD>0&&-aC<0){ap=-Math.atan(-aC/aD)}else{if(aD<0){ap=Math.PI-Math.atan(-aC/aD)}else{if(aD==0&&-aC>0){ap=3*Math.PI/2}else{if(aD==0&&-aC<0){ap=Math.PI/2}else{if(aD==0&&aC==0){ap=0}}}}}}if(at){ap-=at;if(ap<0){ap+=2*Math.PI}else{if(ap>2*Math.PI){ap-=2*Math.PI}}}an=aI.sliceMargin/180*Math.PI;if(aJ<aI._radius&&aJ>aI._innerRadius){for(aO=0;aO<aI.gridData.length;aO++){au=(aO>0)?aI.gridData[aO-1][1]+an:an;aE=aI.gridData[aO][1];if(ap>au&&ap<aE){return{seriesIndex:aI.index,pointIndex:aO,gridData:aI.gridData[aO],data:aI.data[aO]}}}}break;case H.jqplot.PieRenderer:at=aI.startAngle/180*Math.PI;aD=af.x-aI._center[0];aC=af.y-aI._center[1];aJ=Math.sqrt(Math.pow(aD,2)+Math.pow(aC,2));if(aD>0&&-aC>=0){ap=2*Math.PI-Math.atan(-aC/aD)}else{if(aD>0&&-aC<0){ap=-Math.atan(-aC/aD)}else{if(aD<0){ap=Math.PI-Math.atan(-aC/aD)}else{if(aD==0&&-aC>0){ap=3*Math.PI/2}else{if(aD==0&&-aC<0){ap=Math.PI/2}else{if(aD==0&&aC==0){ap=0}}}}}}if(at){ap-=at;if(ap<0){ap+=2*Math.PI}else{if(ap>2*Math.PI){ap-=2*Math.PI}}}an=aI.sliceMargin/180*Math.PI;if(aJ<aI._radius){for(aO=0;aO<aI.gridData.length;aO++){au=(aO>0)?aI.gridData[aO-1][1]+an:an;aE=aI.gridData[aO][1];if(ap>au&&ap<aE){return{seriesIndex:aI.index,pointIndex:aO,gridData:aI.gridData[aO],data:aI.data[aO]}}}}break;case H.jqplot.BubbleRenderer:aD=af.x;aC=af.y;var az=null;if(aI.show){for(var aO=0;aO<aI.gridData.length;aO++){aK=aI.gridData[aO];aR=Math.sqrt((aD-aK[0])*(aD-aK[0])+(aC-aK[1])*(aC-aK[1]));if(aR<=aK[2]&&(aR<=aM||aM==null)){aM=aR;az={seriesIndex:aQ,pointIndex:aO,gridData:aK,data:aI.data[aO]}}}if(az!=null){return az}}break;case H.jqplot.FunnelRenderer:aD=af.x;aC=af.y;var aF=aI._vertices,aj=aF[0],ai=aF[aF.length-1],am,ay,ar;function aL(aU,aW,aV){var aT=(aW[1]-aV[1])/(aW[0]-aV[0]);var aS=aW[1]-aT*aW[0];var aX=aU+aW[1];return[(aX-aS)/aT,aX]}am=aL(aC,aj[0],ai[3]);ay=aL(aC,aj[1],ai[2]);for(aO=0;aO<aF.length;aO++){ar=aF[aO];if(aC>=ar[0][1]&&aC<=ar[3][1]&&aD>=am[0]&&aD<=ay[0]){return{seriesIndex:aI.index,pointIndex:aO,gridData:null,data:aI.data[aO]}}}break;case H.jqplot.LineRenderer:aD=af.x;aC=af.y;aJ=aI.renderer;if(aI.show){if((aI.fill||(aI.renderer.bands.show&&aI.renderer.bands.fill))&&(!ag.plugins.highlighter||!ag.plugins.highlighter.show)){var aq=false;if(aD>aI._boundingBox[0][0]&&aD<aI._boundingBox[1][0]&&aC>aI._boundingBox[1][1]&&aC<aI._boundingBox[0][1]){var ax=aI._areaPoints.length;var aA;var aO=ax-1;for(var aA=0;aA<ax;aA++){var aw=[aI._areaPoints[aA][0],aI._areaPoints[aA][1]];var av=[aI._areaPoints[aO][0],aI._areaPoints[aO][1]];if(aw[1]<aC&&av[1]>=aC||av[1]<aC&&aw[1]>=aC){if(aw[0]+(aC-aw[1])/(av[1]-aw[1])*(av[0]-aw[0])<aD){aq=!aq}}aO=aA}}if(aq){return{seriesIndex:aQ,pointIndex:null,gridData:aI.gridData,data:aI.data,points:aI._areaPoints}}break}else{aH=aI.markerRenderer.size/2+aI.neighborThreshold;ah=(aH>0)?aH:0;for(var aO=0;aO<aI.gridData.length;aO++){aK=aI.gridData[aO];if(aJ.constructor==H.jqplot.OHLCRenderer){if(aJ.candleStick){var ao=aI._yaxis.series_u2p;if(aD>=aK[0]-aJ._bodyWidth/2&&aD<=aK[0]+aJ._bodyWidth/2&&aC>=ao(aI.data[aO][2])&&aC<=ao(aI.data[aO][3])){return{seriesIndex:aQ,pointIndex:aO,gridData:aK,data:aI.data[aO]}}}else{if(!aJ.hlc){var ao=aI._yaxis.series_u2p;if(aD>=aK[0]-aJ._tickLength&&aD<=aK[0]+aJ._tickLength&&aC>=ao(aI.data[aO][2])&&aC<=ao(aI.data[aO][3])){return{seriesIndex:aQ,pointIndex:aO,gridData:aK,data:aI.data[aO]}}}else{var ao=aI._yaxis.series_u2p;if(aD>=aK[0]-aJ._tickLength&&aD<=aK[0]+aJ._tickLength&&aC>=ao(aI.data[aO][1])&&aC<=ao(aI.data[aO][2])){return{seriesIndex:aQ,pointIndex:aO,gridData:aK,data:aI.data[aO]}}}}}else{if(aK[0]!=null&&aK[1]!=null){aR=Math.sqrt((aD-aK[0])*(aD-aK[0])+(aC-aK[1])*(aC-aK[1]));if(aR<=ah&&(aR<=aM||aM==null)){aM=aR;return{seriesIndex:aQ,pointIndex:aO,gridData:aK,data:aI.data[aO]}}}}}}}break;default:aD=af.x;aC=af.y;aJ=aI.renderer;if(aI.show){aH=aI.markerRenderer.size/2+aI.neighborThreshold;ah=(aH>0)?aH:0;for(var aO=0;aO<aI.gridData.length;aO++){aK=aI.gridData[aO];if(aJ.constructor==H.jqplot.OHLCRenderer){if(aJ.candleStick){var ao=aI._yaxis.series_u2p;if(aD>=aK[0]-aJ._bodyWidth/2&&aD<=aK[0]+aJ._bodyWidth/2&&aC>=ao(aI.data[aO][2])&&aC<=ao(aI.data[aO][3])){return{seriesIndex:aQ,pointIndex:aO,gridData:aK,data:aI.data[aO]}}}else{if(!aJ.hlc){var ao=aI._yaxis.series_u2p;if(aD>=aK[0]-aJ._tickLength&&aD<=aK[0]+aJ._tickLength&&aC>=ao(aI.data[aO][2])&&aC<=ao(aI.data[aO][3])){return{seriesIndex:aQ,pointIndex:aO,gridData:aK,data:aI.data[aO]}}}else{var ao=aI._yaxis.series_u2p;if(aD>=aK[0]-aJ._tickLength&&aD<=aK[0]+aJ._tickLength&&aC>=ao(aI.data[aO][1])&&aC<=ao(aI.data[aO][2])){return{seriesIndex:aQ,pointIndex:aO,gridData:aK,data:aI.data[aO]}}}}}else{aR=Math.sqrt((aD-aK[0])*(aD-aK[0])+(aC-aK[1])*(aC-aK[1]));if(aR<=ah&&(aR<=aM||aM==null)){aM=aR;return{seriesIndex:aQ,pointIndex:aO,gridData:aK,data:aI.data[aO]}}}}}break}}return null}this.onClick=function(ah){var ag=ac(ah);var aj=ah.data.plot;var ai=ae(ag.gridPos,aj);var af=H.Event("jqplotClick");af.pageX=ah.pageX;af.pageY=ah.pageY;H(this).trigger(af,[ag.gridPos,ag.dataPos,ai,aj])};this.onDblClick=function(ah){var ag=ac(ah);var aj=ah.data.plot;var ai=ae(ag.gridPos,aj);var af=H.Event("jqplotDblClick");af.pageX=ah.pageX;af.pageY=ah.pageY;H(this).trigger(af,[ag.gridPos,ag.dataPos,ai,aj])};this.onMouseDown=function(ah){var ag=ac(ah);var aj=ah.data.plot;var ai=ae(ag.gridPos,aj);var af=H.Event("jqplotMouseDown");af.pageX=ah.pageX;af.pageY=ah.pageY;H(this).trigger(af,[ag.gridPos,ag.dataPos,ai,aj])};this.onMouseUp=function(ah){var ag=ac(ah);var af=H.Event("jqplotMouseUp");af.pageX=ah.pageX;af.pageY=ah.pageY;H(this).trigger(af,[ag.gridPos,ag.dataPos,null,ah.data.plot])};this.onRightClick=function(ah){var ag=ac(ah);var aj=ah.data.plot;var ai=ae(ag.gridPos,aj);if(aj.captureRightClick){if(ah.which==3){var af=H.Event("jqplotRightClick");af.pageX=ah.pageX;af.pageY=ah.pageY;H(this).trigger(af,[ag.gridPos,ag.dataPos,ai,aj])}else{var af=H.Event("jqplotMouseUp");af.pageX=ah.pageX;af.pageY=ah.pageY;H(this).trigger(af,[ag.gridPos,ag.dataPos,ai,aj])}}};this.onMouseMove=function(ah){var ag=ac(ah);var aj=ah.data.plot;var ai=ae(ag.gridPos,aj);var af=H.Event("jqplotMouseMove");af.pageX=ah.pageX;af.pageY=ah.pageY;H(this).trigger(af,[ag.gridPos,ag.dataPos,ai,aj])};this.onMouseEnter=function(ah){var ag=ac(ah);var ai=ah.data.plot;var af=H.Event("jqplotMouseEnter");af.pageX=ah.pageX;af.pageY=ah.pageY;af.relatedTarget=ah.relatedTarget;H(this).trigger(af,[ag.gridPos,ag.dataPos,null,ai])};this.onMouseLeave=function(ah){var ag=ac(ah);var ai=ah.data.plot;var af=H.Event("jqplotMouseLeave");af.pageX=ah.pageX;af.pageY=ah.pageY;af.relatedTarget=ah.relatedTarget;H(this).trigger(af,[ag.gridPos,ag.dataPos,null,ai])};this.drawSeries=function(ah,af){var aj,ai,ag;af=(typeof(ah)==="number"&&af==null)?ah:af;ah=(typeof(ah)==="object")?ah:{};if(af!=r){ai=this.series[af];ag=ai.shadowCanvas._ctx;ag.clearRect(0,0,ag.canvas.width,ag.canvas.height);ai.drawShadow(ag,ah,this);ag=ai.canvas._ctx;ag.clearRect(0,0,ag.canvas.width,ag.canvas.height);ai.draw(ag,ah,this);if(ai.renderer.constructor==H.jqplot.BezierCurveRenderer){if(af<this.series.length-1){this.drawSeries(af+1)}}}else{for(aj=0;aj<this.series.length;aj++){ai=this.series[aj];ag=ai.shadowCanvas._ctx;ag.clearRect(0,0,ag.canvas.width,ag.canvas.height);ai.drawShadow(ag,ah,this);ag=ai.canvas._ctx;ag.clearRect(0,0,ag.canvas.width,ag.canvas.height);ai.draw(ag,ah,this)}}ah=af=aj=ai=ag=null};this.moveSeriesToFront=function(ag){ag=parseInt(ag,10);var aj=H.inArray(ag,this.seriesStack);if(aj==-1){return}if(aj==this.seriesStack.length-1){this.previousSeriesStack=this.seriesStack.slice(0);return}var af=this.seriesStack[this.seriesStack.length-1];var ai=this.series[ag].canvas._elem.detach();var ah=this.series[ag].shadowCanvas._elem.detach();this.series[af].shadowCanvas._elem.after(ah);this.series[af].canvas._elem.after(ai);this.previousSeriesStack=this.seriesStack.slice(0);this.seriesStack.splice(aj,1);this.seriesStack.push(ag)};this.moveSeriesToBack=function(ag){ag=parseInt(ag,10);var aj=H.inArray(ag,this.seriesStack);if(aj==0||aj==-1){return}var af=this.seriesStack[0];var ai=this.series[ag].canvas._elem.detach();var ah=this.series[ag].shadowCanvas._elem.detach();this.series[af].shadowCanvas._elem.before(ah);this.series[af].canvas._elem.before(ai);this.previousSeriesStack=this.seriesStack.slice(0);this.seriesStack.splice(aj,1);this.seriesStack.unshift(ag)};this.restorePreviousSeriesOrder=function(){var al,ak,aj,ai,ah,af,ag;if(this.seriesStack==this.previousSeriesStack){return}for(al=1;al<this.previousSeriesStack.length;al++){af=this.previousSeriesStack[al];ag=this.previousSeriesStack[al-1];aj=this.series[af].canvas._elem.detach();ai=this.series[af].shadowCanvas._elem.detach();this.series[ag].shadowCanvas._elem.after(ai);this.series[ag].canvas._elem.after(aj)}ah=this.seriesStack.slice(0);this.seriesStack=this.previousSeriesStack.slice(0);this.previousSeriesStack=ah};this.restoreOriginalSeriesOrder=function(){var aj,ai,af=[],ah,ag;for(aj=0;aj<this.series.length;aj++){af.push(aj)}if(this.seriesStack==af){return}this.previousSeriesStack=this.seriesStack.slice(0);this.seriesStack=af;for(aj=1;aj<this.seriesStack.length;aj++){ah=this.series[aj].canvas._elem.detach();ag=this.series[aj].shadowCanvas._elem.detach();this.series[aj-1].shadowCanvas._elem.after(ag);this.series[aj-1].canvas._elem.after(ah)}};this.activateTheme=function(af){this.themeEngine.activate(this,af)}}H.jqplot.computeHighlightColors=function(ac){var ae;if(H.isArray(ac)){ae=[];for(var ag=0;ag<ac.length;ag++){var af=H.jqplot.getColorComponents(ac[ag]);var ab=[af[0],af[1],af[2]];var ah=ab[0]+ab[1]+ab[2];for(var ad=0;ad<3;ad++){ab[ad]=(ah>660)?ab[ad]*0.85:0.73*ab[ad]+90;ab[ad]=parseInt(ab[ad],10);(ab[ad]>255)?255:ab[ad]}ab[3]=0.3+0.35*af[3];ae.push("rgba("+ab[0]+","+ab[1]+","+ab[2]+","+ab[3]+")")}}else{var af=H.jqplot.getColorComponents(ac);var ab=[af[0],af[1],af[2]];var ah=ab[0]+ab[1]+ab[2];for(var ad=0;ad<3;ad++){ab[ad]=(ah>660)?ab[ad]*0.85:0.73*ab[ad]+90;ab[ad]=parseInt(ab[ad],10);(ab[ad]>255)?255:ab[ad]}ab[3]=0.3+0.35*af[3];ae="rgba("+ab[0]+","+ab[1]+","+ab[2]+","+ab[3]+")"}return ae};H.jqplot.ColorGenerator=function(ac){ac=ac||H.jqplot.config.defaultColors;var ab=0;this.next=function(){if(ab<ac.length){return ac[ab++]}else{ab=0;return ac[ab++]}};this.previous=function(){if(ab>0){return ac[ab--]}else{ab=ac.length-1;return ac[ab]}};this.get=function(ae){var ad=ae-ac.length*Math.floor(ae/ac.length);return ac[ad]};this.setColors=function(ad){ac=ad};this.reset=function(){ab=0};this.getIndex=function(){return ab};this.setIndex=function(ad){ab=ad}};H.jqplot.hex2rgb=function(ad,ab){ad=ad.replace("#","");if(ad.length==3){ad=ad.charAt(0)+ad.charAt(0)+ad.charAt(1)+ad.charAt(1)+ad.charAt(2)+ad.charAt(2)}var ac;ac="rgba("+parseInt(ad.slice(0,2),16)+", "+parseInt(ad.slice(2,4),16)+", "+parseInt(ad.slice(4,6),16);if(ab){ac+=", "+ab}ac+=")";return ac};H.jqplot.rgb2hex=function(ag){var ad=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/;var ab=ag.match(ad);var af="#";for(var ae=1;ae<4;ae++){var ac;if(ab[ae].search(/%/)!=-1){ac=parseInt(255*ab[ae]/100,10).toString(16);if(ac.length==1){ac="0"+ac}}else{ac=parseInt(ab[ae],10).toString(16);if(ac.length==1){ac="0"+ac}}af+=ac}return af};H.jqplot.normalize2rgb=function(ac,ab){if(ac.search(/^ *rgba?\(/)!=-1){return ac}else{if(ac.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/)!=-1){return H.jqplot.hex2rgb(ac,ab)}else{throw"invalid color spec"}}};H.jqplot.getColorComponents=function(ag){ag=H.jqplot.colorKeywordMap[ag]||ag;var ae=H.jqplot.normalize2rgb(ag);var ad=/rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/;var ab=ae.match(ad);var ac=[];for(var af=1;af<4;af++){if(ab[af].search(/%/)!=-1){ac[af-1]=parseInt(255*ab[af]/100,10)}else{ac[af-1]=parseInt(ab[af],10)}}ac[3]=parseFloat(ab[4])?parseFloat(ab[4]):1;return ac};H.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)"};H.jqplot.AxisLabelRenderer=function(ab){H.jqplot.ElemContainer.call(this);this.axis;this.show=true;this.label="";this.fontFamily=null;this.fontSize=null;this.textColor=null;this._elem;this.escapeHTML=false;H.extend(true,this,ab)};H.jqplot.AxisLabelRenderer.prototype=new H.jqplot.ElemContainer();H.jqplot.AxisLabelRenderer.prototype.constructor=H.jqplot.AxisLabelRenderer;H.jqplot.AxisLabelRenderer.prototype.init=function(ab){H.extend(true,this,ab)};H.jqplot.AxisLabelRenderer.prototype.draw=function(ab,ac){if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=H('<div style="position:absolute;" class="jqplot-'+this.axis+'-label"></div>');if(Number(this.label)){this._elem.css("white-space","nowrap")}if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}return this._elem};H.jqplot.AxisLabelRenderer.prototype.pack=function(){};H.jqplot.AxisTickRenderer=function(ab){H.jqplot.ElemContainer.call(this);this.mark="outside";this.axis;this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.size=4;this.markSize=6;this.show=true;this.showLabel=true;this.label=null;this.value=null;this._styles={};this.formatter=H.jqplot.DefaultTickFormatter;this.prefix="";this.suffix="";this.formatString="";this.fontFamily;this.fontSize;this.textColor;this.escapeHTML=false;this._elem;this._breakTick=false;H.extend(true,this,ab)};H.jqplot.AxisTickRenderer.prototype.init=function(ab){H.extend(true,this,ab)};H.jqplot.AxisTickRenderer.prototype=new H.jqplot.ElemContainer();H.jqplot.AxisTickRenderer.prototype.constructor=H.jqplot.AxisTickRenderer;H.jqplot.AxisTickRenderer.prototype.setTick=function(ab,ad,ac){this.value=ab;this.axis=ad;if(ac){this.isMinorTick=true}return this};H.jqplot.AxisTickRenderer.prototype.draw=function(){if(this.label===null){this.label=this.prefix+this.formatter(this.formatString,this.value)+this.suffix}var ac={position:"absolute"};if(Number(this.label)){ac.whitSpace="nowrap"}if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=H(document.createElement("div"));this._elem.addClass("jqplot-"+this.axis+"-tick");if(!this.escapeHTML){this._elem.html(this.label)}else{this._elem.text(this.label)}this._elem.css(ac);for(var ab in this._styles){this._elem.css(ab,this._styles[ab])}if(this.fontFamily){this._elem.css("font-family",this.fontFamily)}if(this.fontSize){this._elem.css("font-size",this.fontSize)}if(this.textColor){this._elem.css("color",this.textColor)}if(this._breakTick){this._elem.addClass("jqplot-breakTick")}return this._elem};H.jqplot.DefaultTickFormatter=function(ab,ac){if(typeof ac=="number"){if(!ab){ab=H.jqplot.config.defaultTickFormatString}return H.jqplot.sprintf(ab,ac)}else{return String(ac)}};H.jqplot.PercentTickFormatter=function(ab,ac){if(typeof ac=="number"){ac=100*ac;if(!ab){ab=H.jqplot.config.defaultTickFormatString}return H.jqplot.sprintf(ab,ac)}else{return String(ac)}};H.jqplot.AxisTickRenderer.prototype.pack=function(){};H.jqplot.CanvasGridRenderer=function(){this.shadowRenderer=new H.jqplot.ShadowRenderer()};H.jqplot.CanvasGridRenderer.prototype.init=function(ac){this._ctx;H.extend(true,this,ac);var ab={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};this.renderer.shadowRenderer.init(ab)};H.jqplot.CanvasGridRenderer.prototype.createElement=function(ae){var ad;if(this._elem){if(H.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==r){ad=this._elem.get(0);window.G_vmlCanvasManager.uninitElement(ad);ad=null}this._elem.emptyForce();this._elem=null}ad=ae.canvasManager.getCanvas();var ab=this._plotDimensions.width;var ac=this._plotDimensions.height;ad.width=ab;ad.height=ac;this._elem=H(ad);this._elem.addClass("jqplot-grid-canvas");this._elem.css({position:"absolute",left:0,top:0});ad=ae.canvasManager.initCanvas(ad);this._top=this._offsets.top;this._bottom=ac-this._offsets.bottom;this._left=this._offsets.left;this._right=ab-this._offsets.right;this._width=this._right-this._left;this._height=this._bottom-this._top;ad=null;return this._elem};H.jqplot.CanvasGridRenderer.prototype.draw=function(){this._ctx=this._elem.get(0).getContext("2d");var am=this._ctx;var ap=this._axes;am.save();am.clearRect(0,0,this._plotDimensions.width,this._plotDimensions.height);am.fillStyle=this.backgroundColor||this.background;am.fillRect(this._left,this._top,this._width,this._height);am.save();am.lineJoin="miter";am.lineCap="butt";am.lineWidth=this.gridLineWidth;am.strokeStyle=this.gridLineColor;var at,ar,aj,ak;var ag=["xaxis","yaxis","x2axis","y2axis"];for(var aq=4;aq>0;aq--){var aw=ag[aq-1];var ab=ap[aw];var au=ab._ticks;var al=au.length;if(ab.show){if(ab.drawBaseline){var av={};if(ab.baselineWidth!==null){av.lineWidth=ab.baselineWidth}if(ab.baselineColor!==null){av.strokeStyle=ab.baselineColor}switch(aw){case"xaxis":ai(this._left,this._bottom,this._right,this._bottom,av);break;case"yaxis":ai(this._left,this._bottom,this._left,this._top,av);break;case"x2axis":ai(this._left,this._bottom,this._right,this._bottom,av);break;case"y2axis":ai(this._right,this._bottom,this._right,this._top,av);break}}for(var an=al;an>0;an--){var ah=au[an-1];if(ah.show){var ae=Math.round(ab.u2p(ah.value))+0.5;switch(aw){case"xaxis":if(ah.showGridline&&this.drawGridlines&&((!ah.isMinorTick&&ab.drawMajorGridlines)||(ah.isMinorTick&&ab.drawMinorGridlines))){ai(ae,this._top,ae,this._bottom)}if(ah.showMark&&ah.mark&&((!ah.isMinorTick&&ab.drawMajorTickMarks)||(ah.isMinorTick&&ab.drawMinorTickMarks))){aj=ah.markSize;ak=ah.mark;var ae=Math.round(ab.u2p(ah.value))+0.5;switch(ak){case"outside":at=this._bottom;ar=this._bottom+aj;break;case"inside":at=this._bottom-aj;ar=this._bottom;break;case"cross":at=this._bottom-aj;ar=this._bottom+aj;break;default:at=this._bottom;ar=this._bottom+aj;break}if(this.shadow){this.renderer.shadowRenderer.draw(am,[[ae,at],[ae,ar]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}ai(ae,at,ae,ar)}break;case"yaxis":if(ah.showGridline&&this.drawGridlines&&((!ah.isMinorTick&&ab.drawMajorGridlines)||(ah.isMinorTick&&ab.drawMinorGridlines))){ai(this._right,ae,this._left,ae)}if(ah.showMark&&ah.mark&&((!ah.isMinorTick&&ab.drawMajorTickMarks)||(ah.isMinorTick&&ab.drawMinorTickMarks))){aj=ah.markSize;ak=ah.mark;var ae=Math.round(ab.u2p(ah.value))+0.5;switch(ak){case"outside":at=this._left-aj;ar=this._left;break;case"inside":at=this._left;ar=this._left+aj;break;case"cross":at=this._left-aj;ar=this._left+aj;break;default:at=this._left-aj;ar=this._left;break}if(this.shadow){this.renderer.shadowRenderer.draw(am,[[at,ae],[ar,ae]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ai(at,ae,ar,ae,{strokeStyle:ab.borderColor})}break;case"x2axis":if(ah.showGridline&&this.drawGridlines&&((!ah.isMinorTick&&ab.drawMajorGridlines)||(ah.isMinorTick&&ab.drawMinorGridlines))){ai(ae,this._bottom,ae,this._top)}if(ah.showMark&&ah.mark&&((!ah.isMinorTick&&ab.drawMajorTickMarks)||(ah.isMinorTick&&ab.drawMinorTickMarks))){aj=ah.markSize;ak=ah.mark;var ae=Math.round(ab.u2p(ah.value))+0.5;switch(ak){case"outside":at=this._top-aj;ar=this._top;break;case"inside":at=this._top;ar=this._top+aj;break;case"cross":at=this._top-aj;ar=this._top+aj;break;default:at=this._top-aj;ar=this._top;break}if(this.shadow){this.renderer.shadowRenderer.draw(am,[[ae,at],[ae,ar]],{lineCap:"butt",lineWidth:this.gridLineWidth,offset:this.gridLineWidth*0.75,depth:2,fill:false,closePath:false})}ai(ae,at,ae,ar)}break;case"y2axis":if(ah.showGridline&&this.drawGridlines&&((!ah.isMinorTick&&ab.drawMajorGridlines)||(ah.isMinorTick&&ab.drawMinorGridlines))){ai(this._left,ae,this._right,ae)}if(ah.showMark&&ah.mark&&((!ah.isMinorTick&&ab.drawMajorTickMarks)||(ah.isMinorTick&&ab.drawMinorTickMarks))){aj=ah.markSize;ak=ah.mark;var ae=Math.round(ab.u2p(ah.value))+0.5;switch(ak){case"outside":at=this._right;ar=this._right+aj;break;case"inside":at=this._right-aj;ar=this._right;break;case"cross":at=this._right-aj;ar=this._right+aj;break;default:at=this._right;ar=this._right+aj;break}if(this.shadow){this.renderer.shadowRenderer.draw(am,[[at,ae],[ar,ae]],{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ai(at,ae,ar,ae,{strokeStyle:ab.borderColor})}break;default:break}}}ah=null}ab=null;au=null}ag=["y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];for(var aq=7;aq>0;aq--){var ab=ap[ag[aq-1]];var au=ab._ticks;if(ab.show){var ac=au[ab.numberTicks-1];var af=au[0];var ad=ab.getLeft();var ao=[[ad,ac.getTop()+ac.getHeight()/2],[ad,af.getTop()+af.getHeight()/2+1]];if(this.shadow){this.renderer.shadowRenderer.draw(am,ao,{lineCap:"butt",fill:false,closePath:false})}ai(ao[0][0],ao[0][1],ao[1][0],ao[1][1],{lineCap:"butt",strokeStyle:ab.borderColor,lineWidth:ab.borderWidth});for(var an=au.length;an>0;an--){var ah=au[an-1];aj=ah.markSize;ak=ah.mark;var ae=Math.round(ab.u2p(ah.value))+0.5;if(ah.showMark&&ah.mark){switch(ak){case"outside":at=ad;ar=ad+aj;break;case"inside":at=ad-aj;ar=ad;break;case"cross":at=ad-aj;ar=ad+aj;break;default:at=ad;ar=ad+aj;break}ao=[[at,ae],[ar,ae]];if(this.shadow){this.renderer.shadowRenderer.draw(am,ao,{lineCap:"butt",lineWidth:this.gridLineWidth*1.5,offset:this.gridLineWidth*0.75,fill:false,closePath:false})}ai(at,ae,ar,ae,{strokeStyle:ab.borderColor})}ah=null}af=null}ab=null;au=null}am.restore();function ai(aB,aA,ay,ax,az){am.save();az=az||{};if(az.lineWidth==null||az.lineWidth!=0){H.extend(true,am,az);am.beginPath();am.moveTo(aB,aA);am.lineTo(ay,ax);am.stroke();am.restore()}}if(this.shadow){var ao=[[this._left,this._bottom],[this._right,this._bottom],[this._right,this._top]];this.renderer.shadowRenderer.draw(am,ao)}if(this.borderWidth!=0&&this.drawBorder){ai(this._left,this._top,this._right,this._top,{lineCap:"round",strokeStyle:ap.x2axis.borderColor,lineWidth:ap.x2axis.borderWidth});ai(this._right,this._top,this._right,this._bottom,{lineCap:"round",strokeStyle:ap.y2axis.borderColor,lineWidth:ap.y2axis.borderWidth});ai(this._right,this._bottom,this._left,this._bottom,{lineCap:"round",strokeStyle:ap.xaxis.borderColor,lineWidth:ap.xaxis.borderWidth});ai(this._left,this._bottom,this._left,this._top,{lineCap:"round",strokeStyle:ap.yaxis.borderColor,lineWidth:ap.yaxis.borderWidth})}am.restore();am=null;ap=null};H.jqplot.DivTitleRenderer=function(){};H.jqplot.DivTitleRenderer.prototype.init=function(ab){H.extend(true,this,ab)};H.jqplot.DivTitleRenderer.prototype.draw=function(){if(this._elem){this._elem.emptyForce();this._elem=null}var ae=this.renderer;var ad=document.createElement("div");this._elem=H(ad);this._elem.addClass("jqplot-title");if(!this.text){this.show=false;this._elem.height(0);this._elem.width(0)}else{if(this.text){var ab;if(this.color){ab=this.color}else{if(this.textColor){ab=this.textColor}}var ac={position:"absolute",top:"0px",left:"0px"};if(this._plotWidth){ac.width=this._plotWidth+"px"}if(this.fontSize){ac.fontSize=this.fontSize}if(typeof this.textAlign==="string"){ac.textAlign=this.textAlign}else{ac.textAlign="center"}if(ab){ac.color=ab}if(this.paddingBottom){ac.paddingBottom=this.paddingBottom}if(this.fontFamily){ac.fontFamily=this.fontFamily}this._elem.css(ac);if(this.escapeHtml){this._elem.text(this.text)}else{this._elem.html(this.text)}}}ad=null;return this._elem};H.jqplot.DivTitleRenderer.prototype.pack=function(){};var o=0.1;H.jqplot.LinePattern=function(ap,ak){var aj={dotted:[o,H.jqplot.config.dotGapLength],dashed:[H.jqplot.config.dashLength,H.jqplot.config.gapLength],solid:null};if(typeof ak==="string"){if(ak[0]==="."||ak[0]==="-"){var aq=ak;ak=[];for(var ai=0,af=aq.length;ai<af;ai++){if(aq[ai]==="."){ak.push(o)}else{if(aq[ai]==="-"){ak.push(H.jqplot.config.dashLength)}else{continue}}ak.push(H.jqplot.config.gapLength)}}else{ak=aj[ak]}}if(!(ak&&ak.length)){return ap}var ae=0;var al=ak[0];var an=0;var am=0;var ah=0;var ab=0;var ao=function(ar,at){ap.moveTo(ar,at);an=ar;am=at;ah=ar;ab=at};var ad=function(ar,ay){var aw=ap.lineWidth;var au=ar-an;var at=ay-am;var av=Math.sqrt(au*au+at*at);if((av>0)&&(aw>0)){au/=av;at/=av;while(true){var ax=aw*al;if(ax<av){an+=ax*au;am+=ax*at;if((ae&1)==0){ap.lineTo(an,am)}else{ap.moveTo(an,am)}av-=ax;ae++;if(ae>=ak.length){ae=0}al=ak[ae]}else{an=ar;am=ay;if((ae&1)==0){ap.lineTo(an,am)}else{ap.moveTo(an,am)}al-=av/aw;break}}}};var ac=function(){ap.beginPath()};var ag=function(){ad(ah,ab)};return{moveTo:ao,lineTo:ad,beginPath:ac,closePath:ag}};H.jqplot.LineRenderer=function(){this.shapeRenderer=new H.jqplot.ShapeRenderer();this.shadowRenderer=new H.jqplot.ShadowRenderer()};H.jqplot.LineRenderer.prototype.init=function(ac,ah){ac=ac||{};this._type="line";this.renderer.animation={show:false,direction:"left",speed:2500,_supported:true};this.renderer.smooth=false;this.renderer.tension=null;this.renderer.constrainSmoothing=true;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:false,hiData:[],lowData:[],color:this.color,showLines:false,fill:true,fillColor:null,_min:null,_max:null,interval:"3%"};var af={highlightMouseOver:ac.highlightMouseOver,highlightMouseDown:ac.highlightMouseDown,highlightColor:ac.highlightColor};delete (ac.highlightMouseOver);delete (ac.highlightMouseDown);delete (ac.highlightColor);H.extend(true,this.renderer,ac);this.renderer.options=ac;if(this.renderer.bandData.length>1&&(!ac.bands||ac.bands.show==null)){this.renderer.bands.show=true}else{if(ac.bands&&ac.bands.show==null&&ac.bands.interval!=null){this.renderer.bands.show=true}}if(this.fill){this.renderer.bands.show=false}if(this.renderer.bands.show){this.renderer.initBands.call(this,this.renderer.options,ah)}if(this._stack){this.renderer.smooth=false}var ag={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};this.renderer.shapeRenderer.init(ag);var ad=ac.shadowOffset;if(ad==null){if(this.lineWidth>2.5){ad=1.25*(1+(Math.atan((this.lineWidth/2.5))/0.785398163-1)*0.6)}else{ad=1.25*Math.atan((this.lineWidth/2.5))/0.785398163}}var ab={lineJoin:this.lineJoin,lineCap:this.lineCap,fill:this.fill,isarc:false,angle:this.shadowAngle,offset:ad,alpha:this.shadowAlpha,depth:this.shadowDepth,lineWidth:this.lineWidth,linePattern:this.linePattern,closePath:this.fill};this.renderer.shadowRenderer.init(ab);this._areaPoints=[];this._boundingBox=[[],[]];if(!this.isTrendline&&this.fill||this.renderer.bands.show){this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColor=null;if(af.highlightMouseDown&&af.highlightMouseOver==null){af.highlightMouseOver=false}H.extend(true,this,{highlightMouseOver:af.highlightMouseOver,highlightMouseDown:af.highlightMouseDown,highlightColor:af.highlightColor});if(!this.highlightColor){var ae=(this.renderer.bands.show)?this.renderer.bands.fillColor:this.fillColor;this.highlightColor=H.jqplot.computeHighlightColors(ae)}if(this.highlighter){this.highlighter.show=false}}if(!this.isTrendline&&ah){ah.plugins.lineRenderer={};ah.postInitHooks.addOnce(v);ah.postDrawHooks.addOnce(Z);ah.eventListenerHooks.addOnce("jqplotMouseMove",g);ah.eventListenerHooks.addOnce("jqplotMouseDown",d);ah.eventListenerHooks.addOnce("jqplotMouseUp",Y);ah.eventListenerHooks.addOnce("jqplotClick",f);ah.eventListenerHooks.addOnce("jqplotRightClick",p)}};H.jqplot.LineRenderer.prototype.initBands=function(ae,ao){var af=ae.bandData||[];var ah=this.renderer.bands;ah.hiData=[];ah.lowData=[];var av=this.data;ah._max=null;ah._min=null;if(af.length==2){if(H.isArray(af[0][0])){var ai;var ab=0,al=0;for(var ap=0,am=af[0].length;ap<am;ap++){ai=af[0][ap];if((ai[1]!=null&&ai[1]>ah._max)||ah._max==null){ah._max=ai[1]}if((ai[1]!=null&&ai[1]<ah._min)||ah._min==null){ah._min=ai[1]}}for(var ap=0,am=af[1].length;ap<am;ap++){ai=af[1][ap];if((ai[1]!=null&&ai[1]>ah._max)||ah._max==null){ah._max=ai[1];al=1}if((ai[1]!=null&&ai[1]<ah._min)||ah._min==null){ah._min=ai[1];ab=1}}if(al===ab){ah.show=false}ah.hiData=af[al];ah.lowData=af[ab]}else{if(af[0].length===av.length&&af[1].length===av.length){var ad=(af[0][0]>af[1][0])?0:1;var aw=(ad)?0:1;for(var ap=0,am=av.length;ap<am;ap++){ah.hiData.push([av[ap][0],af[ad][ap]]);ah.lowData.push([av[ap][0],af[aw][ap]])}}else{ah.show=false}}}else{if(af.length>2&&!H.isArray(af[0][0])){var ad=(af[0][0]>af[0][1])?0:1;var aw=(ad)?0:1;for(var ap=0,am=af.length;ap<am;ap++){ah.hiData.push([av[ap][0],af[ap][ad]]);ah.lowData.push([av[ap][0],af[ap][aw]])}}else{var ak=ah.interval;var au=null;var at=null;var ac=null;var an=null;if(H.isArray(ak)){au=ak[0];at=ak[1]}else{au=ak}if(isNaN(au)){if(au.charAt(au.length-1)==="%"){ac="multiply";au=parseFloat(au)/100+1}}else{au=parseFloat(au);ac="add"}if(at!==null&&isNaN(at)){if(at.charAt(at.length-1)==="%"){an="multiply";at=parseFloat(at)/100+1}}else{if(at!==null){at=parseFloat(at);an="add"}}if(au!==null){if(at===null){at=-au;an=ac;if(an==="multiply"){at+=2}}if(au<at){var aq=au;au=at;at=aq;aq=ac;ac=an;an=aq}for(var ap=0,am=av.length;ap<am;ap++){switch(ac){case"add":ah.hiData.push([av[ap][0],av[ap][1]+au]);break;case"multiply":ah.hiData.push([av[ap][0],av[ap][1]*au]);break}switch(an){case"add":ah.lowData.push([av[ap][0],av[ap][1]+at]);break;case"multiply":ah.lowData.push([av[ap][0],av[ap][1]*at]);break}}}else{ah.show=false}}}var ag=ah.hiData;var aj=ah.lowData;for(var ap=0,am=ag.length;ap<am;ap++){if((ag[ap][1]!=null&&ag[ap][1]>ah._max)||ah._max==null){ah._max=ag[ap][1]}}for(var ap=0,am=aj.length;ap<am;ap++){if((aj[ap][1]!=null&&aj[ap][1]<ah._min)||ah._min==null){ah._min=aj[ap][1]}}if(ah.fillColor===null){var ar=H.jqplot.getColorComponents(ah.color);ar[3]=ar[3]*0.5;ah.fillColor="rgba("+ar[0]+", "+ar[1]+", "+ar[2]+", "+ar[3]+")"}};function G(ac,ab){return(3.4182054+ab)*Math.pow(ac,-0.3534992)}function k(ad,ac){var ab=Math.sqrt(Math.pow((ac[0]-ad[0]),2)+Math.pow((ac[1]-ad[1]),2));return 5.7648*Math.log(ab)+7.4456}function w(ab){var ac=(Math.exp(2*ab)-1)/(Math.exp(2*ab)+1);return ac}function F(aD){var am=this.renderer.smooth;var ax=this.canvas.getWidth();var ah=this._xaxis.series_p2u;var aA=this._yaxis.series_p2u;var az=null;var ag=null;var at=aD.length/ax;var ad=[];var ar=[];if(!isNaN(parseFloat(am))){az=parseFloat(am)}else{az=G(at,0.5)}var ap=[];var ae=[];for(var ay=0,au=aD.length;ay<au;ay++){ap.push(aD[ay][1]);ae.push(aD[ay][0])}function ao(aE,aF){if(aE-aF==0){return Math.pow(10,10)}else{return aE-aF}}var aq,al,ak,aj;var ab=aD.length-1;for(var af=1,av=aD.length;af<av;af++){var ac=[];var an=[];for(var aw=0;aw<2;aw++){var ay=af-1+aw;if(ay==0||ay==ab){ac[aw]=Math.pow(10,10)}else{if(ap[ay+1]-ap[ay]==0||ap[ay]-ap[ay-1]==0){ac[aw]=0}else{if(((ae[ay+1]-ae[ay])/(ap[ay+1]-ap[ay])+(ae[ay]-ae[ay-1])/(ap[ay]-ap[ay-1]))==0){ac[aw]=0}else{if((ap[ay+1]-ap[ay])*(ap[ay]-ap[ay-1])<0){ac[aw]=0}else{ac[aw]=2/(ao(ae[ay+1],ae[ay])/(ap[ay+1]-ap[ay])+ao(ae[ay],ae[ay-1])/(ap[ay]-ap[ay-1]))}}}}}if(af==1){ac[0]=3/2*(ap[1]-ap[0])/ao(ae[1],ae[0])-ac[1]/2}else{if(af==ab){ac[1]=3/2*(ap[ab]-ap[ab-1])/ao(ae[ab],ae[ab-1])-ac[0]/2}}an[0]=-2*(ac[1]+2*ac[0])/ao(ae[af],ae[af-1])+6*(ap[af]-ap[af-1])/Math.pow(ao(ae[af],ae[af-1]),2);an[1]=2*(2*ac[1]+ac[0])/ao(ae[af],ae[af-1])-6*(ap[af]-ap[af-1])/Math.pow(ao(ae[af],ae[af-1]),2);aj=1/6*(an[1]-an[0])/ao(ae[af],ae[af-1]);ak=1/2*(ae[af]*an[0]-ae[af-1]*an[1])/ao(ae[af],ae[af-1]);al=(ap[af]-ap[af-1]-ak*(Math.pow(ae[af],2)-Math.pow(ae[af-1],2))-aj*(Math.pow(ae[af],3)-Math.pow(ae[af-1],3)))/ao(ae[af],ae[af-1]);aq=ap[af-1]-al*ae[af-1]-ak*Math.pow(ae[af-1],2)-aj*Math.pow(ae[af-1],3);var aC=(ae[af]-ae[af-1])/az;var aB,ai;for(var aw=0,au=az;aw<au;aw++){aB=[];ai=ae[af-1]+aw*aC;aB.push(ai);aB.push(aq+al*ai+ak*Math.pow(ai,2)+aj*Math.pow(ai,3));ad.push(aB);ar.push([ah(aB[0]),aA(aB[1])])}}ad.push(aD[ay]);ar.push([ah(aD[ay][0]),aA(aD[ay][1])]);return[ad,ar]}function B(aj){var ai=this.renderer.smooth;var aO=this.renderer.tension;var ab=this.canvas.getWidth();var aB=this._xaxis.series_p2u;var ak=this._yaxis.series_p2u;var aC=null;var aD=null;var aN=null;var aI=null;var aG=null;var am=null;var aL=null;var ag=null;var aE,aF,ax,aw,au,ar;var ae,ac,ao,an;var av,at,aH;var ap=[];var ad=[];var af=aj.length/ab;var aM,aq,az,aA,ay;var al=[];var ah=[];if(!isNaN(parseFloat(ai))){aC=parseFloat(ai)}else{aC=G(af,0.5)}if(!isNaN(parseFloat(aO))){aO=parseFloat(aO)}for(var aK=0,aJ=aj.length-1;aK<aJ;aK++){if(aO===null){am=Math.abs((aj[aK+1][1]-aj[aK][1])/(aj[aK+1][0]-aj[aK][0]));aM=0.3;aq=0.6;az=(aq-aM)/2;aA=2.5;ay=-1.4;ag=am/aA+ay;aI=az*w(ag)-az*w(ay)+aM;if(aK>0){aL=Math.abs((aj[aK][1]-aj[aK-1][1])/(aj[aK][0]-aj[aK-1][0]))}ag=aL/aA+ay;aG=az*w(ag)-az*w(ay)+aM;aN=(aI+aG)/2}else{aN=aO}for(aE=0;aE<aC;aE++){aF=aE/aC;ax=(1+2*aF)*Math.pow((1-aF),2);aw=aF*Math.pow((1-aF),2);au=Math.pow(aF,2)*(3-2*aF);ar=Math.pow(aF,2)*(aF-1);if(aj[aK-1]){ae=aN*(aj[aK+1][0]-aj[aK-1][0]);ac=aN*(aj[aK+1][1]-aj[aK-1][1])}else{ae=aN*(aj[aK+1][0]-aj[aK][0]);ac=aN*(aj[aK+1][1]-aj[aK][1])}if(aj[aK+2]){ao=aN*(aj[aK+2][0]-aj[aK][0]);an=aN*(aj[aK+2][1]-aj[aK][1])}else{ao=aN*(aj[aK+1][0]-aj[aK][0]);an=aN*(aj[aK+1][1]-aj[aK][1])}av=ax*aj[aK][0]+au*aj[aK+1][0]+aw*ae+ar*ao;at=ax*aj[aK][1]+au*aj[aK+1][1]+aw*ac+ar*an;aH=[av,at];al.push(aH);ah.push([aB(av),ak(at)])}}al.push(aj[aJ]);ah.push([aB(aj[aJ][0]),ak(aj[aJ][1])]);return[al,ah]}H.jqplot.LineRenderer.prototype.setGridData=function(aj){var af=this._xaxis.series_u2p;var ab=this._yaxis.series_u2p;var ag=this._plotData;var ak=this._prevPlotData;this.gridData=[];this._prevGridData=[];this.renderer._smoothedData=[];this.renderer._smoothedPlotData=[];this.renderer._hiBandGridData=[];this.renderer._lowBandGridData=[];this.renderer._hiBandSmoothedData=[];this.renderer._lowBandSmoothedData=[];var ae=this.renderer.bands;var ac=false;for(var ah=0,ad=ag.length;ah<ad;ah++){if(ag[ah][0]!=null&&ag[ah][1]!=null){this.gridData.push([af.call(this._xaxis,ag[ah][0]),ab.call(this._yaxis,ag[ah][1])])}else{if(ag[ah][0]==null){ac=true;this.gridData.push([null,ab.call(this._yaxis,ag[ah][1])])}else{if(ag[ah][1]==null){ac=true;this.gridData.push([af.call(this._xaxis,ag[ah][0]),null])}}}if(ak[ah]!=null&&ak[ah][0]!=null&&ak[ah][1]!=null){this._prevGridData.push([af.call(this._xaxis,ak[ah][0]),ab.call(this._yaxis,ak[ah][1])])}else{if(ak[ah]!=null&&ak[ah][0]==null){this._prevGridData.push([null,ab.call(this._yaxis,ak[ah][1])])}else{if(ak[ah]!=null&&ak[ah][0]!=null&&ak[ah][1]==null){this._prevGridData.push([af.call(this._xaxis,ak[ah][0]),null])}}}}if(ac){this.renderer.smooth=false;if(this._type==="line"){ae.show=false}}if(this._type==="line"&&ae.show){for(var ah=0,ad=ae.hiData.length;ah<ad;ah++){this.renderer._hiBandGridData.push([af.call(this._xaxis,ae.hiData[ah][0]),ab.call(this._yaxis,ae.hiData[ah][1])])}for(var ah=0,ad=ae.lowData.length;ah<ad;ah++){this.renderer._lowBandGridData.push([af.call(this._xaxis,ae.lowData[ah][0]),ab.call(this._yaxis,ae.lowData[ah][1])])}}if(this._type==="line"&&this.renderer.smooth&&this.gridData.length>2){var ai;if(this.renderer.constrainSmoothing){ai=F.call(this,this.gridData);this.renderer._smoothedData=ai[0];this.renderer._smoothedPlotData=ai[1];if(ae.show){ai=F.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ai[0];ai=F.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ai[0]}ai=null}else{ai=B.call(this,this.gridData);this.renderer._smoothedData=ai[0];this.renderer._smoothedPlotData=ai[1];if(ae.show){ai=B.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=ai[0];ai=B.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=ai[0]}ai=null}}};H.jqplot.LineRenderer.prototype.makeGridData=function(ai,ak){var ag=this._xaxis.series_u2p;var ab=this._yaxis.series_u2p;var al=[];var ad=[];this.renderer._smoothedData=[];this.renderer._smoothedPlotData=[];this.renderer._hiBandGridData=[];this.renderer._lowBandGridData=[];this.renderer._hiBandSmoothedData=[];this.renderer._lowBandSmoothedData=[];var af=this.renderer.bands;var ac=false;for(var ah=0;ah<ai.length;ah++){if(ai[ah][0]!=null&&ai[ah][1]!=null){al.push([ag.call(this._xaxis,ai[ah][0]),ab.call(this._yaxis,ai[ah][1])])}else{if(ai[ah][0]==null){ac=true;al.push([null,ab.call(this._yaxis,ai[ah][1])])}else{if(ai[ah][1]==null){ac=true;al.push([ag.call(this._xaxis,ai[ah][0]),null])}}}}if(ac){this.renderer.smooth=false;if(this._type==="line"){af.show=false}}if(this._type==="line"&&af.show){for(var ah=0,ae=af.hiData.length;ah<ae;ah++){this.renderer._hiBandGridData.push([ag.call(this._xaxis,af.hiData[ah][0]),ab.call(this._yaxis,af.hiData[ah][1])])}for(var ah=0,ae=af.lowData.length;ah<ae;ah++){this.renderer._lowBandGridData.push([ag.call(this._xaxis,af.lowData[ah][0]),ab.call(this._yaxis,af.lowData[ah][1])])}}if(this._type==="line"&&this.renderer.smooth&&al.length>2){var aj;if(this.renderer.constrainSmoothing){aj=F.call(this,al);this.renderer._smoothedData=aj[0];this.renderer._smoothedPlotData=aj[1];if(af.show){aj=F.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=aj[0];aj=F.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=aj[0]}aj=null}else{aj=B.call(this,al);this.renderer._smoothedData=aj[0];this.renderer._smoothedPlotData=aj[1];if(af.show){aj=B.call(this,this.renderer._hiBandGridData);this.renderer._hiBandSmoothedData=aj[0];aj=B.call(this,this.renderer._lowBandGridData);this.renderer._lowBandSmoothedData=aj[0]}aj=null}}return al};H.jqplot.LineRenderer.prototype.draw=function(aq,aC,ac,av){var aw;var ak=H.extend(true,{},ac);var ae=(ak.shadow!=r)?ak.shadow:this.shadow;var aD=(ak.showLine!=r)?ak.showLine:this.showLine;var au=(ak.fill!=r)?ak.fill:this.fill;var ab=(ak.fillAndStroke!=r)?ak.fillAndStroke:this.fillAndStroke;var al,ar,ao,ay;aq.save();if(aC.length){if(aD){if(au){if(this.fillToZero){var az=this.negativeColor;if(!this.useNegativeColors){az=ak.fillStyle}var ai=false;var aj=ak.fillStyle;if(ab){var aB=aC.slice(0)}if(this.index==0||!this._stack){var ap=[];var aF=(this.renderer.smooth)?this.renderer._smoothedPlotData:this._plotData;this._areaPoints=[];var aA=this._yaxis.series_u2p(this.fillToValue);var ad=this._xaxis.series_u2p(this.fillToValue);ak.closePath=true;if(this.fillAxis=="y"){ap.push([aC[0][0],aA]);this._areaPoints.push([aC[0][0],aA]);for(var aw=0;aw<aC.length-1;aw++){ap.push(aC[aw]);this._areaPoints.push(aC[aw]);if(aF[aw][1]*aF[aw+1][1]<0){if(aF[aw][1]<0){ai=true;ak.fillStyle=az}else{ai=false;ak.fillStyle=aj}var ah=aC[aw][0]+(aC[aw+1][0]-aC[aw][0])*(aA-aC[aw][1])/(aC[aw+1][1]-aC[aw][1]);ap.push([ah,aA]);this._areaPoints.push([ah,aA]);if(ae){this.renderer.shadowRenderer.draw(aq,ap,ak)}this.renderer.shapeRenderer.draw(aq,ap,ak);ap=[[ah,aA]]}}if(aF[aC.length-1][1]<0){ai=true;ak.fillStyle=az}else{ai=false;ak.fillStyle=aj}ap.push(aC[aC.length-1]);this._areaPoints.push(aC[aC.length-1]);ap.push([aC[aC.length-1][0],aA]);this._areaPoints.push([aC[aC.length-1][0],aA])}if(ae){this.renderer.shadowRenderer.draw(aq,ap,ak)}this.renderer.shapeRenderer.draw(aq,ap,ak)}else{var an=this._prevGridData;for(var aw=an.length;aw>0;aw--){aC.push(an[aw-1])}if(ae){this.renderer.shadowRenderer.draw(aq,aC,ak)}this._areaPoints=aC;this.renderer.shapeRenderer.draw(aq,aC,ak)}}else{if(ab){var aB=aC.slice(0)}if(this.index==0||!this._stack){var af=aq.canvas.height;aC.unshift([aC[0][0],af]);var ax=aC.length;aC.push([aC[ax-1][0],af])}else{var an=this._prevGridData;for(var aw=an.length;aw>0;aw--){aC.push(an[aw-1])}}this._areaPoints=aC;if(ae){this.renderer.shadowRenderer.draw(aq,aC,ak)}this.renderer.shapeRenderer.draw(aq,aC,ak)}if(ab){var at=H.extend(true,{},ak,{fill:false,closePath:false});this.renderer.shapeRenderer.draw(aq,aB,at);if(this.markerRenderer.show){if(this.renderer.smooth){aB=this.gridData}for(aw=0;aw<aB.length;aw++){this.markerRenderer.draw(aB[aw][0],aB[aw][1],aq,ak.markerOptions)}}}}else{if(this.renderer.bands.show){var ag;var aE=H.extend(true,{},ak);if(this.renderer.bands.showLines){ag=(this.renderer.smooth)?this.renderer._hiBandSmoothedData:this.renderer._hiBandGridData;this.renderer.shapeRenderer.draw(aq,ag,ak);ag=(this.renderer.smooth)?this.renderer._lowBandSmoothedData:this.renderer._lowBandGridData;this.renderer.shapeRenderer.draw(aq,ag,aE)}if(this.renderer.bands.fill){if(this.renderer.smooth){ag=this.renderer._hiBandSmoothedData.concat(this.renderer._lowBandSmoothedData.reverse())}else{ag=this.renderer._hiBandGridData.concat(this.renderer._lowBandGridData.reverse())}this._areaPoints=ag;aE.closePath=true;aE.fill=true;aE.fillStyle=this.renderer.bands.fillColor;this.renderer.shapeRenderer.draw(aq,ag,aE)}}if(ae){this.renderer.shadowRenderer.draw(aq,aC,ak)}this.renderer.shapeRenderer.draw(aq,aC,ak)}}var al=ao=ar=ay=null;for(aw=0;aw<this._areaPoints.length;aw++){var am=this._areaPoints[aw];if(al>am[0]||al==null){al=am[0]}if(ay<am[1]||ay==null){ay=am[1]}if(ao<am[0]||ao==null){ao=am[0]}if(ar>am[1]||ar==null){ar=am[1]}}if(this.type==="line"&&this.renderer.bands.show){ay=this._yaxis.series_u2p(this.renderer.bands._min);ar=this._yaxis.series_u2p(this.renderer.bands._max)}this._boundingBox=[[al,ay],[ao,ar]];if(this.markerRenderer.show&&!au){if(this.renderer.smooth){aC=this.gridData}for(aw=0;aw<aC.length;aw++){if(aC[aw][0]!=null&&aC[aw][1]!=null){this.markerRenderer.draw(aC[aw][0],aC[aw][1],aq,ak.markerOptions)}}}}aq.restore()};H.jqplot.LineRenderer.prototype.drawShadow=function(ab,ad,ac){};function v(ae,ad,ab){for(var ac=0;ac<this.series.length;ac++){if(this.series[ac].renderer.constructor==H.jqplot.LineRenderer){if(this.series[ac].highlightMouseOver){this.series[ac].highlightMouseDown=false}}}}function Z(){if(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 H.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(ab){V(ab.data.plot)})}function X(ah,ag,ae,ad){var ac=ah.series[ag];var ab=ah.plugins.lineRenderer.highlightCanvas;ab._ctx.clearRect(0,0,ab._ctx.canvas.width,ab._ctx.canvas.height);ac._highlightedPoint=ae;ah.plugins.lineRenderer.highlightedSeriesIndex=ag;var af={fillStyle:ac.highlightColor};if(ac.type==="line"&&ac.renderer.bands.show){af.fill=true;af.closePath=true}ac.renderer.shapeRenderer.draw(ab._ctx,ad,af);ab=null}function V(ad){var ab=ad.plugins.lineRenderer.highlightCanvas;ab._ctx.clearRect(0,0,ab._ctx.canvas.width,ab._ctx.canvas.height);for(var ac=0;ac<ad.series.length;ac++){ad.series[ac]._highlightedPoint=null}ad.plugins.lineRenderer.highlightedSeriesIndex=null;ad.target.trigger("jqplotDataUnhighlight");ab=null}function g(af,ae,ai,ah,ag){if(ah){var ad=[ah.seriesIndex,ah.pointIndex,ah.data];var ac=jQuery.Event("jqplotDataMouseOver");ac.pageX=af.pageX;ac.pageY=af.pageY;ag.target.trigger(ac,ad);if(ag.series[ad[0]].highlightMouseOver&&!(ad[0]==ag.plugins.lineRenderer.highlightedSeriesIndex)){var ab=jQuery.Event("jqplotDataHighlight");ab.which=af.which;ab.pageX=af.pageX;ab.pageY=af.pageY;ag.target.trigger(ab,ad);X(ag,ah.seriesIndex,ah.pointIndex,ah.points)}}else{if(ah==null){V(ag)}}}function d(ae,ad,ah,ag,af){if(ag){var ac=[ag.seriesIndex,ag.pointIndex,ag.data];if(af.series[ac[0]].highlightMouseDown&&!(ac[0]==af.plugins.lineRenderer.highlightedSeriesIndex)){var ab=jQuery.Event("jqplotDataHighlight");ab.which=ae.which;ab.pageX=ae.pageX;ab.pageY=ae.pageY;af.target.trigger(ab,ac);X(af,ag.seriesIndex,ag.pointIndex,ag.points)}}else{if(ag==null){V(af)}}}function Y(ad,ac,ag,af,ae){var ab=ae.plugins.lineRenderer.highlightedSeriesIndex;if(ab!=null&&ae.series[ab].highlightMouseDown){V(ae)}}function f(ae,ad,ah,ag,af){if(ag){var ac=[ag.seriesIndex,ag.pointIndex,ag.data];var ab=jQuery.Event("jqplotDataClick");ab.which=ae.which;ab.pageX=ae.pageX;ab.pageY=ae.pageY;af.target.trigger(ab,ac)}}function p(af,ae,ai,ah,ag){if(ah){var ad=[ah.seriesIndex,ah.pointIndex,ah.data];var ab=ag.plugins.lineRenderer.highlightedSeriesIndex;if(ab!=null&&ag.series[ab].highlightMouseDown){V(ag)}var ac=jQuery.Event("jqplotDataRightClick");ac.which=af.which;ac.pageX=af.pageX;ac.pageY=af.pageY;ag.target.trigger(ac,ad)}}H.jqplot.LinearAxisRenderer=function(){};H.jqplot.LinearAxisRenderer.prototype.init=function(ab){this.breakPoints=null;this.breakTickLabel="≈";this.drawBaseline=true;this.baselineWidth=null;this.baselineColor=null;this.forceTickAt0=false;this.forceTickAt100=false;this.tickInset=0;this.minorTicks=0;this.alignTicks=false;this._autoFormatString="";this._overrideFormatString=false;this._scalefact=1;H.extend(true,this,ab);if(this.breakPoints){if(!H.isArray(this.breakPoints)){this.breakPoints=null}else{if(this.breakPoints.length<2||this.breakPoints[1]<=this.breakPoints[0]){this.breakPoints=null}}}if(this.numberTicks!=null&&this.numberTicks<2){this.numberTicks=2}this.resetDataBounds()};H.jqplot.LinearAxisRenderer.prototype.draw=function(ab,ai){if(this.show){this.renderer.createTicks.call(this,ai);var ah=0;var ac;if(this._elem){this._elem.emptyForce();this._elem=null}this._elem=H(document.createElement("div"));this._elem.addClass("jqplot-axis jqplot-"+this.name);this._elem.css("position","absolute");if(this.name=="xaxis"||this.name=="x2axis"){this._elem.width(this._plotDimensions.width)}else{this._elem.height(this._plotDimensions.height)}this.labelOptions.axis=this.name;this._label=new this.labelRenderer(this.labelOptions);if(this._label.show){var ag=this._label.draw(ab,ai);ag.appendTo(this._elem);ag=null}var af=this._ticks;var ae;for(var ad=0;ad<af.length;ad++){ae=af[ad];if(ae.show&&ae.showLabel&&(!ae.isMinorTick||this.showMinorTicks)){this._elem.append(ae.draw(ab,ai))}}ae=null;af=null}return this._elem};H.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="";if(this._overrideFormatString&&this.tickOptions&&this.tickOptions.formatString){this.tickOptions.formatString=""}};H.jqplot.LinearAxisRenderer.prototype.set=function(){var ai=0;var ad;var ac=0;var ah=0;var ab=(this._label==null)?false:this._label.show;if(this.show){var ag=this._ticks;var af;for(var ae=0;ae<ag.length;ae++){af=ag[ae];if(!af._breakTick&&af.show&&af.showLabel&&(!af.isMinorTick||this.showMinorTicks)){if(this.name=="xaxis"||this.name=="x2axis"){ad=af._elem.outerHeight(true)}else{ad=af._elem.outerWidth(true)}if(ad>ai){ai=ad}}}af=null;ag=null;if(ab){ac=this._label._elem.outerWidth(true);ah=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){ai=ai+ah;this._elem.css({height:ai+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){ai=ai+ah;this._elem.css({height:ai+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){ai=ai+ac;this._elem.css({width:ai+"px",left:"0px",top:"0px"});if(ab&&this._label.constructor==H.jqplot.AxisLabelRenderer){this._label._elem.css("width",ac+"px")}}else{ai=ai+ac;this._elem.css({width:ai+"px",right:"0px",top:"0px"});if(ab&&this._label.constructor==H.jqplot.AxisLabelRenderer){this._label._elem.css("width",ac+"px")}}}}}};H.jqplot.LinearAxisRenderer.prototype.createTicks=function(ad){var aN=this._ticks;var aE=this.ticks;var at=this.name;var av=this._dataBounds;var ab=(this.name.charAt(0)==="x")?this._plotDimensions.width:this._plotDimensions.height;var ah;var a0,aC;var aj,ai;var aY,aU;var aB=this.min;var aZ=this.max;var aQ=this.numberTicks;var a4=this.tickInterval;var ag=30;this._scalefact=(Math.max(ab,ag+1)-ag)/300;if(aE.length){for(aU=0;aU<aE.length;aU++){var aI=aE[aU];var aO=new this.tickRenderer(this.tickOptions);if(H.isArray(aI)){aO.value=aI[0];if(this.breakPoints){if(aI[0]==this.breakPoints[0]){aO.label=this.breakTickLabel;aO._breakTick=true;aO.showGridline=false;aO.showMark=false}else{if(aI[0]>this.breakPoints[0]&&aI[0]<=this.breakPoints[1]){aO.show=false;aO.showGridline=false;aO.label=aI[1]}else{aO.label=aI[1]}}}else{aO.label=aI[1]}aO.setTick(aI[0],this.name);this._ticks.push(aO)}else{if(H.isPlainObject(aI)){H.extend(true,aO,aI);aO.axis=this.name;this._ticks.push(aO)}else{aO.value=aI;if(this.breakPoints){if(aI==this.breakPoints[0]){aO.label=this.breakTickLabel;aO._breakTick=true;aO.showGridline=false;aO.showMark=false}else{if(aI>this.breakPoints[0]&&aI<=this.breakPoints[1]){aO.show=false;aO.showGridline=false}}}aO.setTick(aI,this.name);this._ticks.push(aO)}}}this.numberTicks=aE.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{if(at=="xaxis"||at=="x2axis"){ab=this._plotDimensions.width}else{ab=this._plotDimensions.height}var aq=this.numberTicks;if(this.alignTicks){if(this.name==="x2axis"&&ad.axes.xaxis.show){aq=ad.axes.xaxis.numberTicks}else{if(this.name.charAt(0)==="y"&&this.name!=="yaxis"&&this.name!=="yMidAxis"&&ad.axes.yaxis.show){aq=ad.axes.yaxis.numberTicks}}}a0=((this.min!=null)?this.min:av.min);aC=((this.max!=null)?this.max:av.max);var ao=aC-a0;var aM,ar;var am;if(this.tickOptions==null||!this.tickOptions.formatString){this._overrideFormatString=true}if(this.min==null||this.max==null&&this.tickInterval==null&&!this.autoscale){if(this.forceTickAt0){if(a0>0){a0=0}if(aC<0){aC=0}}if(this.forceTickAt100){if(a0>100){a0=100}if(aC<100){aC=100}}var ay=false,aV=false;if(this.min!=null){ay=true}else{if(this.max!=null){aV=true}}var aJ=H.jqplot.LinearTickGenerator(a0,aC,this._scalefact,aq,ay,aV);var ap=(this.min!=null)?a0:a0+ao*(this.padMin-1);var aK=(this.max!=null)?aC:aC-ao*(this.padMax-1);if(a0<ap||aC>aK){ap=(this.min!=null)?a0:a0-ao*(this.padMin-1);aK=(this.max!=null)?aC:aC+ao*(this.padMax-1);aJ=H.jqplot.LinearTickGenerator(ap,aK,this._scalefact,aq,ay,aV)}this.min=aJ[0];this.max=aJ[1];this.numberTicks=aJ[2];this._autoFormatString=aJ[3];this.tickInterval=aJ[4]}else{if(a0==aC){var ac=0.05;if(a0>0){ac=Math.max(Math.log(a0)/Math.LN10,0.05)}a0-=ac;aC+=ac}if(this.autoscale&&this.min==null&&this.max==null){var ae,af,al;var aw=false;var aH=false;var au={min:null,max:null,average:null,stddev:null};for(var aU=0;aU<this._series.length;aU++){var aP=this._series[aU];var ax=(aP.fillAxis=="x")?aP._xaxis.name:aP._yaxis.name;if(this.name==ax){var aL=aP._plotValues[aP.fillAxis];var aA=aL[0];var aW=aL[0];for(var aT=1;aT<aL.length;aT++){if(aL[aT]<aA){aA=aL[aT]}else{if(aL[aT]>aW){aW=aL[aT]}}}var an=(aW-aA)/aW;if(aP.renderer.constructor==H.jqplot.BarRenderer){if(aA>=0&&(aP.fillToZero||an>0.1)){aw=true}else{aw=false;if(aP.fill&&aP.fillToZero&&aA<0&&aW>0){aH=true}else{aH=false}}}else{if(aP.fill){if(aA>=0&&(aP.fillToZero||an>0.1)){aw=true}else{if(aA<0&&aW>0&&aP.fillToZero){aw=false;aH=true}else{aw=false;aH=false}}}else{if(aA<0){aw=false}}}}}if(aw){this.numberTicks=2+Math.ceil((ab-(this.tickSpacing-1))/this.tickSpacing);this.min=0;aB=0;af=aC/(this.numberTicks-1);am=Math.pow(10,Math.abs(Math.floor(Math.log(af)/Math.LN10)));if(af/am==parseInt(af/am,10)){af+=am}this.tickInterval=Math.ceil(af/am)*am;this.max=this.tickInterval*(this.numberTicks-1)}else{if(aH){this.numberTicks=2+Math.ceil((ab-(this.tickSpacing-1))/this.tickSpacing);var aD=Math.ceil(Math.abs(a0)/ao*(this.numberTicks-1));var a3=this.numberTicks-1-aD;af=Math.max(Math.abs(a0/aD),Math.abs(aC/a3));am=Math.pow(10,Math.abs(Math.floor(Math.log(af)/Math.LN10)));this.tickInterval=Math.ceil(af/am)*am;this.max=this.tickInterval*a3;this.min=-this.tickInterval*aD}else{if(this.numberTicks==null){if(this.tickInterval){this.numberTicks=3+Math.ceil(ao/this.tickInterval)}else{this.numberTicks=2+Math.ceil((ab-(this.tickSpacing-1))/this.tickSpacing)}}if(this.tickInterval==null){af=ao/(this.numberTicks-1);if(af<1){am=Math.pow(10,Math.abs(Math.floor(Math.log(af)/Math.LN10)))}else{am=1}this.tickInterval=Math.ceil(af*am*this.pad)/am}else{am=1/this.tickInterval}ae=this.tickInterval*(this.numberTicks-1);al=(ae-ao)/2;if(this.min==null){this.min=Math.floor(am*(a0-al))/am}if(this.max==null){this.max=this.min+ae}}}var az=H.jqplot.getSignificantFigures(this.tickInterval);var aG;if(az.digitsLeft>=az.significantDigits){aG="%d"}else{var am=Math.max(0,5-az.digitsLeft);am=Math.min(am,az.digitsRight);aG="%."+am+"f"}this._autoFormatString=aG}else{aM=(this.min!=null)?this.min:a0-ao*(this.padMin-1);ar=(this.max!=null)?this.max:aC+ao*(this.padMax-1);ao=ar-aM;if(this.numberTicks==null){if(this.tickInterval!=null){this.numberTicks=Math.ceil((ar-aM)/this.tickInterval)+1}else{if(ab>100){this.numberTicks=parseInt(3+(ab-100)/75,10)}else{this.numberTicks=2}}}if(this.tickInterval==null){this.tickInterval=ao/(this.numberTicks-1)}if(this.max==null){ar=aM+this.tickInterval*(this.numberTicks-1)}if(this.min==null){aM=ar-this.tickInterval*(this.numberTicks-1)}var az=H.jqplot.getSignificantFigures(this.tickInterval);var aG;if(az.digitsLeft>=az.significantDigits){aG="%d"}else{var am=Math.max(0,5-az.digitsLeft);am=Math.min(am,az.digitsRight);aG="%."+am+"f"}this._autoFormatString=aG;this.min=aM;this.max=ar}if(this.renderer.constructor==H.jqplot.LinearAxisRenderer&&this._autoFormatString==""){ao=this.max-this.min;var a1=new this.tickRenderer(this.tickOptions);var aF=a1.formatString||H.jqplot.config.defaultTickFormatString;var aF=aF.match(H.jqplot.sprintf.regex)[0];var aX=0;if(aF){if(aF.search(/[fFeEgGpP]/)>-1){var aS=aF.match(/\%\.(\d{0,})?[eEfFgGpP]/);if(aS){aX=parseInt(aS[1],10)}else{aX=6}}else{if(aF.search(/[di]/)>-1){aX=0}}var ak=Math.pow(10,-aX);if(this.tickInterval<ak){if(aQ==null&&a4==null){this.tickInterval=ak;if(aZ==null&&aB==null){this.min=Math.floor(this._dataBounds.min/ak)*ak;if(this.min==this._dataBounds.min){this.min=this._dataBounds.min-this.tickInterval}this.max=Math.ceil(this._dataBounds.max/ak)*ak;if(this.max==this._dataBounds.max){this.max=this._dataBounds.max+this.tickInterval}var aR=(this.max-this.min)/this.tickInterval;aR=aR.toFixed(11);aR=Math.ceil(aR);this.numberTicks=aR+1}else{if(aZ==null){var aR=(this._dataBounds.max-this.min)/this.tickInterval;aR=aR.toFixed(11);this.numberTicks=Math.ceil(aR)+2;this.max=this.min+this.tickInterval*(this.numberTicks-1)}else{if(aB==null){var aR=(this.max-this._dataBounds.min)/this.tickInterval;aR=aR.toFixed(11);this.numberTicks=Math.ceil(aR)+2;this.min=this.max-this.tickInterval*(this.numberTicks-1)}else{this.numberTicks=Math.ceil((aZ-aB)/this.tickInterval)+1;this.min=Math.floor(aB*Math.pow(10,aX))/Math.pow(10,aX);this.max=Math.ceil(aZ*Math.pow(10,aX))/Math.pow(10,aX);this.numberTicks=Math.ceil((this.max-this.min)/this.tickInterval)+1}}}}}}}}if(this._overrideFormatString&&this._autoFormatString!=""){this.tickOptions=this.tickOptions||{};this.tickOptions.formatString=this._autoFormatString}var aO,a2;for(var aU=0;aU<this.numberTicks;aU++){aY=this.min+aU*this.tickInterval;aO=new this.tickRenderer(this.tickOptions);aO.setTick(aY,this.name);this._ticks.push(aO);if(aU<this.numberTicks-1){for(var aT=0;aT<this.minorTicks;aT++){aY+=this.tickInterval/(this.minorTicks+1);a2=H.extend(true,{},this.tickOptions,{name:this.name,value:aY,label:"",isMinorTick:true});aO=new this.tickRenderer(a2);this._ticks.push(aO)}}aO=null}}if(this.tickInset){this.min=this.min-this.tickInset*this.tickInterval;this.max=this.max+this.tickInset*this.tickInterval}aN=null};H.jqplot.LinearAxisRenderer.prototype.resetTickValues=function(ad){if(H.isArray(ad)&&ad.length==this._ticks.length){var ac;for(var ab=0;ab<ad.length;ab++){ac=this._ticks[ab];ac.value=ad[ab];ac.label=ac.formatter(ac.formatString,ad[ab]);ac.label=ac.prefix+ac.label;ac._elem.html(ac.label)}ac=null;this.min=H.jqplot.arrayMin(ad);this.max=H.jqplot.arrayMax(ad);this.pack()}};H.jqplot.LinearAxisRenderer.prototype.pack=function(ad,ac){ad=ad||{};ac=ac||this._offsets;var ar=this._ticks;var an=this.max;var am=this.min;var ai=ac.max;var ag=ac.min;var ak=(this._label==null)?false:this._label.show;for(var al in ad){this._elem.css(al,ad[al])}this._offsets=ac;var ae=ai-ag;var af=an-am;if(this.breakPoints){af=af-this.breakPoints[1]+this.breakPoints[0];this.p2u=function(au){return(au-ag)*af/ae+am};this.u2p=function(au){if(au>this.breakPoints[0]&&au<this.breakPoints[1]){au=this.breakPoints[0]}if(au<=this.breakPoints[0]){return(au-am)*ae/af+ag}else{return(au-this.breakPoints[1]+this.breakPoints[0]-am)*ae/af+ag}};if(this.name.charAt(0)=="x"){this.series_u2p=function(au){if(au>this.breakPoints[0]&&au<this.breakPoints[1]){au=this.breakPoints[0]}if(au<=this.breakPoints[0]){return(au-am)*ae/af}else{return(au-this.breakPoints[1]+this.breakPoints[0]-am)*ae/af}};this.series_p2u=function(au){return au*af/ae+am}}else{this.series_u2p=function(au){if(au>this.breakPoints[0]&&au<this.breakPoints[1]){au=this.breakPoints[0]}if(au>=this.breakPoints[1]){return(au-an)*ae/af}else{return(au+this.breakPoints[1]-this.breakPoints[0]-an)*ae/af}};this.series_p2u=function(au){return au*af/ae+an}}}else{this.p2u=function(au){return(au-ag)*af/ae+am};this.u2p=function(au){return(au-am)*ae/af+ag};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(au){return(au-am)*ae/af};this.series_p2u=function(au){return au*af/ae+am}}else{this.series_u2p=function(au){return(au-an)*ae/af};this.series_p2u=function(au){return au*af/ae+an}}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(var ao=0;ao<ar.length;ao++){var aj=ar[ao];if(aj.show&&aj.showLabel){var ab;if(aj.constructor==H.jqplot.CanvasAxisTickRenderer&&aj.angle){var aq=(this.name=="xaxis")?1:-1;switch(aj.labelPosition){case"auto":if(aq*aj.angle<0){ab=-aj.getWidth()+aj._textRenderer.height*Math.sin(-aj._textRenderer.angle)/2}else{ab=-aj._textRenderer.height*Math.sin(aj._textRenderer.angle)/2}break;case"end":ab=-aj.getWidth()+aj._textRenderer.height*Math.sin(-aj._textRenderer.angle)/2;break;case"start":ab=-aj._textRenderer.height*Math.sin(aj._textRenderer.angle)/2;break;case"middle":ab=-aj.getWidth()/2+aj._textRenderer.height*Math.sin(-aj._textRenderer.angle)/2;break;default:ab=-aj.getWidth()/2+aj._textRenderer.height*Math.sin(-aj._textRenderer.angle)/2;break}}else{ab=-aj.getWidth()/2}var at=this.u2p(aj.value)+ab+"px";aj._elem.css("left",at);aj.pack()}}if(ak){var ah=this._label._elem.outerWidth(true);this._label._elem.css("left",ag+ae/2-ah/2+"px");if(this.name=="xaxis"){this._label._elem.css("bottom","0px")}else{this._label._elem.css("top","0px")}this._label.pack()}}else{for(var ao=0;ao<ar.length;ao++){var aj=ar[ao];if(aj.show&&aj.showLabel){var ab;if(aj.constructor==H.jqplot.CanvasAxisTickRenderer&&aj.angle){var aq=(this.name=="yaxis")?1:-1;switch(aj.labelPosition){case"auto":case"end":if(aq*aj.angle<0){ab=-aj._textRenderer.height*Math.cos(-aj._textRenderer.angle)/2}else{ab=-aj.getHeight()+aj._textRenderer.height*Math.cos(aj._textRenderer.angle)/2}break;case"start":if(aj.angle>0){ab=-aj._textRenderer.height*Math.cos(-aj._textRenderer.angle)/2}else{ab=-aj.getHeight()+aj._textRenderer.height*Math.cos(aj._textRenderer.angle)/2}break;case"middle":ab=-aj.getHeight()/2;break;default:ab=-aj.getHeight()/2;break}}else{ab=-aj.getHeight()/2}var at=this.u2p(aj.value)+ab+"px";aj._elem.css("top",at);aj.pack()}}if(ak){var ap=this._label._elem.outerHeight(true);this._label._elem.css("top",ai-ae/2-ap/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}ar=null};function h(ac){var ab;ac=Math.abs(ac);if(ac>=10){ab="%d"}else{if(ac>1){if(ac===parseInt(ac,10)){ab="%d"}else{ab="%.1f"}}else{var ad=-Math.floor(Math.log(ac)/Math.LN10);ab="%."+ad+"f"}}return ab}var a=[0.1,0.2,0.3,0.4,0.5,0.8,1,2,3,4,5];var b=function(ac){var ab=a.indexOf(ac);if(ab>0){return a[ab-1]}else{return a[a.length-1]/100}};var i=function(ac){var ab=a.indexOf(ac);if(ab<a.length-1){return a[ab+1]}else{return a[0]*100}};function c(af,an,am){var ak=Math.floor(am/2);var ac=Math.ceil(am*1.5);var ae=Number.MAX_VALUE;var ab=(an-af);var aq;var aj;var al;var ar=H.jqplot.getSignificantFigures;var ap;var ah;var ai;var ao;for(var ag=0,ad=ac-ak+1;ag<ad;ag++){ai=ak+ag;aq=ab/(ai-1);aj=ar(aq);aq=Math.abs(am-ai)+aj.digitsRight;if(aq<ae){ae=aq;al=ai;ao=aj.digitsRight}else{if(aq===ae){if(aj.digitsRight<ao){al=ai;ao=aj.digitsRight}}}}ap=Math.max(ao,Math.max(ar(af).digitsRight,ar(an).digitsRight));if(ap===0){ah="%d"}else{ah="%."+ap+"f"}aq=ab/(al-1);return[af,an,al,ah,aq]}function S(ac,af){af=af||7;var ae=ac/(af-1);var ad=Math.pow(10,Math.floor(Math.log(ae)/Math.LN10));var ag=ae/ad;var ab;if(ad<1){if(ag>5){ab=10*ad}else{if(ag>2){ab=5*ad}else{if(ag>1){ab=2*ad}else{ab=ad}}}}else{if(ag>5){ab=10*ad}else{if(ag>4){ab=5*ad}else{if(ag>3){ab=4*ad}else{if(ag>2){ab=3*ad}else{if(ag>1){ab=2*ad}else{ab=ad}}}}}}return ab}function M(ac,ab){ab=ab||1;var ae=Math.floor(Math.log(ac)/Math.LN10);var ag=Math.pow(10,ae);var af=ac/ag;var ad;af=af/ab;if(af<=0.38){ad=0.1}else{if(af<=1.6){ad=0.2}else{if(af<=4){ad=0.5}else{if(af<=8){ad=1}else{if(af<=16){ad=2}else{ad=5}}}}}return ad*ag}function t(ad,ac){var af=Math.floor(Math.log(ad)/Math.LN10);var ah=Math.pow(10,af);var ag=ad/ah;var ab;var ae;ag=ag/ac;if(ag<=0.38){ae=0.1}else{if(ag<=1.6){ae=0.2}else{if(ag<=4){ae=0.5}else{if(ag<=8){ae=1}else{if(ag<=16){ae=2}else{ae=5}}}}}ab=ae*ah;return[ab,ae,ah]}H.jqplot.LinearTickGenerator=function(ah,ak,ad,ae,ai,al){ai=(ai===null)?false:ai;al=(al===null||ai)?false:al;if(ah===ak){ak=(ak)?0:1}ad=ad||1;if(ak<ah){var am=ak;ak=ah;ah=am}var ac=[];var ap=M(ak-ah,ad);var ao=H.jqplot.getSignificantFigures;if(ae==null){if(!ai&&!al){ac[0]=Math.floor(ah/ap)*ap;ac[1]=Math.ceil(ak/ap)*ap;ac[2]=Math.round((ac[1]-ac[0])/ap+1);ac[3]=h(ap);ac[4]=ap}else{if(ai){ac[0]=ah;ac[2]=Math.ceil((ak-ah)/ap+1);ac[1]=ah+(ac[2]-1)*ap;var an=ao(ah).digitsRight;var aj=ao(ap).digitsRight;if(an<aj){ac[3]=h(ap)}else{ac[3]="%."+an+"f"}ac[4]=ap}else{if(al){ac[1]=ak;ac[2]=Math.ceil((ak-ah)/ap+1);ac[0]=ak-(ac[2]-1)*ap;var af=ao(ak).digitsRight;var aj=ao(ap).digitsRight;if(af<aj){ac[3]=h(ap)}else{ac[3]="%."+af+"f"}ac[4]=ap}}}}else{var ag=[];ag[0]=Math.floor(ah/ap)*ap;ag[1]=Math.ceil(ak/ap)*ap;ag[2]=Math.round((ag[1]-ag[0])/ap+1);ag[3]=h(ap);ag[4]=ap;if(ag[2]===ae){ac=ag}else{var ab=S(ag[1]-ag[0],ae);ac[0]=ag[0];ac[2]=ae;ac[4]=ab;ac[3]=h(ab);ac[1]=ac[0]+(ac[2]-1)*ac[4]}}return ac};H.jqplot.LinearTickGenerator.bestLinearInterval=M;H.jqplot.LinearTickGenerator.bestInterval=S;H.jqplot.LinearTickGenerator.bestLinearComponents=t;H.jqplot.LinearTickGenerator.bestConstrainedInterval=c;H.jqplot.MarkerRenderer=function(ab){this.show=true;this.style="filledCircle";this.lineWidth=2;this.size=9;this.color="#666666";this.shadow=true;this.shadowAngle=45;this.shadowOffset=1;this.shadowDepth=3;this.shadowAlpha="0.07";this.shadowRenderer=new H.jqplot.ShadowRenderer();this.shapeRenderer=new H.jqplot.ShapeRenderer();H.extend(true,this,ab)};H.jqplot.MarkerRenderer.prototype.init=function(ab){H.extend(true,this,ab);var ad={angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,lineWidth:this.lineWidth,depth:this.shadowDepth,closePath:true};if(this.style.indexOf("filled")!=-1){ad.fill=true}if(this.style.indexOf("ircle")!=-1){ad.isarc=true;ad.closePath=false}this.shadowRenderer.init(ad);var ac={fill:false,isarc:false,strokeStyle:this.color,fillStyle:this.color,lineWidth:this.lineWidth,closePath:true};if(this.style.indexOf("filled")!=-1){ac.fill=true}if(this.style.indexOf("ircle")!=-1){ac.isarc=true;ac.closePath=false}this.shapeRenderer.init(ac)};H.jqplot.MarkerRenderer.prototype.drawDiamond=function(ad,ac,ag,af,ai){var ab=1.2;var aj=this.size/2/ab;var ah=this.size/2*ab;var ae=[[ad-aj,ac],[ad,ac+ah],[ad+aj,ac],[ad,ac-ah]];if(this.shadow){this.shadowRenderer.draw(ag,ae)}this.shapeRenderer.draw(ag,ae,ai)};H.jqplot.MarkerRenderer.prototype.drawPlus=function(ae,ad,ah,ag,ak){var ac=1;var al=this.size/2*ac;var ai=this.size/2*ac;var aj=[[ae,ad-ai],[ae,ad+ai]];var af=[[ae+al,ad],[ae-al,ad]];var ab=H.extend(true,{},this.options,{closePath:false});if(this.shadow){this.shadowRenderer.draw(ah,aj,{closePath:false});this.shadowRenderer.draw(ah,af,{closePath:false})}this.shapeRenderer.draw(ah,aj,ab);this.shapeRenderer.draw(ah,af,ab)};H.jqplot.MarkerRenderer.prototype.drawX=function(ae,ad,ah,ag,ak){var ac=1;var al=this.size/2*ac;var ai=this.size/2*ac;var ab=H.extend(true,{},this.options,{closePath:false});var aj=[[ae-al,ad-ai],[ae+al,ad+ai]];var af=[[ae-al,ad+ai],[ae+al,ad-ai]];if(this.shadow){this.shadowRenderer.draw(ah,aj,{closePath:false});this.shadowRenderer.draw(ah,af,{closePath:false})}this.shapeRenderer.draw(ah,aj,ab);this.shapeRenderer.draw(ah,af,ab)};H.jqplot.MarkerRenderer.prototype.drawDash=function(ad,ac,ag,af,ai){var ab=1;var aj=this.size/2*ab;var ah=this.size/2*ab;var ae=[[ad-aj,ac],[ad+aj,ac]];if(this.shadow){this.shadowRenderer.draw(ag,ae)}this.shapeRenderer.draw(ag,ae,ai)};H.jqplot.MarkerRenderer.prototype.drawLine=function(ag,af,ab,ae,ac){var ad=[ag,af];if(this.shadow){this.shadowRenderer.draw(ab,ad)}this.shapeRenderer.draw(ab,ad,ac)};H.jqplot.MarkerRenderer.prototype.drawSquare=function(ad,ac,ag,af,ai){var ab=1;var aj=this.size/2/ab;var ah=this.size/2*ab;var ae=[[ad-aj,ac-ah],[ad-aj,ac+ah],[ad+aj,ac+ah],[ad+aj,ac-ah]];if(this.shadow){this.shadowRenderer.draw(ag,ae)}this.shapeRenderer.draw(ag,ae,ai)};H.jqplot.MarkerRenderer.prototype.drawCircle=function(ac,ai,ae,ah,af){var ab=this.size/2;var ad=2*Math.PI;var ag=[ac,ai,ab,0,ad,true];if(this.shadow){this.shadowRenderer.draw(ae,ag)}this.shapeRenderer.draw(ae,ag,af)};H.jqplot.MarkerRenderer.prototype.draw=function(ab,ae,ac,ad){ad=ad||{};if(ad.show==null||ad.show!=false){if(ad.color&&!ad.fillStyle){ad.fillStyle=ad.color}if(ad.color&&!ad.strokeStyle){ad.strokeStyle=ad.color}switch(this.style){case"diamond":this.drawDiamond(ab,ae,ac,false,ad);break;case"filledDiamond":this.drawDiamond(ab,ae,ac,true,ad);break;case"circle":this.drawCircle(ab,ae,ac,false,ad);break;case"filledCircle":this.drawCircle(ab,ae,ac,true,ad);break;case"square":this.drawSquare(ab,ae,ac,false,ad);break;case"filledSquare":this.drawSquare(ab,ae,ac,true,ad);break;case"x":this.drawX(ab,ae,ac,true,ad);break;case"plus":this.drawPlus(ab,ae,ac,true,ad);break;case"dash":this.drawDash(ab,ae,ac,true,ad);break;case"line":this.drawLine(ab,ae,ac,false,ad);break;default:this.drawDiamond(ab,ae,ac,false,ad);break}}};H.jqplot.ShadowRenderer=function(ab){this.angle=45;this.offset=1;this.alpha=0.07;this.lineWidth=1.5;this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.depth=3;this.strokeStyle="rgba(0,0,0,0.1)";this.isarc=false;H.extend(true,this,ab)};H.jqplot.ShadowRenderer.prototype.init=function(ab){H.extend(true,this,ab)};H.jqplot.ShadowRenderer.prototype.draw=function(ao,am,aq){ao.save();var ab=(aq!=null)?aq:{};var an=(ab.fill!=null)?ab.fill:this.fill;var aj=(ab.fillRect!=null)?ab.fillRect:this.fillRect;var ai=(ab.closePath!=null)?ab.closePath:this.closePath;var af=(ab.offset!=null)?ab.offset:this.offset;var ad=(ab.alpha!=null)?ab.alpha:this.alpha;var ah=(ab.depth!=null)?ab.depth:this.depth;var ap=(ab.isarc!=null)?ab.isarc:this.isarc;var ak=(ab.linePattern!=null)?ab.linePattern:this.linePattern;ao.lineWidth=(ab.lineWidth!=null)?ab.lineWidth:this.lineWidth;ao.lineJoin=(ab.lineJoin!=null)?ab.lineJoin:this.lineJoin;ao.lineCap=(ab.lineCap!=null)?ab.lineCap:this.lineCap;ao.strokeStyle=ab.strokeStyle||this.strokeStyle||"rgba(0,0,0,"+ad+")";ao.fillStyle=ab.fillStyle||this.fillStyle||"rgba(0,0,0,"+ad+")";for(var ae=0;ae<ah;ae++){var al=H.jqplot.LinePattern(ao,ak);ao.translate(Math.cos(this.angle*Math.PI/180)*af,Math.sin(this.angle*Math.PI/180)*af);al.beginPath();if(ap){ao.arc(am[0],am[1],am[2],am[3],am[4],true)}else{if(aj){if(aj){ao.fillRect(am[0],am[1],am[2],am[3])}}else{if(am&&am.length){var ac=true;for(var ag=0;ag<am.length;ag++){if(am[ag][0]!=null&&am[ag][1]!=null){if(ac){al.moveTo(am[ag][0],am[ag][1]);ac=false}else{al.lineTo(am[ag][0],am[ag][1])}}else{ac=true}}}}}if(ai){al.closePath()}if(an){ao.fill()}else{ao.stroke()}}ao.restore()};H.jqplot.ShapeRenderer=function(ab){this.lineWidth=1.5;this.linePattern="solid";this.lineJoin="miter";this.lineCap="round";this.closePath=false;this.fill=false;this.isarc=false;this.fillRect=false;this.strokeRect=false;this.clearRect=false;this.strokeStyle="#999999";this.fillStyle="#999999";H.extend(true,this,ab)};H.jqplot.ShapeRenderer.prototype.init=function(ab){H.extend(true,this,ab)};H.jqplot.ShapeRenderer.prototype.draw=function(am,ak,ao){am.save();var ab=(ao!=null)?ao:{};var al=(ab.fill!=null)?ab.fill:this.fill;var ag=(ab.closePath!=null)?ab.closePath:this.closePath;var ah=(ab.fillRect!=null)?ab.fillRect:this.fillRect;var ae=(ab.strokeRect!=null)?ab.strokeRect:this.strokeRect;var ac=(ab.clearRect!=null)?ab.clearRect:this.clearRect;var an=(ab.isarc!=null)?ab.isarc:this.isarc;var ai=(ab.linePattern!=null)?ab.linePattern:this.linePattern;var aj=H.jqplot.LinePattern(am,ai);am.lineWidth=ab.lineWidth||this.lineWidth;am.lineJoin=ab.lineJoin||this.lineJoin;am.lineCap=ab.lineCap||this.lineCap;am.strokeStyle=(ab.strokeStyle||ab.color)||this.strokeStyle;am.fillStyle=ab.fillStyle||this.fillStyle;am.beginPath();if(an){am.arc(ak[0],ak[1],ak[2],ak[3],ak[4],true);if(ag){am.closePath()}if(al){am.fill()}else{am.stroke()}am.restore();return}else{if(ac){am.clearRect(ak[0],ak[1],ak[2],ak[3]);am.restore();return}else{if(ah||ae){if(ah){am.fillRect(ak[0],ak[1],ak[2],ak[3])}if(ae){am.strokeRect(ak[0],ak[1],ak[2],ak[3]);am.restore();return}}else{if(ak&&ak.length){var ad=true;for(var af=0;af<ak.length;af++){if(ak[af][0]!=null&&ak[af][1]!=null){if(ad){aj.moveTo(ak[af][0],ak[af][1]);ad=false}else{aj.lineTo(ak[af][0],ak[af][1])}}else{ad=true}}if(ag){aj.closePath()}if(al){am.fill()}else{am.stroke()}}}}}am.restore()};H.jqplot.TableLegendRenderer=function(){};H.jqplot.TableLegendRenderer.prototype.init=function(ab){H.extend(true,this,ab)};H.jqplot.TableLegendRenderer.prototype.addrow=function(ak,ae,ab,ai){var af=(ab)?this.rowSpacing+"px":"0px";var aj;var ad;var ac;var ah;var ag;ac=document.createElement("tr");aj=H(ac);aj.addClass("jqplot-table-legend");ac=null;if(ai){aj.prependTo(this._elem)}else{aj.appendTo(this._elem)}if(this.showSwatches){ad=H(document.createElement("td"));ad.addClass("jqplot-table-legend jqplot-table-legend-swatch");ad.css({textAlign:"center",paddingTop:af});ah=H(document.createElement("div"));ah.addClass("jqplot-table-legend-swatch-outline");ag=H(document.createElement("div"));ag.addClass("jqplot-table-legend-swatch");ag.css({backgroundColor:ae,borderColor:ae});aj.append(ad.append(ah.append(ag)))}if(this.showLabels){ad=H(document.createElement("td"));ad.addClass("jqplot-table-legend jqplot-table-legend-label");ad.css("paddingTop",af);aj.append(ad);if(this.escapeHtml){ad.text(ak)}else{ad.html(ak)}}ad=null;ah=null;ag=null;aj=null;ac=null};H.jqplot.TableLegendRenderer.prototype.draw=function(){if(this._elem){this._elem.emptyForce();this._elem=null}if(this.show){var ag=this._series;var ac=document.createElement("table");this._elem=H(ac);this._elem.addClass("jqplot-table-legend");var al={position:"absolute"};if(this.background){al.background=this.background}if(this.border){al.border=this.border}if(this.fontSize){al.fontSize=this.fontSize}if(this.fontFamily){al.fontFamily=this.fontFamily}if(this.textColor){al.textColor=this.textColor}if(this.marginTop!=null){al.marginTop=this.marginTop}if(this.marginBottom!=null){al.marginBottom=this.marginBottom}if(this.marginLeft!=null){al.marginLeft=this.marginLeft}if(this.marginRight!=null){al.marginRight=this.marginRight}var ab=false,ai=false,ak;for(var ah=0;ah<ag.length;ah++){ak=ag[ah];if(ak._stack||ak.renderer.constructor==H.jqplot.BezierCurveRenderer){ai=true}if(ak.show&&ak.showLabel){var af=this.labels[ah]||ak.label.toString();if(af){var ad=ak.color;if(ai&&ah<ag.length-1){ab=true}else{if(ai&&ah==ag.length-1){ab=false}}this.renderer.addrow.call(this,af,ad,ab,ai);ab=true}for(var ae=0;ae<H.jqplot.addLegendRowHooks.length;ae++){var aj=H.jqplot.addLegendRowHooks[ae].call(this,ak);if(aj){this.renderer.addrow.call(this,aj.label,aj.color,ab);ab=true}}af=null}}}return this._elem};H.jqplot.TableLegendRenderer.prototype.pack=function(ad){if(this.show){if(this.placement=="insideGrid"){switch(this.location){case"nw":var ac=ad.left;var ab=ad.top;this._elem.css("left",ac);this._elem.css("top",ab);break;case"n":var ac=(ad.left+(this._plotDimensions.width-ad.right))/2-this.getWidth()/2;var ab=ad.top;this._elem.css("left",ac);this._elem.css("top",ab);break;case"ne":var ac=ad.right;var ab=ad.top;this._elem.css({right:ac,top:ab});break;case"e":var ac=ad.right;var ab=(ad.top+(this._plotDimensions.height-ad.bottom))/2-this.getHeight()/2;this._elem.css({right:ac,top:ab});break;case"se":var ac=ad.right;var ab=ad.bottom;this._elem.css({right:ac,bottom:ab});break;case"s":var ac=(ad.left+(this._plotDimensions.width-ad.right))/2-this.getWidth()/2;var ab=ad.bottom;this._elem.css({left:ac,bottom:ab});break;case"sw":var ac=ad.left;var ab=ad.bottom;this._elem.css({left:ac,bottom:ab});break;case"w":var ac=ad.left;var ab=(ad.top+(this._plotDimensions.height-ad.bottom))/2-this.getHeight()/2;this._elem.css({left:ac,top:ab});break;default:var ac=ad.right;var ab=ad.bottom;this._elem.css({right:ac,bottom:ab});break}}else{if(this.placement=="outside"){switch(this.location){case"nw":var ac=this._plotDimensions.width-ad.left;var ab=ad.top;this._elem.css("right",ac);this._elem.css("top",ab);break;case"n":var ac=(ad.left+(this._plotDimensions.width-ad.right))/2-this.getWidth()/2;var ab=this._plotDimensions.height-ad.top;this._elem.css("left",ac);this._elem.css("bottom",ab);break;case"ne":var ac=this._plotDimensions.width-ad.right;var ab=ad.top;this._elem.css({left:ac,top:ab});break;case"e":var ac=this._plotDimensions.width-ad.right;var ab=(ad.top+(this._plotDimensions.height-ad.bottom))/2-this.getHeight()/2;this._elem.css({left:ac,top:ab});break;case"se":var ac=this._plotDimensions.width-ad.right;var ab=ad.bottom;this._elem.css({left:ac,bottom:ab});break;case"s":var ac=(ad.left+(this._plotDimensions.width-ad.right))/2-this.getWidth()/2;var ab=this._plotDimensions.height-ad.bottom;this._elem.css({left:ac,top:ab});break;case"sw":var ac=this._plotDimensions.width-ad.left;var ab=ad.bottom;this._elem.css({right:ac,bottom:ab});break;case"w":var ac=this._plotDimensions.width-ad.left;var ab=(ad.top+(this._plotDimensions.height-ad.bottom))/2-this.getHeight()/2;this._elem.css({right:ac,top:ab});break;default:var ac=ad.right;var ab=ad.bottom;this._elem.css({right:ac,bottom:ab});break}}else{switch(this.location){case"nw":this._elem.css({left:0,top:ad.top});break;case"n":var ac=(ad.left+(this._plotDimensions.width-ad.right))/2-this.getWidth()/2;this._elem.css({left:ac,top:ad.top});break;case"ne":this._elem.css({right:0,top:ad.top});break;case"e":var ab=(ad.top+(this._plotDimensions.height-ad.bottom))/2-this.getHeight()/2;this._elem.css({right:ad.right,top:ab});break;case"se":this._elem.css({right:ad.right,bottom:ad.bottom});break;case"s":var ac=(ad.left+(this._plotDimensions.width-ad.right))/2-this.getWidth()/2;this._elem.css({left:ac,bottom:ad.bottom});break;case"sw":this._elem.css({left:ad.left,bottom:ad.bottom});break;case"w":var ab=(ad.top+(this._plotDimensions.height-ad.bottom))/2-this.getHeight()/2;this._elem.css({left:ad.left,top:ab});break;default:this._elem.css({right:ad.right,bottom:ad.bottom});break}}}}};H.jqplot.ThemeEngine=function(){this.themes={};this.activeTheme=null};H.jqplot.ThemeEngine.prototype.init=function(){var ae=new H.jqplot.Theme({_name:"Default"});var ah,ac,ag;for(ah in ae.target){if(ah=="textColor"){ae.target[ah]=this.target.css("color")}else{ae.target[ah]=this.target.css(ah)}}if(this.title.show&&this.title._elem){for(ah in ae.title){if(ah=="textColor"){ae.title[ah]=this.title._elem.css("color")}else{ae.title[ah]=this.title._elem.css(ah)}}}for(ah in ae.grid){ae.grid[ah]=this.grid[ah]}if(ae.grid.backgroundColor==null&&this.grid.background!=null){ae.grid.backgroundColor=this.grid.background}if(this.legend.show&&this.legend._elem){for(ah in ae.legend){if(ah=="textColor"){ae.legend[ah]=this.legend._elem.css("color")}else{ae.legend[ah]=this.legend._elem.css(ah)}}}var ad;for(ac=0;ac<this.series.length;ac++){ad=this.series[ac];if(ad.renderer.constructor==H.jqplot.LineRenderer){ae.series.push(new m())}else{if(ad.renderer.constructor==H.jqplot.BarRenderer){ae.series.push(new P())}else{if(ad.renderer.constructor==H.jqplot.PieRenderer){ae.series.push(new e())}else{if(ad.renderer.constructor==H.jqplot.DonutRenderer){ae.series.push(new C())}else{if(ad.renderer.constructor==H.jqplot.FunnelRenderer){ae.series.push(new U())}else{if(ad.renderer.constructor==H.jqplot.MeterGaugeRenderer){ae.series.push(new z())}else{ae.series.push({})}}}}}}for(ah in ae.series[ac]){ae.series[ac][ah]=ad[ah]}}var ab,af;for(ah in this.axes){af=this.axes[ah];ab=ae.axes[ah]=new L();ab.borderColor=af.borderColor;ab.borderWidth=af.borderWidth;if(af._ticks&&af._ticks[0]){for(ag in ab.ticks){if(af._ticks[0].hasOwnProperty(ag)){ab.ticks[ag]=af._ticks[0][ag]}else{if(af._ticks[0]._elem){ab.ticks[ag]=af._ticks[0]._elem.css(ag)}}}}if(af._label&&af._label.show){for(ag in ab.label){if(af._label[ag]){ab.label[ag]=af._label[ag]}else{if(af._label._elem){if(ag=="textColor"){ab.label[ag]=af._label._elem.css("color")}else{ab.label[ag]=af._label._elem.css(ag)}}}}}}this.themeEngine._add(ae);this.themeEngine.activeTheme=this.themeEngine.themes[ae._name]};H.jqplot.ThemeEngine.prototype.get=function(ab){if(!ab){return this.activeTheme}else{return this.themes[ab]}};function K(ac,ab){return ac-ab}H.jqplot.ThemeEngine.prototype.getThemeNames=function(){var ab=[];for(var ac in this.themes){ab.push(ac)}return ab.sort(K)};H.jqplot.ThemeEngine.prototype.getThemes=function(){var ac=[];var ab=[];for(var ae in this.themes){ac.push(ae)}ac.sort(K);for(var ad=0;ad<ac.length;ad++){ab.push(this.themes[ac[ad]])}return ab};H.jqplot.ThemeEngine.prototype.activate=function(ao,au){var ab=false;if(!au&&this.activeTheme&&this.activeTheme._name){au=this.activeTheme._name}if(!this.themes.hasOwnProperty(au)){throw new Error("No theme of that name")}else{var ag=this.themes[au];this.activeTheme=ag;var at,am=false,al=false;var ac=["xaxis","x2axis","yaxis","y2axis"];for(ap=0;ap<ac.length;ap++){var ah=ac[ap];if(ag.axesStyles.borderColor!=null){ao.axes[ah].borderColor=ag.axesStyles.borderColor}if(ag.axesStyles.borderWidth!=null){ao.axes[ah].borderWidth=ag.axesStyles.borderWidth}}for(var ar in ao.axes){var ae=ao.axes[ar];if(ae.show){var ak=ag.axes[ar]||{};var ai=ag.axesStyles;var af=H.jqplot.extend(true,{},ak,ai);at=(ag.axesStyles.borderColor!=null)?ag.axesStyles.borderColor:af.borderColor;if(af.borderColor!=null){ae.borderColor=af.borderColor;ab=true}at=(ag.axesStyles.borderWidth!=null)?ag.axesStyles.borderWidth:af.borderWidth;if(af.borderWidth!=null){ae.borderWidth=af.borderWidth;ab=true}if(ae._ticks&&ae._ticks[0]){for(var ad in af.ticks){at=af.ticks[ad];if(at!=null){ae.tickOptions[ad]=at;ae._ticks=[];ab=true}}}if(ae._label&&ae._label.show){for(var ad in af.label){at=af.label[ad];if(at!=null){ae.labelOptions[ad]=at;ab=true}}}}}for(var an in ag.grid){if(ag.grid[an]!=null){ao.grid[an]=ag.grid[an]}}if(!ab){ao.grid.draw()}if(ao.legend.show){for(an in ag.legend){if(ag.legend[an]!=null){ao.legend[an]=ag.legend[an]}}}if(ao.title.show){for(an in ag.title){if(ag.title[an]!=null){ao.title[an]=ag.title[an]}}}var ap;for(ap=0;ap<ag.series.length;ap++){var aj={};var aq=false;for(an in ag.series[ap]){at=(ag.seriesStyles[an]!=null)?ag.seriesStyles[an]:ag.series[ap][an];if(at!=null){aj[an]=at;if(an=="color"){ao.series[ap].renderer.shapeRenderer.fillStyle=at;ao.series[ap].renderer.shapeRenderer.strokeStyle=at;ao.series[ap][an]=at}else{if((an=="lineWidth")||(an=="linePattern")){ao.series[ap].renderer.shapeRenderer[an]=at;ao.series[ap][an]=at}else{if(an=="markerOptions"){R(ao.series[ap].markerOptions,at);R(ao.series[ap].markerRenderer,at)}else{ao.series[ap][an]=at}}}ab=true}}}if(ab){ao.target.empty();ao.draw()}for(an in ag.target){if(ag.target[an]!=null){ao.target.css(an,ag.target[an])}}}};H.jqplot.ThemeEngine.prototype._add=function(ac,ab){if(ab){ac._name=ab}if(!ac._name){ac._name=Date.parse(new Date())}if(!this.themes.hasOwnProperty(ac._name)){this.themes[ac._name]=ac}else{throw new Error("jqplot.ThemeEngine Error: Theme already in use")}};H.jqplot.ThemeEngine.prototype.remove=function(ab){if(ab=="Default"){return false}return delete this.themes[ab]};H.jqplot.ThemeEngine.prototype.newTheme=function(ab,ad){if(typeof(ab)=="object"){ad=ad||ab;ab=null}if(ad&&ad._name){ab=ad._name}else{ab=ab||Date.parse(new Date())}var ac=this.copy(this.themes.Default._name,ab);H.jqplot.extend(ac,ad);return ac};function x(ad){if(ad==null||typeof(ad)!="object"){return ad}var ab=new ad.constructor();for(var ac in ad){ab[ac]=x(ad[ac])}return ab}H.jqplot.clone=x;function R(ad,ac){if(ac==null||typeof(ac)!="object"){return}for(var ab in ac){if(ab=="highlightColors"){ad[ab]=x(ac[ab])}if(ac[ab]!=null&&typeof(ac[ab])=="object"){if(!ad.hasOwnProperty(ab)){ad[ab]={}}R(ad[ab],ac[ab])}else{ad[ab]=ac[ab]}}}H.jqplot.merge=R;H.jqplot.extend=function(){var ag=arguments[0]||{},ae=1,af=arguments.length,ab=false,ad;if(typeof ag==="boolean"){ab=ag;ag=arguments[1]||{};ae=2}if(typeof ag!=="object"&&!toString.call(ag)==="[object Function]"){ag={}}for(;ae<af;ae++){if((ad=arguments[ae])!=null){for(var ac in ad){var ah=ag[ac],ai=ad[ac];if(ag===ai){continue}if(ab&&ai&&typeof ai==="object"&&!ai.nodeType){ag[ac]=H.jqplot.extend(ab,ah||(ai.length!=null?[]:{}),ai)}else{if(ai!==r){ag[ac]=ai}}}}}return ag};H.jqplot.ThemeEngine.prototype.rename=function(ac,ab){if(ac=="Default"||ab=="Default"){throw new Error("jqplot.ThemeEngine Error: Cannot rename from/to Default")}if(this.themes.hasOwnProperty(ab)){throw new Error("jqplot.ThemeEngine Error: New name already in use.")}else{if(this.themes.hasOwnProperty(ac)){var ad=this.copy(ac,ab);this.remove(ac);return ad}}throw new Error("jqplot.ThemeEngine Error: Old name or new name invalid")};H.jqplot.ThemeEngine.prototype.copy=function(ab,ad,af){if(ad=="Default"){throw new Error("jqplot.ThemeEngine Error: Cannot copy over Default theme")}if(!this.themes.hasOwnProperty(ab)){var ac="jqplot.ThemeEngine Error: Source name invalid";throw new Error(ac)}if(this.themes.hasOwnProperty(ad)){var ac="jqplot.ThemeEngine Error: Target name invalid";throw new Error(ac)}else{var ae=x(this.themes[ab]);ae._name=ad;H.jqplot.extend(true,ae,af);this._add(ae);return ae}};H.jqplot.Theme=function(ab,ac){if(typeof(ab)=="object"){ac=ac||ab;ab=null}ab=ab||Date.parse(new Date());this._name=ab;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={};if(typeof(ac)=="string"){this._name=ac}else{if(typeof(ac)=="object"){H.jqplot.extend(true,this,ac)}}};var L=function(){this.borderColor=null;this.borderWidth=null;this.ticks=new l();this.label=new q()};var l=function(){this.show=null;this.showGridline=null;this.showLabel=null;this.showMark=null;this.size=null;this.textColor=null;this.whiteSpace=null;this.fontSize=null;this.fontFamily=null};var q=function(){this.textColor=null;this.whiteSpace=null;this.fontSize=null;this.fontFamily=null;this.fontWeight=null};var m=function(){this.color=null;this.lineWidth=null;this.linePattern=null;this.shadow=null;this.fillColor=null;this.showMarker=null;this.markerOptions=new E()};var E=function(){this.show=null;this.style=null;this.lineWidth=null;this.size=null;this.color=null;this.shadow=null};var P=function(){this.color=null;this.seriesColors=null;this.lineWidth=null;this.shadow=null;this.barPadding=null;this.barMargin=null;this.barWidth=null;this.highlightColors=null};var e=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};var C=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};var U=function(){this.color=null;this.lineWidth=null;this.shadow=null;this.padding=null;this.sectionMargin=null;this.seriesColors=null;this.highlightColors=null};var z=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};H.fn.jqplotChildText=function(){return H(this).contents().filter(function(){return this.nodeType==3}).text()};H.fn.jqplotGetComputedFontStyle=function(){var ae=window.getComputedStyle?window.getComputedStyle(this[0],""):this[0].currentStyle;var ac=ae["font-style"]?["font-style","font-weight","font-size","font-family"]:["fontStyle","fontWeight","fontSize","fontFamily"];var af=[];for(var ad=0;ad<ac.length;++ad){var ab=String(ae[ac[ad]]);if(ab&&ab!="normal"){af.push(ab)}}return af.join(" ")};H.fn.jqplotToImageCanvas=function(ad){ad=ad||{};var ao=(ad.x_offset==null)?0:ad.x_offset;var aq=(ad.y_offset==null)?0:ad.y_offset;var af=(ad.backgroundColor==null)?"rgb(255,255,255)":ad.backgroundColor;if(H(this).width()==0||H(this).height()==0){return null}if(H.jqplot.use_excanvas){return null}var ah=document.createElement("canvas");var au=H(this).outerHeight(true);var am=H(this).outerWidth(true);var ag=H(this).offset();var ai=ag.left;var ak=ag.top;var an=0,al=0;var ar=["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"];var aj,ab,ac,av;for(var at=0;at<ar.length;at++){H(this).find("."+ar[at]).each(function(){aj=H(this).offset().top-ak;ab=H(this).offset().left-ai;av=ab+H(this).outerWidth(true)+an;ac=aj+H(this).outerHeight(true)+al;if(ab<-an){am=am-an-ab;an=-ab}if(aj<-al){au=au-al-aj;al=-aj}if(av>am){am=av}if(ac>au){au=ac}})}ah.width=am+Number(ao);ah.height=au+Number(aq);var ae=ah.getContext("2d");ae.save();ae.fillStyle=af;ae.fillRect(0,0,ah.width,ah.height);ae.restore();ae.translate(an,al);ae.textAlign="left";ae.textBaseline="top";function aw(ay){var az=parseInt(H(ay).css("line-height"),10);if(isNaN(az)){az=parseInt(H(ay).css("font-size"),10)*1.2}return az}function ax(az,ay,aM,aA,aI,aB){var aK=aw(az);var aE=H(az).innerWidth();var aF=H(az).innerHeight();var aH=aM.split(/\s+/);var aL=aH.length;var aJ="";var aG=[];var aO=aI;var aN=aA;for(var aD=0;aD<aL;aD++){aJ+=aH[aD];if(ay.measureText(aJ).width>aE){aG.push(aD);aJ="";aD--}}if(aG.length===0){if(H(az).css("textAlign")==="center"){aN=aA+(aB-ay.measureText(aJ).width)/2-an}ay.fillText(aM,aN,aI)}else{aJ=aH.slice(0,aG[0]).join(" ");if(H(az).css("textAlign")==="center"){aN=aA+(aB-ay.measureText(aJ).width)/2-an}ay.fillText(aJ,aN,aO);aO+=aK;for(var aD=1,aC=aG.length;aD<aC;aD++){aJ=aH.slice(aG[aD-1],aG[aD]).join(" ");if(H(az).css("textAlign")==="center"){aN=aA+(aB-ay.measureText(aJ).width)/2-an}ay.fillText(aJ,aN,aO);aO+=aK}aJ=aH.slice(aG[aD-1],aH.length).join(" ");if(H(az).css("textAlign")==="center"){aN=aA+(aB-ay.measureText(aJ).width)/2-an}ay.fillText(aJ,aN,aO)}}function ap(aA,aD,ay){var aH=aA.tagName.toLowerCase();var az=H(aA).position();var aE=window.getComputedStyle?window.getComputedStyle(aA,""):aA.currentStyle;var aC=aD+az.left+parseInt(aE.marginLeft,10)+parseInt(aE.borderLeftWidth,10)+parseInt(aE.paddingLeft,10);var aF=ay+az.top+parseInt(aE.marginTop,10)+parseInt(aE.borderTopWidth,10)+parseInt(aE.paddingTop,10);var aG=ah.width;if((aH=="div"||aH=="span")&&!H(aA).hasClass("jqplot-highlighter-tooltip")){H(aA).children().each(function(){ap(this,aC,aF)});var aI=H(aA).jqplotChildText();if(aI){ae.font=H(aA).jqplotGetComputedFontStyle();ae.fillStyle=H(aA).css("color");ax(aA,ae,aI,aC,aF,aG)}}else{if(aH==="table"&&H(aA).hasClass("jqplot-table-legend")){ae.strokeStyle=H(aA).css("border-top-color");ae.fillStyle=H(aA).css("background-color");ae.fillRect(aC,aF,H(aA).innerWidth(),H(aA).innerHeight());if(parseInt(H(aA).css("border-top-width"),10)>0){ae.strokeRect(aC,aF,H(aA).innerWidth(),H(aA).innerHeight())}H(aA).find("div.jqplot-table-legend-swatch-outline").each(function(){var aO=H(this);ae.strokeStyle=aO.css("border-top-color");var aK=aC+aO.position().left;var aL=aF+aO.position().top;ae.strokeRect(aK,aL,aO.innerWidth(),aO.innerHeight());aK+=parseInt(aO.css("padding-left"),10);aL+=parseInt(aO.css("padding-top"),10);var aN=aO.innerHeight()-2*parseInt(aO.css("padding-top"),10);var aJ=aO.innerWidth()-2*parseInt(aO.css("padding-left"),10);var aM=aO.children("div.jqplot-table-legend-swatch");ae.fillStyle=aM.css("background-color");ae.fillRect(aK,aL,aJ,aN)});H(aA).find("td.jqplot-table-legend-label").each(function(){var aL=H(this);var aJ=aC+aL.position().left;var aK=aF+aL.position().top+parseInt(aL.css("padding-top"),10);ae.font=aL.jqplotGetComputedFontStyle();ae.fillStyle=aL.css("color");ax(aL,ae,aL.text(),aJ,aK,aG)});var aB=null}else{if(aH=="canvas"){ae.drawImage(aA,aC,aF)}}}}H(this).children().each(function(){ap(this,ao,aq)});return ah};H.fn.jqplotToImageStr=function(ac){var ab=H(this).jqplotToImageCanvas(ac);if(ab){return ab.toDataURL("image/png")}else{return null}};H.fn.jqplotToImageElem=function(ab){var ac=document.createElement("img");var ad=H(this).jqplotToImageStr(ab);ac.src=ad;return ac};H.fn.jqplotToImageElemStr=function(ab){var ac="<img src="+H(this).jqplotToImageStr(ab)+" />";return ac};H.fn.jqplotSaveImage=function(){var ab=H(this).jqplotToImageStr({});if(ab){window.location.href=ab.replace("image/png","image/octet-stream")}};H.fn.jqplotViewImage=function(){var ac=H(this).jqplotToImageElemStr({});var ad=H(this).jqplotToImageStr({});if(ac){var ab=window.open("");ab.document.open("image/png");ab.document.write(ac);ab.document.close();ab=null}};var aa=function(){this.syntax=aa.config.syntax;this._type="jsDate";this.proxy=new Date();this.options={};this.locale=aa.regional.getLocale();this.formatString="";this.defaultCentury=aa.config.defaultCentury;switch(arguments.length){case 0:break;case 1:if(j(arguments[0])=="[object Object]"&&arguments[0]._type!="jsDate"){var ad=this.options=arguments[0];this.syntax=ad.syntax||this.syntax;this.defaultCentury=ad.defaultCentury||this.defaultCentury;this.proxy=aa.createDate(ad.date)}else{this.proxy=aa.createDate(arguments[0])}break;default:var ab=[];for(var ac=0;ac<arguments.length;ac++){ab.push(arguments[ac])}this.proxy=new Date();this.proxy.setFullYear.apply(this.proxy,ab.slice(0,3));if(ab.slice(3).length){this.proxy.setHours.apply(this.proxy,ab.slice(3))}break}};aa.config={defaultLocale:"en",syntax:"perl",defaultCentury:1900};aa.prototype.add=function(ad,ac){var ab=A[ac]||A.day;if(typeof ab=="number"){this.proxy.setTime(this.proxy.getTime()+(ab*ad))}else{ab.add(this,ad)}return this};aa.prototype.clone=function(){return new aa(this.proxy.getTime())};aa.prototype.getUtcOffset=function(){return this.proxy.getTimezoneOffset()*60000};aa.prototype.diff=function(ac,af,ab){ac=new aa(ac);if(ac===null){return null}var ad=A[af]||A.day;if(typeof ad=="number"){var ae=(this.proxy.getTime()-ac.proxy.getTime())/ad}else{var ae=ad.diff(this.proxy,ac.proxy)}return(ab?ae:Math[ae>0?"floor":"ceil"](ae))};aa.prototype.getAbbrDayName=function(){return aa.regional[this.locale]["dayNamesShort"][this.proxy.getDay()]};aa.prototype.getAbbrMonthName=function(){return aa.regional[this.locale]["monthNamesShort"][this.proxy.getMonth()]};aa.prototype.getAMPM=function(){return this.proxy.getHours()>=12?"PM":"AM"};aa.prototype.getAmPm=function(){return this.proxy.getHours()>=12?"pm":"am"};aa.prototype.getCentury=function(){return parseInt(this.proxy.getFullYear()/100,10)};aa.prototype.getDate=function(){return this.proxy.getDate()};aa.prototype.getDay=function(){return this.proxy.getDay()};aa.prototype.getDayOfWeek=function(){var ab=this.proxy.getDay();return ab===0?7:ab};aa.prototype.getDayOfYear=function(){var ac=this.proxy;var ab=ac-new Date(""+ac.getFullYear()+"/1/1 GMT");ab+=ac.getTimezoneOffset()*60000;ac=null;return parseInt(ab/60000/60/24,10)+1};aa.prototype.getDayName=function(){return aa.regional[this.locale]["dayNames"][this.proxy.getDay()]};aa.prototype.getFullWeekOfYear=function(){var ae=this.proxy;var ab=this.getDayOfYear();var ad=6-ae.getDay();var ac=parseInt((ab+ad)/7,10);return ac};aa.prototype.getFullYear=function(){return this.proxy.getFullYear()};aa.prototype.getGmtOffset=function(){var ab=this.proxy.getTimezoneOffset()/60;var ac=ab<0?"+":"-";ab=Math.abs(ab);return ac+J(Math.floor(ab),2)+":"+J((ab%1)*60,2)};aa.prototype.getHours=function(){return this.proxy.getHours()};aa.prototype.getHours12=function(){var ab=this.proxy.getHours();return ab>12?ab-12:(ab==0?12:ab)};aa.prototype.getIsoWeek=function(){var ae=this.proxy;var ad=ae.getWeekOfYear();var ab=(new Date(""+ae.getFullYear()+"/1/1")).getDay();var ac=ad+(ab>4||ab<=1?0:1);if(ac==53&&(new Date(""+ae.getFullYear()+"/12/31")).getDay()<4){ac=1}else{if(ac===0){ae=new aa(new Date(""+(ae.getFullYear()-1)+"/12/31"));ac=ae.getIsoWeek()}}ae=null;return ac};aa.prototype.getMilliseconds=function(){return this.proxy.getMilliseconds()};aa.prototype.getMinutes=function(){return this.proxy.getMinutes()};aa.prototype.getMonth=function(){return this.proxy.getMonth()};aa.prototype.getMonthName=function(){return aa.regional[this.locale]["monthNames"][this.proxy.getMonth()]};aa.prototype.getMonthNumber=function(){return this.proxy.getMonth()+1};aa.prototype.getSeconds=function(){return this.proxy.getSeconds()};aa.prototype.getShortYear=function(){return this.proxy.getYear()%100};aa.prototype.getTime=function(){return this.proxy.getTime()};aa.prototype.getTimezoneAbbr=function(){return this.proxy.toString().replace(/^.*\(([^)]+)\)$/,"$1")};aa.prototype.getTimezoneName=function(){var ab=/(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString());return ab[1]||ab[2]||"GMT"+this.getGmtOffset()};aa.prototype.getTimezoneOffset=function(){return this.proxy.getTimezoneOffset()};aa.prototype.getWeekOfYear=function(){var ab=this.getDayOfYear();var ad=7-this.getDayOfWeek();var ac=parseInt((ab+ad)/7,10);return ac};aa.prototype.getUnix=function(){return Math.round(this.proxy.getTime()/1000,0)};aa.prototype.getYear=function(){return this.proxy.getYear()};aa.prototype.next=function(ab){ab=ab||"day";return this.clone().add(1,ab)};aa.prototype.set=function(){switch(arguments.length){case 0:this.proxy=new Date();break;case 1:if(j(arguments[0])=="[object Object]"&&arguments[0]._type!="jsDate"){var ad=this.options=arguments[0];this.syntax=ad.syntax||this.syntax;this.defaultCentury=ad.defaultCentury||this.defaultCentury;this.proxy=aa.createDate(ad.date)}else{this.proxy=aa.createDate(arguments[0])}break;default:var ab=[];for(var ac=0;ac<arguments.length;ac++){ab.push(arguments[ac])}this.proxy=new Date();this.proxy.setFullYear.apply(this.proxy,ab.slice(0,3));if(ab.slice(3).length){this.proxy.setHours.apply(this.proxy,ab.slice(3))}break}return this};aa.prototype.setDate=function(ab){this.proxy.setDate(ab);return this};aa.prototype.setFullYear=function(){this.proxy.setFullYear.apply(this.proxy,arguments);return this};aa.prototype.setHours=function(){this.proxy.setHours.apply(this.proxy,arguments);return this};aa.prototype.setMilliseconds=function(ab){this.proxy.setMilliseconds(ab);return this};aa.prototype.setMinutes=function(){this.proxy.setMinutes.apply(this.proxy,arguments);return this};aa.prototype.setMonth=function(){this.proxy.setMonth.apply(this.proxy,arguments);return this};aa.prototype.setSeconds=function(){this.proxy.setSeconds.apply(this.proxy,arguments);return this};aa.prototype.setTime=function(ab){this.proxy.setTime(ab);return this};aa.prototype.setYear=function(){this.proxy.setYear.apply(this.proxy,arguments);return this};aa.prototype.strftime=function(ab){ab=ab||this.formatString||aa.regional[this.locale]["formatString"];return aa.strftime(this,ab,this.syntax)};aa.prototype.toString=function(){return this.proxy.toString()};aa.prototype.toYmdInt=function(){return(this.proxy.getFullYear()*10000)+(this.getMonthNumber()*100)+this.proxy.getDate()};aa.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ércoles","Jueves","Viernes","Sábado"],dayNamesShort:["Dom","Lun","Mar","Mié","Juv","Vie","Sá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ç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ça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],formatString:"%Y-%m-%d %H:%M:%S"},"pt-BR":{monthNames:["Janeiro","Fevereiro","Març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ça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],formatString:"%Y-%m-%d %H:%M:%S"}};aa.regional["en-US"]=aa.regional["en-GB"]=aa.regional.en;aa.regional.getLocale=function(){var ab=aa.config.defaultLocale;if(document&&document.getElementsByTagName("html")&&document.getElementsByTagName("html")[0].lang){ab=document.getElementsByTagName("html")[0].lang;if(!aa.regional.hasOwnProperty(ab)){ab=aa.config.defaultLocale}}return ab};var y=24*60*60*1000;var J=function(ab,ae){ab=String(ab);var ac=ae-ab.length;var ad=String(Math.pow(10,ac)).slice(1);return ad.concat(ab)};var A={millisecond:1,second:1000,minute:60*1000,hour:60*60*1000,day:y,week:7*y,month:{add:function(ad,ab){A.year.add(ad,Math[ab>0?"floor":"ceil"](ab/12));var ac=ad.getMonth()+(ab%12);if(ac==12){ac=0;ad.setYear(ad.getFullYear()+1)}else{if(ac==-1){ac=11;ad.setYear(ad.getFullYear()-1)}}ad.setMonth(ac)},diff:function(af,ad){var ab=af.getFullYear()-ad.getFullYear();var ac=af.getMonth()-ad.getMonth()+(ab*12);var ae=af.getDate()-ad.getDate();return ac+(ae/30)}},year:{add:function(ac,ab){ac.setYear(ac.getFullYear()+Math[ab>0?"floor":"ceil"](ab))},diff:function(ac,ab){return A.month.diff(ac,ab)/12}}};for(var T in A){if(T.substring(T.length-1)!="s"){A[T+"s"]=A[T]}}var D=function(af,ae,ac){if(aa.formats[ac]["shortcuts"][ae]){return aa.strftime(af,aa.formats[ac]["shortcuts"][ae],ac)}else{var ab=(aa.formats[ac]["codes"][ae]||"").split(".");var ad=af["get"+ab[0]]?af["get"+ab[0]]():"";if(ab[1]){ad=J(ad,ab[1])}return ad}};aa.strftime=function(ah,ae,ad,ai){var ac="perl";var ag=aa.regional.getLocale();if(ad&&aa.formats.hasOwnProperty(ad)){ac=ad}else{if(ad&&aa.regional.hasOwnProperty(ad)){ag=ad}}if(ai&&aa.formats.hasOwnProperty(ai)){ac=ai}else{if(ai&&aa.regional.hasOwnProperty(ai)){ag=ai}}if(j(ah)!="[object Object]"||ah._type!="jsDate"){ah=new aa(ah);ah.locale=ag}if(!ae){ae=ah.formatString||aa.regional[ag]["formatString"]}var ab=ae||"%Y-%m-%d",aj="",af;while(ab.length>0){if(af=ab.match(aa.formats[ac].codes.matcher)){aj+=ab.slice(0,af.index);aj+=(af[1]||"")+D(ah,af[2],ac);ab=ab.slice(af.index+af[0].length)}else{aj+=ab;ab=""}}return aj};aa.formats={ISO:"%Y-%m-%dT%H:%M:%S.%N%G",SQL:"%Y-%m-%d %H:%M:%S"};aa.formats.perl={codes:{matcher:/()%(#?(%|[a-z]))/i,Y:"FullYear",y:"ShortYear.2",m:"MonthNumber.2","#m":"MonthNumber",B:"MonthName",b:"AbbrMonthName",d:"Date.2","#d":"Date",e:"Date",A:"DayName",a:"AbbrDayName",w:"Day",H:"Hours.2","#H":"Hours",I:"Hours12.2","#I":"Hours12",p:"AMPM",M:"Minutes.2","#M":"Minutes",S:"Seconds.2","#S":"Seconds",s:"Unix",N:"Milliseconds.3","#N":"Milliseconds",O:"TimezoneOffset",Z:"TimezoneName",G:"GmtOffset"},shortcuts:{F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",D:"%m/%d/%y","#c":"%a %b %e %H:%M:%S %Y",v:"%e-%b-%Y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}};aa.formats.php={codes:{matcher:/()%((%|[a-z]))/i,a:"AbbrDayName",A:"DayName",d:"Date.2",e:"Date",j:"DayOfYear.3",u:"DayOfWeek",w:"Day",U:"FullWeekOfYear.2",V:"IsoWeek.2",W:"WeekOfYear.2",b:"AbbrMonthName",B:"MonthName",m:"MonthNumber.2",h:"AbbrMonthName",C:"Century.2",y:"ShortYear.2",Y:"FullYear",H:"Hours.2",I:"Hours12.2",l:"Hours12",p:"AMPM",P:"AmPm",M:"Minutes.2",S:"Seconds.2",s:"Unix",O:"TimezoneOffset",z:"GmtOffset",Z:"TimezoneAbbr"},shortcuts:{D:"%m/%d/%y",F:"%Y-%m-%d",T:"%H:%M:%S",X:"%H:%M:%S",x:"%m/%d/%y",R:"%H:%M",r:"%I:%M:%S %p",t:"\t",n:"\n","%":"%"}};aa.createDate=function(ad){if(ad==null){return new Date()}if(ad instanceof Date){return ad}if(typeof ad=="number"){return new Date(ad)}var ai=String(ad).replace(/^\s*(.+)\s*$/g,"$1");ai=ai.replace(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/,"$1/$2/$3");ai=ai.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{4})/i,"$1 $2 $3");var ah=ai.match(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i);if(ah&&ah.length>3){var am=parseFloat(ah[3]);var ag=aa.config.defaultCentury+am;ag=String(ag);ai=ai.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i,ah[1]+" "+ah[2]+" "+ag)}ah=ai.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})[^0-9]/);function al(aq,ap){var aw=parseFloat(ap[1]);var av=parseFloat(ap[2]);var au=parseFloat(ap[3]);var at=aa.config.defaultCentury;var ao,an,ax,ar;if(aw>31){an=au;ax=av;ao=at+aw}else{an=av;ax=aw;ao=at+au}ar=ax+"/"+an+"/"+ao;return aq.replace(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})/,ar)}if(ah&&ah.length>3){ai=al(ai,ah)}var ah=ai.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})$/);if(ah&&ah.length>3){ai=al(ai,ah)}var af=0;var ac=aa.matchers.length;var ak,ab,aj=ai,ae;while(af<ac){ab=Date.parse(aj);if(!isNaN(ab)){return new Date(ab)}ak=aa.matchers[af];if(typeof ak=="function"){ae=ak.call(aa,aj);if(ae instanceof Date){return ae}}else{aj=ai.replace(ak[0],ak[1])}af++}return NaN};aa.daysInMonth=function(ab,ac){if(ac==2){return new Date(ab,1,29).getDate()==29?29:28}return[r,31,r,31,30,31,30,31,31,30,31,30,31][ac]};aa.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(ae){var ac=ae.match(/^(?:(.+)\s+)?([012]?\d)(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d(\.\d*)?))?\s*(am|pm)?\s*$/i);if(ac){if(ac[1]){var ad=this.createDate(ac[1]);if(isNaN(ad)){return}}else{var ad=new Date();ad.setMilliseconds(0)}var ab=parseFloat(ac[2]);if(ac[6]){ab=ac[6].toLowerCase()=="am"?(ab==12?0:ab):(ab==12?12:ab+12)}ad.setHours(ab,parseInt(ac[3]||0,10),parseInt(ac[4]||0,10),((parseFloat(ac[5]||0))||0)*1000);return ad}else{return ae}},function(ae){var ac=ae.match(/^(?:(.+))[T|\s+]([012]\d)(?:\:(\d\d))(?:\:(\d\d))(?:\.\d+)([\+\-]\d\d\:\d\d)$/i);if(ac){if(ac[1]){var ad=this.createDate(ac[1]);if(isNaN(ad)){return}}else{var ad=new Date();ad.setMilliseconds(0)}var ab=parseFloat(ac[2]);ad.setHours(ab,parseInt(ac[3],10),parseInt(ac[4],10),parseFloat(ac[5])*1000);return ad}else{return ae}},function(af){var ad=af.match(/^([0-3]?\d)\s*[-\/.\s]{1}\s*([a-zA-Z]{3,9})\s*[-\/.\s]{1}\s*([0-3]?\d)$/);if(ad){var ae=new Date();var ag=aa.config.defaultCentury;var ai=parseFloat(ad[1]);var ah=parseFloat(ad[3]);var ac,ab,aj;if(ai>31){ab=ah;ac=ag+ai}else{ab=ai;ac=ag+ah}var aj=W(ad[2],aa.regional[aa.regional.getLocale()]["monthNamesShort"]);if(aj==-1){aj=W(ad[2],aa.regional[aa.regional.getLocale()]["monthNames"])}ae.setFullYear(ac,aj,ab);ae.setHours(0,0,0,0);return ae}else{return af}}];function W(ad,ae){if(ae.indexOf){return ae.indexOf(ad)}for(var ab=0,ac=ae.length;ab<ac;ab++){if(ae[ab]===ad){return ab}}return -1}function j(ab){if(ab===null){return"[object Null]"}return Object.prototype.toString.call(ab)}H.jsDate=aa;H.jqplot.sprintf=function(){function ah(an,aj,ak,am){var al=(an.length>=aj)?"":Array(1+aj-an.length>>>0).join(ak);return am?an+al:al+an}function ae(al){var ak=new String(al);for(var aj=10;aj>0;aj--){if(ak==(ak=ak.replace(/^(\d+)(\d{3})/,"$1"+H.jqplot.sprintf.thousandsSeparator+"$2"))){break}}return ak}function ad(ao,an,aq,al,am,ak){var ap=al-ao.length;if(ap>0){var aj=" ";if(ak){aj=" "}if(aq||!am){ao=ah(ao,al,aj,aq)}else{ao=ao.slice(0,an.length)+ah("",ap,"0",true)+ao.slice(an.length)}}return ao}function ai(ar,ak,ap,al,aj,ao,aq,an){var am=ar>>>0;ap=ap&&am&&{"2":"0b","8":"0","16":"0x"}[ak]||"";ar=ap+ah(am.toString(ak),ao||0,"0",false);return ad(ar,ap,al,aj,aq,an)}function ab(an,ao,al,aj,am,ak){if(aj!=null){an=an.slice(0,aj)}return ad(an,"",ao,al,am,ak)}var ac=arguments,af=0,ag=ac[af++];return ag.replace(H.jqplot.sprintf.regex,function(aG,aq,ar,av,aI,aD,ao){if(aG=="%%"){return"%"}var ax=false,at="",au=false,aF=false,ap=false,an=false;for(var aC=0;ar&&aC<ar.length;aC++){switch(ar.charAt(aC)){case" ":at=" ";break;case"+":at="+";break;case"-":ax=true;break;case"0":au=true;break;case"#":aF=true;break;case"&":ap=true;break;case"'":an=true;break}}if(!av){av=0}else{if(av=="*"){av=+ac[af++]}else{if(av.charAt(0)=="*"){av=+ac[av.slice(1,-1)]}else{av=+av}}}if(av<0){av=-av;ax=true}if(!isFinite(av)){throw new Error("$.jqplot.sprintf: (minimum-)width must be finite")}if(!aD){aD="fFeE".indexOf(ao)>-1?6:(ao=="d")?0:void (0)}else{if(aD=="*"){aD=+ac[af++]}else{if(aD.charAt(0)=="*"){aD=+ac[aD.slice(1,-1)]}else{aD=+aD}}}var az=aq?ac[aq.slice(0,-1)]:ac[af++];switch(ao){case"s":if(az==null){return""}return ab(String(az),ax,av,aD,au,ap);case"c":return ab(String.fromCharCode(+az),ax,av,aD,au,ap);case"b":return ai(az,2,aF,ax,av,aD,au,ap);case"o":return ai(az,8,aF,ax,av,aD,au,ap);case"x":return ai(az,16,aF,ax,av,aD,au,ap);case"X":return ai(az,16,aF,ax,av,aD,au,ap).toUpperCase();case"u":return ai(az,10,aF,ax,av,aD,au,ap);case"i":var al=parseInt(+az,10);if(isNaN(al)){return""}var aB=al<0?"-":at;var aE=an?ae(String(Math.abs(al))):String(Math.abs(al));az=aB+ah(aE,aD,"0",false);return ad(az,aB,ax,av,au,ap);case"d":var al=Math.round(+az);if(isNaN(al)){return""}var aB=al<0?"-":at;var aE=an?ae(String(Math.abs(al))):String(Math.abs(al));az=aB+ah(aE,aD,"0",false);return ad(az,aB,ax,av,au,ap);case"e":case"E":case"f":case"F":case"g":case"G":var al=+az;if(isNaN(al)){return""}var aB=al<0?"-":at;var am=["toExponential","toFixed","toPrecision"]["efg".indexOf(ao.toLowerCase())];var aH=["toString","toUpperCase"]["eEfFgG".indexOf(ao)%2];var aE=Math.abs(al)[am](aD);aE=an?ae(aE):aE;az=aB+aE;var aw=ad(az,aB,ax,av,au,ap)[aH]();if(H.jqplot.sprintf.decimalMark!=="."&&H.jqplot.sprintf.decimalMark!==H.jqplot.sprintf.thousandsSeparator){return aw.replace(/\./,H.jqplot.sprintf.decimalMark)}else{return aw}case"p":case"P":var al=+az;if(isNaN(al)){return""}var aB=al<0?"-":at;var ay=String(Number(Math.abs(al)).toExponential()).split(/e|E/);var ak=(ay[0].indexOf(".")!=-1)?ay[0].length-1:ay[0].length;var aA=(ay[1]<0)?-ay[1]-1:0;if(Math.abs(al)<1){if(ak+aA<=aD){az=aB+Math.abs(al).toPrecision(ak)}else{if(ak<=aD-1){az=aB+Math.abs(al).toExponential(ak-1)}else{az=aB+Math.abs(al).toExponential(aD-1)}}}else{var aj=(ak<=aD)?ak:aD;az=aB+Math.abs(al).toPrecision(aj)}var aH=["toString","toUpperCase"]["pP".indexOf(ao)%2];return ad(az,aB,ax,av,au,ap)[aH]();case"n":return"";default:return aG}})};H.jqplot.sprintf.thousandsSeparator=",";H.jqplot.sprintf.decimalMark=".";H.jqplot.sprintf.regex=/%%|%(\d+\$)?([-+#0&\' ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g;H.jqplot.getSignificantFigures=function(af){var ah=String(Number(Math.abs(af)).toExponential()).split(/e|E/);var ag=(ah[0].indexOf(".")!=-1)?ah[0].length-1:ah[0].length;var ac=(ah[1]<0)?-ah[1]-1:0;var ab=parseInt(ah[1],10);var ad=(ab+1>0)?ab+1:0;var ae=(ag<=ad)?0:ag-ab-1;return{significantDigits:ag,digitsLeft:ad,digitsRight:ae,zeros:ac,exponent:ab}};H.jqplot.getPrecision=function(ab){return H.jqplot.getSignificantFigures(ab).digitsRight}})(jQuery);var backCompat=$.uiBackCompat!==false;$.jqplot.effects={effect:{}};var dataSpace="jqplot.storage.";$.extend($.jqplot.effects,{version:"1.9pre",save:function(b,c){for(var a=0;a<c.length;a++){if(c[a]!==null){b.data(dataSpace+c[a],b[0].style[c[a]])}}},restore:function(b,c){for(var a=0;a<c.length;a++){if(c[a]!==null){b.css(c[a],b.data(dataSpace+c[a]))}}},setMode:function(a,b){if(b==="toggle"){b=a.is(":hidden")?"show":"hide"}return b},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper")){return b.parent()}var c={width:b.outerWidth(true),height:b.outerHeight(true),"float":b.css("float")},e=$("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),a={width:b.width(),height:b.height()},d=document.activeElement;b.wrap(e);if(b[0]===d||$.contains(b[0],d)){$(d).focus()}e=b.parent();if(b.css("position")==="static"){e.css({position:"relative"});b.css({position:"relative"})}else{$.extend(c,{position:b.css("position"),zIndex:b.css("z-index")});$.each(["top","left","bottom","right"],function(f,g){c[g]=b.css(g);if(isNaN(parseInt(c[g],10))){c[g]="auto"}});b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}b.css(a);return e.css(c).show()},removeWrapper:function(a){var b=document.activeElement;if(a.parent().is(".ui-effects-wrapper")){a.parent().replaceWith(a);if(a[0]===b||$.contains(a[0],b)){$(b).focus()}}return a}});function _normalizeArguments(b,a,c,d){if($.isPlainObject(b)){return b}b={effect:b};if(a===undefined){a={}}if($.isFunction(a)){d=a;c=null;a={}}if($.type(a)==="number"||$.fx.speeds[a]){d=c;c=a;a={}}if($.isFunction(c)){d=c;c=null}if(a){$.extend(b,a)}c=c||a.duration;b.duration=$.fx.off?0:typeof c==="number"?c:c in $.fx.speeds?$.fx.speeds[c]:$.fx.speeds._default;b.complete=d||a.complete;return b}function standardSpeed(a){if(!a||typeof a==="number"||$.fx.speeds[a]){return true}if(typeof a==="string"&&!$.jqplot.effects.effect[a]){if(backCompat&&$.jqplot.effects[a]){return false}return true}return false}$.fn.extend({jqplotEffect:function(i,j,b,h){var g=_normalizeArguments.apply(this,arguments),d=g.mode,e=g.queue,f=$.jqplot.effects.effect[g.effect],a=!f&&backCompat&&$.jqplot.effects[g.effect];if($.fx.off||!(f||a)){if(d){return this[d](g.duration,g.complete)}else{return this.each(function(){if(g.complete){g.complete.call(this)}})}}function c(m){var n=$(this),l=g.complete,o=g.mode;function k(){if($.isFunction(l)){l.call(n[0])}if($.isFunction(m)){m()}}if(n.is(":hidden")?o==="hide":o==="show"){k()}else{f.call(n[0],g,k)}}if(f){return e===false?this.each(c):this.queue(e||"fx",c)}else{return a.call(this,{options:g,duration:g.duration,callback:g.complete,mode:g.mode})}}});var rvertical=/up|down|vertical/,rpositivemotion=/up|left|vertical|horizontal/;$.jqplot.effects.effect.blind=function(c,h){var d=$(this),k=["position","top","bottom","left","right","height","width"],i=$.jqplot.effects.setMode(d,c.mode||"hide"),m=c.direction||"up",f=rvertical.test(m),e=f?"height":"width",j=f?"top":"left",p=rpositivemotion.test(m),g={},n=i==="show",b,a,l;if(d.parent().is(".ui-effects-wrapper")){$.jqplot.effects.save(d.parent(),k)}else{$.jqplot.effects.save(d,k)}d.show();l=parseInt(d.css("top"),10);b=$.jqplot.effects.createWrapper(d).css({overflow:"hidden"});a=f?b[e]()+l:b[e]();g[e]=n?String(a):"0";if(!p){d.css(f?"bottom":"right",0).css(f?"top":"left","").css({position:"absolute"});g[j]=n?"0":String(a)}if(n){b.css(e,0);if(!p){b.css(j,a)}}b.animate(g,{duration:c.duration,easing:c.easing,queue:false,complete:function(){if(i==="hide"){d.hide()}$.jqplot.effects.restore(d,k);$.jqplot.effects.removeWrapper(d);h()}})};
|
3 |
+
}(jQuery));
|
backend/settings/assets/js/jqPlot/plugins/jqplot.BezierCurveRenderer.js
ADDED
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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.BezierCurveRenderer.js
|
33 |
+
// Renderer which draws lines as stacked bezier curves.
|
34 |
+
// Data for the line will not be specified as an array of
|
35 |
+
// [x, y] data point values, but as a an array of [start piont, bezier curve]
|
36 |
+
// So, the line is specified as: [[xstart, ystart], [cp1x, cp1y, cp2x, cp2y, xend, yend]].
|
37 |
+
$.jqplot.BezierCurveRenderer = function(){
|
38 |
+
$.jqplot.LineRenderer.call(this);
|
39 |
+
};
|
40 |
+
|
41 |
+
$.jqplot.BezierCurveRenderer.prototype = new $.jqplot.LineRenderer();
|
42 |
+
$.jqplot.BezierCurveRenderer.prototype.constructor = $.jqplot.BezierCurveRenderer;
|
43 |
+
|
44 |
+
|
45 |
+
// Method: setGridData
|
46 |
+
// converts the user data values to grid coordinates and stores them
|
47 |
+
// in the gridData array.
|
48 |
+
// Called with scope of a series.
|
49 |
+
$.jqplot.BezierCurveRenderer.prototype.setGridData = function(plot) {
|
50 |
+
// recalculate the grid data
|
51 |
+
var xp = this._xaxis.series_u2p;
|
52 |
+
var yp = this._yaxis.series_u2p;
|
53 |
+
// this._plotData should be same as this.data
|
54 |
+
var data = this.data;
|
55 |
+
this.gridData = [];
|
56 |
+
this._prevGridData = [];
|
57 |
+
// if seriesIndex = 0, fill to x axis.
|
58 |
+
// if seriesIndex > 0, fill to previous series data.
|
59 |
+
var idx = this.index;
|
60 |
+
if (data.length == 2) {
|
61 |
+
if (idx == 0) {
|
62 |
+
this.gridData = [
|
63 |
+
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
|
64 |
+
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
|
65 |
+
xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
|
66 |
+
xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
|
67 |
+
[xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, this._yaxis.min)],
|
68 |
+
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
|
69 |
+
];
|
70 |
+
}
|
71 |
+
else {
|
72 |
+
var psd = plot.series[idx-1].data;
|
73 |
+
this.gridData = [
|
74 |
+
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
|
75 |
+
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
|
76 |
+
xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
|
77 |
+
xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
|
78 |
+
[xp.call(this._xaxis, psd[1][4]), yp.call(this._yaxis, psd[1][5])],
|
79 |
+
[xp.call(this._xaxis, psd[1][2]), yp.call(this._yaxis, psd[1][3]),
|
80 |
+
xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
|
81 |
+
xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
|
82 |
+
];
|
83 |
+
}
|
84 |
+
}
|
85 |
+
else {
|
86 |
+
if (idx == 0) {
|
87 |
+
this.gridData = [
|
88 |
+
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
|
89 |
+
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
|
90 |
+
xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
|
91 |
+
xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
|
92 |
+
[xp.call(this._xaxis, data[3][1]), yp.call(this._yaxis, this._yaxis.min)],
|
93 |
+
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
|
94 |
+
];
|
95 |
+
}
|
96 |
+
else {
|
97 |
+
var psd = plot.series[idx-1].data;
|
98 |
+
this.gridData = [
|
99 |
+
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
|
100 |
+
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
|
101 |
+
xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
|
102 |
+
xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
|
103 |
+
[xp.call(this._xaxis, psd[3][0]), yp.call(this._yaxis, psd[3][1])],
|
104 |
+
[xp.call(this._xaxis, psd[2][0]), yp.call(this._yaxis, psd[2][1]),
|
105 |
+
xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
|
106 |
+
xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
|
107 |
+
];
|
108 |
+
}
|
109 |
+
}
|
110 |
+
};
|
111 |
+
|
112 |
+
// Method: makeGridData
|
113 |
+
// converts any arbitrary data values to grid coordinates and
|
114 |
+
// returns them. This method exists so that plugins can use a series'
|
115 |
+
// linerenderer to generate grid data points without overwriting the
|
116 |
+
// grid data associated with that series.
|
117 |
+
// Called with scope of a series.
|
118 |
+
$.jqplot.BezierCurveRenderer.prototype.makeGridData = function(data, plot) {
|
119 |
+
// recalculate the grid data
|
120 |
+
var xp = this._xaxis.series_u2p;
|
121 |
+
var yp = this._yaxis.series_u2p;
|
122 |
+
var gd = [];
|
123 |
+
var pgd = [];
|
124 |
+
// if seriesIndex = 0, fill to x axis.
|
125 |
+
// if seriesIndex > 0, fill to previous series data.
|
126 |
+
var idx = this.index;
|
127 |
+
if (data.length == 2) {
|
128 |
+
if (idx == 0) {
|
129 |
+
gd = [
|
130 |
+
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
|
131 |
+
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
|
132 |
+
xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
|
133 |
+
xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
|
134 |
+
[xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, this._yaxis.min)],
|
135 |
+
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
|
136 |
+
];
|
137 |
+
}
|
138 |
+
else {
|
139 |
+
var psd = plot.series[idx-1].data;
|
140 |
+
gd = [
|
141 |
+
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
|
142 |
+
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
|
143 |
+
xp.call(this._xaxis, data[1][2]), yp.call(this._yaxis, data[1][3]),
|
144 |
+
xp.call(this._xaxis, data[1][4]), yp.call(this._yaxis, data[1][5])],
|
145 |
+
[xp.call(this._xaxis, psd[1][4]), yp.call(this._yaxis, psd[1][5])],
|
146 |
+
[xp.call(this._xaxis, psd[1][2]), yp.call(this._yaxis, psd[1][3]),
|
147 |
+
xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
|
148 |
+
xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
|
149 |
+
];
|
150 |
+
}
|
151 |
+
}
|
152 |
+
else {
|
153 |
+
if (idx == 0) {
|
154 |
+
gd = [
|
155 |
+
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
|
156 |
+
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
|
157 |
+
xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
|
158 |
+
xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
|
159 |
+
[xp.call(this._xaxis, data[3][1]), yp.call(this._yaxis, this._yaxis.min)],
|
160 |
+
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, this._yaxis.min)]
|
161 |
+
];
|
162 |
+
}
|
163 |
+
else {
|
164 |
+
var psd = plot.series[idx-1].data;
|
165 |
+
gd = [
|
166 |
+
[xp.call(this._xaxis, data[0][0]), yp.call(this._yaxis, data[0][1])],
|
167 |
+
[xp.call(this._xaxis, data[1][0]), yp.call(this._yaxis, data[1][1]),
|
168 |
+
xp.call(this._xaxis, data[2][0]), yp.call(this._yaxis, data[2][1]),
|
169 |
+
xp.call(this._xaxis, data[3][0]), yp.call(this._yaxis, data[3][1])],
|
170 |
+
[xp.call(this._xaxis, psd[3][0]), yp.call(this._yaxis, psd[3][1])],
|
171 |
+
[xp.call(this._xaxis, psd[2][0]), yp.call(this._yaxis, psd[2][1]),
|
172 |
+
xp.call(this._xaxis, psd[1][0]), yp.call(this._yaxis, psd[1][1]),
|
173 |
+
xp.call(this._xaxis, psd[0][0]), yp.call(this._yaxis, psd[0][1])]
|
174 |
+
];
|
175 |
+
}
|
176 |
+
}
|
177 |
+
return gd;
|
178 |
+
};
|
179 |
+
|
180 |
+
|
181 |
+
// called within scope of series.
|
182 |
+
$.jqplot.BezierCurveRenderer.prototype.draw = function(ctx, gd, options) {
|
183 |
+
var i;
|
184 |
+
ctx.save();
|
185 |
+
if (gd.length) {
|
186 |
+
if (this.showLine) {
|
187 |
+
ctx.save();
|
188 |
+
var opts = (options != null) ? options : {};
|
189 |
+
ctx.fillStyle = opts.fillStyle || this.color;
|
190 |
+
ctx.beginPath();
|
191 |
+
ctx.moveTo(gd[0][0], gd[0][1]);
|
192 |
+
ctx.bezierCurveTo(gd[1][0], gd[1][1], gd[1][2], gd[1][3], gd[1][4], gd[1][5]);
|
193 |
+
ctx.lineTo(gd[2][0], gd[2][1]);
|
194 |
+
if (gd[3].length == 2) {
|
195 |
+
ctx.lineTo(gd[3][0], gd[3][1]);
|
196 |
+
}
|
197 |
+
else {
|
198 |
+
ctx.bezierCurveTo(gd[3][0], gd[3][1], gd[3][2], gd[3][3], gd[3][4], gd[3][5]);
|
199 |
+
}
|
200 |
+
ctx.closePath();
|
201 |
+
ctx.fill();
|
202 |
+
ctx.restore();
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
ctx.restore();
|
207 |
+
};
|
208 |
+
|
209 |
+
$.jqplot.BezierCurveRenderer.prototype.drawShadow = function(ctx, gd, options) {
|
210 |
+
// This is a no-op, shadows drawn with lines.
|
211 |
+
};
|
212 |
+
|
213 |
+
$.jqplot.BezierAxisRenderer = function() {
|
214 |
+
$.jqplot.LinearAxisRenderer.call(this);
|
215 |
+
};
|
216 |
+
|
217 |
+
$.jqplot.BezierAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
|
218 |
+
$.jqplot.BezierAxisRenderer.prototype.constructor = $.jqplot.BezierAxisRenderer;
|
219 |
+
|
220 |
+
|
221 |
+
// Axes on a plot with Bezier Curves
|
222 |
+
$.jqplot.BezierAxisRenderer.prototype.init = function(options){
|
223 |
+
$.extend(true, this, options);
|
224 |
+
var db = this._dataBounds;
|
225 |
+
// Go through all the series attached to this axis and find
|
226 |
+
// the min/max bounds for this axis.
|
227 |
+
for (var i=0; i<this._series.length; i++) {
|
228 |
+
var s = this._series[i];
|
229 |
+
var d = s.data;
|
230 |
+
if (d.length == 4) {
|
231 |
+
for (var j=0; j<d.length; j++) {
|
232 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
233 |
+
if (d[j][0] < db.min || db.min == null) {
|
234 |
+
db.min = d[j][0];
|
235 |
+
}
|
236 |
+
if (d[j][0] > db.max || db.max == null) {
|
237 |
+
db.max = d[j][0];
|
238 |
+
}
|
239 |
+
}
|
240 |
+
else {
|
241 |
+
if (d[j][1] < db.min || db.min == null) {
|
242 |
+
db.min = d[j][1];
|
243 |
+
}
|
244 |
+
if (d[j][1] > db.max || db.max == null) {
|
245 |
+
db.max = d[j][1];
|
246 |
+
}
|
247 |
+
}
|
248 |
+
}
|
249 |
+
}
|
250 |
+
else {
|
251 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
252 |
+
if (d[0][0] < db.min || db.min == null) {
|
253 |
+
db.min = d[0][0];
|
254 |
+
}
|
255 |
+
if (d[0][0] > db.max || db.max == null) {
|
256 |
+
db.max = d[0][0];
|
257 |
+
}
|
258 |
+
for (var j=0; j<5; j+=2) {
|
259 |
+
if (d[1][j] < db.min || db.min == null) {
|
260 |
+
db.min = d[1][j];
|
261 |
+
}
|
262 |
+
if (d[1][j] > db.max || db.max == null) {
|
263 |
+
db.max = d[1][j];
|
264 |
+
}
|
265 |
+
}
|
266 |
+
}
|
267 |
+
else {
|
268 |
+
if (d[0][1] < db.min || db.min == null) {
|
269 |
+
db.min = d[0][1];
|
270 |
+
}
|
271 |
+
if (d[0][1] > db.max || db.max == null) {
|
272 |
+
db.max = d[0][1];
|
273 |
+
}
|
274 |
+
for (var j=1; j<6; j+=2) {
|
275 |
+
if (d[1][j] < db.min || db.min == null) {
|
276 |
+
db.min = d[1][j];
|
277 |
+
}
|
278 |
+
if (d[1][j] > db.max || db.max == null) {
|
279 |
+
db.max = d[1][j];
|
280 |
+
}
|
281 |
+
}
|
282 |
+
}
|
283 |
+
}
|
284 |
+
}
|
285 |
+
};
|
286 |
+
|
287 |
+
// setup default renderers for axes and legend so user doesn't have to
|
288 |
+
// called with scope of plot
|
289 |
+
function preInit(target, data, options) {
|
290 |
+
options = options || {};
|
291 |
+
options.axesDefaults = $.extend(true, {pad:0}, options.axesDefaults);
|
292 |
+
options.legend = $.extend(true, {placement:'outside'}, options.legend);
|
293 |
+
// only set these if there is a pie series
|
294 |
+
var setopts = false;
|
295 |
+
if (options.seriesDefaults.renderer == $.jqplot.BezierCurveRenderer) {
|
296 |
+
setopts = true;
|
297 |
+
}
|
298 |
+
else if (options.series) {
|
299 |
+
for (var i=0; i < options.series.length; i++) {
|
300 |
+
if (options.series[i].renderer == $.jqplot.BezierCurveRenderer) {
|
301 |
+
setopts = true;
|
302 |
+
}
|
303 |
+
}
|
304 |
+
}
|
305 |
+
|
306 |
+
if (setopts) {
|
307 |
+
options.axesDefaults.renderer = $.jqplot.BezierAxisRenderer;
|
308 |
+
}
|
309 |
+
}
|
310 |
+
|
311 |
+
$.jqplot.preInitHooks.push(preInit);
|
312 |
+
|
313 |
+
})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.BezierCurveRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(b){b.jqplot.BezierCurveRenderer=function(){b.jqplot.LineRenderer.call(this)};b.jqplot.BezierCurveRenderer.prototype=new b.jqplot.LineRenderer();b.jqplot.BezierCurveRenderer.prototype.constructor=b.jqplot.BezierCurveRenderer;b.jqplot.BezierCurveRenderer.prototype.setGridData=function(h){var e=this._xaxis.series_u2p;var g=this._yaxis.series_u2p;var f=this.data;this.gridData=[];this._prevGridData=[];var d=this.index;if(f.length==2){if(d==0){this.gridData=[[e.call(this._xaxis,f[0][0]),g.call(this._yaxis,f[0][1])],[e.call(this._xaxis,f[1][0]),g.call(this._yaxis,f[1][1]),e.call(this._xaxis,f[1][2]),g.call(this._yaxis,f[1][3]),e.call(this._xaxis,f[1][4]),g.call(this._yaxis,f[1][5])],[e.call(this._xaxis,f[1][4]),g.call(this._yaxis,this._yaxis.min)],[e.call(this._xaxis,f[0][0]),g.call(this._yaxis,this._yaxis.min)]]}else{var c=h.series[d-1].data;this.gridData=[[e.call(this._xaxis,f[0][0]),g.call(this._yaxis,f[0][1])],[e.call(this._xaxis,f[1][0]),g.call(this._yaxis,f[1][1]),e.call(this._xaxis,f[1][2]),g.call(this._yaxis,f[1][3]),e.call(this._xaxis,f[1][4]),g.call(this._yaxis,f[1][5])],[e.call(this._xaxis,c[1][4]),g.call(this._yaxis,c[1][5])],[e.call(this._xaxis,c[1][2]),g.call(this._yaxis,c[1][3]),e.call(this._xaxis,c[1][0]),g.call(this._yaxis,c[1][1]),e.call(this._xaxis,c[0][0]),g.call(this._yaxis,c[0][1])]]}}else{if(d==0){this.gridData=[[e.call(this._xaxis,f[0][0]),g.call(this._yaxis,f[0][1])],[e.call(this._xaxis,f[1][0]),g.call(this._yaxis,f[1][1]),e.call(this._xaxis,f[2][0]),g.call(this._yaxis,f[2][1]),e.call(this._xaxis,f[3][0]),g.call(this._yaxis,f[3][1])],[e.call(this._xaxis,f[3][1]),g.call(this._yaxis,this._yaxis.min)],[e.call(this._xaxis,f[0][0]),g.call(this._yaxis,this._yaxis.min)]]}else{var c=h.series[d-1].data;this.gridData=[[e.call(this._xaxis,f[0][0]),g.call(this._yaxis,f[0][1])],[e.call(this._xaxis,f[1][0]),g.call(this._yaxis,f[1][1]),e.call(this._xaxis,f[2][0]),g.call(this._yaxis,f[2][1]),e.call(this._xaxis,f[3][0]),g.call(this._yaxis,f[3][1])],[e.call(this._xaxis,c[3][0]),g.call(this._yaxis,c[3][1])],[e.call(this._xaxis,c[2][0]),g.call(this._yaxis,c[2][1]),e.call(this._xaxis,c[1][0]),g.call(this._yaxis,c[1][1]),e.call(this._xaxis,c[0][0]),g.call(this._yaxis,c[0][1])]]}}};b.jqplot.BezierCurveRenderer.prototype.makeGridData=function(g,i){var f=this._xaxis.series_u2p;var h=this._yaxis.series_u2p;var e=[];var j=[];var d=this.index;if(g.length==2){if(d==0){e=[[f.call(this._xaxis,g[0][0]),h.call(this._yaxis,g[0][1])],[f.call(this._xaxis,g[1][0]),h.call(this._yaxis,g[1][1]),f.call(this._xaxis,g[1][2]),h.call(this._yaxis,g[1][3]),f.call(this._xaxis,g[1][4]),h.call(this._yaxis,g[1][5])],[f.call(this._xaxis,g[1][4]),h.call(this._yaxis,this._yaxis.min)],[f.call(this._xaxis,g[0][0]),h.call(this._yaxis,this._yaxis.min)]]}else{var c=i.series[d-1].data;e=[[f.call(this._xaxis,g[0][0]),h.call(this._yaxis,g[0][1])],[f.call(this._xaxis,g[1][0]),h.call(this._yaxis,g[1][1]),f.call(this._xaxis,g[1][2]),h.call(this._yaxis,g[1][3]),f.call(this._xaxis,g[1][4]),h.call(this._yaxis,g[1][5])],[f.call(this._xaxis,c[1][4]),h.call(this._yaxis,c[1][5])],[f.call(this._xaxis,c[1][2]),h.call(this._yaxis,c[1][3]),f.call(this._xaxis,c[1][0]),h.call(this._yaxis,c[1][1]),f.call(this._xaxis,c[0][0]),h.call(this._yaxis,c[0][1])]]}}else{if(d==0){e=[[f.call(this._xaxis,g[0][0]),h.call(this._yaxis,g[0][1])],[f.call(this._xaxis,g[1][0]),h.call(this._yaxis,g[1][1]),f.call(this._xaxis,g[2][0]),h.call(this._yaxis,g[2][1]),f.call(this._xaxis,g[3][0]),h.call(this._yaxis,g[3][1])],[f.call(this._xaxis,g[3][1]),h.call(this._yaxis,this._yaxis.min)],[f.call(this._xaxis,g[0][0]),h.call(this._yaxis,this._yaxis.min)]]}else{var c=i.series[d-1].data;e=[[f.call(this._xaxis,g[0][0]),h.call(this._yaxis,g[0][1])],[f.call(this._xaxis,g[1][0]),h.call(this._yaxis,g[1][1]),f.call(this._xaxis,g[2][0]),h.call(this._yaxis,g[2][1]),f.call(this._xaxis,g[3][0]),h.call(this._yaxis,g[3][1])],[f.call(this._xaxis,c[3][0]),h.call(this._yaxis,c[3][1])],[f.call(this._xaxis,c[2][0]),h.call(this._yaxis,c[2][1]),f.call(this._xaxis,c[1][0]),h.call(this._yaxis,c[1][1]),f.call(this._xaxis,c[0][0]),h.call(this._yaxis,c[0][1])]]}}return e};b.jqplot.BezierCurveRenderer.prototype.draw=function(c,g,d){var e;c.save();if(g.length){if(this.showLine){c.save();var f=(d!=null)?d:{};c.fillStyle=f.fillStyle||this.color;c.beginPath();c.moveTo(g[0][0],g[0][1]);c.bezierCurveTo(g[1][0],g[1][1],g[1][2],g[1][3],g[1][4],g[1][5]);c.lineTo(g[2][0],g[2][1]);if(g[3].length==2){c.lineTo(g[3][0],g[3][1])}else{c.bezierCurveTo(g[3][0],g[3][1],g[3][2],g[3][3],g[3][4],g[3][5])}c.closePath();c.fill();c.restore()}}c.restore()};b.jqplot.BezierCurveRenderer.prototype.drawShadow=function(c,e,d){};b.jqplot.BezierAxisRenderer=function(){b.jqplot.LinearAxisRenderer.call(this)};b.jqplot.BezierAxisRenderer.prototype=new b.jqplot.LinearAxisRenderer();b.jqplot.BezierAxisRenderer.prototype.constructor=b.jqplot.BezierAxisRenderer;b.jqplot.BezierAxisRenderer.prototype.init=function(f){b.extend(true,this,f);var c=this._dataBounds;for(var g=0;g<this._series.length;g++){var h=this._series[g];var k=h.data;if(k.length==4){for(var e=0;e<k.length;e++){if(this.name=="xaxis"||this.name=="x2axis"){if(k[e][0]<c.min||c.min==null){c.min=k[e][0]}if(k[e][0]>c.max||c.max==null){c.max=k[e][0]}}else{if(k[e][1]<c.min||c.min==null){c.min=k[e][1]}if(k[e][1]>c.max||c.max==null){c.max=k[e][1]}}}}else{if(this.name=="xaxis"||this.name=="x2axis"){if(k[0][0]<c.min||c.min==null){c.min=k[0][0]}if(k[0][0]>c.max||c.max==null){c.max=k[0][0]}for(var e=0;e<5;e+=2){if(k[1][e]<c.min||c.min==null){c.min=k[1][e]}if(k[1][e]>c.max||c.max==null){c.max=k[1][e]}}}else{if(k[0][1]<c.min||c.min==null){c.min=k[0][1]}if(k[0][1]>c.max||c.max==null){c.max=k[0][1]}for(var e=1;e<6;e+=2){if(k[1][e]<c.min||c.min==null){c.min=k[1][e]}if(k[1][e]>c.max||c.max==null){c.max=k[1][e]}}}}}};function a(g,f,d){d=d||{};d.axesDefaults=b.extend(true,{pad:0},d.axesDefaults);d.legend=b.extend(true,{placement:"outside"},d.legend);var c=false;if(d.seriesDefaults.renderer==b.jqplot.BezierCurveRenderer){c=true}else{if(d.series){for(var e=0;e<d.series.length;e++){if(d.series[e].renderer==b.jqplot.BezierCurveRenderer){c=true}}}}if(c){d.axesDefaults.renderer=b.jqplot.BezierAxisRenderer}}b.jqplot.preInitHooks.push(a)})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.barRenderer.js
ADDED
@@ -0,0 +1,797 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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.BarRenderer
|
34 |
+
// A plugin renderer for jqPlot to draw a bar plot.
|
35 |
+
// Draws series as a line.
|
36 |
+
|
37 |
+
$.jqplot.BarRenderer = function(){
|
38 |
+
$.jqplot.LineRenderer.call(this);
|
39 |
+
};
|
40 |
+
|
41 |
+
$.jqplot.BarRenderer.prototype = new $.jqplot.LineRenderer();
|
42 |
+
$.jqplot.BarRenderer.prototype.constructor = $.jqplot.BarRenderer;
|
43 |
+
|
44 |
+
// called with scope of series.
|
45 |
+
$.jqplot.BarRenderer.prototype.init = function(options, plot) {
|
46 |
+
// Group: Properties
|
47 |
+
//
|
48 |
+
// prop: barPadding
|
49 |
+
// Number of pixels between adjacent bars at the same axis value.
|
50 |
+
this.barPadding = 8;
|
51 |
+
// prop: barMargin
|
52 |
+
// Number of pixels between groups of bars at adjacent axis values.
|
53 |
+
this.barMargin = 10;
|
54 |
+
// prop: barDirection
|
55 |
+
// 'vertical' = up and down bars, 'horizontal' = side to side bars
|
56 |
+
this.barDirection = 'vertical';
|
57 |
+
// prop: barWidth
|
58 |
+
// Width of the bar in pixels (auto by devaul). null = calculated automatically.
|
59 |
+
this.barWidth = null;
|
60 |
+
// prop: shadowOffset
|
61 |
+
// offset of the shadow from the slice and offset of
|
62 |
+
// each succesive stroke of the shadow from the last.
|
63 |
+
this.shadowOffset = 2;
|
64 |
+
// prop: shadowDepth
|
65 |
+
// number of strokes to apply to the shadow,
|
66 |
+
// each stroke offset shadowOffset from the last.
|
67 |
+
this.shadowDepth = 5;
|
68 |
+
// prop: shadowAlpha
|
69 |
+
// transparency of the shadow (0 = transparent, 1 = opaque)
|
70 |
+
this.shadowAlpha = 0.08;
|
71 |
+
// prop: waterfall
|
72 |
+
// true to enable waterfall plot.
|
73 |
+
this.waterfall = false;
|
74 |
+
// prop: groups
|
75 |
+
// group bars into this many groups
|
76 |
+
this.groups = 1;
|
77 |
+
// prop: varyBarColor
|
78 |
+
// true to color each bar of a series separately rather than
|
79 |
+
// have every bar of a given series the same color.
|
80 |
+
// If used for non-stacked multiple series bar plots, user should
|
81 |
+
// specify a separate 'seriesColors' array for each series.
|
82 |
+
// Otherwise, each series will set their bars to the same color array.
|
83 |
+
// This option has no Effect for stacked bar charts and is disabled.
|
84 |
+
this.varyBarColor = false;
|
85 |
+
// prop: highlightMouseOver
|
86 |
+
// True to highlight slice when moused over.
|
87 |
+
// This must be false to enable highlightMouseDown to highlight when clicking on a slice.
|
88 |
+
this.highlightMouseOver = true;
|
89 |
+
// prop: highlightMouseDown
|
90 |
+
// True to highlight when a mouse button is pressed over a slice.
|
91 |
+
// This will be disabled if highlightMouseOver is true.
|
92 |
+
this.highlightMouseDown = false;
|
93 |
+
// prop: highlightColors
|
94 |
+
// an array of colors to use when highlighting a bar.
|
95 |
+
this.highlightColors = [];
|
96 |
+
// prop: transposedData
|
97 |
+
// NOT IMPLEMENTED YET. True if this is a horizontal bar plot and
|
98 |
+
// x and y values are "transposed". Tranposed, or "swapped", data is
|
99 |
+
// required prior to rev. 894 builds of jqPlot with horizontal bars.
|
100 |
+
// Allows backward compatability of bar renderer horizontal bars with
|
101 |
+
// old style data sets.
|
102 |
+
this.transposedData = true;
|
103 |
+
this.renderer.animation = {
|
104 |
+
show: false,
|
105 |
+
direction: 'down',
|
106 |
+
speed: 3000,
|
107 |
+
_supported: true
|
108 |
+
};
|
109 |
+
this._type = 'bar';
|
110 |
+
|
111 |
+
// if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
|
112 |
+
if (options.highlightMouseDown && options.highlightMouseOver == null) {
|
113 |
+
options.highlightMouseOver = false;
|
114 |
+
}
|
115 |
+
|
116 |
+
//////
|
117 |
+
// This is probably wrong here.
|
118 |
+
// After going back and forth on wether renderer should be the thing
|
119 |
+
// or extend the thing, it seems that it it best if it is a property
|
120 |
+
// on the thing. This should be something that is commonized
|
121 |
+
// among series renderers in the future.
|
122 |
+
//////
|
123 |
+
$.extend(true, this, options);
|
124 |
+
|
125 |
+
// really should probably do this
|
126 |
+
$.extend(true, this.renderer, options);
|
127 |
+
// fill is still needed to properly draw the legend.
|
128 |
+
// bars have to be filled.
|
129 |
+
this.fill = true;
|
130 |
+
|
131 |
+
// if horizontal bar and animating, reset the default direction
|
132 |
+
if (this.barDirection === 'horizontal' && this.rendererOptions.animation && this.rendererOptions.animation.direction == null) {
|
133 |
+
this.renderer.animation.direction = 'left';
|
134 |
+
}
|
135 |
+
|
136 |
+
if (this.waterfall) {
|
137 |
+
this.fillToZero = false;
|
138 |
+
this.disableStack = true;
|
139 |
+
}
|
140 |
+
|
141 |
+
if (this.barDirection == 'vertical' ) {
|
142 |
+
this._primaryAxis = '_xaxis';
|
143 |
+
this._stackAxis = 'y';
|
144 |
+
this.fillAxis = 'y';
|
145 |
+
}
|
146 |
+
else {
|
147 |
+
this._primaryAxis = '_yaxis';
|
148 |
+
this._stackAxis = 'x';
|
149 |
+
this.fillAxis = 'x';
|
150 |
+
}
|
151 |
+
// index of the currenty highlighted point, if any
|
152 |
+
this._highlightedPoint = null;
|
153 |
+
// total number of values for all bar series, total number of bar series, and position of this series
|
154 |
+
this._plotSeriesInfo = null;
|
155 |
+
// Array of actual data colors used for each data point.
|
156 |
+
this._dataColors = [];
|
157 |
+
this._barPoints = [];
|
158 |
+
|
159 |
+
// set the shape renderer options
|
160 |
+
var opts = {lineJoin:'miter', lineCap:'round', fill:true, isarc:false, strokeStyle:this.color, fillStyle:this.color, closePath:this.fill};
|
161 |
+
this.renderer.shapeRenderer.init(opts);
|
162 |
+
// set the shadow renderer options
|
163 |
+
var sopts = {lineJoin:'miter', lineCap:'round', fill:true, isarc:false, angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, depth:this.shadowDepth, closePath:this.fill};
|
164 |
+
this.renderer.shadowRenderer.init(sopts);
|
165 |
+
|
166 |
+
plot.postInitHooks.addOnce(postInit);
|
167 |
+
plot.postDrawHooks.addOnce(postPlotDraw);
|
168 |
+
plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
|
169 |
+
plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
|
170 |
+
plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
|
171 |
+
plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
|
172 |
+
plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
|
173 |
+
};
|
174 |
+
|
175 |
+
// called with scope of series
|
176 |
+
function barPreInit(target, data, seriesDefaults, options) {
|
177 |
+
if (this.rendererOptions.barDirection == 'horizontal') {
|
178 |
+
this._stackAxis = 'x';
|
179 |
+
this._primaryAxis = '_yaxis';
|
180 |
+
}
|
181 |
+
if (this.rendererOptions.waterfall == true) {
|
182 |
+
this._data = $.extend(true, [], this.data);
|
183 |
+
var sum = 0;
|
184 |
+
var pos = (!this.rendererOptions.barDirection || this.rendererOptions.barDirection === 'vertical' || this.transposedData === false) ? 1 : 0;
|
185 |
+
for(var i=0; i<this.data.length; i++) {
|
186 |
+
sum += this.data[i][pos];
|
187 |
+
if (i>0) {
|
188 |
+
this.data[i][pos] += this.data[i-1][pos];
|
189 |
+
}
|
190 |
+
}
|
191 |
+
this.data[this.data.length] = (pos == 1) ? [this.data.length+1, sum] : [sum, this.data.length+1];
|
192 |
+
this._data[this._data.length] = (pos == 1) ? [this._data.length+1, sum] : [sum, this._data.length+1];
|
193 |
+
}
|
194 |
+
if (this.rendererOptions.groups > 1) {
|
195 |
+
this.breakOnNull = true;
|
196 |
+
var l = this.data.length;
|
197 |
+
var skip = parseInt(l/this.rendererOptions.groups, 10);
|
198 |
+
var count = 0;
|
199 |
+
for (var i=skip; i<l; i+=skip) {
|
200 |
+
this.data.splice(i+count, 0, [null, null]);
|
201 |
+
this._plotData.splice(i+count, 0, [null, null]);
|
202 |
+
this._stackData.splice(i+count, 0, [null, null]);
|
203 |
+
count++;
|
204 |
+
}
|
205 |
+
for (i=0; i<this.data.length; i++) {
|
206 |
+
if (this._primaryAxis == '_xaxis') {
|
207 |
+
this.data[i][0] = i+1;
|
208 |
+
this._plotData[i][0] = i+1;
|
209 |
+
this._stackData[i][0] = i+1;
|
210 |
+
}
|
211 |
+
else {
|
212 |
+
this.data[i][1] = i+1;
|
213 |
+
this._plotData[i][1] = i+1;
|
214 |
+
this._stackData[i][1] = i+1;
|
215 |
+
}
|
216 |
+
}
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
$.jqplot.preSeriesInitHooks.push(barPreInit);
|
221 |
+
|
222 |
+
// needs to be called with scope of series, not renderer.
|
223 |
+
$.jqplot.BarRenderer.prototype.calcSeriesNumbers = function() {
|
224 |
+
var nvals = 0;
|
225 |
+
var nseries = 0;
|
226 |
+
var paxis = this[this._primaryAxis];
|
227 |
+
var s, series, pos;
|
228 |
+
// loop through all series on this axis
|
229 |
+
for (var i=0; i < paxis._series.length; i++) {
|
230 |
+
series = paxis._series[i];
|
231 |
+
if (series === this) {
|
232 |
+
pos = i;
|
233 |
+
}
|
234 |
+
// is the series rendered as a bar?
|
235 |
+
if (series.renderer.constructor == $.jqplot.BarRenderer) {
|
236 |
+
// gridData may not be computed yet, use data length insted
|
237 |
+
nvals += series.data.length;
|
238 |
+
nseries += 1;
|
239 |
+
}
|
240 |
+
}
|
241 |
+
// return total number of values for all bar series, total number of bar series, and position of this series
|
242 |
+
return [nvals, nseries, pos];
|
243 |
+
};
|
244 |
+
|
245 |
+
$.jqplot.BarRenderer.prototype.setBarWidth = function() {
|
246 |
+
// need to know how many data values we have on the approprate axis and figure it out.
|
247 |
+
var i;
|
248 |
+
var nvals = 0;
|
249 |
+
var nseries = 0;
|
250 |
+
var paxis = this[this._primaryAxis];
|
251 |
+
var s, series, pos;
|
252 |
+
var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
|
253 |
+
nvals = temp[0];
|
254 |
+
nseries = temp[1];
|
255 |
+
var nticks = paxis.numberTicks;
|
256 |
+
var nbins = (nticks-1)/2;
|
257 |
+
// so, now we have total number of axis values.
|
258 |
+
if (paxis.name == 'xaxis' || paxis.name == 'x2axis') {
|
259 |
+
if (this._stack) {
|
260 |
+
this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals * nseries - this.barMargin;
|
261 |
+
}
|
262 |
+
else {
|
263 |
+
this.barWidth = ((paxis._offsets.max - paxis._offsets.min)/nbins - this.barPadding * (nseries-1) - this.barMargin*2)/nseries;
|
264 |
+
// this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals - this.barPadding - this.barMargin/nseries;
|
265 |
+
}
|
266 |
+
}
|
267 |
+
else {
|
268 |
+
if (this._stack) {
|
269 |
+
this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals * nseries - this.barMargin;
|
270 |
+
}
|
271 |
+
else {
|
272 |
+
this.barWidth = ((paxis._offsets.min - paxis._offsets.max)/nbins - this.barPadding * (nseries-1) - this.barMargin*2)/nseries;
|
273 |
+
// this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals - this.barPadding - this.barMargin/nseries;
|
274 |
+
}
|
275 |
+
}
|
276 |
+
return [nvals, nseries];
|
277 |
+
};
|
278 |
+
|
279 |
+
function computeHighlightColors (colors) {
|
280 |
+
var ret = [];
|
281 |
+
for (var i=0; i<colors.length; i++){
|
282 |
+
var rgba = $.jqplot.getColorComponents(colors[i]);
|
283 |
+
var newrgb = [rgba[0], rgba[1], rgba[2]];
|
284 |
+
var sum = newrgb[0] + newrgb[1] + newrgb[2];
|
285 |
+
for (var j=0; j<3; j++) {
|
286 |
+
// when darkening, lowest color component can be is 60.
|
287 |
+
newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
|
288 |
+
newrgb[j] = parseInt(newrgb[j], 10);
|
289 |
+
}
|
290 |
+
ret.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
|
291 |
+
}
|
292 |
+
return ret;
|
293 |
+
}
|
294 |
+
|
295 |
+
function getStart(sidx, didx, comp, plot, axis) {
|
296 |
+
// check if sign change
|
297 |
+
var seriesIndex = sidx,
|
298 |
+
prevSeriesIndex = sidx - 1,
|
299 |
+
start,
|
300 |
+
prevVal,
|
301 |
+
aidx = (axis === 'x') ? 0 : 1;
|
302 |
+
|
303 |
+
// is this not the first series?
|
304 |
+
if (seriesIndex > 0) {
|
305 |
+
prevVal = plot.series[prevSeriesIndex]._plotData[didx][aidx];
|
306 |
+
|
307 |
+
// is there a sign change
|
308 |
+
if ((comp * prevVal) < 0) {
|
309 |
+
start = getStart(prevSeriesIndex, didx, comp, plot, axis);
|
310 |
+
}
|
311 |
+
|
312 |
+
// no sign change.
|
313 |
+
else {
|
314 |
+
start = plot.series[prevSeriesIndex].gridData[didx][aidx];
|
315 |
+
}
|
316 |
+
|
317 |
+
}
|
318 |
+
|
319 |
+
// if first series, return value at 0
|
320 |
+
else {
|
321 |
+
|
322 |
+
start = (aidx === 0) ? plot.series[seriesIndex]._xaxis.series_u2p(0) : plot.series[seriesIndex]._yaxis.series_u2p(0);
|
323 |
+
}
|
324 |
+
|
325 |
+
return start;
|
326 |
+
}
|
327 |
+
|
328 |
+
|
329 |
+
$.jqplot.BarRenderer.prototype.draw = function(ctx, gridData, options, plot) {
|
330 |
+
var i;
|
331 |
+
// Ughhh, have to make a copy of options b/c it may be modified later.
|
332 |
+
var opts = $.extend({}, options);
|
333 |
+
var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
|
334 |
+
var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
|
335 |
+
var fill = (opts.fill != undefined) ? opts.fill : this.fill;
|
336 |
+
var xaxis = this.xaxis;
|
337 |
+
var yaxis = this.yaxis;
|
338 |
+
var xp = this._xaxis.series_u2p;
|
339 |
+
var yp = this._yaxis.series_u2p;
|
340 |
+
var pointx, pointy;
|
341 |
+
// clear out data colors.
|
342 |
+
this._dataColors = [];
|
343 |
+
this._barPoints = [];
|
344 |
+
|
345 |
+
if (this.barWidth == null) {
|
346 |
+
this.renderer.setBarWidth.call(this);
|
347 |
+
}
|
348 |
+
|
349 |
+
var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
|
350 |
+
var nvals = temp[0];
|
351 |
+
var nseries = temp[1];
|
352 |
+
var pos = temp[2];
|
353 |
+
var points = [];
|
354 |
+
|
355 |
+
if (this._stack) {
|
356 |
+
this._barNudge = 0;
|
357 |
+
}
|
358 |
+
else {
|
359 |
+
this._barNudge = (-Math.abs(nseries/2 - 0.5) + pos) * (this.barWidth + this.barPadding);
|
360 |
+
}
|
361 |
+
if (showLine) {
|
362 |
+
var negativeColors = new $.jqplot.ColorGenerator(this.negativeSeriesColors);
|
363 |
+
var positiveColors = new $.jqplot.ColorGenerator(this.seriesColors);
|
364 |
+
var negativeColor = negativeColors.get(this.index);
|
365 |
+
if (! this.useNegativeColors) {
|
366 |
+
negativeColor = opts.fillStyle;
|
367 |
+
}
|
368 |
+
var positiveColor = opts.fillStyle;
|
369 |
+
var base;
|
370 |
+
var xstart;
|
371 |
+
var ystart;
|
372 |
+
|
373 |
+
if (this.barDirection == 'vertical') {
|
374 |
+
for (var i=0; i<gridData.length; i++) {
|
375 |
+
if (!this._stack && this.data[i][1] == null) {
|
376 |
+
continue;
|
377 |
+
}
|
378 |
+
points = [];
|
379 |
+
base = gridData[i][0] + this._barNudge;
|
380 |
+
|
381 |
+
// stacked
|
382 |
+
if (this._stack && this._prevGridData.length) {
|
383 |
+
ystart = getStart(this.index, i, this._plotData[i][1], plot, 'y');
|
384 |
+
}
|
385 |
+
|
386 |
+
// not stacked
|
387 |
+
else {
|
388 |
+
if (this.fillToZero) {
|
389 |
+
ystart = this._yaxis.series_u2p(0);
|
390 |
+
}
|
391 |
+
else if (this.waterfall && i > 0 && i < this.gridData.length-1) {
|
392 |
+
ystart = this.gridData[i-1][1];
|
393 |
+
}
|
394 |
+
else if (this.waterfall && i == 0 && i < this.gridData.length-1) {
|
395 |
+
if (this._yaxis.min <= 0 && this._yaxis.max >= 0) {
|
396 |
+
ystart = this._yaxis.series_u2p(0);
|
397 |
+
}
|
398 |
+
else if (this._yaxis.min > 0) {
|
399 |
+
ystart = ctx.canvas.height;
|
400 |
+
}
|
401 |
+
else {
|
402 |
+
ystart = 0;
|
403 |
+
}
|
404 |
+
}
|
405 |
+
else if (this.waterfall && i == this.gridData.length - 1) {
|
406 |
+
if (this._yaxis.min <= 0 && this._yaxis.max >= 0) {
|
407 |
+
ystart = this._yaxis.series_u2p(0);
|
408 |
+
}
|
409 |
+
else if (this._yaxis.min > 0) {
|
410 |
+
ystart = ctx.canvas.height;
|
411 |
+
}
|
412 |
+
else {
|
413 |
+
ystart = 0;
|
414 |
+
}
|
415 |
+
}
|
416 |
+
else {
|
417 |
+
ystart = ctx.canvas.height;
|
418 |
+
}
|
419 |
+
}
|
420 |
+
if ((this.fillToZero && this._plotData[i][1] < 0) || (this.waterfall && this._data[i][1] < 0)) {
|
421 |
+
if (this.varyBarColor && !this._stack) {
|
422 |
+
if (this.useNegativeColors) {
|
423 |
+
opts.fillStyle = negativeColors.next();
|
424 |
+
}
|
425 |
+
else {
|
426 |
+
opts.fillStyle = positiveColors.next();
|
427 |
+
}
|
428 |
+
}
|
429 |
+
else {
|
430 |
+
opts.fillStyle = negativeColor;
|
431 |
+
}
|
432 |
+
}
|
433 |
+
else {
|
434 |
+
if (this.varyBarColor && !this._stack) {
|
435 |
+
opts.fillStyle = positiveColors.next();
|
436 |
+
}
|
437 |
+
else {
|
438 |
+
opts.fillStyle = positiveColor;
|
439 |
+
}
|
440 |
+
}
|
441 |
+
|
442 |
+
if (!this.fillToZero || this._plotData[i][1] >= 0) {
|
443 |
+
points.push([base-this.barWidth/2, ystart]);
|
444 |
+
points.push([base-this.barWidth/2, gridData[i][1]]);
|
445 |
+
points.push([base+this.barWidth/2, gridData[i][1]]);
|
446 |
+
points.push([base+this.barWidth/2, ystart]);
|
447 |
+
}
|
448 |
+
// for negative bars make sure points are always ordered clockwise
|
449 |
+
else {
|
450 |
+
points.push([base-this.barWidth/2, gridData[i][1]]);
|
451 |
+
points.push([base-this.barWidth/2, ystart]);
|
452 |
+
points.push([base+this.barWidth/2, ystart]);
|
453 |
+
points.push([base+this.barWidth/2, gridData[i][1]]);
|
454 |
+
}
|
455 |
+
this._barPoints.push(points);
|
456 |
+
// now draw the shadows if not stacked.
|
457 |
+
// for stacked plots, they are predrawn by drawShadow
|
458 |
+
if (shadow && !this._stack) {
|
459 |
+
var sopts = $.extend(true, {}, opts);
|
460 |
+
// need to get rid of fillStyle on shadow.
|
461 |
+
delete sopts.fillStyle;
|
462 |
+
this.renderer.shadowRenderer.draw(ctx, points, sopts);
|
463 |
+
}
|
464 |
+
var clr = opts.fillStyle || this.color;
|
465 |
+
this._dataColors.push(clr);
|
466 |
+
this.renderer.shapeRenderer.draw(ctx, points, opts);
|
467 |
+
}
|
468 |
+
}
|
469 |
+
|
470 |
+
else if (this.barDirection == 'horizontal'){
|
471 |
+
for (var i=0; i<gridData.length; i++) {
|
472 |
+
if (!this._stack && this.data[i][0] == null) {
|
473 |
+
continue;
|
474 |
+
}
|
475 |
+
points = [];
|
476 |
+
base = gridData[i][1] - this._barNudge;
|
477 |
+
xstart;
|
478 |
+
|
479 |
+
if (this._stack && this._prevGridData.length) {
|
480 |
+
xstart = getStart(this.index, i, this._plotData[i][0], plot, 'x');
|
481 |
+
}
|
482 |
+
// not stacked
|
483 |
+
else {
|
484 |
+
if (this.fillToZero) {
|
485 |
+
xstart = this._xaxis.series_u2p(0);
|
486 |
+
}
|
487 |
+
else if (this.waterfall && i > 0 && i < this.gridData.length-1) {
|
488 |
+
xstart = this.gridData[i-1][0];
|
489 |
+
}
|
490 |
+
else if (this.waterfall && i == 0 && i < this.gridData.length-1) {
|
491 |
+
if (this._xaxis.min <= 0 && this._xaxis.max >= 0) {
|
492 |
+
xstart = this._xaxis.series_u2p(0);
|
493 |
+
}
|
494 |
+
else if (this._xaxis.min > 0) {
|
495 |
+
xstart = 0;
|
496 |
+
}
|
497 |
+
else {
|
498 |
+
xstart = 0;
|
499 |
+
}
|
500 |
+
}
|
501 |
+
else if (this.waterfall && i == this.gridData.length - 1) {
|
502 |
+
if (this._xaxis.min <= 0 && this._xaxis.max >= 0) {
|
503 |
+
xstart = this._xaxis.series_u2p(0);
|
504 |
+
}
|
505 |
+
else if (this._xaxis.min > 0) {
|
506 |
+
xstart = 0;
|
507 |
+
}
|
508 |
+
else {
|
509 |
+
xstart = ctx.canvas.width;
|
510 |
+
}
|
511 |
+
}
|
512 |
+
else {
|
513 |
+
xstart = 0;
|
514 |
+
}
|
515 |
+
}
|
516 |
+
if ((this.fillToZero && this._plotData[i][1] < 0) || (this.waterfall && this._data[i][1] < 0)) {
|
517 |
+
if (this.varyBarColor && !this._stack) {
|
518 |
+
if (this.useNegativeColors) {
|
519 |
+
opts.fillStyle = negativeColors.next();
|
520 |
+
}
|
521 |
+
else {
|
522 |
+
opts.fillStyle = positiveColors.next();
|
523 |
+
}
|
524 |
+
}
|
525 |
+
}
|
526 |
+
else {
|
527 |
+
if (this.varyBarColor && !this._stack) {
|
528 |
+
opts.fillStyle = positiveColors.next();
|
529 |
+
}
|
530 |
+
else {
|
531 |
+
opts.fillStyle = positiveColor;
|
532 |
+
}
|
533 |
+
}
|
534 |
+
|
535 |
+
|
536 |
+
if (!this.fillToZero || this._plotData[i][0] >= 0) {
|
537 |
+
points.push([xstart, base + this.barWidth / 2]);
|
538 |
+
points.push([xstart, base - this.barWidth / 2]);
|
539 |
+
points.push([gridData[i][0], base - this.barWidth / 2]);
|
540 |
+
points.push([gridData[i][0], base + this.barWidth / 2]);
|
541 |
+
}
|
542 |
+
else {
|
543 |
+
points.push([gridData[i][0], base + this.barWidth / 2]);
|
544 |
+
points.push([gridData[i][0], base - this.barWidth / 2]);
|
545 |
+
points.push([xstart, base - this.barWidth / 2]);
|
546 |
+
points.push([xstart, base + this.barWidth / 2]);
|
547 |
+
}
|
548 |
+
|
549 |
+
this._barPoints.push(points);
|
550 |
+
// now draw the shadows if not stacked.
|
551 |
+
// for stacked plots, they are predrawn by drawShadow
|
552 |
+
if (shadow && !this._stack) {
|
553 |
+
var sopts = $.extend(true, {}, opts);
|
554 |
+
delete sopts.fillStyle;
|
555 |
+
this.renderer.shadowRenderer.draw(ctx, points, sopts);
|
556 |
+
}
|
557 |
+
var clr = opts.fillStyle || this.color;
|
558 |
+
this._dataColors.push(clr);
|
559 |
+
this.renderer.shapeRenderer.draw(ctx, points, opts);
|
560 |
+
}
|
561 |
+
}
|
562 |
+
}
|
563 |
+
|
564 |
+
if (this.highlightColors.length == 0) {
|
565 |
+
this.highlightColors = $.jqplot.computeHighlightColors(this._dataColors);
|
566 |
+
}
|
567 |
+
|
568 |
+
else if (typeof(this.highlightColors) == 'string') {
|
569 |
+
var temp = this.highlightColors;
|
570 |
+
this.highlightColors = [];
|
571 |
+
for (var i=0; i<this._dataColors.length; i++) {
|
572 |
+
this.highlightColors.push(temp);
|
573 |
+
}
|
574 |
+
}
|
575 |
+
|
576 |
+
};
|
577 |
+
|
578 |
+
|
579 |
+
// for stacked plots, shadows will be pre drawn by drawShadow.
|
580 |
+
$.jqplot.BarRenderer.prototype.drawShadow = function(ctx, gridData, options, plot) {
|
581 |
+
var i;
|
582 |
+
var opts = (options != undefined) ? options : {};
|
583 |
+
var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
|
584 |
+
var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
|
585 |
+
var fill = (opts.fill != undefined) ? opts.fill : this.fill;
|
586 |
+
var xaxis = this.xaxis;
|
587 |
+
var yaxis = this.yaxis;
|
588 |
+
var xp = this._xaxis.series_u2p;
|
589 |
+
var yp = this._yaxis.series_u2p;
|
590 |
+
var pointx, points, pointy, nvals, nseries, pos;
|
591 |
+
|
592 |
+
if (this._stack && this.shadow) {
|
593 |
+
if (this.barWidth == null) {
|
594 |
+
this.renderer.setBarWidth.call(this);
|
595 |
+
}
|
596 |
+
|
597 |
+
var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this);
|
598 |
+
nvals = temp[0];
|
599 |
+
nseries = temp[1];
|
600 |
+
pos = temp[2];
|
601 |
+
|
602 |
+
if (this._stack) {
|
603 |
+
this._barNudge = 0;
|
604 |
+
}
|
605 |
+
else {
|
606 |
+
this._barNudge = (-Math.abs(nseries/2 - 0.5) + pos) * (this.barWidth + this.barPadding);
|
607 |
+
}
|
608 |
+
if (showLine) {
|
609 |
+
|
610 |
+
if (this.barDirection == 'vertical') {
|
611 |
+
for (var i=0; i<gridData.length; i++) {
|
612 |
+
if (this.data[i][1] == null) {
|
613 |
+
continue;
|
614 |
+
}
|
615 |
+
points = [];
|
616 |
+
var base = gridData[i][0] + this._barNudge;
|
617 |
+
var ystart;
|
618 |
+
|
619 |
+
if (this._stack && this._prevGridData.length) {
|
620 |
+
ystart = getStart(this.index, i, this._plotData[i][1], plot, 'y');
|
621 |
+
}
|
622 |
+
else {
|
623 |
+
if (this.fillToZero) {
|
624 |
+
ystart = this._yaxis.series_u2p(0);
|
625 |
+
}
|
626 |
+
else {
|
627 |
+
ystart = ctx.canvas.height;
|
628 |
+
}
|
629 |
+
}
|
630 |
+
|
631 |
+
points.push([base-this.barWidth/2, ystart]);
|
632 |
+
points.push([base-this.barWidth/2, gridData[i][1]]);
|
633 |
+
points.push([base+this.barWidth/2, gridData[i][1]]);
|
634 |
+
points.push([base+this.barWidth/2, ystart]);
|
635 |
+
this.renderer.shadowRenderer.draw(ctx, points, opts);
|
636 |
+
}
|
637 |
+
}
|
638 |
+
|
639 |
+
else if (this.barDirection == 'horizontal'){
|
640 |
+
for (var i=0; i<gridData.length; i++) {
|
641 |
+
if (this.data[i][0] == null) {
|
642 |
+
continue;
|
643 |
+
}
|
644 |
+
points = [];
|
645 |
+
var base = gridData[i][1] - this._barNudge;
|
646 |
+
var xstart;
|
647 |
+
|
648 |
+
if (this._stack && this._prevGridData.length) {
|
649 |
+
xstart = getStart(this.index, i, this._plotData[i][0], plot, 'x');
|
650 |
+
}
|
651 |
+
else {
|
652 |
+
if (this.fillToZero) {
|
653 |
+
xstart = this._xaxis.series_u2p(0);
|
654 |
+
}
|
655 |
+
else {
|
656 |
+
xstart = 0;
|
657 |
+
}
|
658 |
+
}
|
659 |
+
|
660 |
+
points.push([xstart, base+this.barWidth/2]);
|
661 |
+
points.push([gridData[i][0], base+this.barWidth/2]);
|
662 |
+
points.push([gridData[i][0], base-this.barWidth/2]);
|
663 |
+
points.push([xstart, base-this.barWidth/2]);
|
664 |
+
this.renderer.shadowRenderer.draw(ctx, points, opts);
|
665 |
+
}
|
666 |
+
}
|
667 |
+
}
|
668 |
+
|
669 |
+
}
|
670 |
+
};
|
671 |
+
|
672 |
+
function postInit(target, data, options) {
|
673 |
+
for (var i=0; i<this.series.length; i++) {
|
674 |
+
if (this.series[i].renderer.constructor == $.jqplot.BarRenderer) {
|
675 |
+
// don't allow mouseover and mousedown at same time.
|
676 |
+
if (this.series[i].highlightMouseOver) {
|
677 |
+
this.series[i].highlightMouseDown = false;
|
678 |
+
}
|
679 |
+
}
|
680 |
+
}
|
681 |
+
}
|
682 |
+
|
683 |
+
// called within context of plot
|
684 |
+
// create a canvas which we can draw on.
|
685 |
+
// insert it before the eventCanvas, so eventCanvas will still capture events.
|
686 |
+
function postPlotDraw() {
|
687 |
+
// Memory Leaks patch
|
688 |
+
if (this.plugins.barRenderer && this.plugins.barRenderer.highlightCanvas) {
|
689 |
+
|
690 |
+
this.plugins.barRenderer.highlightCanvas.resetCanvas();
|
691 |
+
this.plugins.barRenderer.highlightCanvas = null;
|
692 |
+
}
|
693 |
+
|
694 |
+
this.plugins.barRenderer = {highlightedSeriesIndex:null};
|
695 |
+
this.plugins.barRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
|
696 |
+
|
697 |
+
this.eventCanvas._elem.before(this.plugins.barRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-barRenderer-highlight-canvas', this._plotDimensions, this));
|
698 |
+
this.plugins.barRenderer.highlightCanvas.setContext();
|
699 |
+
this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
|
700 |
+
}
|
701 |
+
|
702 |
+
function highlight (plot, sidx, pidx, points) {
|
703 |
+
var s = plot.series[sidx];
|
704 |
+
var canvas = plot.plugins.barRenderer.highlightCanvas;
|
705 |
+
canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
|
706 |
+
s._highlightedPoint = pidx;
|
707 |
+
plot.plugins.barRenderer.highlightedSeriesIndex = sidx;
|
708 |
+
var opts = {fillStyle: s.highlightColors[pidx]};
|
709 |
+
s.renderer.shapeRenderer.draw(canvas._ctx, points, opts);
|
710 |
+
canvas = null;
|
711 |
+
}
|
712 |
+
|
713 |
+
function unhighlight (plot) {
|
714 |
+
var canvas = plot.plugins.barRenderer.highlightCanvas;
|
715 |
+
canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
|
716 |
+
for (var i=0; i<plot.series.length; i++) {
|
717 |
+
plot.series[i]._highlightedPoint = null;
|
718 |
+
}
|
719 |
+
plot.plugins.barRenderer.highlightedSeriesIndex = null;
|
720 |
+
plot.target.trigger('jqplotDataUnhighlight');
|
721 |
+
canvas = null;
|
722 |
+
}
|
723 |
+
|
724 |
+
|
725 |
+
function handleMove(ev, gridpos, datapos, neighbor, plot) {
|
726 |
+
if (neighbor) {
|
727 |
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
728 |
+
var evt1 = jQuery.Event('jqplotDataMouseOver');
|
729 |
+
evt1.pageX = ev.pageX;
|
730 |
+
evt1.pageY = ev.pageY;
|
731 |
+
plot.target.trigger(evt1, ins);
|
732 |
+
if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
|
733 |
+
var evt = jQuery.Event('jqplotDataHighlight');
|
734 |
+
evt.which = ev.which;
|
735 |
+
evt.pageX = ev.pageX;
|
736 |
+
evt.pageY = ev.pageY;
|
737 |
+
plot.target.trigger(evt, ins);
|
738 |
+
highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
|
739 |
+
}
|
740 |
+
}
|
741 |
+
else if (neighbor == null) {
|
742 |
+
unhighlight (plot);
|
743 |
+
}
|
744 |
+
}
|
745 |
+
|
746 |
+
function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
|
747 |
+
if (neighbor) {
|
748 |
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
749 |
+
if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
|
750 |
+
var evt = jQuery.Event('jqplotDataHighlight');
|
751 |
+
evt.which = ev.which;
|
752 |
+
evt.pageX = ev.pageX;
|
753 |
+
evt.pageY = ev.pageY;
|
754 |
+
plot.target.trigger(evt, ins);
|
755 |
+
highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points);
|
756 |
+
}
|
757 |
+
}
|
758 |
+
else if (neighbor == null) {
|
759 |
+
unhighlight (plot);
|
760 |
+
}
|
761 |
+
}
|
762 |
+
|
763 |
+
function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
|
764 |
+
var idx = plot.plugins.barRenderer.highlightedSeriesIndex;
|
765 |
+
if (idx != null && plot.series[idx].highlightMouseDown) {
|
766 |
+
unhighlight(plot);
|
767 |
+
}
|
768 |
+
}
|
769 |
+
|
770 |
+
function handleClick(ev, gridpos, datapos, neighbor, plot) {
|
771 |
+
if (neighbor) {
|
772 |
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
773 |
+
var evt = jQuery.Event('jqplotDataClick');
|
774 |
+
evt.which = ev.which;
|
775 |
+
evt.pageX = ev.pageX;
|
776 |
+
evt.pageY = ev.pageY;
|
777 |
+
plot.target.trigger(evt, ins);
|
778 |
+
}
|
779 |
+
}
|
780 |
+
|
781 |
+
function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
|
782 |
+
if (neighbor) {
|
783 |
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
784 |
+
var idx = plot.plugins.barRenderer.highlightedSeriesIndex;
|
785 |
+
if (idx != null && plot.series[idx].highlightMouseDown) {
|
786 |
+
unhighlight(plot);
|
787 |
+
}
|
788 |
+
var evt = jQuery.Event('jqplotDataRightClick');
|
789 |
+
evt.which = ev.which;
|
790 |
+
evt.pageX = ev.pageX;
|
791 |
+
evt.pageY = ev.pageY;
|
792 |
+
plot.target.trigger(evt, ins);
|
793 |
+
}
|
794 |
+
}
|
795 |
+
|
796 |
+
|
797 |
+
})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.barRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(d){d.jqplot.BarRenderer=function(){d.jqplot.LineRenderer.call(this)};d.jqplot.BarRenderer.prototype=new d.jqplot.LineRenderer();d.jqplot.BarRenderer.prototype.constructor=d.jqplot.BarRenderer;d.jqplot.BarRenderer.prototype.init=function(o,q){this.barPadding=8;this.barMargin=10;this.barDirection="vertical";this.barWidth=null;this.shadowOffset=2;this.shadowDepth=5;this.shadowAlpha=0.08;this.waterfall=false;this.groups=1;this.varyBarColor=false;this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColors=[];this.transposedData=true;this.renderer.animation={show:false,direction:"down",speed:3000,_supported:true};this._type="bar";if(o.highlightMouseDown&&o.highlightMouseOver==null){o.highlightMouseOver=false}d.extend(true,this,o);d.extend(true,this.renderer,o);this.fill=true;if(this.barDirection==="horizontal"&&this.rendererOptions.animation&&this.rendererOptions.animation.direction==null){this.renderer.animation.direction="left"}if(this.waterfall){this.fillToZero=false;this.disableStack=true}if(this.barDirection=="vertical"){this._primaryAxis="_xaxis";this._stackAxis="y";this.fillAxis="y"}else{this._primaryAxis="_yaxis";this._stackAxis="x";this.fillAxis="x"}this._highlightedPoint=null;this._plotSeriesInfo=null;this._dataColors=[];this._barPoints=[];var p={lineJoin:"miter",lineCap:"round",fill:true,isarc:false,strokeStyle:this.color,fillStyle:this.color,closePath:this.fill};this.renderer.shapeRenderer.init(p);var n={lineJoin:"miter",lineCap:"round",fill:true,isarc:false,angle:this.shadowAngle,offset:this.shadowOffset,alpha:this.shadowAlpha,depth:this.shadowDepth,closePath:this.fill};this.renderer.shadowRenderer.init(n);q.postInitHooks.addOnce(h);q.postDrawHooks.addOnce(j);q.eventListenerHooks.addOnce("jqplotMouseMove",b);q.eventListenerHooks.addOnce("jqplotMouseDown",a);q.eventListenerHooks.addOnce("jqplotMouseUp",l);q.eventListenerHooks.addOnce("jqplotClick",e);q.eventListenerHooks.addOnce("jqplotRightClick",m)};function g(t,p,o,w){if(this.rendererOptions.barDirection=="horizontal"){this._stackAxis="x";this._primaryAxis="_yaxis"}if(this.rendererOptions.waterfall==true){this._data=d.extend(true,[],this.data);var s=0;var u=(!this.rendererOptions.barDirection||this.rendererOptions.barDirection==="vertical"||this.transposedData===false)?1:0;for(var q=0;q<this.data.length;q++){s+=this.data[q][u];if(q>0){this.data[q][u]+=this.data[q-1][u]}}this.data[this.data.length]=(u==1)?[this.data.length+1,s]:[s,this.data.length+1];this._data[this._data.length]=(u==1)?[this._data.length+1,s]:[s,this._data.length+1]}if(this.rendererOptions.groups>1){this.breakOnNull=true;var n=this.data.length;var v=parseInt(n/this.rendererOptions.groups,10);var r=0;for(var q=v;q<n;q+=v){this.data.splice(q+r,0,[null,null]);this._plotData.splice(q+r,0,[null,null]);this._stackData.splice(q+r,0,[null,null]);r++}for(q=0;q<this.data.length;q++){if(this._primaryAxis=="_xaxis"){this.data[q][0]=q+1;this._plotData[q][0]=q+1;this._stackData[q][0]=q+1}else{this.data[q][1]=q+1;this._plotData[q][1]=q+1;this._stackData[q][1]=q+1}}}}d.jqplot.preSeriesInitHooks.push(g);d.jqplot.BarRenderer.prototype.calcSeriesNumbers=function(){var r=0;var t=0;var q=this[this._primaryAxis];var p,o,u;for(var n=0;n<q._series.length;n++){o=q._series[n];if(o===this){u=n}if(o.renderer.constructor==d.jqplot.BarRenderer){r+=o.data.length;t+=1}}return[r,t,u]};d.jqplot.BarRenderer.prototype.setBarWidth=function(){var q;var n=0;var o=0;var t=this[this._primaryAxis];var x,r,v;var w=this._plotSeriesInfo=this.renderer.calcSeriesNumbers.call(this);n=w[0];o=w[1];var u=t.numberTicks;var p=(u-1)/2;if(t.name=="xaxis"||t.name=="x2axis"){if(this._stack){this.barWidth=(t._offsets.max-t._offsets.min)/n*o-this.barMargin}else{this.barWidth=((t._offsets.max-t._offsets.min)/p-this.barPadding*(o-1)-this.barMargin*2)/o}}else{if(this._stack){this.barWidth=(t._offsets.min-t._offsets.max)/n*o-this.barMargin}else{this.barWidth=((t._offsets.min-t._offsets.max)/p-this.barPadding*(o-1)-this.barMargin*2)/o}}return[n,o]};function f(o){var q=[];for(var s=0;s<o.length;s++){var r=d.jqplot.getColorComponents(o[s]);var n=[r[0],r[1],r[2]];var t=n[0]+n[1]+n[2];for(var p=0;p<3;p++){n[p]=(t>570)?n[p]*0.8:n[p]+0.3*(255-n[p]);n[p]=parseInt(n[p],10)}q.push("rgb("+n[0]+","+n[1]+","+n[2]+")")}return q}function i(v,u,s,t,o){var q=v,w=v-1,n,p,r=(o==="x")?0:1;if(q>0){p=t.series[w]._plotData[u][r];if((s*p)<0){n=i(w,u,s,t,o)}else{n=t.series[w].gridData[u][r]}}else{n=(r===0)?t.series[q]._xaxis.series_u2p(0):t.series[q]._yaxis.series_u2p(0)}return n}d.jqplot.BarRenderer.prototype.draw=function(E,L,q,G){var I;var A=d.extend({},q);var w=(A.shadow!=undefined)?A.shadow:this.shadow;var O=(A.showLine!=undefined)?A.showLine:this.showLine;var F=(A.fill!=undefined)?A.fill:this.fill;var p=this.xaxis;var J=this.yaxis;var y=this._xaxis.series_u2p;var K=this._yaxis.series_u2p;var D,C;this._dataColors=[];this._barPoints=[];if(this.barWidth==null){this.renderer.setBarWidth.call(this)}var N=this._plotSeriesInfo=this.renderer.calcSeriesNumbers.call(this);var x=N[0];var v=N[1];var s=N[2];var H=[];if(this._stack){this._barNudge=0}else{this._barNudge=(-Math.abs(v/2-0.5)+s)*(this.barWidth+this.barPadding)}if(O){var u=new d.jqplot.ColorGenerator(this.negativeSeriesColors);var B=new d.jqplot.ColorGenerator(this.seriesColors);var M=u.get(this.index);if(!this.useNegativeColors){M=A.fillStyle}var t=A.fillStyle;var r;var P;var o;if(this.barDirection=="vertical"){for(var I=0;I<L.length;I++){if(!this._stack&&this.data[I][1]==null){continue}H=[];r=L[I][0]+this._barNudge;if(this._stack&&this._prevGridData.length){o=i(this.index,I,this._plotData[I][1],G,"y")}else{if(this.fillToZero){o=this._yaxis.series_u2p(0)}else{if(this.waterfall&&I>0&&I<this.gridData.length-1){o=this.gridData[I-1][1]}else{if(this.waterfall&&I==0&&I<this.gridData.length-1){if(this._yaxis.min<=0&&this._yaxis.max>=0){o=this._yaxis.series_u2p(0)}else{if(this._yaxis.min>0){o=E.canvas.height}else{o=0}}}else{if(this.waterfall&&I==this.gridData.length-1){if(this._yaxis.min<=0&&this._yaxis.max>=0){o=this._yaxis.series_u2p(0)}else{if(this._yaxis.min>0){o=E.canvas.height}else{o=0}}}else{o=E.canvas.height}}}}}if((this.fillToZero&&this._plotData[I][1]<0)||(this.waterfall&&this._data[I][1]<0)){if(this.varyBarColor&&!this._stack){if(this.useNegativeColors){A.fillStyle=u.next()}else{A.fillStyle=B.next()}}else{A.fillStyle=M}}else{if(this.varyBarColor&&!this._stack){A.fillStyle=B.next()}else{A.fillStyle=t}}if(!this.fillToZero||this._plotData[I][1]>=0){H.push([r-this.barWidth/2,o]);H.push([r-this.barWidth/2,L[I][1]]);H.push([r+this.barWidth/2,L[I][1]]);H.push([r+this.barWidth/2,o])}else{H.push([r-this.barWidth/2,L[I][1]]);H.push([r-this.barWidth/2,o]);H.push([r+this.barWidth/2,o]);H.push([r+this.barWidth/2,L[I][1]])}this._barPoints.push(H);if(w&&!this._stack){var z=d.extend(true,{},A);delete z.fillStyle;this.renderer.shadowRenderer.draw(E,H,z)}var n=A.fillStyle||this.color;this._dataColors.push(n);this.renderer.shapeRenderer.draw(E,H,A)}}else{if(this.barDirection=="horizontal"){for(var I=0;I<L.length;I++){if(!this._stack&&this.data[I][0]==null){continue}H=[];r=L[I][1]-this._barNudge;P;if(this._stack&&this._prevGridData.length){P=i(this.index,I,this._plotData[I][0],G,"x")}else{if(this.fillToZero){P=this._xaxis.series_u2p(0)}else{if(this.waterfall&&I>0&&I<this.gridData.length-1){P=this.gridData[I-1][0]}else{if(this.waterfall&&I==0&&I<this.gridData.length-1){if(this._xaxis.min<=0&&this._xaxis.max>=0){P=this._xaxis.series_u2p(0)}else{if(this._xaxis.min>0){P=0}else{P=0}}}else{if(this.waterfall&&I==this.gridData.length-1){if(this._xaxis.min<=0&&this._xaxis.max>=0){P=this._xaxis.series_u2p(0)}else{if(this._xaxis.min>0){P=0}else{P=E.canvas.width}}}else{P=0}}}}}if((this.fillToZero&&this._plotData[I][1]<0)||(this.waterfall&&this._data[I][1]<0)){if(this.varyBarColor&&!this._stack){if(this.useNegativeColors){A.fillStyle=u.next()}else{A.fillStyle=B.next()}}}else{if(this.varyBarColor&&!this._stack){A.fillStyle=B.next()}else{A.fillStyle=t}}if(!this.fillToZero||this._plotData[I][0]>=0){H.push([P,r+this.barWidth/2]);H.push([P,r-this.barWidth/2]);H.push([L[I][0],r-this.barWidth/2]);H.push([L[I][0],r+this.barWidth/2])}else{H.push([L[I][0],r+this.barWidth/2]);H.push([L[I][0],r-this.barWidth/2]);H.push([P,r-this.barWidth/2]);H.push([P,r+this.barWidth/2])}this._barPoints.push(H);if(w&&!this._stack){var z=d.extend(true,{},A);delete z.fillStyle;this.renderer.shadowRenderer.draw(E,H,z)}var n=A.fillStyle||this.color;this._dataColors.push(n);this.renderer.shapeRenderer.draw(E,H,A)}}}}if(this.highlightColors.length==0){this.highlightColors=d.jqplot.computeHighlightColors(this._dataColors)}else{if(typeof(this.highlightColors)=="string"){var N=this.highlightColors;this.highlightColors=[];for(var I=0;I<this._dataColors.length;I++){this.highlightColors.push(N)}}}};d.jqplot.BarRenderer.prototype.drawShadow=function(z,G,p,B){var D;var w=(p!=undefined)?p:{};var t=(w.shadow!=undefined)?w.shadow:this.shadow;var I=(w.showLine!=undefined)?w.showLine:this.showLine;var A=(w.fill!=undefined)?w.fill:this.fill;var o=this.xaxis;var E=this.yaxis;var v=this._xaxis.series_u2p;var F=this._yaxis.series_u2p;var y,C,x,u,s,r;if(this._stack&&this.shadow){if(this.barWidth==null){this.renderer.setBarWidth.call(this)}var H=this._plotSeriesInfo=this.renderer.calcSeriesNumbers.call(this);u=H[0];s=H[1];r=H[2];if(this._stack){this._barNudge=0}else{this._barNudge=(-Math.abs(s/2-0.5)+r)*(this.barWidth+this.barPadding)}if(I){if(this.barDirection=="vertical"){for(var D=0;D<G.length;D++){if(this.data[D][1]==null){continue}C=[];var q=G[D][0]+this._barNudge;var n;if(this._stack&&this._prevGridData.length){n=i(this.index,D,this._plotData[D][1],B,"y")}else{if(this.fillToZero){n=this._yaxis.series_u2p(0)}else{n=z.canvas.height}}C.push([q-this.barWidth/2,n]);C.push([q-this.barWidth/2,G[D][1]]);C.push([q+this.barWidth/2,G[D][1]]);C.push([q+this.barWidth/2,n]);this.renderer.shadowRenderer.draw(z,C,w)}}else{if(this.barDirection=="horizontal"){for(var D=0;D<G.length;D++){if(this.data[D][0]==null){continue}C=[];var q=G[D][1]-this._barNudge;var J;if(this._stack&&this._prevGridData.length){J=i(this.index,D,this._plotData[D][0],B,"x")}else{if(this.fillToZero){J=this._xaxis.series_u2p(0)}else{J=0}}C.push([J,q+this.barWidth/2]);C.push([G[D][0],q+this.barWidth/2]);C.push([G[D][0],q-this.barWidth/2]);C.push([J,q-this.barWidth/2]);this.renderer.shadowRenderer.draw(z,C,w)}}}}}};function h(q,p,n){for(var o=0;o<this.series.length;o++){if(this.series[o].renderer.constructor==d.jqplot.BarRenderer){if(this.series[o].highlightMouseOver){this.series[o].highlightMouseDown=false}}}}function j(){if(this.plugins.barRenderer&&this.plugins.barRenderer.highlightCanvas){this.plugins.barRenderer.highlightCanvas.resetCanvas();this.plugins.barRenderer.highlightCanvas=null}this.plugins.barRenderer={highlightedSeriesIndex:null};this.plugins.barRenderer.highlightCanvas=new d.jqplot.GenericCanvas();this.eventCanvas._elem.before(this.plugins.barRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-barRenderer-highlight-canvas",this._plotDimensions,this));this.plugins.barRenderer.highlightCanvas.setContext();this.eventCanvas._elem.bind("mouseleave",{plot:this},function(n){k(n.data.plot)})}function c(u,t,q,p){var o=u.series[t];var n=u.plugins.barRenderer.highlightCanvas;n._ctx.clearRect(0,0,n._ctx.canvas.width,n._ctx.canvas.height);o._highlightedPoint=q;u.plugins.barRenderer.highlightedSeriesIndex=t;var r={fillStyle:o.highlightColors[q]};o.renderer.shapeRenderer.draw(n._ctx,p,r);n=null}function k(p){var n=p.plugins.barRenderer.highlightCanvas;n._ctx.clearRect(0,0,n._ctx.canvas.width,n._ctx.canvas.height);for(var o=0;o<p.series.length;o++){p.series[o]._highlightedPoint=null}p.plugins.barRenderer.highlightedSeriesIndex=null;p.target.trigger("jqplotDataUnhighlight");n=null}function b(r,q,u,t,s){if(t){var p=[t.seriesIndex,t.pointIndex,t.data];var o=jQuery.Event("jqplotDataMouseOver");o.pageX=r.pageX;o.pageY=r.pageY;s.target.trigger(o,p);if(s.series[p[0]].highlightMouseOver&&!(p[0]==s.plugins.barRenderer.highlightedSeriesIndex&&p[1]==s.series[p[0]]._highlightedPoint)){var n=jQuery.Event("jqplotDataHighlight");n.which=r.which;n.pageX=r.pageX;n.pageY=r.pageY;s.target.trigger(n,p);c(s,t.seriesIndex,t.pointIndex,t.points)}}else{if(t==null){k(s)}}}function a(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];if(r.series[o[0]].highlightMouseDown&&!(o[0]==r.plugins.barRenderer.highlightedSeriesIndex&&o[1]==r.series[o[0]]._highlightedPoint)){var n=jQuery.Event("jqplotDataHighlight");n.which=q.which;n.pageX=q.pageX;n.pageY=q.pageY;r.target.trigger(n,o);c(r,s.seriesIndex,s.pointIndex,s.points)}}else{if(s==null){k(r)}}}function l(p,o,s,r,q){var n=q.plugins.barRenderer.highlightedSeriesIndex;if(n!=null&&q.series[n].highlightMouseDown){k(q)}}function e(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];var n=jQuery.Event("jqplotDataClick");n.which=q.which;n.pageX=q.pageX;n.pageY=q.pageY;r.target.trigger(n,o)}}function m(r,q,u,t,s){if(t){var p=[t.seriesIndex,t.pointIndex,t.data];var n=s.plugins.barRenderer.highlightedSeriesIndex;if(n!=null&&s.series[n].highlightMouseDown){k(s)}var o=jQuery.Event("jqplotDataRightClick");o.which=r.which;o.pageX=r.pageX;o.pageY=r.pageY;s.target.trigger(o,p)}}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.blockRenderer.js
ADDED
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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.BlockRenderer
|
34 |
+
* Plugin renderer to draw a x-y block chart. A Block chart has data points displayed as
|
35 |
+
* colored squares with a text label inside. Data must be supplied in the form:
|
36 |
+
*
|
37 |
+
* > [[x1, y1, "label 1", {css}], [x2, y2, "label 2", {css}], ...]
|
38 |
+
*
|
39 |
+
* The label and css object are optional. If the label is ommitted, the
|
40 |
+
* box will collapse unless a css height and/or width is specified.
|
41 |
+
*
|
42 |
+
* The css object is an object specifying css properties
|
43 |
+
* such as:
|
44 |
+
*
|
45 |
+
* > {background:'#4f98a5', border:'3px solid gray', padding:'1px'}
|
46 |
+
*
|
47 |
+
* Note that css properties specified with the data point override defaults
|
48 |
+
* specified with the series.
|
49 |
+
*
|
50 |
+
*/
|
51 |
+
$.jqplot.BlockRenderer = function(){
|
52 |
+
$.jqplot.LineRenderer.call(this);
|
53 |
+
};
|
54 |
+
|
55 |
+
$.jqplot.BlockRenderer.prototype = new $.jqplot.LineRenderer();
|
56 |
+
$.jqplot.BlockRenderer.prototype.constructor = $.jqplot.BlockRenderer;
|
57 |
+
|
58 |
+
// called with scope of a series
|
59 |
+
$.jqplot.BlockRenderer.prototype.init = function(options) {
|
60 |
+
// Group: Properties
|
61 |
+
//
|
62 |
+
// prop: css
|
63 |
+
// default css styles that will be applied to all data blocks.
|
64 |
+
// these values will be overridden by css styles supplied with the
|
65 |
+
// individulal data points.
|
66 |
+
this.css = {padding:'2px', border:'1px solid #999', textAlign:'center'};
|
67 |
+
// prop: escapeHtml
|
68 |
+
// true to escape html in the box label.
|
69 |
+
this.escapeHtml = false;
|
70 |
+
// prop: insertBreaks
|
71 |
+
// true to turn spaces in data block label into html breaks <br />.
|
72 |
+
this.insertBreaks = true;
|
73 |
+
// prop: varyBlockColors
|
74 |
+
// true to vary the color of each block in this series according to
|
75 |
+
// the seriesColors array. False to set each block to the color
|
76 |
+
// specified on this series. This has no effect if a css background color
|
77 |
+
// option is specified in the renderer css options.
|
78 |
+
this.varyBlockColors = false;
|
79 |
+
$.extend(true, this, options);
|
80 |
+
if (this.css.backgroundColor) {
|
81 |
+
this.color = this.css.backgroundColor;
|
82 |
+
}
|
83 |
+
else if (this.css.background) {
|
84 |
+
this.color = this.css.background;
|
85 |
+
}
|
86 |
+
else if (!this.varyBlockColors) {
|
87 |
+
this.css.background = this.color;
|
88 |
+
}
|
89 |
+
this.canvas = new $.jqplot.BlockCanvas();
|
90 |
+
this.shadowCanvas = new $.jqplot.BlockCanvas();
|
91 |
+
this.canvas._plotDimensions = this._plotDimensions;
|
92 |
+
this.shadowCanvas._plotDimensions = this._plotDimensions;
|
93 |
+
this._type = 'block';
|
94 |
+
|
95 |
+
// group: Methods
|
96 |
+
//
|
97 |
+
// Method: moveBlock
|
98 |
+
// Moves an individual block. More efficient than redrawing
|
99 |
+
// the whole series by calling plot.drawSeries().
|
100 |
+
// Properties:
|
101 |
+
// idx - the 0 based index of the block or point in this series.
|
102 |
+
// x - the x coordinate in data units (value on x axis) to move the block to.
|
103 |
+
// y - the y coordinate in data units (value on the y axis) to move the block to.
|
104 |
+
// duration - optional parameter to create an animated movement. Can be a
|
105 |
+
// number (higher is slower animation) or 'fast', 'normal' or 'slow'. If not
|
106 |
+
// provided, the element is moved without any animation.
|
107 |
+
this.moveBlock = function (idx, x, y, duration) {
|
108 |
+
// update plotData, stackData, data and gridData
|
109 |
+
// x and y are in data coordinates.
|
110 |
+
var el = this.canvas._elem.children(':eq('+idx+')');
|
111 |
+
this.data[idx][0] = x;
|
112 |
+
this.data[idx][1] = y;
|
113 |
+
this._plotData[idx][0] = x;
|
114 |
+
this._plotData[idx][1] = y;
|
115 |
+
this._stackData[idx][0] = x;
|
116 |
+
this._stackData[idx][1] = y;
|
117 |
+
this.gridData[idx][0] = this._xaxis.series_u2p(x);
|
118 |
+
this.gridData[idx][1] = this._yaxis.series_u2p(y);
|
119 |
+
var w = el.outerWidth();
|
120 |
+
var h = el.outerHeight();
|
121 |
+
var left = this.gridData[idx][0] - w/2 + 'px';
|
122 |
+
var top = this.gridData[idx][1] - h/2 + 'px';
|
123 |
+
if (duration) {
|
124 |
+
if (parseInt(duration, 10)) {
|
125 |
+
duration = parseInt(duration, 10);
|
126 |
+
}
|
127 |
+
el.animate({left:left, top:top}, duration);
|
128 |
+
}
|
129 |
+
else {
|
130 |
+
el.css({left:left, top:top});
|
131 |
+
}
|
132 |
+
el = null;
|
133 |
+
};
|
134 |
+
};
|
135 |
+
|
136 |
+
// called with scope of series
|
137 |
+
$.jqplot.BlockRenderer.prototype.draw = function (ctx, gd, options) {
|
138 |
+
if (this.plugins.pointLabels) {
|
139 |
+
this.plugins.pointLabels.show = false;
|
140 |
+
}
|
141 |
+
var i, el, d, gd, t, css, w, h, left, top;
|
142 |
+
var opts = (options != undefined) ? options : {};
|
143 |
+
var colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors);
|
144 |
+
this.canvas._elem.empty();
|
145 |
+
for (i=0; i<this.gridData.length; i++) {
|
146 |
+
d = this.data[i];
|
147 |
+
gd = this.gridData[i];
|
148 |
+
t = '';
|
149 |
+
css = {};
|
150 |
+
if (typeof d[2] == 'string') {
|
151 |
+
t = d[2];
|
152 |
+
}
|
153 |
+
else if (typeof d[2] == 'object') {
|
154 |
+
css = d[2];
|
155 |
+
}
|
156 |
+
if (typeof d[3] == 'object') {
|
157 |
+
css = d[3];
|
158 |
+
}
|
159 |
+
if (this.insertBreaks){
|
160 |
+
t = t.replace(/ /g, '<br />');
|
161 |
+
}
|
162 |
+
css = $.extend(true, {}, this.css, css);
|
163 |
+
// create a div
|
164 |
+
el = $('<div style="position:absolute;margin-left:auto;margin-right:auto;"></div>');
|
165 |
+
this.canvas._elem.append(el);
|
166 |
+
// set text
|
167 |
+
this.escapeHtml ? el.text(t) : el.html(t);
|
168 |
+
// style it
|
169 |
+
// remove styles we don't want overridden.
|
170 |
+
delete css.position;
|
171 |
+
delete css.marginRight;
|
172 |
+
delete css.marginLeft;
|
173 |
+
if (!css.background && !css.backgroundColor && !css.backgroundImage){
|
174 |
+
css.background = colorGenerator.next();
|
175 |
+
}
|
176 |
+
el.css(css);
|
177 |
+
w = el.outerWidth();
|
178 |
+
h = el.outerHeight();
|
179 |
+
left = gd[0] - w/2 + 'px';
|
180 |
+
top = gd[1] - h/2 + 'px';
|
181 |
+
el.css({left:left, top:top});
|
182 |
+
el = null;
|
183 |
+
}
|
184 |
+
};
|
185 |
+
|
186 |
+
$.jqplot.BlockCanvas = function() {
|
187 |
+
$.jqplot.ElemContainer.call(this);
|
188 |
+
this._ctx;
|
189 |
+
};
|
190 |
+
|
191 |
+
$.jqplot.BlockCanvas.prototype = new $.jqplot.ElemContainer();
|
192 |
+
$.jqplot.BlockCanvas.prototype.constructor = $.jqplot.BlockCanvas;
|
193 |
+
|
194 |
+
$.jqplot.BlockCanvas.prototype.createElement = function(offsets, clss, plotDimensions) {
|
195 |
+
this._offsets = offsets;
|
196 |
+
var klass = 'jqplot-blockCanvas';
|
197 |
+
if (clss != undefined) {
|
198 |
+
klass = clss;
|
199 |
+
}
|
200 |
+
var elem;
|
201 |
+
// if this canvas already has a dom element, don't make a new one.
|
202 |
+
if (this._elem) {
|
203 |
+
elem = this._elem.get(0);
|
204 |
+
}
|
205 |
+
else {
|
206 |
+
elem = document.createElement('div');
|
207 |
+
}
|
208 |
+
// if new plotDimensions supplied, use them.
|
209 |
+
if (plotDimensions != undefined) {
|
210 |
+
this._plotDimensions = plotDimensions;
|
211 |
+
}
|
212 |
+
|
213 |
+
var w = this._plotDimensions.width - this._offsets.left - this._offsets.right + 'px';
|
214 |
+
var h = this._plotDimensions.height - this._offsets.top - this._offsets.bottom + 'px';
|
215 |
+
this._elem = $(elem);
|
216 |
+
this._elem.css({ position: 'absolute', width:w, height:h, left: this._offsets.left, top: this._offsets.top });
|
217 |
+
|
218 |
+
this._elem.addClass(klass);
|
219 |
+
return this._elem;
|
220 |
+
};
|
221 |
+
|
222 |
+
$.jqplot.BlockCanvas.prototype.setContext = function() {
|
223 |
+
this._ctx = {
|
224 |
+
canvas:{
|
225 |
+
width:0,
|
226 |
+
height:0
|
227 |
+
},
|
228 |
+
clearRect:function(){return null;}
|
229 |
+
};
|
230 |
+
return this._ctx;
|
231 |
+
};
|
232 |
+
|
233 |
+
})(jQuery);
|
234 |
+
|
235 |
+
|
backend/settings/assets/js/jqPlot/plugins/jqplot.blockRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(a){a.jqplot.BlockRenderer=function(){a.jqplot.LineRenderer.call(this)};a.jqplot.BlockRenderer.prototype=new a.jqplot.LineRenderer();a.jqplot.BlockRenderer.prototype.constructor=a.jqplot.BlockRenderer;a.jqplot.BlockRenderer.prototype.init=function(b){this.css={padding:"2px",border:"1px solid #999",textAlign:"center"};this.escapeHtml=false;this.insertBreaks=true;this.varyBlockColors=false;a.extend(true,this,b);if(this.css.backgroundColor){this.color=this.css.backgroundColor}else{if(this.css.background){this.color=this.css.background}else{if(!this.varyBlockColors){this.css.background=this.color}}}this.canvas=new a.jqplot.BlockCanvas();this.shadowCanvas=new a.jqplot.BlockCanvas();this.canvas._plotDimensions=this._plotDimensions;this.shadowCanvas._plotDimensions=this._plotDimensions;this._type="block";this.moveBlock=function(l,j,i,e){var c=this.canvas._elem.children(":eq("+l+")");this.data[l][0]=j;this.data[l][1]=i;this._plotData[l][0]=j;this._plotData[l][1]=i;this._stackData[l][0]=j;this._stackData[l][1]=i;this.gridData[l][0]=this._xaxis.series_u2p(j);this.gridData[l][1]=this._yaxis.series_u2p(i);var k=c.outerWidth();var f=c.outerHeight();var d=this.gridData[l][0]-k/2+"px";var g=this.gridData[l][1]-f/2+"px";if(e){if(parseInt(e,10)){e=parseInt(e,10)}c.animate({left:d,top:g},e)}else{c.css({left:d,top:g})}c=null}};a.jqplot.BlockRenderer.prototype.draw=function(q,o,r){if(this.plugins.pointLabels){this.plugins.pointLabels.show=false}var f,c,l,o,p,k,n,g,e,m;var b=(r!=undefined)?r:{};var j=new a.jqplot.ColorGenerator(this.seriesColors);this.canvas._elem.empty();for(f=0;f<this.gridData.length;f++){l=this.data[f];o=this.gridData[f];p="";k={};if(typeof l[2]=="string"){p=l[2]}else{if(typeof l[2]=="object"){k=l[2]}}if(typeof l[3]=="object"){k=l[3]}if(this.insertBreaks){p=p.replace(/ /g,"<br />")}k=a.extend(true,{},this.css,k);c=a('<div style="position:absolute;margin-left:auto;margin-right:auto;"></div>');this.canvas._elem.append(c);this.escapeHtml?c.text(p):c.html(p);delete k.position;delete k.marginRight;delete k.marginLeft;if(!k.background&&!k.backgroundColor&&!k.backgroundImage){k.background=j.next()}c.css(k);n=c.outerWidth();g=c.outerHeight();e=o[0]-n/2+"px";m=o[1]-g/2+"px";c.css({left:e,top:m});c=null}};a.jqplot.BlockCanvas=function(){a.jqplot.ElemContainer.call(this);this._ctx};a.jqplot.BlockCanvas.prototype=new a.jqplot.ElemContainer();a.jqplot.BlockCanvas.prototype.constructor=a.jqplot.BlockCanvas;a.jqplot.BlockCanvas.prototype.createElement=function(i,e,c){this._offsets=i;var b="jqplot-blockCanvas";if(e!=undefined){b=e}var g;if(this._elem){g=this._elem.get(0)}else{g=document.createElement("div")}if(c!=undefined){this._plotDimensions=c}var d=this._plotDimensions.width-this._offsets.left-this._offsets.right+"px";var f=this._plotDimensions.height-this._offsets.top-this._offsets.bottom+"px";this._elem=a(g);this._elem.css({position:"absolute",width:d,height:f,left:this._offsets.left,top:this._offsets.top});this._elem.addClass(b);return this._elem};a.jqplot.BlockCanvas.prototype.setContext=function(){this._ctx={canvas:{width:0,height:0},clearRect:function(){return null}};return this._ctx}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.bubbleRenderer.js
ADDED
@@ -0,0 +1,759 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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 |
+
var arrayMax = function( array ){
|
33 |
+
return Math.max.apply( Math, array );
|
34 |
+
};
|
35 |
+
var arrayMin = function( array ){
|
36 |
+
return Math.min.apply( Math, array );
|
37 |
+
};
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Class: $.jqplot.BubbleRenderer
|
41 |
+
* Plugin renderer to draw a bubble chart. A Bubble chart has data points displayed as
|
42 |
+
* colored circles with an optional text label inside. To use
|
43 |
+
* the bubble renderer, you must include the bubble renderer like:
|
44 |
+
*
|
45 |
+
* > <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.bubbleRenderer.js"></script>
|
46 |
+
*
|
47 |
+
* Data must be supplied in
|
48 |
+
* the form:
|
49 |
+
*
|
50 |
+
* > [[x1, y1, r1, <label or {label:'text', color:color}>], ...]
|
51 |
+
*
|
52 |
+
* where the label or options
|
53 |
+
* object is optional.
|
54 |
+
*
|
55 |
+
* Note that all bubble colors will be the same
|
56 |
+
* unless the "varyBubbleColors" option is set to true. Colors can be specified in the data array
|
57 |
+
* or in the seriesColors array option on the series. If no colors are defined, the default jqPlot
|
58 |
+
* series of 16 colors are used. Colors are automatically cycled around again if there are more
|
59 |
+
* bubbles than colors.
|
60 |
+
*
|
61 |
+
* Bubbles are autoscaled by default to fit within the chart area while maintaining
|
62 |
+
* relative sizes. If the "autoscaleBubbles" option is set to false, the r(adius) values
|
63 |
+
* in the data array a treated as literal pixel values for the radii of the bubbles.
|
64 |
+
*
|
65 |
+
* Properties are passed into the bubble renderer in the rendererOptions object of
|
66 |
+
* the series options like:
|
67 |
+
*
|
68 |
+
* > seriesDefaults: {
|
69 |
+
* > renderer: $.jqplot.BubbleRenderer,
|
70 |
+
* > rendererOptions: {
|
71 |
+
* > bubbleAlpha: 0.7,
|
72 |
+
* > varyBubbleColors: false
|
73 |
+
* > }
|
74 |
+
* > }
|
75 |
+
*
|
76 |
+
*/
|
77 |
+
$.jqplot.BubbleRenderer = function(){
|
78 |
+
$.jqplot.LineRenderer.call(this);
|
79 |
+
};
|
80 |
+
|
81 |
+
$.jqplot.BubbleRenderer.prototype = new $.jqplot.LineRenderer();
|
82 |
+
$.jqplot.BubbleRenderer.prototype.constructor = $.jqplot.BubbleRenderer;
|
83 |
+
|
84 |
+
// called with scope of a series
|
85 |
+
$.jqplot.BubbleRenderer.prototype.init = function(options, plot) {
|
86 |
+
// Group: Properties
|
87 |
+
//
|
88 |
+
// prop: varyBubbleColors
|
89 |
+
// True to vary the color of each bubble in this series according to
|
90 |
+
// the seriesColors array. False to set each bubble to the color
|
91 |
+
// specified on this series. This has no effect if a css background color
|
92 |
+
// option is specified in the renderer css options.
|
93 |
+
this.varyBubbleColors = true;
|
94 |
+
// prop: autoscaleBubbles
|
95 |
+
// True to scale the bubble radius based on plot size.
|
96 |
+
// False will use the radius value as provided as a raw pixel value for
|
97 |
+
// bubble radius.
|
98 |
+
this.autoscaleBubbles = true;
|
99 |
+
// prop: autoscaleMultiplier
|
100 |
+
// Multiplier the bubble size if autoscaleBubbles is true.
|
101 |
+
this.autoscaleMultiplier = 1.0;
|
102 |
+
// prop: autoscalePointsFactor
|
103 |
+
// Factor which decreases bubble size based on how many bubbles on on the chart.
|
104 |
+
// 0 means no adjustment for number of bubbles. Negative values will decrease
|
105 |
+
// size of bubbles as more bubbles are added. Values between 0 and -0.2
|
106 |
+
// should work well.
|
107 |
+
this.autoscalePointsFactor = -0.07;
|
108 |
+
// prop: escapeHtml
|
109 |
+
// True to escape html in bubble label text.
|
110 |
+
this.escapeHtml = true;
|
111 |
+
// prop: highlightMouseOver
|
112 |
+
// True to highlight bubbles when moused over.
|
113 |
+
// This must be false to enable highlightMouseDown to highlight when clicking on a slice.
|
114 |
+
this.highlightMouseOver = true;
|
115 |
+
// prop: highlightMouseDown
|
116 |
+
// True to highlight when a mouse button is pressed over a bubble.
|
117 |
+
// This will be disabled if highlightMouseOver is true.
|
118 |
+
this.highlightMouseDown = false;
|
119 |
+
// prop: highlightColors
|
120 |
+
// An array of colors to use when highlighting a slice. Calculated automatically
|
121 |
+
// if not supplied.
|
122 |
+
this.highlightColors = [];
|
123 |
+
// prop: bubbleAlpha
|
124 |
+
// Alpha transparency to apply to all bubbles in this series.
|
125 |
+
this.bubbleAlpha = 1.0;
|
126 |
+
// prop: highlightAlpha
|
127 |
+
// Alpha transparency to apply when highlighting bubble.
|
128 |
+
// Set to value of bubbleAlpha by default.
|
129 |
+
this.highlightAlpha = null;
|
130 |
+
// prop: bubbleGradients
|
131 |
+
// True to color the bubbles with gradient fills instead of flat colors.
|
132 |
+
// NOT AVAILABLE IN IE due to lack of excanvas support for radial gradient fills.
|
133 |
+
// will be ignored in IE.
|
134 |
+
this.bubbleGradients = false;
|
135 |
+
// prop: showLabels
|
136 |
+
// True to show labels on bubbles (if any), false to not show.
|
137 |
+
this.showLabels = true;
|
138 |
+
// array of [point index, radius] which will be sorted in descending order to plot
|
139 |
+
// largest points below smaller points.
|
140 |
+
this.radii = [];
|
141 |
+
this.maxRadius = 0;
|
142 |
+
// index of the currenty highlighted point, if any
|
143 |
+
this._highlightedPoint = null;
|
144 |
+
// array of jQuery labels.
|
145 |
+
this.labels = [];
|
146 |
+
this.bubbleCanvases = [];
|
147 |
+
this._type = 'bubble';
|
148 |
+
|
149 |
+
// if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
|
150 |
+
if (options.highlightMouseDown && options.highlightMouseOver == null) {
|
151 |
+
options.highlightMouseOver = false;
|
152 |
+
}
|
153 |
+
|
154 |
+
$.extend(true, this, options);
|
155 |
+
|
156 |
+
if (this.highlightAlpha == null) {
|
157 |
+
this.highlightAlpha = this.bubbleAlpha;
|
158 |
+
if (this.bubbleGradients) {
|
159 |
+
this.highlightAlpha = 0.35;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
this.autoscaleMultiplier = this.autoscaleMultiplier * Math.pow(this.data.length, this.autoscalePointsFactor);
|
164 |
+
|
165 |
+
// index of the currenty highlighted point, if any
|
166 |
+
this._highlightedPoint = null;
|
167 |
+
|
168 |
+
// adjust the series colors for options colors passed in with data or for alpha.
|
169 |
+
// note, this can leave undefined holes in the seriesColors array.
|
170 |
+
var comps;
|
171 |
+
for (var i=0; i<this.data.length; i++) {
|
172 |
+
var color = null;
|
173 |
+
var d = this.data[i];
|
174 |
+
this.maxRadius = Math.max(this.maxRadius, d[2]);
|
175 |
+
if (d[3]) {
|
176 |
+
if (typeof(d[3]) == 'object') {
|
177 |
+
color = d[3]['color'];
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
if (color == null) {
|
182 |
+
if (this.seriesColors[i] != null) {
|
183 |
+
color = this.seriesColors[i];
|
184 |
+
}
|
185 |
+
}
|
186 |
+
|
187 |
+
if (color && this.bubbleAlpha < 1.0) {
|
188 |
+
comps = $.jqplot.getColorComponents(color);
|
189 |
+
color = 'rgba('+comps[0]+', '+comps[1]+', '+comps[2]+', '+this.bubbleAlpha+')';
|
190 |
+
}
|
191 |
+
|
192 |
+
if (color) {
|
193 |
+
this.seriesColors[i] = color;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
if (!this.varyBubbleColors) {
|
198 |
+
this.seriesColors = [this.color];
|
199 |
+
}
|
200 |
+
|
201 |
+
this.colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors);
|
202 |
+
|
203 |
+
// set highlight colors if none provided
|
204 |
+
if (this.highlightColors.length == 0) {
|
205 |
+
for (var i=0; i<this.seriesColors.length; i++){
|
206 |
+
var rgba = $.jqplot.getColorComponents(this.seriesColors[i]);
|
207 |
+
var newrgb = [rgba[0], rgba[1], rgba[2]];
|
208 |
+
var sum = newrgb[0] + newrgb[1] + newrgb[2];
|
209 |
+
for (var j=0; j<3; j++) {
|
210 |
+
// when darkening, lowest color component can be is 60.
|
211 |
+
newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
|
212 |
+
newrgb[j] = parseInt(newrgb[j], 10);
|
213 |
+
}
|
214 |
+
this.highlightColors.push('rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+', '+this.highlightAlpha+')');
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
this.highlightColorGenerator = new $.jqplot.ColorGenerator(this.highlightColors);
|
219 |
+
|
220 |
+
var sopts = {fill:true, isarc:true, angle:this.shadowAngle, alpha:this.shadowAlpha, closePath:true};
|
221 |
+
|
222 |
+
this.renderer.shadowRenderer.init(sopts);
|
223 |
+
|
224 |
+
this.canvas = new $.jqplot.DivCanvas();
|
225 |
+
this.canvas._plotDimensions = this._plotDimensions;
|
226 |
+
|
227 |
+
plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
|
228 |
+
plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
|
229 |
+
plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
|
230 |
+
plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
|
231 |
+
plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
|
232 |
+
plot.postDrawHooks.addOnce(postPlotDraw);
|
233 |
+
|
234 |
+
};
|
235 |
+
|
236 |
+
|
237 |
+
// converts the user data values to grid coordinates and stores them
|
238 |
+
// in the gridData array.
|
239 |
+
// Called with scope of a series.
|
240 |
+
$.jqplot.BubbleRenderer.prototype.setGridData = function(plot) {
|
241 |
+
// recalculate the grid data
|
242 |
+
var xp = this._xaxis.series_u2p;
|
243 |
+
var yp = this._yaxis.series_u2p;
|
244 |
+
var data = this._plotData;
|
245 |
+
this.gridData = [];
|
246 |
+
var radii = [];
|
247 |
+
this.radii = [];
|
248 |
+
var dim = Math.min(plot._height, plot._width);
|
249 |
+
for (var i=0; i<this.data.length; i++) {
|
250 |
+
if (data[i] != null) {
|
251 |
+
this.gridData.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1]), data[i][2]]);
|
252 |
+
this.radii.push([i, data[i][2]]);
|
253 |
+
radii.push(data[i][2]);
|
254 |
+
}
|
255 |
+
}
|
256 |
+
var r, val, maxr = this.maxRadius = arrayMax(radii);
|
257 |
+
var l = this.gridData.length;
|
258 |
+
if (this.autoscaleBubbles) {
|
259 |
+
for (var i=0; i<l; i++) {
|
260 |
+
val = radii[i]/maxr;
|
261 |
+
r = this.autoscaleMultiplier * dim / 6;
|
262 |
+
this.gridData[i][2] = r * val;
|
263 |
+
}
|
264 |
+
}
|
265 |
+
|
266 |
+
this.radii.sort(function(a, b) { return b[1] - a[1]; });
|
267 |
+
};
|
268 |
+
|
269 |
+
// converts any arbitrary data values to grid coordinates and
|
270 |
+
// returns them. This method exists so that plugins can use a series'
|
271 |
+
// linerenderer to generate grid data points without overwriting the
|
272 |
+
// grid data associated with that series.
|
273 |
+
// Called with scope of a series.
|
274 |
+
$.jqplot.BubbleRenderer.prototype.makeGridData = function(data, plot) {
|
275 |
+
// recalculate the grid data
|
276 |
+
var xp = this._xaxis.series_u2p;
|
277 |
+
var yp = this._yaxis.series_u2p;
|
278 |
+
var gd = [];
|
279 |
+
var radii = [];
|
280 |
+
this.radii = [];
|
281 |
+
var dim = Math.min(plot._height, plot._width);
|
282 |
+
for (var i=0; i<data.length; i++) {
|
283 |
+
if (data[i] != null) {
|
284 |
+
gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1]), data[i][2]]);
|
285 |
+
radii.push(data[i][2]);
|
286 |
+
this.radii.push([i, data[i][2]]);
|
287 |
+
}
|
288 |
+
}
|
289 |
+
var r, val, maxr = this.maxRadius = arrayMax(radii);
|
290 |
+
var l = this.gridData.length;
|
291 |
+
if (this.autoscaleBubbles) {
|
292 |
+
for (var i=0; i<l; i++) {
|
293 |
+
val = radii[i]/maxr;
|
294 |
+
r = this.autoscaleMultiplier * dim / 6;
|
295 |
+
gd[i][2] = r * val;
|
296 |
+
}
|
297 |
+
}
|
298 |
+
this.radii.sort(function(a, b) { return b[1] - a[1]; });
|
299 |
+
return gd;
|
300 |
+
};
|
301 |
+
|
302 |
+
// called with scope of series
|
303 |
+
$.jqplot.BubbleRenderer.prototype.draw = function (ctx, gd, options) {
|
304 |
+
if (this.plugins.pointLabels) {
|
305 |
+
this.plugins.pointLabels.show = false;
|
306 |
+
}
|
307 |
+
var opts = (options != undefined) ? options : {};
|
308 |
+
var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
|
309 |
+
this.canvas._elem.empty();
|
310 |
+
for (var i=0; i<this.radii.length; i++) {
|
311 |
+
var idx = this.radii[i][0];
|
312 |
+
var t=null;
|
313 |
+
var color = null;
|
314 |
+
var el = null;
|
315 |
+
var tel = null;
|
316 |
+
var d = this.data[idx];
|
317 |
+
var gd = this.gridData[idx];
|
318 |
+
if (d[3]) {
|
319 |
+
if (typeof(d[3]) == 'object') {
|
320 |
+
t = d[3]['label'];
|
321 |
+
}
|
322 |
+
else if (typeof(d[3]) == 'string') {
|
323 |
+
t = d[3];
|
324 |
+
}
|
325 |
+
}
|
326 |
+
|
327 |
+
// color = (this.varyBubbleColors) ? this.colorGenerator.get(idx) : this.color;
|
328 |
+
color = this.colorGenerator.get(idx);
|
329 |
+
|
330 |
+
// If we're drawing a shadow, expand the canvas dimensions to accomodate.
|
331 |
+
var canvasRadius = gd[2];
|
332 |
+
var offset, depth;
|
333 |
+
if (this.shadow) {
|
334 |
+
offset = (0.7 + gd[2]/40).toFixed(1);
|
335 |
+
depth = 1 + Math.ceil(gd[2]/15);
|
336 |
+
canvasRadius += offset*depth;
|
337 |
+
}
|
338 |
+
this.bubbleCanvases[idx] = new $.jqplot.BubbleCanvas();
|
339 |
+
this.canvas._elem.append(this.bubbleCanvases[idx].createElement(gd[0], gd[1], canvasRadius));
|
340 |
+
this.bubbleCanvases[idx].setContext();
|
341 |
+
var ctx = this.bubbleCanvases[idx]._ctx;
|
342 |
+
var x = ctx.canvas.width/2;
|
343 |
+
var y = ctx.canvas.height/2;
|
344 |
+
if (this.shadow) {
|
345 |
+
this.renderer.shadowRenderer.draw(ctx, [x, y, gd[2], 0, 2*Math.PI], {offset: offset, depth: depth});
|
346 |
+
}
|
347 |
+
this.bubbleCanvases[idx].draw(gd[2], color, this.bubbleGradients, this.shadowAngle/180*Math.PI);
|
348 |
+
|
349 |
+
// now draw label.
|
350 |
+
if (t && this.showLabels) {
|
351 |
+
tel = $('<div style="position:absolute;" class="jqplot-bubble-label"></div>');
|
352 |
+
if (this.escapeHtml) {
|
353 |
+
tel.text(t);
|
354 |
+
}
|
355 |
+
else {
|
356 |
+
tel.html(t);
|
357 |
+
}
|
358 |
+
this.canvas._elem.append(tel);
|
359 |
+
var h = $(tel).outerHeight();
|
360 |
+
var w = $(tel).outerWidth();
|
361 |
+
var top = gd[1] - 0.5*h;
|
362 |
+
var left = gd[0] - 0.5*w;
|
363 |
+
tel.css({top: top, left: left});
|
364 |
+
this.labels[idx] = $(tel);
|
365 |
+
}
|
366 |
+
}
|
367 |
+
};
|
368 |
+
|
369 |
+
|
370 |
+
$.jqplot.DivCanvas = function() {
|
371 |
+
$.jqplot.ElemContainer.call(this);
|
372 |
+
this._ctx;
|
373 |
+
};
|
374 |
+
|
375 |
+
$.jqplot.DivCanvas.prototype = new $.jqplot.ElemContainer();
|
376 |
+
$.jqplot.DivCanvas.prototype.constructor = $.jqplot.DivCanvas;
|
377 |
+
|
378 |
+
$.jqplot.DivCanvas.prototype.createElement = function(offsets, clss, plotDimensions) {
|
379 |
+
this._offsets = offsets;
|
380 |
+
var klass = 'jqplot-DivCanvas';
|
381 |
+
if (clss != undefined) {
|
382 |
+
klass = clss;
|
383 |
+
}
|
384 |
+
var elem;
|
385 |
+
// if this canvas already has a dom element, don't make a new one.
|
386 |
+
if (this._elem) {
|
387 |
+
elem = this._elem.get(0);
|
388 |
+
}
|
389 |
+
else {
|
390 |
+
elem = document.createElement('div');
|
391 |
+
}
|
392 |
+
// if new plotDimensions supplied, use them.
|
393 |
+
if (plotDimensions != undefined) {
|
394 |
+
this._plotDimensions = plotDimensions;
|
395 |
+
}
|
396 |
+
|
397 |
+
var w = this._plotDimensions.width - this._offsets.left - this._offsets.right + 'px';
|
398 |
+
var h = this._plotDimensions.height - this._offsets.top - this._offsets.bottom + 'px';
|
399 |
+
this._elem = $(elem);
|
400 |
+
this._elem.css({ position: 'absolute', width:w, height:h, left: this._offsets.left, top: this._offsets.top });
|
401 |
+
|
402 |
+
this._elem.addClass(klass);
|
403 |
+
return this._elem;
|
404 |
+
};
|
405 |
+
|
406 |
+
$.jqplot.DivCanvas.prototype.setContext = function() {
|
407 |
+
this._ctx = {
|
408 |
+
canvas:{
|
409 |
+
width:0,
|
410 |
+
height:0
|
411 |
+
},
|
412 |
+
clearRect:function(){return null;}
|
413 |
+
};
|
414 |
+
return this._ctx;
|
415 |
+
};
|
416 |
+
|
417 |
+
$.jqplot.BubbleCanvas = function() {
|
418 |
+
$.jqplot.ElemContainer.call(this);
|
419 |
+
this._ctx;
|
420 |
+
};
|
421 |
+
|
422 |
+
$.jqplot.BubbleCanvas.prototype = new $.jqplot.ElemContainer();
|
423 |
+
$.jqplot.BubbleCanvas.prototype.constructor = $.jqplot.BubbleCanvas;
|
424 |
+
|
425 |
+
// initialize with the x,y pont of bubble center and the bubble radius.
|
426 |
+
$.jqplot.BubbleCanvas.prototype.createElement = function(x, y, r) {
|
427 |
+
var klass = 'jqplot-bubble-point';
|
428 |
+
|
429 |
+
var elem;
|
430 |
+
// if this canvas already has a dom element, don't make a new one.
|
431 |
+
if (this._elem) {
|
432 |
+
elem = this._elem.get(0);
|
433 |
+
}
|
434 |
+
else {
|
435 |
+
elem = document.createElement('canvas');
|
436 |
+
}
|
437 |
+
|
438 |
+
elem.width = (r != null) ? 2*r : elem.width;
|
439 |
+
elem.height = (r != null) ? 2*r : elem.height;
|
440 |
+
this._elem = $(elem);
|
441 |
+
var l = (x != null && r != null) ? x - r : this._elem.css('left');
|
442 |
+
var t = (y != null && r != null) ? y - r : this._elem.css('top');
|
443 |
+
this._elem.css({ position: 'absolute', left: l, top: t });
|
444 |
+
|
445 |
+
this._elem.addClass(klass);
|
446 |
+
if ($.jqplot.use_excanvas) {
|
447 |
+
window.G_vmlCanvasManager.init_(document);
|
448 |
+
elem = window.G_vmlCanvasManager.initElement(elem);
|
449 |
+
}
|
450 |
+
|
451 |
+
return this._elem;
|
452 |
+
};
|
453 |
+
|
454 |
+
$.jqplot.BubbleCanvas.prototype.draw = function(r, color, gradients, angle) {
|
455 |
+
var ctx = this._ctx;
|
456 |
+
// r = Math.floor(r*1.04);
|
457 |
+
// var x = Math.round(ctx.canvas.width/2);
|
458 |
+
// var y = Math.round(ctx.canvas.height/2);
|
459 |
+
var x = ctx.canvas.width/2;
|
460 |
+
var y = ctx.canvas.height/2;
|
461 |
+
ctx.save();
|
462 |
+
if (gradients && !$.jqplot.use_excanvas) {
|
463 |
+
r = r*1.04;
|
464 |
+
var comps = $.jqplot.getColorComponents(color);
|
465 |
+
var colorinner = 'rgba('+Math.round(comps[0]+0.8*(255-comps[0]))+', '+Math.round(comps[1]+0.8*(255-comps[1]))+', '+Math.round(comps[2]+0.8*(255-comps[2]))+', '+comps[3]+')';
|
466 |
+
var colorend = 'rgba('+comps[0]+', '+comps[1]+', '+comps[2]+', 0)';
|
467 |
+
// var rinner = Math.round(0.35 * r);
|
468 |
+
// var xinner = Math.round(x - Math.cos(angle) * 0.33 * r);
|
469 |
+
// var yinner = Math.round(y - Math.sin(angle) * 0.33 * r);
|
470 |
+
var rinner = 0.35 * r;
|
471 |
+
var xinner = x - Math.cos(angle) * 0.33 * r;
|
472 |
+
var yinner = y - Math.sin(angle) * 0.33 * r;
|
473 |
+
var radgrad = ctx.createRadialGradient(xinner, yinner, rinner, x, y, r);
|
474 |
+
radgrad.addColorStop(0, colorinner);
|
475 |
+
radgrad.addColorStop(0.93, color);
|
476 |
+
radgrad.addColorStop(0.96, colorend);
|
477 |
+
radgrad.addColorStop(1, colorend);
|
478 |
+
// radgrad.addColorStop(.98, colorend);
|
479 |
+
ctx.fillStyle = radgrad;
|
480 |
+
ctx.fillRect(0,0, ctx.canvas.width, ctx.canvas.height);
|
481 |
+
}
|
482 |
+
else {
|
483 |
+
ctx.fillStyle = color;
|
484 |
+
ctx.strokeStyle = color;
|
485 |
+
ctx.lineWidth = 1;
|
486 |
+
ctx.beginPath();
|
487 |
+
var ang = 2*Math.PI;
|
488 |
+
ctx.arc(x, y, r, 0, ang, 0);
|
489 |
+
ctx.closePath();
|
490 |
+
ctx.fill();
|
491 |
+
}
|
492 |
+
ctx.restore();
|
493 |
+
};
|
494 |
+
|
495 |
+
$.jqplot.BubbleCanvas.prototype.setContext = function() {
|
496 |
+
this._ctx = this._elem.get(0).getContext("2d");
|
497 |
+
return this._ctx;
|
498 |
+
};
|
499 |
+
|
500 |
+
$.jqplot.BubbleAxisRenderer = function() {
|
501 |
+
$.jqplot.LinearAxisRenderer.call(this);
|
502 |
+
};
|
503 |
+
|
504 |
+
$.jqplot.BubbleAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
|
505 |
+
$.jqplot.BubbleAxisRenderer.prototype.constructor = $.jqplot.BubbleAxisRenderer;
|
506 |
+
|
507 |
+
// called with scope of axis object.
|
508 |
+
$.jqplot.BubbleAxisRenderer.prototype.init = function(options){
|
509 |
+
$.extend(true, this, options);
|
510 |
+
var db = this._dataBounds;
|
511 |
+
var minsidx = 0,
|
512 |
+
minpidx = 0,
|
513 |
+
maxsidx = 0,
|
514 |
+
maxpidx = 0,
|
515 |
+
maxr = 0,
|
516 |
+
minr = 0,
|
517 |
+
minMaxRadius = 0,
|
518 |
+
maxMaxRadius = 0,
|
519 |
+
maxMult = 0,
|
520 |
+
minMult = 0;
|
521 |
+
// Go through all the series attached to this axis and find
|
522 |
+
// the min/max bounds for this axis.
|
523 |
+
for (var i=0; i<this._series.length; i++) {
|
524 |
+
var s = this._series[i];
|
525 |
+
var d = s._plotData;
|
526 |
+
|
527 |
+
for (var j=0; j<d.length; j++) {
|
528 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
529 |
+
if (d[j][0] < db.min || db.min == null) {
|
530 |
+
db.min = d[j][0];
|
531 |
+
minsidx=i;
|
532 |
+
minpidx=j;
|
533 |
+
minr = d[j][2];
|
534 |
+
minMaxRadius = s.maxRadius;
|
535 |
+
minMult = s.autoscaleMultiplier;
|
536 |
+
}
|
537 |
+
if (d[j][0] > db.max || db.max == null) {
|
538 |
+
db.max = d[j][0];
|
539 |
+
maxsidx=i;
|
540 |
+
maxpidx=j;
|
541 |
+
maxr = d[j][2];
|
542 |
+
maxMaxRadius = s.maxRadius;
|
543 |
+
maxMult = s.autoscaleMultiplier;
|
544 |
+
}
|
545 |
+
}
|
546 |
+
else {
|
547 |
+
if (d[j][1] < db.min || db.min == null) {
|
548 |
+
db.min = d[j][1];
|
549 |
+
minsidx=i;
|
550 |
+
minpidx=j;
|
551 |
+
minr = d[j][2];
|
552 |
+
minMaxRadius = s.maxRadius;
|
553 |
+
minMult = s.autoscaleMultiplier;
|
554 |
+
}
|
555 |
+
if (d[j][1] > db.max || db.max == null) {
|
556 |
+
db.max = d[j][1];
|
557 |
+
maxsidx=i;
|
558 |
+
maxpidx=j;
|
559 |
+
maxr = d[j][2];
|
560 |
+
maxMaxRadius = s.maxRadius;
|
561 |
+
maxMult = s.autoscaleMultiplier;
|
562 |
+
}
|
563 |
+
}
|
564 |
+
}
|
565 |
+
}
|
566 |
+
|
567 |
+
var minRatio = minr/minMaxRadius;
|
568 |
+
var maxRatio = maxr/maxMaxRadius;
|
569 |
+
|
570 |
+
// need to estimate the effect of the radius on total axis span and adjust axis accordingly.
|
571 |
+
var span = db.max - db.min;
|
572 |
+
// var dim = (this.name == 'xaxis' || this.name == 'x2axis') ? this._plotDimensions.width : this._plotDimensions.height;
|
573 |
+
var dim = Math.min(this._plotDimensions.width, this._plotDimensions.height);
|
574 |
+
|
575 |
+
var minfact = minRatio * minMult/3 * span;
|
576 |
+
var maxfact = maxRatio * maxMult/3 * span;
|
577 |
+
db.max += maxfact;
|
578 |
+
db.min -= minfact;
|
579 |
+
};
|
580 |
+
|
581 |
+
function highlight (plot, sidx, pidx) {
|
582 |
+
plot.plugins.bubbleRenderer.highlightLabelCanvas.empty();
|
583 |
+
var s = plot.series[sidx];
|
584 |
+
var canvas = plot.plugins.bubbleRenderer.highlightCanvas;
|
585 |
+
var ctx = canvas._ctx;
|
586 |
+
ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
|
587 |
+
s._highlightedPoint = pidx;
|
588 |
+
plot.plugins.bubbleRenderer.highlightedSeriesIndex = sidx;
|
589 |
+
|
590 |
+
var color = s.highlightColorGenerator.get(pidx);
|
591 |
+
var x = s.gridData[pidx][0],
|
592 |
+
y = s.gridData[pidx][1],
|
593 |
+
r = s.gridData[pidx][2];
|
594 |
+
ctx.save();
|
595 |
+
ctx.fillStyle = color;
|
596 |
+
ctx.strokeStyle = color;
|
597 |
+
ctx.lineWidth = 1;
|
598 |
+
ctx.beginPath();
|
599 |
+
ctx.arc(x, y, r, 0, 2*Math.PI, 0);
|
600 |
+
ctx.closePath();
|
601 |
+
ctx.fill();
|
602 |
+
ctx.restore();
|
603 |
+
// bring label to front
|
604 |
+
if (s.labels[pidx]) {
|
605 |
+
plot.plugins.bubbleRenderer.highlightLabel = s.labels[pidx].clone();
|
606 |
+
plot.plugins.bubbleRenderer.highlightLabel.appendTo(plot.plugins.bubbleRenderer.highlightLabelCanvas);
|
607 |
+
plot.plugins.bubbleRenderer.highlightLabel.addClass('jqplot-bubble-label-highlight');
|
608 |
+
}
|
609 |
+
}
|
610 |
+
|
611 |
+
function unhighlight (plot) {
|
612 |
+
var canvas = plot.plugins.bubbleRenderer.highlightCanvas;
|
613 |
+
var sidx = plot.plugins.bubbleRenderer.highlightedSeriesIndex;
|
614 |
+
plot.plugins.bubbleRenderer.highlightLabelCanvas.empty();
|
615 |
+
canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
|
616 |
+
for (var i=0; i<plot.series.length; i++) {
|
617 |
+
plot.series[i]._highlightedPoint = null;
|
618 |
+
}
|
619 |
+
plot.plugins.bubbleRenderer.highlightedSeriesIndex = null;
|
620 |
+
plot.target.trigger('jqplotDataUnhighlight');
|
621 |
+
}
|
622 |
+
|
623 |
+
|
624 |
+
function handleMove(ev, gridpos, datapos, neighbor, plot) {
|
625 |
+
if (neighbor) {
|
626 |
+
var si = neighbor.seriesIndex;
|
627 |
+
var pi = neighbor.pointIndex;
|
628 |
+
var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
|
629 |
+
var evt1 = jQuery.Event('jqplotDataMouseOver');
|
630 |
+
evt1.pageX = ev.pageX;
|
631 |
+
evt1.pageY = ev.pageY;
|
632 |
+
plot.target.trigger(evt1, ins);
|
633 |
+
if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.bubbleRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
|
634 |
+
var evt = jQuery.Event('jqplotDataHighlight');
|
635 |
+
evt.which = ev.which;
|
636 |
+
evt.pageX = ev.pageX;
|
637 |
+
evt.pageY = ev.pageY;
|
638 |
+
plot.target.trigger(evt, ins);
|
639 |
+
highlight (plot, ins[0], ins[1]);
|
640 |
+
}
|
641 |
+
}
|
642 |
+
else if (neighbor == null) {
|
643 |
+
unhighlight (plot);
|
644 |
+
}
|
645 |
+
}
|
646 |
+
|
647 |
+
function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
|
648 |
+
if (neighbor) {
|
649 |
+
var si = neighbor.seriesIndex;
|
650 |
+
var pi = neighbor.pointIndex;
|
651 |
+
var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
|
652 |
+
if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.bubbleRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
|
653 |
+
var evt = jQuery.Event('jqplotDataHighlight');
|
654 |
+
evt.which = ev.which;
|
655 |
+
evt.pageX = ev.pageX;
|
656 |
+
evt.pageY = ev.pageY;
|
657 |
+
plot.target.trigger(evt, ins);
|
658 |
+
highlight (plot, ins[0], ins[1]);
|
659 |
+
}
|
660 |
+
}
|
661 |
+
else if (neighbor == null) {
|
662 |
+
unhighlight (plot);
|
663 |
+
}
|
664 |
+
}
|
665 |
+
|
666 |
+
function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
|
667 |
+
var idx = plot.plugins.bubbleRenderer.highlightedSeriesIndex;
|
668 |
+
if (idx != null && plot.series[idx].highlightMouseDown) {
|
669 |
+
unhighlight(plot);
|
670 |
+
}
|
671 |
+
}
|
672 |
+
|
673 |
+
function handleClick(ev, gridpos, datapos, neighbor, plot) {
|
674 |
+
if (neighbor) {
|
675 |
+
var si = neighbor.seriesIndex;
|
676 |
+
var pi = neighbor.pointIndex;
|
677 |
+
var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
|
678 |
+
var evt = jQuery.Event('jqplotDataClick');
|
679 |
+
evt.which = ev.which;
|
680 |
+
evt.pageX = ev.pageX;
|
681 |
+
evt.pageY = ev.pageY;
|
682 |
+
plot.target.trigger(evt, ins);
|
683 |
+
}
|
684 |
+
}
|
685 |
+
|
686 |
+
function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
|
687 |
+
if (neighbor) {
|
688 |
+
var si = neighbor.seriesIndex;
|
689 |
+
var pi = neighbor.pointIndex;
|
690 |
+
var ins = [si, pi, neighbor.data, plot.series[si].gridData[pi][2]];
|
691 |
+
var idx = plot.plugins.bubbleRenderer.highlightedSeriesIndex;
|
692 |
+
if (idx != null && plot.series[idx].highlightMouseDown) {
|
693 |
+
unhighlight(plot);
|
694 |
+
}
|
695 |
+
var evt = jQuery.Event('jqplotDataRightClick');
|
696 |
+
evt.which = ev.which;
|
697 |
+
evt.pageX = ev.pageX;
|
698 |
+
evt.pageY = ev.pageY;
|
699 |
+
plot.target.trigger(evt, ins);
|
700 |
+
}
|
701 |
+
}
|
702 |
+
|
703 |
+
// called within context of plot
|
704 |
+
// create a canvas which we can draw on.
|
705 |
+
// insert it before the eventCanvas, so eventCanvas will still capture events.
|
706 |
+
function postPlotDraw() {
|
707 |
+
// Memory Leaks patch
|
708 |
+
if (this.plugins.bubbleRenderer && this.plugins.bubbleRenderer.highlightCanvas) {
|
709 |
+
this.plugins.bubbleRenderer.highlightCanvas.resetCanvas();
|
710 |
+
this.plugins.bubbleRenderer.highlightCanvas = null;
|
711 |
+
}
|
712 |
+
|
713 |
+
this.plugins.bubbleRenderer = {highlightedSeriesIndex:null};
|
714 |
+
this.plugins.bubbleRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
|
715 |
+
this.plugins.bubbleRenderer.highlightLabel = null;
|
716 |
+
this.plugins.bubbleRenderer.highlightLabelCanvas = $('<div style="position:absolute;"></div>');
|
717 |
+
var top = this._gridPadding.top;
|
718 |
+
var left = this._gridPadding.left;
|
719 |
+
var width = this._plotDimensions.width - this._gridPadding.left - this._gridPadding.right;
|
720 |
+
var height = this._plotDimensions.height - this._gridPadding.top - this._gridPadding.bottom;
|
721 |
+
this.plugins.bubbleRenderer.highlightLabelCanvas.css({top:top, left:left, width:width+'px', height:height+'px'});
|
722 |
+
|
723 |
+
this.eventCanvas._elem.before(this.plugins.bubbleRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-bubbleRenderer-highlight-canvas', this._plotDimensions, this));
|
724 |
+
this.eventCanvas._elem.before(this.plugins.bubbleRenderer.highlightLabelCanvas);
|
725 |
+
|
726 |
+
var hctx = this.plugins.bubbleRenderer.highlightCanvas.setContext();
|
727 |
+
}
|
728 |
+
|
729 |
+
|
730 |
+
// setup default renderers for axes and legend so user doesn't have to
|
731 |
+
// called with scope of plot
|
732 |
+
function preInit(target, data, options) {
|
733 |
+
options = options || {};
|
734 |
+
options.axesDefaults = options.axesDefaults || {};
|
735 |
+
options.seriesDefaults = options.seriesDefaults || {};
|
736 |
+
// only set these if there is a Bubble series
|
737 |
+
var setopts = false;
|
738 |
+
if (options.seriesDefaults.renderer == $.jqplot.BubbleRenderer) {
|
739 |
+
setopts = true;
|
740 |
+
}
|
741 |
+
else if (options.series) {
|
742 |
+
for (var i=0; i < options.series.length; i++) {
|
743 |
+
if (options.series[i].renderer == $.jqplot.BubbleRenderer) {
|
744 |
+
setopts = true;
|
745 |
+
}
|
746 |
+
}
|
747 |
+
}
|
748 |
+
|
749 |
+
if (setopts) {
|
750 |
+
options.axesDefaults.renderer = $.jqplot.BubbleAxisRenderer;
|
751 |
+
options.sortData = false;
|
752 |
+
}
|
753 |
+
}
|
754 |
+
|
755 |
+
$.jqplot.preInitHooks.push(preInit);
|
756 |
+
|
757 |
+
})(jQuery);
|
758 |
+
|
759 |
+
|
backend/settings/assets/js/jqPlot/plugins/jqplot.bubbleRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(f){var d=function(m){return Math.max.apply(Math,m)};var j=function(m){return Math.min.apply(Math,m)};f.jqplot.BubbleRenderer=function(){f.jqplot.LineRenderer.call(this)};f.jqplot.BubbleRenderer.prototype=new f.jqplot.LineRenderer();f.jqplot.BubbleRenderer.prototype.constructor=f.jqplot.BubbleRenderer;f.jqplot.BubbleRenderer.prototype.init=function(w,t){this.varyBubbleColors=true;this.autoscaleBubbles=true;this.autoscaleMultiplier=1;this.autoscalePointsFactor=-0.07;this.escapeHtml=true;this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColors=[];this.bubbleAlpha=1;this.highlightAlpha=null;this.bubbleGradients=false;this.showLabels=true;this.radii=[];this.maxRadius=0;this._highlightedPoint=null;this.labels=[];this.bubbleCanvases=[];this._type="bubble";if(w.highlightMouseDown&&w.highlightMouseOver==null){w.highlightMouseOver=false}f.extend(true,this,w);if(this.highlightAlpha==null){this.highlightAlpha=this.bubbleAlpha;if(this.bubbleGradients){this.highlightAlpha=0.35}}this.autoscaleMultiplier=this.autoscaleMultiplier*Math.pow(this.data.length,this.autoscalePointsFactor);this._highlightedPoint=null;var n;for(var r=0;r<this.data.length;r++){var p=null;var v=this.data[r];this.maxRadius=Math.max(this.maxRadius,v[2]);if(v[3]){if(typeof(v[3])=="object"){p=v[3]["color"]}}if(p==null){if(this.seriesColors[r]!=null){p=this.seriesColors[r]}}if(p&&this.bubbleAlpha<1){n=f.jqplot.getColorComponents(p);p="rgba("+n[0]+", "+n[1]+", "+n[2]+", "+this.bubbleAlpha+")"}if(p){this.seriesColors[r]=p}}if(!this.varyBubbleColors){this.seriesColors=[this.color]}this.colorGenerator=new f.jqplot.ColorGenerator(this.seriesColors);if(this.highlightColors.length==0){for(var r=0;r<this.seriesColors.length;r++){var o=f.jqplot.getColorComponents(this.seriesColors[r]);var u=[o[0],o[1],o[2]];var s=u[0]+u[1]+u[2];for(var q=0;q<3;q++){u[q]=(s>570)?u[q]*0.8:u[q]+0.3*(255-u[q]);u[q]=parseInt(u[q],10)}this.highlightColors.push("rgba("+u[0]+","+u[1]+","+u[2]+", "+this.highlightAlpha+")")}}this.highlightColorGenerator=new f.jqplot.ColorGenerator(this.highlightColors);var m={fill:true,isarc:true,angle:this.shadowAngle,alpha:this.shadowAlpha,closePath:true};this.renderer.shadowRenderer.init(m);this.canvas=new f.jqplot.DivCanvas();this.canvas._plotDimensions=this._plotDimensions;t.eventListenerHooks.addOnce("jqplotMouseMove",a);t.eventListenerHooks.addOnce("jqplotMouseDown",b);t.eventListenerHooks.addOnce("jqplotMouseUp",k);t.eventListenerHooks.addOnce("jqplotClick",g);t.eventListenerHooks.addOnce("jqplotRightClick",l);t.postDrawHooks.addOnce(h)};f.jqplot.BubbleRenderer.prototype.setGridData=function(w){var q=this._xaxis.series_u2p;var m=this._yaxis.series_u2p;var t=this._plotData;this.gridData=[];var s=[];this.radii=[];var v=Math.min(w._height,w._width);for(var u=0;u<this.data.length;u++){if(t[u]!=null){this.gridData.push([q.call(this._xaxis,t[u][0]),m.call(this._yaxis,t[u][1]),t[u][2]]);this.radii.push([u,t[u][2]]);s.push(t[u][2])}}var n,o,x=this.maxRadius=d(s);var p=this.gridData.length;if(this.autoscaleBubbles){for(var u=0;u<p;u++){o=s[u]/x;n=this.autoscaleMultiplier*v/6;this.gridData[u][2]=n*o}}this.radii.sort(function(y,r){return r[1]-y[1]})};f.jqplot.BubbleRenderer.prototype.makeGridData=function(t,w){var q=this._xaxis.series_u2p;var n=this._yaxis.series_u2p;var x=[];var s=[];this.radii=[];var v=Math.min(w._height,w._width);for(var u=0;u<t.length;u++){if(t[u]!=null){x.push([q.call(this._xaxis,t[u][0]),n.call(this._yaxis,t[u][1]),t[u][2]]);s.push(t[u][2]);this.radii.push([u,t[u][2]])}}var m,o,y=this.maxRadius=d(s);var p=this.gridData.length;if(this.autoscaleBubbles){for(var u=0;u<p;u++){o=s[u]/y;m=this.autoscaleMultiplier*v/6;x[u][2]=m*o}}this.radii.sort(function(z,r){return r[1]-z[1]});return x};f.jqplot.BubbleRenderer.prototype.draw=function(D,J,n){if(this.plugins.pointLabels){this.plugins.pointLabels.show=false}var A=(n!=undefined)?n:{};var r=(A.shadow!=undefined)?A.shadow:this.shadow;this.canvas._elem.empty();for(var G=0;G<this.radii.length;G++){var C=this.radii[G][0];var z=null;var F=null;var m=null;var p=null;var I=this.data[C];var J=this.gridData[C];if(I[3]){if(typeof(I[3])=="object"){z=I[3]["label"]}else{if(typeof(I[3])=="string"){z=I[3]}}}F=this.colorGenerator.get(C);var E=J[2];var q,K;if(this.shadow){q=(0.7+J[2]/40).toFixed(1);K=1+Math.ceil(J[2]/15);E+=q*K}this.bubbleCanvases[C]=new f.jqplot.BubbleCanvas();this.canvas._elem.append(this.bubbleCanvases[C].createElement(J[0],J[1],E));this.bubbleCanvases[C].setContext();var D=this.bubbleCanvases[C]._ctx;var u=D.canvas.width/2;var s=D.canvas.height/2;if(this.shadow){this.renderer.shadowRenderer.draw(D,[u,s,J[2],0,2*Math.PI],{offset:q,depth:K})}this.bubbleCanvases[C].draw(J[2],F,this.bubbleGradients,this.shadowAngle/180*Math.PI);if(z&&this.showLabels){p=f('<div style="position:absolute;" class="jqplot-bubble-label"></div>');if(this.escapeHtml){p.text(z)}else{p.html(z)}this.canvas._elem.append(p);var H=f(p).outerHeight();var v=f(p).outerWidth();var B=J[1]-0.5*H;var o=J[0]-0.5*v;p.css({top:B,left:o});this.labels[C]=f(p)}}};f.jqplot.DivCanvas=function(){f.jqplot.ElemContainer.call(this);this._ctx};f.jqplot.DivCanvas.prototype=new f.jqplot.ElemContainer();f.jqplot.DivCanvas.prototype.constructor=f.jqplot.DivCanvas;f.jqplot.DivCanvas.prototype.createElement=function(s,p,n){this._offsets=s;var m="jqplot-DivCanvas";if(p!=undefined){m=p}var r;if(this._elem){r=this._elem.get(0)}else{r=document.createElement("div")}if(n!=undefined){this._plotDimensions=n}var o=this._plotDimensions.width-this._offsets.left-this._offsets.right+"px";var q=this._plotDimensions.height-this._offsets.top-this._offsets.bottom+"px";this._elem=f(r);this._elem.css({position:"absolute",width:o,height:q,left:this._offsets.left,top:this._offsets.top});this._elem.addClass(m);return this._elem};f.jqplot.DivCanvas.prototype.setContext=function(){this._ctx={canvas:{width:0,height:0},clearRect:function(){return null}};return this._ctx};f.jqplot.BubbleCanvas=function(){f.jqplot.ElemContainer.call(this);this._ctx};f.jqplot.BubbleCanvas.prototype=new f.jqplot.ElemContainer();f.jqplot.BubbleCanvas.prototype.constructor=f.jqplot.BubbleCanvas;f.jqplot.BubbleCanvas.prototype.createElement=function(n,u,s){var m="jqplot-bubble-point";var q;if(this._elem){q=this._elem.get(0)}else{q=document.createElement("canvas")}q.width=(s!=null)?2*s:q.width;q.height=(s!=null)?2*s:q.height;this._elem=f(q);var o=(n!=null&&s!=null)?n-s:this._elem.css("left");var p=(u!=null&&s!=null)?u-s:this._elem.css("top");this._elem.css({position:"absolute",left:o,top:p});this._elem.addClass(m);if(f.jqplot.use_excanvas){window.G_vmlCanvasManager.init_(document);q=window.G_vmlCanvasManager.initElement(q)}return this._elem};f.jqplot.BubbleCanvas.prototype.draw=function(m,s,v,p){var D=this._ctx;var B=D.canvas.width/2;var z=D.canvas.height/2;D.save();if(v&&!f.jqplot.use_excanvas){m=m*1.04;var o=f.jqplot.getColorComponents(s);var u="rgba("+Math.round(o[0]+0.8*(255-o[0]))+", "+Math.round(o[1]+0.8*(255-o[1]))+", "+Math.round(o[2]+0.8*(255-o[2]))+", "+o[3]+")";var t="rgba("+o[0]+", "+o[1]+", "+o[2]+", 0)";var C=0.35*m;var A=B-Math.cos(p)*0.33*m;var n=z-Math.sin(p)*0.33*m;var w=D.createRadialGradient(A,n,C,B,z,m);w.addColorStop(0,u);w.addColorStop(0.93,s);w.addColorStop(0.96,t);w.addColorStop(1,t);D.fillStyle=w;D.fillRect(0,0,D.canvas.width,D.canvas.height)}else{D.fillStyle=s;D.strokeStyle=s;D.lineWidth=1;D.beginPath();var q=2*Math.PI;D.arc(B,z,m,0,q,0);D.closePath();D.fill()}D.restore()};f.jqplot.BubbleCanvas.prototype.setContext=function(){this._ctx=this._elem.get(0).getContext("2d");return this._ctx};f.jqplot.BubbleAxisRenderer=function(){f.jqplot.LinearAxisRenderer.call(this)};f.jqplot.BubbleAxisRenderer.prototype=new f.jqplot.LinearAxisRenderer();f.jqplot.BubbleAxisRenderer.prototype.constructor=f.jqplot.BubbleAxisRenderer;f.jqplot.BubbleAxisRenderer.prototype.init=function(n){f.extend(true,this,n);var I=this._dataBounds;var H=0,v=0,m=0,y=0,q=0,r=0,D=0,t=0,F=0,z=0;for(var E=0;E<this._series.length;E++){var x=this._series[E];var G=x._plotData;for(var B=0;B<G.length;B++){if(this.name=="xaxis"||this.name=="x2axis"){if(G[B][0]<I.min||I.min==null){I.min=G[B][0];H=E;v=B;r=G[B][2];D=x.maxRadius;z=x.autoscaleMultiplier}if(G[B][0]>I.max||I.max==null){I.max=G[B][0];m=E;y=B;q=G[B][2];t=x.maxRadius;F=x.autoscaleMultiplier}}else{if(G[B][1]<I.min||I.min==null){I.min=G[B][1];H=E;v=B;r=G[B][2];D=x.maxRadius;z=x.autoscaleMultiplier}if(G[B][1]>I.max||I.max==null){I.max=G[B][1];m=E;y=B;q=G[B][2];t=x.maxRadius;F=x.autoscaleMultiplier}}}}var o=r/D;var w=q/t;var C=I.max-I.min;var A=Math.min(this._plotDimensions.width,this._plotDimensions.height);var p=o*z/3*C;var u=w*F/3*C;I.max+=u;I.min-=p};function e(p,v,q){p.plugins.bubbleRenderer.highlightLabelCanvas.empty();var z=p.series[v];var n=p.plugins.bubbleRenderer.highlightCanvas;var w=n._ctx;w.clearRect(0,0,w.canvas.width,w.canvas.height);z._highlightedPoint=q;p.plugins.bubbleRenderer.highlightedSeriesIndex=v;var o=z.highlightColorGenerator.get(q);var u=z.gridData[q][0],t=z.gridData[q][1],m=z.gridData[q][2];w.save();w.fillStyle=o;w.strokeStyle=o;w.lineWidth=1;w.beginPath();w.arc(u,t,m,0,2*Math.PI,0);w.closePath();w.fill();w.restore();if(z.labels[q]){p.plugins.bubbleRenderer.highlightLabel=z.labels[q].clone();p.plugins.bubbleRenderer.highlightLabel.appendTo(p.plugins.bubbleRenderer.highlightLabelCanvas);p.plugins.bubbleRenderer.highlightLabel.addClass("jqplot-bubble-label-highlight")}}function i(p){var m=p.plugins.bubbleRenderer.highlightCanvas;var o=p.plugins.bubbleRenderer.highlightedSeriesIndex;p.plugins.bubbleRenderer.highlightLabelCanvas.empty();m._ctx.clearRect(0,0,m._ctx.canvas.width,m._ctx.canvas.height);for(var n=0;n<p.series.length;n++){p.series[n]._highlightedPoint=null}p.plugins.bubbleRenderer.highlightedSeriesIndex=null;p.target.trigger("jqplotDataUnhighlight")}function a(s,p,m,v,r){if(v){var n=v.seriesIndex;var o=v.pointIndex;var q=[n,o,v.data,r.series[n].gridData[o][2]];var t=jQuery.Event("jqplotDataMouseOver");t.pageX=s.pageX;t.pageY=s.pageY;r.target.trigger(t,q);if(r.series[q[0]].highlightMouseOver&&!(q[0]==r.plugins.bubbleRenderer.highlightedSeriesIndex&&q[1]==r.series[q[0]]._highlightedPoint)){var u=jQuery.Event("jqplotDataHighlight");u.which=s.which;u.pageX=s.pageX;u.pageY=s.pageY;r.target.trigger(u,q);e(r,q[0],q[1])}}else{if(v==null){i(r)}}}function b(s,p,m,u,r){if(u){var n=u.seriesIndex;var o=u.pointIndex;var q=[n,o,u.data,r.series[n].gridData[o][2]];if(r.series[q[0]].highlightMouseDown&&!(q[0]==r.plugins.bubbleRenderer.highlightedSeriesIndex&&q[1]==r.series[q[0]]._highlightedPoint)){var t=jQuery.Event("jqplotDataHighlight");t.which=s.which;t.pageX=s.pageX;t.pageY=s.pageY;r.target.trigger(t,q);e(r,q[0],q[1])}}else{if(u==null){i(r)}}}function k(o,n,r,q,p){var m=p.plugins.bubbleRenderer.highlightedSeriesIndex;if(m!=null&&p.series[m].highlightMouseDown){i(p)}}function g(s,p,m,u,r){if(u){var n=u.seriesIndex;var o=u.pointIndex;var q=[n,o,u.data,r.series[n].gridData[o][2]];var t=jQuery.Event("jqplotDataClick");t.which=s.which;t.pageX=s.pageX;t.pageY=s.pageY;r.target.trigger(t,q)}}function l(s,p,m,v,r){if(v){var n=v.seriesIndex;var o=v.pointIndex;var q=[n,o,v.data,r.series[n].gridData[o][2]];var t=r.plugins.bubbleRenderer.highlightedSeriesIndex;if(t!=null&&r.series[t].highlightMouseDown){i(r)}var u=jQuery.Event("jqplotDataRightClick");u.which=s.which;u.pageX=s.pageX;u.pageY=s.pageY;r.target.trigger(u,q)}}function h(){if(this.plugins.bubbleRenderer&&this.plugins.bubbleRenderer.highlightCanvas){this.plugins.bubbleRenderer.highlightCanvas.resetCanvas();this.plugins.bubbleRenderer.highlightCanvas=null}this.plugins.bubbleRenderer={highlightedSeriesIndex:null};this.plugins.bubbleRenderer.highlightCanvas=new f.jqplot.GenericCanvas();this.plugins.bubbleRenderer.highlightLabel=null;this.plugins.bubbleRenderer.highlightLabelCanvas=f('<div style="position:absolute;"></div>');var q=this._gridPadding.top;var p=this._gridPadding.left;var n=this._plotDimensions.width-this._gridPadding.left-this._gridPadding.right;var m=this._plotDimensions.height-this._gridPadding.top-this._gridPadding.bottom;this.plugins.bubbleRenderer.highlightLabelCanvas.css({top:q,left:p,width:n+"px",height:m+"px"});this.eventCanvas._elem.before(this.plugins.bubbleRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-bubbleRenderer-highlight-canvas",this._plotDimensions,this));this.eventCanvas._elem.before(this.plugins.bubbleRenderer.highlightLabelCanvas);var o=this.plugins.bubbleRenderer.highlightCanvas.setContext()}function c(q,p,n){n=n||{};n.axesDefaults=n.axesDefaults||{};n.seriesDefaults=n.seriesDefaults||{};var m=false;if(n.seriesDefaults.renderer==f.jqplot.BubbleRenderer){m=true}else{if(n.series){for(var o=0;o<n.series.length;o++){if(n.series[o].renderer==f.jqplot.BubbleRenderer){m=true}}}}if(m){n.axesDefaults.renderer=f.jqplot.BubbleAxisRenderer;n.sortData=false}}f.jqplot.preInitHooks.push(c)})(jQuery);
|
backend/settings/assets/js/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.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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 |
+
// wether or not to show the tick (mark and label).
|
56 |
+
this.show = true;
|
57 |
+
// prop: showLabel
|
58 |
+
// wether 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);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.canvasAxisLabelRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(a){a.jqplot.CanvasAxisLabelRenderer=function(b){this.angle=0;this.axis;this.show=true;this.showLabel=true;this.label="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="11pt";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport=true;this.pt2px=null;this._elem;this._ctx;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null};a.extend(true,this,b);if(b.angle==null&&this.axis!="xaxis"&&this.axis!="x2axis"){this.angle=-90}var c={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};if(this.pt2px){c.pt2px=this.pt2px}if(this.enableFontSupport){if(a.jqplot.support_canvas_text()){this._textRenderer=new a.jqplot.CanvasFontRenderer(c)}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}};a.jqplot.CanvasAxisLabelRenderer.prototype.init=function(b){a.extend(true,this,b);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};a.jqplot.CanvasAxisLabelRenderer.prototype.getWidth=function(d){if(this._elem){return this._elem.outerWidth(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.sin(f.angle)*e)+Math.abs(Math.cos(f.angle)*c);return b}};a.jqplot.CanvasAxisLabelRenderer.prototype.getHeight=function(d){if(this._elem){return this._elem.outerHeight(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.cos(f.angle)*e)+Math.abs(Math.sin(f.angle)*c);return b}};a.jqplot.CanvasAxisLabelRenderer.prototype.getAngleRad=function(){var b=this.angle*Math.PI/180;return b};a.jqplot.CanvasAxisLabelRenderer.prototype.draw=function(c,f){if(this._elem){if(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==undefined){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce();this._elem=null}var e=f.canvasManager.getCanvas();this._textRenderer.setText(this.label,c);var b=this.getWidth(c);var d=this.getHeight(c);e.width=b;e.height=d;e.style.width=b;e.style.height=d;e=f.canvasManager.initCanvas(e);this._elem=a(e);this._elem.css({position:"absolute"});this._elem.addClass("jqplot-"+this.axis+"-label");e=null;return this._elem};a.jqplot.CanvasAxisLabelRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.canvasAxisTickRenderer.js
ADDED
@@ -0,0 +1,243 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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 |
+
// wether or not to show the mark on the axis.
|
53 |
+
this.showMark = true;
|
54 |
+
// prop: showGridline
|
55 |
+
// wether 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 |
+
// wether or not to show the tick (mark and label).
|
69 |
+
this.show = true;
|
70 |
+
// prop: showLabel
|
71 |
+
// wether 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 |
+
$.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad = function() {
|
185 |
+
var a = this.angle * Math.PI/180;
|
186 |
+
return a;
|
187 |
+
};
|
188 |
+
|
189 |
+
|
190 |
+
$.jqplot.CanvasAxisTickRenderer.prototype.setTick = function(value, axisName, isMinor) {
|
191 |
+
this.value = value;
|
192 |
+
if (isMinor) {
|
193 |
+
this.isMinorTick = true;
|
194 |
+
}
|
195 |
+
return this;
|
196 |
+
};
|
197 |
+
|
198 |
+
$.jqplot.CanvasAxisTickRenderer.prototype.draw = function(ctx, plot) {
|
199 |
+
if (!this.label) {
|
200 |
+
this.label = this.prefix + this.formatter(this.formatString, this.value);
|
201 |
+
}
|
202 |
+
|
203 |
+
// Memory Leaks patch
|
204 |
+
if (this._elem) {
|
205 |
+
if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) {
|
206 |
+
window.G_vmlCanvasManager.uninitElement(this._elem.get(0));
|
207 |
+
}
|
208 |
+
|
209 |
+
this._elem.emptyForce();
|
210 |
+
this._elem = null;
|
211 |
+
}
|
212 |
+
|
213 |
+
// create a canvas here, but can't draw on it untill it is appended
|
214 |
+
// to dom for IE compatability.
|
215 |
+
|
216 |
+
var elem = plot.canvasManager.getCanvas();
|
217 |
+
|
218 |
+
this._textRenderer.setText(this.label, ctx);
|
219 |
+
var w = this.getWidth(ctx);
|
220 |
+
var h = this.getHeight(ctx);
|
221 |
+
// canvases seem to need to have width and heigh attributes directly set.
|
222 |
+
elem.width = w;
|
223 |
+
elem.height = h;
|
224 |
+
elem.style.width = w;
|
225 |
+
elem.style.height = h;
|
226 |
+
elem.style.textAlign = 'left';
|
227 |
+
elem.style.position = 'absolute';
|
228 |
+
|
229 |
+
elem = plot.canvasManager.initCanvas(elem);
|
230 |
+
|
231 |
+
this._elem = $(elem);
|
232 |
+
this._elem.css(this._styles);
|
233 |
+
this._elem.addClass('jqplot-'+this.axis+'-tick');
|
234 |
+
|
235 |
+
elem = null;
|
236 |
+
return this._elem;
|
237 |
+
};
|
238 |
+
|
239 |
+
$.jqplot.CanvasAxisTickRenderer.prototype.pack = function() {
|
240 |
+
this._textRenderer.draw(this._elem.get(0).getContext("2d"), this.label);
|
241 |
+
};
|
242 |
+
|
243 |
+
})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.canvasAxisTickRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(a){a.jqplot.CanvasAxisTickRenderer=function(b){this.mark="outside";this.showMark=true;this.showGridline=true;this.isMinorTick=false;this.angle=0;this.markSize=4;this.show=true;this.showLabel=true;this.labelPosition="auto";this.label="";this.value=null;this._styles={};this.formatter=a.jqplot.DefaultTickFormatter;this.formatString="";this.prefix="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="10pt";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport=true;this.pt2px=null;this._elem;this._ctx;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null};a.extend(true,this,b);var c={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};if(this.pt2px){c.pt2px=this.pt2px}if(this.enableFontSupport){if(a.jqplot.support_canvas_text()){this._textRenderer=new a.jqplot.CanvasFontRenderer(c)}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}}else{this._textRenderer=new a.jqplot.CanvasTextRenderer(c)}};a.jqplot.CanvasAxisTickRenderer.prototype.init=function(b){a.extend(true,this,b);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};a.jqplot.CanvasAxisTickRenderer.prototype.getWidth=function(d){if(this._elem){return this._elem.outerWidth(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.sin(f.angle)*e)+Math.abs(Math.cos(f.angle)*c);return b}};a.jqplot.CanvasAxisTickRenderer.prototype.getHeight=function(d){if(this._elem){return this._elem.outerHeight(true)}else{var f=this._textRenderer;var c=f.getWidth(d);var e=f.getHeight(d);var b=Math.abs(Math.cos(f.angle)*e)+Math.abs(Math.sin(f.angle)*c);return b}};a.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad=function(){var b=this.angle*Math.PI/180;return b};a.jqplot.CanvasAxisTickRenderer.prototype.setTick=function(b,d,c){this.value=b;if(c){this.isMinorTick=true}return this};a.jqplot.CanvasAxisTickRenderer.prototype.draw=function(c,f){if(!this.label){this.label=this.prefix+this.formatter(this.formatString,this.value)}if(this._elem){if(a.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==undefined){window.G_vmlCanvasManager.uninitElement(this._elem.get(0))}this._elem.emptyForce();this._elem=null}var e=f.canvasManager.getCanvas();this._textRenderer.setText(this.label,c);var b=this.getWidth(c);var d=this.getHeight(c);e.width=b;e.height=d;e.style.width=b;e.style.height=d;e.style.textAlign="left";e.style.position="absolute";e=f.canvasManager.initCanvas(e);this._elem=a(e);this._elem.css(this._styles);this._elem.addClass("jqplot-"+this.axis+"-tick");e=null;return this._elem};a.jqplot.CanvasAxisTickRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.canvasOverlay.js
ADDED
@@ -0,0 +1,865 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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 |
+
var objCounter = 0;
|
33 |
+
// class: $.jqplot.CanvasOverlay
|
34 |
+
$.jqplot.CanvasOverlay = function(opts){
|
35 |
+
var options = opts || {};
|
36 |
+
this.options = {
|
37 |
+
show: $.jqplot.config.enablePlugins,
|
38 |
+
deferDraw: false
|
39 |
+
};
|
40 |
+
// prop: objects
|
41 |
+
this.objects = [];
|
42 |
+
this.objectNames = [];
|
43 |
+
this.canvas = null;
|
44 |
+
this.markerRenderer = new $.jqplot.MarkerRenderer({style:'line'});
|
45 |
+
this.markerRenderer.init();
|
46 |
+
this.highlightObjectIndex = null;
|
47 |
+
if (options.objects) {
|
48 |
+
var objs = options.objects,
|
49 |
+
obj;
|
50 |
+
for (var i=0; i<objs.length; i++) {
|
51 |
+
obj = objs[i];
|
52 |
+
for (var n in obj) {
|
53 |
+
switch (n) {
|
54 |
+
case 'line':
|
55 |
+
this.addLine(obj[n]);
|
56 |
+
break;
|
57 |
+
case 'horizontalLine':
|
58 |
+
this.addHorizontalLine(obj[n]);
|
59 |
+
break;
|
60 |
+
case 'dashedHorizontalLine':
|
61 |
+
this.addDashedHorizontalLine(obj[n]);
|
62 |
+
break;
|
63 |
+
case 'verticalLine':
|
64 |
+
this.addVerticalLine(obj[n]);
|
65 |
+
break;
|
66 |
+
case 'dashedVerticalLine':
|
67 |
+
this.addDashedVerticalLine(obj[n]);
|
68 |
+
break;
|
69 |
+
default:
|
70 |
+
break;
|
71 |
+
}
|
72 |
+
}
|
73 |
+
}
|
74 |
+
}
|
75 |
+
$.extend(true, this.options, options);
|
76 |
+
};
|
77 |
+
|
78 |
+
// called with scope of a plot object
|
79 |
+
$.jqplot.CanvasOverlay.postPlotInit = function (target, data, opts) {
|
80 |
+
var options = opts || {};
|
81 |
+
// add a canvasOverlay attribute to the plot
|
82 |
+
this.plugins.canvasOverlay = new $.jqplot.CanvasOverlay(options.canvasOverlay);
|
83 |
+
};
|
84 |
+
|
85 |
+
|
86 |
+
function LineBase() {
|
87 |
+
this.uid = null;
|
88 |
+
this.type = null;
|
89 |
+
this.gridStart = null;
|
90 |
+
this.gridStop = null;
|
91 |
+
this.tooltipWidthFactor = 0;
|
92 |
+
this.options = {
|
93 |
+
// prop: name
|
94 |
+
// Optional name for the overlay object.
|
95 |
+
// Can be later used to retrieve the object by name.
|
96 |
+
name: null,
|
97 |
+
// prop: show
|
98 |
+
// true to show (draw), false to not draw.
|
99 |
+
show: true,
|
100 |
+
// prop: lineWidth
|
101 |
+
// Width of the line.
|
102 |
+
lineWidth: 2,
|
103 |
+
// prop: lineCap
|
104 |
+
// Type of ending placed on the line ['round', 'butt', 'square']
|
105 |
+
lineCap: 'round',
|
106 |
+
// prop: color
|
107 |
+
// color of the line
|
108 |
+
color: '#666666',
|
109 |
+
// prop: shadow
|
110 |
+
// wether or not to draw a shadow on the line
|
111 |
+
shadow: true,
|
112 |
+
// prop: shadowAngle
|
113 |
+
// Shadow angle in degrees
|
114 |
+
shadowAngle: 45,
|
115 |
+
// prop: shadowOffset
|
116 |
+
// Shadow offset from line in pixels
|
117 |
+
shadowOffset: 1,
|
118 |
+
// prop: shadowDepth
|
119 |
+
// Number of times shadow is stroked, each stroke offset shadowOffset from the last.
|
120 |
+
shadowDepth: 3,
|
121 |
+
// prop: shadowAlpha
|
122 |
+
// Alpha channel transparency of shadow. 0 = transparent.
|
123 |
+
shadowAlpha: '0.07',
|
124 |
+
// prop: xaxis
|
125 |
+
// X axis to use for positioning/scaling the line.
|
126 |
+
xaxis: 'xaxis',
|
127 |
+
// prop: yaxis
|
128 |
+
// Y axis to use for positioning/scaling the line.
|
129 |
+
yaxis: 'yaxis',
|
130 |
+
// prop: showTooltip
|
131 |
+
// Show a tooltip with data point values.
|
132 |
+
showTooltip: false,
|
133 |
+
// prop: showTooltipPrecision
|
134 |
+
// Controls how close to line cursor must be to show tooltip.
|
135 |
+
// Higher number = closer to line, lower number = farther from line.
|
136 |
+
// 1.0 = cursor must be over line.
|
137 |
+
showTooltipPrecision: 0.6,
|
138 |
+
// prop: tooltipLocation
|
139 |
+
// Where to position tooltip, 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'
|
140 |
+
tooltipLocation: 'nw',
|
141 |
+
// prop: fadeTooltip
|
142 |
+
// true = fade in/out tooltip, flase = show/hide tooltip
|
143 |
+
fadeTooltip: true,
|
144 |
+
// prop: tooltipFadeSpeed
|
145 |
+
// 'slow', 'def', 'fast', or number of milliseconds.
|
146 |
+
tooltipFadeSpeed: "fast",
|
147 |
+
// prop: tooltipOffset
|
148 |
+
// Pixel offset of tooltip from the highlight.
|
149 |
+
tooltipOffset: 4,
|
150 |
+
// prop: tooltipFormatString
|
151 |
+
// Format string passed the x and y values of the cursor on the line.
|
152 |
+
// e.g., 'Dogs: %.2f, Cats: %d'.
|
153 |
+
tooltipFormatString: '%d, %d'
|
154 |
+
};
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Class: Line
|
159 |
+
* A straight line.
|
160 |
+
*/
|
161 |
+
function Line(options) {
|
162 |
+
LineBase.call(this);
|
163 |
+
this.type = 'line';
|
164 |
+
var opts = {
|
165 |
+
// prop: start
|
166 |
+
// [x, y] coordinates for the start of the line.
|
167 |
+
start: [],
|
168 |
+
// prop: stop
|
169 |
+
// [x, y] coordinates for the end of the line.
|
170 |
+
stop: []
|
171 |
+
};
|
172 |
+
$.extend(true, this.options, opts, options);
|
173 |
+
|
174 |
+
if (this.options.showTooltipPrecision < 0.01) {
|
175 |
+
this.options.showTooltipPrecision = 0.01;
|
176 |
+
}
|
177 |
+
}
|
178 |
+
|
179 |
+
Line.prototype = new LineBase();
|
180 |
+
Line.prototype.constructor = Line;
|
181 |
+
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Class: HorizontalLine
|
185 |
+
* A straight horizontal line.
|
186 |
+
*/
|
187 |
+
function HorizontalLine(options) {
|
188 |
+
LineBase.call(this);
|
189 |
+
this.type = 'horizontalLine';
|
190 |
+
var opts = {
|
191 |
+
// prop: y
|
192 |
+
// y value to position the line
|
193 |
+
y: null,
|
194 |
+
// prop: xmin
|
195 |
+
// x value for the start of the line, null to scale to axis min.
|
196 |
+
xmin: null,
|
197 |
+
// prop: xmax
|
198 |
+
// x value for the end of the line, null to scale to axis max.
|
199 |
+
xmax: null,
|
200 |
+
// prop xOffset
|
201 |
+
// offset ends of the line inside the grid. Number
|
202 |
+
xOffset: '6px', // number or string. Number interpreted as units, string as pixels.
|
203 |
+
xminOffset: null,
|
204 |
+
xmaxOffset: null
|
205 |
+
};
|
206 |
+
$.extend(true, this.options, opts, options);
|
207 |
+
|
208 |
+
if (this.options.showTooltipPrecision < 0.01) {
|
209 |
+
this.options.showTooltipPrecision = 0.01;
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
HorizontalLine.prototype = new LineBase();
|
214 |
+
HorizontalLine.prototype.constructor = HorizontalLine;
|
215 |
+
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Class: DashedHorizontalLine
|
219 |
+
* A straight dashed horizontal line.
|
220 |
+
*/
|
221 |
+
function DashedHorizontalLine(options) {
|
222 |
+
LineBase.call(this);
|
223 |
+
this.type = 'dashedHorizontalLine';
|
224 |
+
var opts = {
|
225 |
+
y: null,
|
226 |
+
xmin: null,
|
227 |
+
xmax: null,
|
228 |
+
xOffset: '6px', // number or string. Number interpreted as units, string as pixels.
|
229 |
+
xminOffset: null,
|
230 |
+
xmaxOffset: null,
|
231 |
+
// prop: dashPattern
|
232 |
+
// Array of line, space settings in pixels.
|
233 |
+
// Default is 8 pixel of line, 8 pixel of space.
|
234 |
+
// Note, limit to a 2 element array b/c of bug with higher order arrays.
|
235 |
+
dashPattern: [8,8]
|
236 |
+
};
|
237 |
+
$.extend(true, this.options, opts, options);
|
238 |
+
|
239 |
+
if (this.options.showTooltipPrecision < 0.01) {
|
240 |
+
this.options.showTooltipPrecision = 0.01;
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
+
DashedHorizontalLine.prototype = new LineBase();
|
245 |
+
DashedHorizontalLine.prototype.constructor = DashedHorizontalLine;
|
246 |
+
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Class: VerticalLine
|
250 |
+
* A straight vertical line.
|
251 |
+
*/
|
252 |
+
function VerticalLine(options) {
|
253 |
+
LineBase.call(this);
|
254 |
+
this.type = 'verticalLine';
|
255 |
+
var opts = {
|
256 |
+
x: null,
|
257 |
+
ymin: null,
|
258 |
+
ymax: null,
|
259 |
+
yOffset: '6px', // number or string. Number interpreted as units, string as pixels.
|
260 |
+
yminOffset: null,
|
261 |
+
ymaxOffset: null
|
262 |
+
};
|
263 |
+
$.extend(true, this.options, opts, options);
|
264 |
+
|
265 |
+
if (this.options.showTooltipPrecision < 0.01) {
|
266 |
+
this.options.showTooltipPrecision = 0.01;
|
267 |
+
}
|
268 |
+
}
|
269 |
+
|
270 |
+
VerticalLine.prototype = new LineBase();
|
271 |
+
VerticalLine.prototype.constructor = VerticalLine;
|
272 |
+
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Class: DashedVerticalLine
|
276 |
+
* A straight dashed vertical line.
|
277 |
+
*/
|
278 |
+
function DashedVerticalLine(options) {
|
279 |
+
LineBase.call(this);
|
280 |
+
this.type = 'dashedVerticalLine';
|
281 |
+
this.start = null;
|
282 |
+
this.stop = null;
|
283 |
+
var opts = {
|
284 |
+
x: null,
|
285 |
+
ymin: null,
|
286 |
+
ymax: null,
|
287 |
+
yOffset: '6px', // number or string. Number interpreted as units, string as pixels.
|
288 |
+
yminOffset: null,
|
289 |
+
ymaxOffset: null,
|
290 |
+
// prop: dashPattern
|
291 |
+
// Array of line, space settings in pixels.
|
292 |
+
// Default is 8 pixel of line, 8 pixel of space.
|
293 |
+
// Note, limit to a 2 element array b/c of bug with higher order arrays.
|
294 |
+
dashPattern: [8,8]
|
295 |
+
};
|
296 |
+
$.extend(true, this.options, opts, options);
|
297 |
+
|
298 |
+
if (this.options.showTooltipPrecision < 0.01) {
|
299 |
+
this.options.showTooltipPrecision = 0.01;
|
300 |
+
}
|
301 |
+
}
|
302 |
+
|
303 |
+
DashedVerticalLine.prototype = new LineBase();
|
304 |
+
DashedVerticalLine.prototype.constructor = DashedVerticalLine;
|
305 |
+
|
306 |
+
$.jqplot.CanvasOverlay.prototype.addLine = function(opts) {
|
307 |
+
var line = new Line(opts);
|
308 |
+
line.uid = objCounter++;
|
309 |
+
this.objects.push(line);
|
310 |
+
this.objectNames.push(line.options.name);
|
311 |
+
};
|
312 |
+
|
313 |
+
$.jqplot.CanvasOverlay.prototype.addHorizontalLine = function(opts) {
|
314 |
+
var line = new HorizontalLine(opts);
|
315 |
+
line.uid = objCounter++;
|
316 |
+
this.objects.push(line);
|
317 |
+
this.objectNames.push(line.options.name);
|
318 |
+
};
|
319 |
+
|
320 |
+
$.jqplot.CanvasOverlay.prototype.addDashedHorizontalLine = function(opts) {
|
321 |
+
var line = new DashedHorizontalLine(opts);
|
322 |
+
line.uid = objCounter++;
|
323 |
+
this.objects.push(line);
|
324 |
+
this.objectNames.push(line.options.name);
|
325 |
+
};
|
326 |
+
|
327 |
+
$.jqplot.CanvasOverlay.prototype.addVerticalLine = function(opts) {
|
328 |
+
var line = new VerticalLine(opts);
|
329 |
+
line.uid = objCounter++;
|
330 |
+
this.objects.push(line);
|
331 |
+
this.objectNames.push(line.options.name);
|
332 |
+
};
|
333 |
+
|
334 |
+
$.jqplot.CanvasOverlay.prototype.addDashedVerticalLine = function(opts) {
|
335 |
+
var line = new DashedVerticalLine(opts);
|
336 |
+
line.uid = objCounter++;
|
337 |
+
this.objects.push(line);
|
338 |
+
this.objectNames.push(line.options.name);
|
339 |
+
};
|
340 |
+
|
341 |
+
$.jqplot.CanvasOverlay.prototype.removeObject = function(idx) {
|
342 |
+
// check if integer, remove by index
|
343 |
+
if ($.type(idx) == 'number') {
|
344 |
+
this.objects.splice(idx, 1);
|
345 |
+
this.objectNames.splice(idx, 1);
|
346 |
+
}
|
347 |
+
// if string, remove by name
|
348 |
+
else {
|
349 |
+
var id = $.inArray(idx, this.objectNames);
|
350 |
+
if (id != -1) {
|
351 |
+
this.objects.splice(id, 1);
|
352 |
+
this.objectNames.splice(id, 1);
|
353 |
+
}
|
354 |
+
}
|
355 |
+
};
|
356 |
+
|
357 |
+
$.jqplot.CanvasOverlay.prototype.getObject = function(idx) {
|
358 |
+
// check if integer, remove by index
|
359 |
+
if ($.type(idx) == 'number') {
|
360 |
+
return this.objects[idx];
|
361 |
+
}
|
362 |
+
// if string, remove by name
|
363 |
+
else {
|
364 |
+
var id = $.inArray(idx, this.objectNames);
|
365 |
+
if (id != -1) {
|
366 |
+
return this.objects[id];
|
367 |
+
}
|
368 |
+
}
|
369 |
+
};
|
370 |
+
|
371 |
+
// Set get as alias for getObject.
|
372 |
+
$.jqplot.CanvasOverlay.prototype.get = $.jqplot.CanvasOverlay.prototype.getObject;
|
373 |
+
|
374 |
+
$.jqplot.CanvasOverlay.prototype.clear = function(plot) {
|
375 |
+
this.canvas._ctx.clearRect(0,0,this.canvas.getWidth(), this.canvas.getHeight());
|
376 |
+
};
|
377 |
+
|
378 |
+
$.jqplot.CanvasOverlay.prototype.draw = function(plot) {
|
379 |
+
var obj,
|
380 |
+
objs = this.objects,
|
381 |
+
mr = this.markerRenderer,
|
382 |
+
start,
|
383 |
+
stop;
|
384 |
+
if (this.options.show) {
|
385 |
+
this.canvas._ctx.clearRect(0,0,this.canvas.getWidth(), this.canvas.getHeight());
|
386 |
+
for (var k=0; k<objs.length; k++) {
|
387 |
+
obj = objs[k];
|
388 |
+
var opts = $.extend(true, {}, obj.options);
|
389 |
+
if (obj.options.show) {
|
390 |
+
// style and shadow properties should be set before
|
391 |
+
// every draw of marker renderer.
|
392 |
+
mr.shadow = obj.options.shadow;
|
393 |
+
obj.tooltipWidthFactor = obj.options.lineWidth / obj.options.showTooltipPrecision;
|
394 |
+
switch (obj.type) {
|
395 |
+
case 'line':
|
396 |
+
// style and shadow properties should be set before
|
397 |
+
// every draw of marker renderer.
|
398 |
+
mr.style = 'line';
|
399 |
+
opts.closePath = false;
|
400 |
+
start = [plot.axes[obj.options.xaxis].series_u2p(obj.options.start[0]), plot.axes[obj.options.yaxis].series_u2p(obj.options.start[1])];
|
401 |
+
stop = [plot.axes[obj.options.xaxis].series_u2p(obj.options.stop[0]), plot.axes[obj.options.yaxis].series_u2p(obj.options.stop[1])];
|
402 |
+
obj.gridStart = start;
|
403 |
+
obj.gridStop = stop;
|
404 |
+
mr.draw(start, stop, this.canvas._ctx, opts);
|
405 |
+
break;
|
406 |
+
case 'horizontalLine':
|
407 |
+
|
408 |
+
// style and shadow properties should be set before
|
409 |
+
// every draw of marker renderer.
|
410 |
+
if (obj.options.y != null) {
|
411 |
+
mr.style = 'line';
|
412 |
+
opts.closePath = false;
|
413 |
+
var xaxis = plot.axes[obj.options.xaxis],
|
414 |
+
xstart,
|
415 |
+
xstop,
|
416 |
+
y = plot.axes[obj.options.yaxis].series_u2p(obj.options.y),
|
417 |
+
xminoff = obj.options.xminOffset || obj.options.xOffset,
|
418 |
+
xmaxoff = obj.options.xmaxOffset || obj.options.xOffset;
|
419 |
+
if (obj.options.xmin != null) {
|
420 |
+
xstart = xaxis.series_u2p(obj.options.xmin);
|
421 |
+
}
|
422 |
+
else if (xminoff != null) {
|
423 |
+
if ($.type(xminoff) == "number") {
|
424 |
+
xstart = xaxis.series_u2p(xaxis.min + xminoff);
|
425 |
+
}
|
426 |
+
else if ($.type(xminoff) == "string") {
|
427 |
+
xstart = xaxis.series_u2p(xaxis.min) + parseFloat(xminoff);
|
428 |
+
}
|
429 |
+
}
|
430 |
+
if (obj.options.xmax != null) {
|
431 |
+
xstop = xaxis.series_u2p(obj.options.xmax);
|
432 |
+
}
|
433 |
+
else if (xmaxoff != null) {
|
434 |
+
if ($.type(xmaxoff) == "number") {
|
435 |
+
xstop = xaxis.series_u2p(xaxis.max - xmaxoff);
|
436 |
+
}
|
437 |
+
else if ($.type(xmaxoff) == "string") {
|
438 |
+
xstop = xaxis.series_u2p(xaxis.max) - parseFloat(xmaxoff);
|
439 |
+
}
|
440 |
+
}
|
441 |
+
if (xstop != null && xstart != null) {
|
442 |
+
obj.gridStart = [xstart, y];
|
443 |
+
obj.gridStop = [xstop, y];
|
444 |
+
mr.draw([xstart, y], [xstop, y], this.canvas._ctx, opts);
|
445 |
+
}
|
446 |
+
}
|
447 |
+
break;
|
448 |
+
|
449 |
+
case 'dashedHorizontalLine':
|
450 |
+
|
451 |
+
var dashPat = obj.options.dashPattern;
|
452 |
+
var dashPatLen = 0;
|
453 |
+
for (var i=0; i<dashPat.length; i++) {
|
454 |
+
dashPatLen += dashPat[i];
|
455 |
+
}
|
456 |
+
|
457 |
+
// style and shadow properties should be set before
|
458 |
+
// every draw of marker renderer.
|
459 |
+
if (obj.options.y != null) {
|
460 |
+
mr.style = 'line';
|
461 |
+
opts.closePath = false;
|
462 |
+
var xaxis = plot.axes[obj.options.xaxis],
|
463 |
+
xstart,
|
464 |
+
xstop,
|
465 |
+
y = plot.axes[obj.options.yaxis].series_u2p(obj.options.y),
|
466 |
+
xminoff = obj.options.xminOffset || obj.options.xOffset,
|
467 |
+
xmaxoff = obj.options.xmaxOffset || obj.options.xOffset;
|
468 |
+
if (obj.options.xmin != null) {
|
469 |
+
xstart = xaxis.series_u2p(obj.options.xmin);
|
470 |
+
}
|
471 |
+
else if (xminoff != null) {
|
472 |
+
if ($.type(xminoff) == "number") {
|
473 |
+
xstart = xaxis.series_u2p(xaxis.min + xminoff);
|
474 |
+
}
|
475 |
+
else if ($.type(xminoff) == "string") {
|
476 |
+
xstart = xaxis.series_u2p(xaxis.min) + parseFloat(xminoff);
|
477 |
+
}
|
478 |
+
}
|
479 |
+
if (obj.options.xmax != null) {
|
480 |
+
xstop = xaxis.series_u2p(obj.options.xmax);
|
481 |
+
}
|
482 |
+
else if (xmaxoff != null) {
|
483 |
+
if ($.type(xmaxoff) == "number") {
|
484 |
+
xstop = xaxis.series_u2p(xaxis.max - xmaxoff);
|
485 |
+
}
|
486 |
+
else if ($.type(xmaxoff) == "string") {
|
487 |
+
xstop = xaxis.series_u2p(xaxis.max) - parseFloat(xmaxoff);
|
488 |
+
}
|
489 |
+
}
|
490 |
+
if (xstop != null && xstart != null) {
|
491 |
+
obj.gridStart = [xstart, y];
|
492 |
+
obj.gridStop = [xstop, y];
|
493 |
+
var numDash = Math.ceil((xstop - xstart)/dashPatLen);
|
494 |
+
var b=xstart, e;
|
495 |
+
for (var i=0; i<numDash; i++) {
|
496 |
+
for (var j=0; j<dashPat.length; j+=2) {
|
497 |
+
e = b+dashPat[j];
|
498 |
+
mr.draw([b, y], [e, y], this.canvas._ctx, opts);
|
499 |
+
b += dashPat[j];
|
500 |
+
if (j < dashPat.length-1) {
|
501 |
+
b += dashPat[j+1];
|
502 |
+
}
|
503 |
+
}
|
504 |
+
}
|
505 |
+
}
|
506 |
+
}
|
507 |
+
break;
|
508 |
+
|
509 |
+
case 'verticalLine':
|
510 |
+
|
511 |
+
// style and shadow properties should be set before
|
512 |
+
// every draw of marker renderer.
|
513 |
+
if (obj.options.x != null) {
|
514 |
+
mr.style = 'line';
|
515 |
+
opts.closePath = false;
|
516 |
+
var yaxis = plot.axes[obj.options.yaxis],
|
517 |
+
ystart,
|
518 |
+
ystop,
|
519 |
+
x = plot.axes[obj.options.xaxis].series_u2p(obj.options.x),
|
520 |
+
yminoff = obj.options.yminOffset || obj.options.yOffset,
|
521 |
+
ymaxoff = obj.options.ymaxOffset || obj.options.yOffset;
|
522 |
+
if (obj.options.ymin != null) {
|
523 |
+
ystart = yaxis.series_u2p(obj.options.ymin);
|
524 |
+
}
|
525 |
+
else if (yminoff != null) {
|
526 |
+
if ($.type(yminoff) == "number") {
|
527 |
+
ystart = yaxis.series_u2p(yaxis.min - yminoff);
|
528 |
+
}
|
529 |
+
else if ($.type(yminoff) == "string") {
|
530 |
+
ystart = yaxis.series_u2p(yaxis.min) - parseFloat(yminoff);
|
531 |
+
}
|
532 |
+
}
|
533 |
+
if (obj.options.ymax != null) {
|
534 |
+
ystop = yaxis.series_u2p(obj.options.ymax);
|
535 |
+
}
|
536 |
+
else if (ymaxoff != null) {
|
537 |
+
if ($.type(ymaxoff) == "number") {
|
538 |
+
ystop = yaxis.series_u2p(yaxis.max + ymaxoff);
|
539 |
+
}
|
540 |
+
else if ($.type(ymaxoff) == "string") {
|
541 |
+
ystop = yaxis.series_u2p(yaxis.max) + parseFloat(ymaxoff);
|
542 |
+
}
|
543 |
+
}
|
544 |
+
if (ystop != null && ystart != null) {
|
545 |
+
obj.gridStart = [x, ystart];
|
546 |
+
obj.gridStop = [x, ystop];
|
547 |
+
mr.draw([x, ystart], [x, ystop], this.canvas._ctx, opts);
|
548 |
+
}
|
549 |
+
}
|
550 |
+
break;
|
551 |
+
|
552 |
+
case 'dashedVerticalLine':
|
553 |
+
|
554 |
+
var dashPat = obj.options.dashPattern;
|
555 |
+
var dashPatLen = 0;
|
556 |
+
for (var i=0; i<dashPat.length; i++) {
|
557 |
+
dashPatLen += dashPat[i];
|
558 |
+
}
|
559 |
+
|
560 |
+
// style and shadow properties should be set before
|
561 |
+
// every draw of marker renderer.
|
562 |
+
if (obj.options.x != null) {
|
563 |
+
mr.style = 'line';
|
564 |
+
opts.closePath = false;
|
565 |
+
var yaxis = plot.axes[obj.options.yaxis],
|
566 |
+
ystart,
|
567 |
+
ystop,
|
568 |
+
x = plot.axes[obj.options.xaxis].series_u2p(obj.options.x),
|
569 |
+
yminoff = obj.options.yminOffset || obj.options.yOffset,
|
570 |
+
ymaxoff = obj.options.ymaxOffset || obj.options.yOffset;
|
571 |
+
if (obj.options.ymin != null) {
|
572 |
+
ystart = yaxis.series_u2p(obj.options.ymin);
|
573 |
+
}
|
574 |
+
else if (yminoff != null) {
|
575 |
+
if ($.type(yminoff) == "number") {
|
576 |
+
ystart = yaxis.series_u2p(yaxis.min - yminoff);
|
577 |
+
}
|
578 |
+
else if ($.type(yminoff) == "string") {
|
579 |
+
ystart = yaxis.series_u2p(yaxis.min) - parseFloat(yminoff);
|
580 |
+
}
|
581 |
+
}
|
582 |
+
if (obj.options.ymax != null) {
|
583 |
+
ystop = yaxis.series_u2p(obj.options.ymax);
|
584 |
+
}
|
585 |
+
else if (ymaxoff != null) {
|
586 |
+
if ($.type(ymaxoff) == "number") {
|
587 |
+
ystop = yaxis.series_u2p(yaxis.max + ymaxoff);
|
588 |
+
}
|
589 |
+
else if ($.type(ymaxoff) == "string") {
|
590 |
+
ystop = yaxis.series_u2p(yaxis.max) + parseFloat(ymaxoff);
|
591 |
+
}
|
592 |
+
}
|
593 |
+
|
594 |
+
|
595 |
+
if (ystop != null && ystart != null) {
|
596 |
+
obj.gridStart = [x, ystart];
|
597 |
+
obj.gridStop = [x, ystop];
|
598 |
+
var numDash = Math.ceil((ystart - ystop)/dashPatLen);
|
599 |
+
var firstDashAdjust = ((numDash * dashPatLen) - (ystart - ystop))/2.0;
|
600 |
+
var b=ystart, e, bs, es;
|
601 |
+
for (var i=0; i<numDash; i++) {
|
602 |
+
for (var j=0; j<dashPat.length; j+=2) {
|
603 |
+
e = b - dashPat[j];
|
604 |
+
if (e < ystop) {
|
605 |
+
e = ystop;
|
606 |
+
}
|
607 |
+
if (b < ystop) {
|
608 |
+
b = ystop;
|
609 |
+
}
|
610 |
+
// es = e;
|
611 |
+
// if (i == 0) {
|
612 |
+
// es += firstDashAdjust;
|
613 |
+
// }
|
614 |
+
mr.draw([x, b], [x, e], this.canvas._ctx, opts);
|
615 |
+
b -= dashPat[j];
|
616 |
+
if (j < dashPat.length-1) {
|
617 |
+
b -= dashPat[j+1];
|
618 |
+
}
|
619 |
+
}
|
620 |
+
}
|
621 |
+
}
|
622 |
+
}
|
623 |
+
break;
|
624 |
+
|
625 |
+
default:
|
626 |
+
break;
|
627 |
+
}
|
628 |
+
}
|
629 |
+
}
|
630 |
+
}
|
631 |
+
};
|
632 |
+
|
633 |
+
// called within context of plot
|
634 |
+
// create a canvas which we can draw on.
|
635 |
+
// insert it before the eventCanvas, so eventCanvas will still capture events.
|
636 |
+
$.jqplot.CanvasOverlay.postPlotDraw = function() {
|
637 |
+
var co = this.plugins.canvasOverlay;
|
638 |
+
// Memory Leaks patch
|
639 |
+
if (co && co.highlightCanvas) {
|
640 |
+
co.highlightCanvas.resetCanvas();
|
641 |
+
co.highlightCanvas = null;
|
642 |
+
}
|
643 |
+
co.canvas = new $.jqplot.GenericCanvas();
|
644 |
+
|
645 |
+
this.eventCanvas._elem.before(co.canvas.createElement(this._gridPadding, 'jqplot-overlayCanvas-canvas', this._plotDimensions, this));
|
646 |
+
co.canvas.setContext();
|
647 |
+
if (!co.deferDraw) {
|
648 |
+
co.draw(this);
|
649 |
+
}
|
650 |
+
|
651 |
+
var elem = document.createElement('div');
|
652 |
+
co._tooltipElem = $(elem);
|
653 |
+
elem = null;
|
654 |
+
co._tooltipElem.addClass('jqplot-canvasOverlay-tooltip');
|
655 |
+
co._tooltipElem.css({position:'absolute', display:'none'});
|
656 |
+
|
657 |
+
this.eventCanvas._elem.before(co._tooltipElem);
|
658 |
+
this.eventCanvas._elem.bind('mouseleave', { elem: co._tooltipElem }, function (ev) { ev.data.elem.hide(); });
|
659 |
+
|
660 |
+
var co = null;
|
661 |
+
};
|
662 |
+
|
663 |
+
|
664 |
+
function showTooltip(plot, obj, gridpos, datapos) {
|
665 |
+
var co = plot.plugins.canvasOverlay;
|
666 |
+
var elem = co._tooltipElem;
|
667 |
+
|
668 |
+
var opts = obj.options, x, y;
|
669 |
+
|
670 |
+
elem.html($.jqplot.sprintf(opts.tooltipFormatString, datapos[0], datapos[1]));
|
671 |
+
|
672 |
+
switch (opts.tooltipLocation) {
|
673 |
+
case 'nw':
|
674 |
+
x = gridpos[0] + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset;
|
675 |
+
y = gridpos[1] + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true);
|
676 |
+
break;
|
677 |
+
case 'n':
|
678 |
+
x = gridpos[0] + plot._gridPadding.left - elem.outerWidth(true)/2;
|
679 |
+
y = gridpos[1] + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true);
|
680 |
+
break;
|
681 |
+
case 'ne':
|
682 |
+
x = gridpos[0] + plot._gridPadding.left + opts.tooltipOffset;
|
683 |
+
y = gridpos[1] + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true);
|
684 |
+
break;
|
685 |
+
case 'e':
|
686 |
+
x = gridpos[0] + plot._gridPadding.left + opts.tooltipOffset;
|
687 |
+
y = gridpos[1] + plot._gridPadding.top - elem.outerHeight(true)/2;
|
688 |
+
break;
|
689 |
+
case 'se':
|
690 |
+
x = gridpos[0] + plot._gridPadding.left + opts.tooltipOffset;
|
691 |
+
y = gridpos[1] + plot._gridPadding.top + opts.tooltipOffset;
|
692 |
+
break;
|
693 |
+
case 's':
|
694 |
+
x = gridpos[0] + plot._gridPadding.left - elem.outerWidth(true)/2;
|
695 |
+
y = gridpos[1] + plot._gridPadding.top + opts.tooltipOffset;
|
696 |
+
break;
|
697 |
+
case 'sw':
|
698 |
+
x = gridpos[0] + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset;
|
699 |
+
y = gridpos[1] + plot._gridPadding.top + opts.tooltipOffset;
|
700 |
+
break;
|
701 |
+
case 'w':
|
702 |
+
x = gridpos[0] + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset;
|
703 |
+
y = gridpos[1] + plot._gridPadding.top - elem.outerHeight(true)/2;
|
704 |
+
break;
|
705 |
+
default: // same as 'nw'
|
706 |
+
x = gridpos[0] + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset;
|
707 |
+
y = gridpos[1] + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true);
|
708 |
+
break;
|
709 |
+
}
|
710 |
+
|
711 |
+
elem.css('left', x);
|
712 |
+
elem.css('top', y);
|
713 |
+
if (opts.fadeTooltip) {
|
714 |
+
// Fix for stacked up animations. Thnanks Trevor!
|
715 |
+
elem.stop(true,true).fadeIn(opts.tooltipFadeSpeed);
|
716 |
+
}
|
717 |
+
else {
|
718 |
+
elem.show();
|
719 |
+
}
|
720 |
+
elem = null;
|
721 |
+
}
|
722 |
+
|
723 |
+
|
724 |
+
function isNearLine(point, lstart, lstop, width) {
|
725 |
+
// r is point to test, p and q are end points.
|
726 |
+
var rx = point[0];
|
727 |
+
var ry = point[1];
|
728 |
+
var px = Math.round(lstop[0]);
|
729 |
+
var py = Math.round(lstop[1]);
|
730 |
+
var qx = Math.round(lstart[0]);
|
731 |
+
var qy = Math.round(lstart[1]);
|
732 |
+
|
733 |
+
var l = Math.sqrt(Math.pow(px-qx, 2) + Math.pow(py-qy, 2));
|
734 |
+
|
735 |
+
// scale error term by length of line.
|
736 |
+
var eps = width*l;
|
737 |
+
var res = Math.abs((qx-px) * (ry-py) - (qy-py) * (rx-px));
|
738 |
+
var ret = (res < eps) ? true : false;
|
739 |
+
return ret;
|
740 |
+
}
|
741 |
+
|
742 |
+
|
743 |
+
function handleMove(ev, gridpos, datapos, neighbor, plot) {
|
744 |
+
var co = plot.plugins.canvasOverlay;
|
745 |
+
var objs = co.objects;
|
746 |
+
var l = objs.length;
|
747 |
+
var obj, haveHighlight=false;
|
748 |
+
var elem;
|
749 |
+
for (var i=0; i<l; i++) {
|
750 |
+
obj = objs[i];
|
751 |
+
if (obj.options.showTooltip) {
|
752 |
+
var n = isNearLine([gridpos.x, gridpos.y], obj.gridStart, obj.gridStop, obj.tooltipWidthFactor);
|
753 |
+
datapos = [plot.axes[obj.options.xaxis].series_p2u(gridpos.x), plot.axes[obj.options.yaxis].series_p2u(gridpos.y)];
|
754 |
+
|
755 |
+
// cases:
|
756 |
+
// near line, no highlighting
|
757 |
+
// near line, highliting on this line
|
758 |
+
// near line, highlighting another line
|
759 |
+
// not near any line, highlighting
|
760 |
+
// not near any line, no highlighting
|
761 |
+
|
762 |
+
// near line, not currently highlighting
|
763 |
+
if (n && co.highlightObjectIndex == null) {
|
764 |
+
switch (obj.type) {
|
765 |
+
case 'line':
|
766 |
+
showTooltip(plot, obj, [gridpos.x, gridpos.y], datapos);
|
767 |
+
break;
|
768 |
+
|
769 |
+
case 'horizontalLine':
|
770 |
+
case 'dashedHorizontalLine':
|
771 |
+
showTooltip(plot, obj, [gridpos.x, obj.gridStart[1]], [datapos[0], obj.options.y]);
|
772 |
+
break;
|
773 |
+
|
774 |
+
case 'verticalLine':
|
775 |
+
case 'dashedVerticalLine':
|
776 |
+
showTooltip(plot, obj, [obj.gridStart[0], gridpos.y], [obj.options.x, datapos[1]]);
|
777 |
+
break;
|
778 |
+
default:
|
779 |
+
break;
|
780 |
+
}
|
781 |
+
co.highlightObjectIndex = i;
|
782 |
+
haveHighlight = true;
|
783 |
+
break;
|
784 |
+
}
|
785 |
+
|
786 |
+
// near line, highlighting another line.
|
787 |
+
else if (n && co.highlightObjectIndex !== i) {
|
788 |
+
// turn off tooltip.
|
789 |
+
elem = co._tooltipElem;
|
790 |
+
if (obj.fadeTooltip) {
|
791 |
+
elem.fadeOut(obj.tooltipFadeSpeed);
|
792 |
+
}
|
793 |
+
else {
|
794 |
+
elem.hide();
|
795 |
+
}
|
796 |
+
|
797 |
+
// turn on right tooltip.
|
798 |
+
switch (obj.type) {
|
799 |
+
case 'line':
|
800 |
+
showTooltip(plot, obj, [gridpos.x, gridpos.y], datapos);
|
801 |
+
break;
|
802 |
+
|
803 |
+
case 'horizontalLine':
|
804 |
+
case 'dashedHorizontalLine':
|
805 |
+
showTooltip(plot, obj, [gridpos.x, obj.gridStart[1]], [datapos[0], obj.options.y]);
|
806 |
+
break;
|
807 |
+
|
808 |
+
case 'verticalLine':
|
809 |
+
case 'dashedVerticalLine':
|
810 |
+
showTooltip(plot, obj, [obj.gridStart[0], gridpos.y], [obj.options.x, datapos[1]]);
|
811 |
+
break;
|
812 |
+
default:
|
813 |
+
break;
|
814 |
+
}
|
815 |
+
|
816 |
+
co.highlightObjectIndex = i;
|
817 |
+
haveHighlight = true;
|
818 |
+
break;
|
819 |
+
}
|
820 |
+
|
821 |
+
// near line, already highlighting this line, update
|
822 |
+
else if (n) {
|
823 |
+
switch (obj.type) {
|
824 |
+
case 'line':
|
825 |
+
showTooltip(plot, obj, [gridpos.x, gridpos.y], datapos);
|
826 |
+
break;
|
827 |
+
|
828 |
+
case 'horizontalLine':
|
829 |
+
case 'dashedHorizontalLine':
|
830 |
+
showTooltip(plot, obj, [gridpos.x, obj.gridStart[1]], [datapos[0], obj.options.y]);
|
831 |
+
break;
|
832 |
+
|
833 |
+
case 'verticalLine':
|
834 |
+
case 'dashedVerticalLine':
|
835 |
+
showTooltip(plot, obj, [obj.gridStart[0], gridpos.y], [obj.options.x, datapos[1]]);
|
836 |
+
break;
|
837 |
+
default:
|
838 |
+
break;
|
839 |
+
}
|
840 |
+
|
841 |
+
haveHighlight = true;
|
842 |
+
break;
|
843 |
+
}
|
844 |
+
}
|
845 |
+
}
|
846 |
+
|
847 |
+
// check if we are highlighting and not near a line, turn it off.
|
848 |
+
if (!haveHighlight && co.highlightObjectIndex !== null) {
|
849 |
+
elem = co._tooltipElem;
|
850 |
+
obj = co.getObject(co.highlightObjectIndex);
|
851 |
+
if (obj.fadeTooltip) {
|
852 |
+
elem.fadeOut(obj.tooltipFadeSpeed);
|
853 |
+
}
|
854 |
+
else {
|
855 |
+
elem.hide();
|
856 |
+
}
|
857 |
+
co.highlightObjectIndex = null;
|
858 |
+
}
|
859 |
+
}
|
860 |
+
|
861 |
+
$.jqplot.postInitHooks.push($.jqplot.CanvasOverlay.postPlotInit);
|
862 |
+
$.jqplot.postDrawHooks.push($.jqplot.CanvasOverlay.postPlotDraw);
|
863 |
+
$.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMove]);
|
864 |
+
|
865 |
+
})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.canvasOverlay.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(d){var f=0;d.jqplot.CanvasOverlay=function(o){var l=o||{};this.options={show:d.jqplot.config.enablePlugins,deferDraw:false};this.objects=[];this.objectNames=[];this.canvas=null;this.markerRenderer=new d.jqplot.MarkerRenderer({style:"line"});this.markerRenderer.init();this.highlightObjectIndex=null;if(l.objects){var q=l.objects,p;for(var m=0;m<q.length;m++){p=q[m];for(var r in p){switch(r){case"line":this.addLine(p[r]);break;case"horizontalLine":this.addHorizontalLine(p[r]);break;case"dashedHorizontalLine":this.addDashedHorizontalLine(p[r]);break;case"verticalLine":this.addVerticalLine(p[r]);break;case"dashedVerticalLine":this.addDashedVerticalLine(p[r]);break;default:break}}}}d.extend(true,this.options,l)};d.jqplot.CanvasOverlay.postPlotInit=function(o,n,m){var l=m||{};this.plugins.canvasOverlay=new d.jqplot.CanvasOverlay(l.canvasOverlay)};function h(){this.uid=null;this.type=null;this.gridStart=null;this.gridStop=null;this.tooltipWidthFactor=0;this.options={name:null,show:true,lineWidth:2,lineCap:"round",color:"#666666",shadow:true,shadowAngle:45,shadowOffset:1,shadowDepth:3,shadowAlpha:"0.07",xaxis:"xaxis",yaxis:"yaxis",showTooltip:false,showTooltipPrecision:0.6,tooltipLocation:"nw",fadeTooltip:true,tooltipFadeSpeed:"fast",tooltipOffset:4,tooltipFormatString:"%d, %d"}}function b(l){h.call(this);this.type="line";var m={start:[],stop:[]};d.extend(true,this.options,m,l);if(this.options.showTooltipPrecision<0.01){this.options.showTooltipPrecision=0.01}}b.prototype=new h();b.prototype.constructor=b;function e(l){h.call(this);this.type="horizontalLine";var m={y:null,xmin:null,xmax:null,xOffset:"6px",xminOffset:null,xmaxOffset:null};d.extend(true,this.options,m,l);if(this.options.showTooltipPrecision<0.01){this.options.showTooltipPrecision=0.01}}e.prototype=new h();e.prototype.constructor=e;function i(l){h.call(this);this.type="dashedHorizontalLine";var m={y:null,xmin:null,xmax:null,xOffset:"6px",xminOffset:null,xmaxOffset:null,dashPattern:[8,8]};d.extend(true,this.options,m,l);if(this.options.showTooltipPrecision<0.01){this.options.showTooltipPrecision=0.01}}i.prototype=new h();i.prototype.constructor=i;function c(l){h.call(this);this.type="verticalLine";var m={x:null,ymin:null,ymax:null,yOffset:"6px",yminOffset:null,ymaxOffset:null};d.extend(true,this.options,m,l);if(this.options.showTooltipPrecision<0.01){this.options.showTooltipPrecision=0.01}}c.prototype=new h();c.prototype.constructor=c;function k(l){h.call(this);this.type="dashedVerticalLine";this.start=null;this.stop=null;var m={x:null,ymin:null,ymax:null,yOffset:"6px",yminOffset:null,ymaxOffset:null,dashPattern:[8,8]};d.extend(true,this.options,m,l);if(this.options.showTooltipPrecision<0.01){this.options.showTooltipPrecision=0.01}}k.prototype=new h();k.prototype.constructor=k;d.jqplot.CanvasOverlay.prototype.addLine=function(m){var l=new b(m);l.uid=f++;this.objects.push(l);this.objectNames.push(l.options.name)};d.jqplot.CanvasOverlay.prototype.addHorizontalLine=function(m){var l=new e(m);l.uid=f++;this.objects.push(l);this.objectNames.push(l.options.name)};d.jqplot.CanvasOverlay.prototype.addDashedHorizontalLine=function(m){var l=new i(m);l.uid=f++;this.objects.push(l);this.objectNames.push(l.options.name)};d.jqplot.CanvasOverlay.prototype.addVerticalLine=function(m){var l=new c(m);l.uid=f++;this.objects.push(l);this.objectNames.push(l.options.name)};d.jqplot.CanvasOverlay.prototype.addDashedVerticalLine=function(m){var l=new k(m);l.uid=f++;this.objects.push(l);this.objectNames.push(l.options.name)};d.jqplot.CanvasOverlay.prototype.removeObject=function(l){if(d.type(l)=="number"){this.objects.splice(l,1);this.objectNames.splice(l,1)}else{var m=d.inArray(l,this.objectNames);if(m!=-1){this.objects.splice(m,1);this.objectNames.splice(m,1)}}};d.jqplot.CanvasOverlay.prototype.getObject=function(l){if(d.type(l)=="number"){return this.objects[l]}else{var m=d.inArray(l,this.objectNames);if(m!=-1){return this.objects[m]}}};d.jqplot.CanvasOverlay.prototype.get=d.jqplot.CanvasOverlay.prototype.getObject;d.jqplot.CanvasOverlay.prototype.clear=function(l){this.canvas._ctx.clearRect(0,0,this.canvas.getWidth(),this.canvas.getHeight())};d.jqplot.CanvasOverlay.prototype.draw=function(I){var w,t=this.objects,D=this.markerRenderer,q,E;if(this.options.show){this.canvas._ctx.clearRect(0,0,this.canvas.getWidth(),this.canvas.getHeight());for(var F=0;F<t.length;F++){w=t[F];var z=d.extend(true,{},w.options);if(w.options.show){D.shadow=w.options.shadow;w.tooltipWidthFactor=w.options.lineWidth/w.options.showTooltipPrecision;switch(w.type){case"line":D.style="line";z.closePath=false;q=[I.axes[w.options.xaxis].series_u2p(w.options.start[0]),I.axes[w.options.yaxis].series_u2p(w.options.start[1])];E=[I.axes[w.options.xaxis].series_u2p(w.options.stop[0]),I.axes[w.options.yaxis].series_u2p(w.options.stop[1])];w.gridStart=q;w.gridStop=E;D.draw(q,E,this.canvas._ctx,z);break;case"horizontalLine":if(w.options.y!=null){D.style="line";z.closePath=false;var n=I.axes[w.options.xaxis],Q,J,u=I.axes[w.options.yaxis].series_u2p(w.options.y),G=w.options.xminOffset||w.options.xOffset,r=w.options.xmaxOffset||w.options.xOffset;if(w.options.xmin!=null){Q=n.series_u2p(w.options.xmin)}else{if(G!=null){if(d.type(G)=="number"){Q=n.series_u2p(n.min+G)}else{if(d.type(G)=="string"){Q=n.series_u2p(n.min)+parseFloat(G)}}}}if(w.options.xmax!=null){J=n.series_u2p(w.options.xmax)}else{if(r!=null){if(d.type(r)=="number"){J=n.series_u2p(n.max-r)}else{if(d.type(r)=="string"){J=n.series_u2p(n.max)-parseFloat(r)}}}}if(J!=null&&Q!=null){w.gridStart=[Q,u];w.gridStop=[J,u];D.draw([Q,u],[J,u],this.canvas._ctx,z)}}break;case"dashedHorizontalLine":var m=w.options.dashPattern;var C=0;for(var K=0;K<m.length;K++){C+=m[K]}if(w.options.y!=null){D.style="line";z.closePath=false;var n=I.axes[w.options.xaxis],Q,J,u=I.axes[w.options.yaxis].series_u2p(w.options.y),G=w.options.xminOffset||w.options.xOffset,r=w.options.xmaxOffset||w.options.xOffset;if(w.options.xmin!=null){Q=n.series_u2p(w.options.xmin)}else{if(G!=null){if(d.type(G)=="number"){Q=n.series_u2p(n.min+G)}else{if(d.type(G)=="string"){Q=n.series_u2p(n.min)+parseFloat(G)}}}}if(w.options.xmax!=null){J=n.series_u2p(w.options.xmax)}else{if(r!=null){if(d.type(r)=="number"){J=n.series_u2p(n.max-r)}else{if(d.type(r)=="string"){J=n.series_u2p(n.max)-parseFloat(r)}}}}if(J!=null&&Q!=null){w.gridStart=[Q,u];w.gridStop=[J,u];var p=Math.ceil((J-Q)/C);var O=Q,M;for(var K=0;K<p;K++){for(var H=0;H<m.length;H+=2){M=O+m[H];D.draw([O,u],[M,u],this.canvas._ctx,z);O+=m[H];if(H<m.length-1){O+=m[H+1]}}}}}break;case"verticalLine":if(w.options.x!=null){D.style="line";z.closePath=false;var L=I.axes[w.options.yaxis],l,s,v=I.axes[w.options.xaxis].series_u2p(w.options.x),B=w.options.yminOffset||w.options.yOffset,o=w.options.ymaxOffset||w.options.yOffset;if(w.options.ymin!=null){l=L.series_u2p(w.options.ymin)}else{if(B!=null){if(d.type(B)=="number"){l=L.series_u2p(L.min-B)}else{if(d.type(B)=="string"){l=L.series_u2p(L.min)-parseFloat(B)}}}}if(w.options.ymax!=null){s=L.series_u2p(w.options.ymax)}else{if(o!=null){if(d.type(o)=="number"){s=L.series_u2p(L.max+o)}else{if(d.type(o)=="string"){s=L.series_u2p(L.max)+parseFloat(o)}}}}if(s!=null&&l!=null){w.gridStart=[v,l];w.gridStop=[v,s];D.draw([v,l],[v,s],this.canvas._ctx,z)}}break;case"dashedVerticalLine":var m=w.options.dashPattern;var C=0;for(var K=0;K<m.length;K++){C+=m[K]}if(w.options.x!=null){D.style="line";z.closePath=false;var L=I.axes[w.options.yaxis],l,s,v=I.axes[w.options.xaxis].series_u2p(w.options.x),B=w.options.yminOffset||w.options.yOffset,o=w.options.ymaxOffset||w.options.yOffset;if(w.options.ymin!=null){l=L.series_u2p(w.options.ymin)}else{if(B!=null){if(d.type(B)=="number"){l=L.series_u2p(L.min-B)}else{if(d.type(B)=="string"){l=L.series_u2p(L.min)-parseFloat(B)}}}}if(w.options.ymax!=null){s=L.series_u2p(w.options.ymax)}else{if(o!=null){if(d.type(o)=="number"){s=L.series_u2p(L.max+o)}else{if(d.type(o)=="string"){s=L.series_u2p(L.max)+parseFloat(o)}}}}if(s!=null&&l!=null){w.gridStart=[v,l];w.gridStop=[v,s];var p=Math.ceil((l-s)/C);var A=((p*C)-(l-s))/2;var O=l,M,N,P;for(var K=0;K<p;K++){for(var H=0;H<m.length;H+=2){M=O-m[H];if(M<s){M=s}if(O<s){O=s}D.draw([v,O],[v,M],this.canvas._ctx,z);O-=m[H];if(H<m.length-1){O-=m[H+1]}}}}}break;default:break}}}}};d.jqplot.CanvasOverlay.postPlotDraw=function(){var m=this.plugins.canvasOverlay;if(m&&m.highlightCanvas){m.highlightCanvas.resetCanvas();m.highlightCanvas=null}m.canvas=new d.jqplot.GenericCanvas();this.eventCanvas._elem.before(m.canvas.createElement(this._gridPadding,"jqplot-overlayCanvas-canvas",this._plotDimensions,this));m.canvas.setContext();if(!m.deferDraw){m.draw(this)}var l=document.createElement("div");m._tooltipElem=d(l);l=null;m._tooltipElem.addClass("jqplot-canvasOverlay-tooltip");m._tooltipElem.css({position:"absolute",display:"none"});this.eventCanvas._elem.before(m._tooltipElem);this.eventCanvas._elem.bind("mouseleave",{elem:m._tooltipElem},function(n){n.data.elem.hide()});var m=null};function j(q,o,p,n){var s=q.plugins.canvasOverlay;var m=s._tooltipElem;var l=o.options,t,r;m.html(d.jqplot.sprintf(l.tooltipFormatString,n[0],n[1]));switch(l.tooltipLocation){case"nw":t=p[0]+q._gridPadding.left-m.outerWidth(true)-l.tooltipOffset;r=p[1]+q._gridPadding.top-l.tooltipOffset-m.outerHeight(true);break;case"n":t=p[0]+q._gridPadding.left-m.outerWidth(true)/2;r=p[1]+q._gridPadding.top-l.tooltipOffset-m.outerHeight(true);break;case"ne":t=p[0]+q._gridPadding.left+l.tooltipOffset;r=p[1]+q._gridPadding.top-l.tooltipOffset-m.outerHeight(true);break;case"e":t=p[0]+q._gridPadding.left+l.tooltipOffset;r=p[1]+q._gridPadding.top-m.outerHeight(true)/2;break;case"se":t=p[0]+q._gridPadding.left+l.tooltipOffset;r=p[1]+q._gridPadding.top+l.tooltipOffset;break;case"s":t=p[0]+q._gridPadding.left-m.outerWidth(true)/2;r=p[1]+q._gridPadding.top+l.tooltipOffset;break;case"sw":t=p[0]+q._gridPadding.left-m.outerWidth(true)-l.tooltipOffset;r=p[1]+q._gridPadding.top+l.tooltipOffset;break;case"w":t=p[0]+q._gridPadding.left-m.outerWidth(true)-l.tooltipOffset;r=p[1]+q._gridPadding.top-m.outerHeight(true)/2;break;default:t=p[0]+q._gridPadding.left-m.outerWidth(true)-l.tooltipOffset;r=p[1]+q._gridPadding.top-l.tooltipOffset-m.outerHeight(true);break}m.css("left",t);m.css("top",r);if(l.fadeTooltip){m.stop(true,true).fadeIn(l.tooltipFadeSpeed)}else{m.show()}m=null}function g(y,p,r,o){var n=y[0];var m=y[1];var x=Math.round(r[0]);var w=Math.round(r[1]);var t=Math.round(p[0]);var s=Math.round(p[1]);var q=Math.sqrt(Math.pow(x-t,2)+Math.pow(w-s,2));var z=o*q;var v=Math.abs((t-x)*(m-w)-(s-w)*(n-x));var u=(v<z)?true:false;return u}function a(y,v,q,z,w){var x=w.plugins.canvasOverlay;var u=x.objects;var r=u.length;var t,m=false;var p;for(var s=0;s<r;s++){t=u[s];if(t.options.showTooltip){var o=g([v.x,v.y],t.gridStart,t.gridStop,t.tooltipWidthFactor);q=[w.axes[t.options.xaxis].series_p2u(v.x),w.axes[t.options.yaxis].series_p2u(v.y)];if(o&&x.highlightObjectIndex==null){switch(t.type){case"line":j(w,t,[v.x,v.y],q);break;case"horizontalLine":case"dashedHorizontalLine":j(w,t,[v.x,t.gridStart[1]],[q[0],t.options.y]);break;case"verticalLine":case"dashedVerticalLine":j(w,t,[t.gridStart[0],v.y],[t.options.x,q[1]]);break;default:break}x.highlightObjectIndex=s;m=true;break}else{if(o&&x.highlightObjectIndex!==s){p=x._tooltipElem;if(t.fadeTooltip){p.fadeOut(t.tooltipFadeSpeed)}else{p.hide()}switch(t.type){case"line":j(w,t,[v.x,v.y],q);break;case"horizontalLine":case"dashedHorizontalLine":j(w,t,[v.x,t.gridStart[1]],[q[0],t.options.y]);break;case"verticalLine":case"dashedVerticalLine":j(w,t,[t.gridStart[0],v.y],[t.options.x,q[1]]);break;default:break}x.highlightObjectIndex=s;m=true;break}else{if(o){switch(t.type){case"line":j(w,t,[v.x,v.y],q);break;case"horizontalLine":case"dashedHorizontalLine":j(w,t,[v.x,t.gridStart[1]],[q[0],t.options.y]);break;case"verticalLine":case"dashedVerticalLine":j(w,t,[t.gridStart[0],v.y],[t.options.x,q[1]]);break;default:break}m=true;break}}}}}if(!m&&x.highlightObjectIndex!==null){p=x._tooltipElem;t=x.getObject(x.highlightObjectIndex);if(t.fadeTooltip){p.fadeOut(t.tooltipFadeSpeed)}else{p.hide()}x.highlightObjectIndex=null}}d.jqplot.postInitHooks.push(d.jqplot.CanvasOverlay.postPlotInit);d.jqplot.postDrawHooks.push(d.jqplot.CanvasOverlay.postPlotDraw);d.jqplot.eventListenerHooks.push(["jqplotMouseMove",a])})(jQuery);
|
backend/settings/assets/js/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.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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-2012 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 origianl 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);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.canvasTextRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(a){a.jqplot.CanvasTextRenderer=function(b){this.fontStyle="normal";this.fontVariant="normal";this.fontWeight="normal";this.fontSize="10px";this.fontFamily="sans-serif";this.fontStretch=1;this.fillStyle="#666666";this.angle=0;this.textAlign="start";this.textBaseline="alphabetic";this.text;this.width;this.height;this.pt2px=1.28;a.extend(true,this,b);this.normalizedFontSize=this.normalizeFontSize(this.fontSize);this.setHeight()};a.jqplot.CanvasTextRenderer.prototype.init=function(b){a.extend(true,this,b);this.normalizedFontSize=this.normalizeFontSize(this.fontSize);this.setHeight()};a.jqplot.CanvasTextRenderer.prototype.normalizeFontSize=function(b){b=String(b);var c=parseFloat(b);if(b.indexOf("px")>-1){return c/this.pt2px}else{if(b.indexOf("pt")>-1){return c}else{if(b.indexOf("em")>-1){return c*12}else{if(b.indexOf("%")>-1){return c*12/100}else{return c/this.pt2px}}}}};a.jqplot.CanvasTextRenderer.prototype.fontWeight2Float=function(b){if(Number(b)){return b/400}else{switch(b){case"normal":return 1;break;case"bold":return 1.75;break;case"bolder":return 2.25;break;case"lighter":return 0.75;break;default:return 1;break}}};a.jqplot.CanvasTextRenderer.prototype.getText=function(){return this.text};a.jqplot.CanvasTextRenderer.prototype.setText=function(c,b){this.text=c;this.setWidth(b);return this};a.jqplot.CanvasTextRenderer.prototype.getWidth=function(b){return this.width};a.jqplot.CanvasTextRenderer.prototype.setWidth=function(c,b){if(!b){this.width=this.measure(c,this.text)}else{this.width=b}return this};a.jqplot.CanvasTextRenderer.prototype.getHeight=function(b){return this.height};a.jqplot.CanvasTextRenderer.prototype.setHeight=function(b){if(!b){this.height=this.normalizedFontSize*this.pt2px}else{this.height=b}return this};a.jqplot.CanvasTextRenderer.prototype.letter=function(b){return this.letters[b]};a.jqplot.CanvasTextRenderer.prototype.ascent=function(){return this.normalizedFontSize};a.jqplot.CanvasTextRenderer.prototype.descent=function(){return 7*this.normalizedFontSize/25};a.jqplot.CanvasTextRenderer.prototype.measure=function(d,g){var f=0;var b=g.length;for(var e=0;e<b;e++){var h=this.letter(g.charAt(e));if(h){f+=h.width*this.normalizedFontSize/25*this.fontStretch}}return f};a.jqplot.CanvasTextRenderer.prototype.draw=function(s,n){var r=0;var o=this.height*0.72;var p=0;var l=n.length;var k=this.normalizedFontSize/25;s.save();var h,f;if((-Math.PI/2<=this.angle&&this.angle<=0)||(Math.PI*3/2<=this.angle&&this.angle<=Math.PI*2)){h=0;f=-Math.sin(this.angle)*this.width}else{if((0<this.angle&&this.angle<=Math.PI/2)||(-Math.PI*2<=this.angle&&this.angle<=-Math.PI*3/2)){h=Math.sin(this.angle)*this.height;f=0}else{if((-Math.PI<this.angle&&this.angle<-Math.PI/2)||(Math.PI<=this.angle&&this.angle<=Math.PI*3/2)){h=-Math.cos(this.angle)*this.width;f=-Math.sin(this.angle)*this.width-Math.cos(this.angle)*this.height}else{if((-Math.PI*3/2<this.angle&&this.angle<Math.PI)||(Math.PI/2<this.angle&&this.angle<Math.PI)){h=Math.sin(this.angle)*this.height-Math.cos(this.angle)*this.width;f=-Math.cos(this.angle)*this.height}}}}s.strokeStyle=this.fillStyle;s.fillStyle=this.fillStyle;s.translate(h,f);s.rotate(this.angle);s.lineCap="round";var t=(this.normalizedFontSize>30)?2:2+(30-this.normalizedFontSize)/20;s.lineWidth=t*k*this.fontWeight2Float(this.fontWeight);for(var g=0;g<l;g++){var m=this.letter(n.charAt(g));if(!m){continue}s.beginPath();var e=1;var b=0;for(var d=0;d<m.points.length;d++){var q=m.points[d];if(q[0]==-1&&q[1]==-1){e=1;continue}if(e){s.moveTo(r+q[0]*k*this.fontStretch,o-q[1]*k);e=false}else{s.lineTo(r+q[0]*k*this.fontStretch,o-q[1]*k)}}s.stroke();r+=m.width*k*this.fontStretch}s.restore();return p};a.jqplot.CanvasTextRenderer.prototype.letters={" ":{width:16,points:[]},"!":{width:10,points:[[5,21],[5,7],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},'"':{width:16,points:[[4,21],[4,14],[-1,-1],[12,21],[12,14]]},"#":{width:21,points:[[11,25],[4,-7],[-1,-1],[17,25],[10,-7],[-1,-1],[4,12],[18,12],[-1,-1],[3,6],[17,6]]},"$":{width:20,points:[[8,25],[8,-4],[-1,-1],[12,25],[12,-4],[-1,-1],[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},"%":{width:24,points:[[21,21],[3,0],[-1,-1],[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],[10,20],[13,19],[16,19],[19,20],[21,21],[-1,-1],[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]]},"&":{width:26,points:[[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,0],[23,1],[23,2]]},"'":{width:10,points:[[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]]},"(":{width:14,points:[[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]]},")":{width:14,points:[[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]]},"*":{width:16,points:[[8,21],[8,9],[-1,-1],[3,18],[13,12],[-1,-1],[13,18],[3,12]]},"+":{width:26,points:[[13,18],[13,0],[-1,-1],[4,9],[22,9]]},",":{width:10,points:[[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"-":{width:18,points:[[6,9],[12,9]]},".":{width:10,points:[[5,2],[4,1],[5,0],[6,1],[5,2]]},"/":{width:22,points:[[20,25],[2,-7]]},"0":{width:20,points:[[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]]},"1":{width:20,points:[[6,17],[8,18],[11,21],[11,0]]},"2":{width:20,points:[[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]]},"3":{width:20,points:[[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},"4":{width:20,points:[[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]]},"5":{width:20,points:[[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]]},"6":{width:20,points:[[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]]},"7":{width:20,points:[[17,21],[7,0],[-1,-1],[3,21],[17,21]]},"8":{width:20,points:[[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]]},"9":{width:20,points:[[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]]},":":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]]},";":{width:10,points:[[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]]},"<":{width:24,points:[[20,18],[4,9],[20,0]]},"=":{width:26,points:[[4,12],[22,12],[-1,-1],[4,6],[22,6]]},">":{width:24,points:[[4,18],[20,9],[4,0]]},"?":{width:18,points:[[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]]},"@":{width:27,points:[[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]]},A:{width:18,points:[[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]]},B:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]]},C:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]]},D:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]]},E:{width:19,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11],[-1,-1],[4,0],[17,0]]},F:{width:18,points:[[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]]},G:{width:21,points:[[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]]},H:{width:22,points:[[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]]},I:{width:8,points:[[4,21],[4,0]]},J:{width:16,points:[[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]]},K:{width:21,points:[[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]]},L:{width:17,points:[[4,21],[4,0],[-1,-1],[4,0],[16,0]]},M:{width:24,points:[[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]]},N:{width:22,points:[[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]]},O:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]]},P:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]]},Q:{width:22,points:[[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]]},R:{width:21,points:[[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]]},S:{width:20,points:[[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]]},T:{width:16,points:[[8,21],[8,0],[-1,-1],[1,21],[15,21]]},U:{width:22,points:[[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]]},V:{width:18,points:[[1,21],[9,0],[-1,-1],[17,21],[9,0]]},W:{width:24,points:[[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]]},X:{width:20,points:[[3,21],[17,0],[-1,-1],[17,21],[3,0]]},Y:{width:18,points:[[1,21],[9,11],[9,0],[-1,-1],[17,21],[9,11]]},Z:{width:20,points:[[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]]},"[":{width:14,points:[[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]]},"\\":{width:14,points:[[0,21],[14,-3]]},"]":{width:14,points:[[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]]},"^":{width:16,points:[[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]]},_:{width:16,points:[[0,-2],[16,-2]]},"`":{width:10,points:[[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]]},a:{width:19,points:[[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},b:{width:19,points:[[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},c:{width:18,points:[[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},d:{width:19,points:[[15,21],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},e:{width:18,points:[[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},f:{width:12,points:[[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]]},g:{width:19,points:[[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},h:{width:19,points:[[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},i:{width:8,points:[[3,21],[4,20],[5,21],[4,22],[3,21],[-1,-1],[4,14],[4,0]]},j:{width:10,points:[[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]]},k:{width:17,points:[[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]]},l:{width:8,points:[[4,21],[4,0]]},m:{width:30,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]]},n:{width:19,points:[[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]]},o:{width:19,points:[[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]]},p:{width:19,points:[[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]]},q:{width:19,points:[[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]]},r:{width:13,points:[[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]]},s:{width:17,points:[[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]]},t:{width:12,points:[[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]]},u:{width:19,points:[[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]]},v:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0]]},w:{width:22,points:[[3,14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]]},x:{width:17,points:[[3,14],[14,0],[-1,-1],[14,14],[3,0]]},y:{width:16,points:[[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]]},z:{width:17,points:[[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]]},"{":{width:14,points:[[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]]},"|":{width:8,points:[[4,25],[4,-7]]},"}":{width:14,points:[[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]]},"~":{width:24,points:[[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]]}};a.jqplot.CanvasFontRenderer=function(b){b=b||{};if(!b.pt2px){b.pt2px=1.5}a.jqplot.CanvasTextRenderer.call(this,b)};a.jqplot.CanvasFontRenderer.prototype=new a.jqplot.CanvasTextRenderer({});a.jqplot.CanvasFontRenderer.prototype.constructor=a.jqplot.CanvasFontRenderer;a.jqplot.CanvasFontRenderer.prototype.measure=function(c,e){var d=this.fontSize+" "+this.fontFamily;c.save();c.font=d;var b=c.measureText(e).width;c.restore();return b};a.jqplot.CanvasFontRenderer.prototype.draw=function(e,g){var c=0;var h=this.height*0.72;e.save();var d,b;if((-Math.PI/2<=this.angle&&this.angle<=0)||(Math.PI*3/2<=this.angle&&this.angle<=Math.PI*2)){d=0;b=-Math.sin(this.angle)*this.width}else{if((0<this.angle&&this.angle<=Math.PI/2)||(-Math.PI*2<=this.angle&&this.angle<=-Math.PI*3/2)){d=Math.sin(this.angle)*this.height;b=0}else{if((-Math.PI<this.angle&&this.angle<-Math.PI/2)||(Math.PI<=this.angle&&this.angle<=Math.PI*3/2)){d=-Math.cos(this.angle)*this.width;b=-Math.sin(this.angle)*this.width-Math.cos(this.angle)*this.height}else{if((-Math.PI*3/2<this.angle&&this.angle<Math.PI)||(Math.PI/2<this.angle&&this.angle<Math.PI)){d=Math.sin(this.angle)*this.height-Math.cos(this.angle)*this.width;b=-Math.cos(this.angle)*this.height}}}}e.strokeStyle=this.fillStyle;e.fillStyle=this.fillStyle;var f=this.fontSize+" "+this.fontFamily;e.font=f;e.translate(d,b);e.rotate(this.angle);e.fillText(g,c,h);e.restore()}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.categoryAxisRenderer.js
ADDED
@@ -0,0 +1,673 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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.CategoryAxisRenderer
|
34 |
+
* A plugin for jqPlot to render a category style axis, with equal pixel spacing between y data values of a series.
|
35 |
+
*
|
36 |
+
* To use this renderer, include the plugin in your source
|
37 |
+
* > <script type="text/javascript" language="javascript" src="plugins/jqplot.categoryAxisRenderer.js"></script>
|
38 |
+
*
|
39 |
+
* and supply the appropriate options to your plot
|
40 |
+
*
|
41 |
+
* > {axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer}}}
|
42 |
+
**/
|
43 |
+
$.jqplot.CategoryAxisRenderer = function(options) {
|
44 |
+
$.jqplot.LinearAxisRenderer.call(this);
|
45 |
+
// prop: sortMergedLabels
|
46 |
+
// True to sort tick labels when labels are created by merging
|
47 |
+
// x axis values from multiple series. That is, say you have
|
48 |
+
// two series like:
|
49 |
+
// > line1 = [[2006, 4], [2008, 9], [2009, 16]];
|
50 |
+
// > line2 = [[2006, 3], [2007, 7], [2008, 6]];
|
51 |
+
// If no label array is specified, tick labels will be collected
|
52 |
+
// from the x values of the series. With sortMergedLabels
|
53 |
+
// set to true, tick labels will be:
|
54 |
+
// > [2006, 2007, 2008, 2009]
|
55 |
+
// With sortMergedLabels set to false, tick labels will be:
|
56 |
+
// > [2006, 2008, 2009, 2007]
|
57 |
+
//
|
58 |
+
// Note, this property is specified on the renderOptions for the
|
59 |
+
// axes when creating a plot:
|
60 |
+
// > axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer, rendererOptions:{sortMergedLabels:true}}}
|
61 |
+
this.sortMergedLabels = false;
|
62 |
+
};
|
63 |
+
|
64 |
+
$.jqplot.CategoryAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
|
65 |
+
$.jqplot.CategoryAxisRenderer.prototype.constructor = $.jqplot.CategoryAxisRenderer;
|
66 |
+
|
67 |
+
$.jqplot.CategoryAxisRenderer.prototype.init = function(options){
|
68 |
+
this.groups = 1;
|
69 |
+
this.groupLabels = [];
|
70 |
+
this._groupLabels = [];
|
71 |
+
this._grouped = false;
|
72 |
+
this._barsPerGroup = null;
|
73 |
+
this.reverse = false;
|
74 |
+
// prop: tickRenderer
|
75 |
+
// A class of a rendering engine for creating the ticks labels displayed on the plot,
|
76 |
+
// See <$.jqplot.AxisTickRenderer>.
|
77 |
+
// this.tickRenderer = $.jqplot.AxisTickRenderer;
|
78 |
+
// this.labelRenderer = $.jqplot.AxisLabelRenderer;
|
79 |
+
$.extend(true, this, {tickOptions:{formatString:'%d'}}, options);
|
80 |
+
var db = this._dataBounds;
|
81 |
+
// Go through all the series attached to this axis and find
|
82 |
+
// the min/max bounds for this axis.
|
83 |
+
for (var i=0; i<this._series.length; i++) {
|
84 |
+
var s = this._series[i];
|
85 |
+
if (s.groups) {
|
86 |
+
this.groups = s.groups;
|
87 |
+
}
|
88 |
+
var d = s.data;
|
89 |
+
|
90 |
+
for (var j=0; j<d.length; j++) {
|
91 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
92 |
+
if (d[j][0] < db.min || db.min == null) {
|
93 |
+
db.min = d[j][0];
|
94 |
+
}
|
95 |
+
if (d[j][0] > db.max || db.max == null) {
|
96 |
+
db.max = d[j][0];
|
97 |
+
}
|
98 |
+
}
|
99 |
+
else {
|
100 |
+
if (d[j][1] < db.min || db.min == null) {
|
101 |
+
db.min = d[j][1];
|
102 |
+
}
|
103 |
+
if (d[j][1] > db.max || db.max == null) {
|
104 |
+
db.max = d[j][1];
|
105 |
+
}
|
106 |
+
}
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
if (this.groupLabels.length) {
|
111 |
+
this.groups = this.groupLabels.length;
|
112 |
+
}
|
113 |
+
};
|
114 |
+
|
115 |
+
|
116 |
+
$.jqplot.CategoryAxisRenderer.prototype.createTicks = function() {
|
117 |
+
// we're are operating on an axis here
|
118 |
+
var ticks = this._ticks;
|
119 |
+
var userTicks = this.ticks;
|
120 |
+
var name = this.name;
|
121 |
+
// databounds were set on axis initialization.
|
122 |
+
var db = this._dataBounds;
|
123 |
+
var dim, interval;
|
124 |
+
var min, max;
|
125 |
+
var pos1, pos2;
|
126 |
+
var tt, i;
|
127 |
+
|
128 |
+
// if we already have ticks, use them.
|
129 |
+
if (userTicks.length) {
|
130 |
+
// adjust with blanks if we have groups
|
131 |
+
if (this.groups > 1 && !this._grouped) {
|
132 |
+
var l = userTicks.length;
|
133 |
+
var skip = parseInt(l/this.groups, 10);
|
134 |
+
var count = 0;
|
135 |
+
for (var i=skip; i<l; i+=skip) {
|
136 |
+
userTicks.splice(i+count, 0, ' ');
|
137 |
+
count++;
|
138 |
+
}
|
139 |
+
this._grouped = true;
|
140 |
+
}
|
141 |
+
this.min = 0.5;
|
142 |
+
this.max = userTicks.length + 0.5;
|
143 |
+
var range = this.max - this.min;
|
144 |
+
this.numberTicks = 2*userTicks.length + 1;
|
145 |
+
for (i=0; i<userTicks.length; i++){
|
146 |
+
tt = this.min + 2 * i * range / (this.numberTicks-1);
|
147 |
+
// need a marker before and after the tick
|
148 |
+
var t = new this.tickRenderer(this.tickOptions);
|
149 |
+
t.showLabel = false;
|
150 |
+
// t.showMark = true;
|
151 |
+
t.setTick(tt, this.name);
|
152 |
+
this._ticks.push(t);
|
153 |
+
var t = new this.tickRenderer(this.tickOptions);
|
154 |
+
t.label = userTicks[i];
|
155 |
+
// t.showLabel = true;
|
156 |
+
t.showMark = false;
|
157 |
+
t.showGridline = false;
|
158 |
+
t.setTick(tt+0.5, this.name);
|
159 |
+
this._ticks.push(t);
|
160 |
+
}
|
161 |
+
// now add the last tick at the end
|
162 |
+
var t = new this.tickRenderer(this.tickOptions);
|
163 |
+
t.showLabel = false;
|
164 |
+
// t.showMark = true;
|
165 |
+
t.setTick(tt+1, this.name);
|
166 |
+
this._ticks.push(t);
|
167 |
+
}
|
168 |
+
|
169 |
+
// we don't have any ticks yet, let's make some!
|
170 |
+
else {
|
171 |
+
if (name == 'xaxis' || name == 'x2axis') {
|
172 |
+
dim = this._plotDimensions.width;
|
173 |
+
}
|
174 |
+
else {
|
175 |
+
dim = this._plotDimensions.height;
|
176 |
+
}
|
177 |
+
|
178 |
+
// if min, max and number of ticks specified, user can't specify interval.
|
179 |
+
if (this.min != null && this.max != null && this.numberTicks != null) {
|
180 |
+
this.tickInterval = null;
|
181 |
+
}
|
182 |
+
|
183 |
+
// if max, min, and interval specified and interval won't fit, ignore interval.
|
184 |
+
if (this.min != null && this.max != null && this.tickInterval != null) {
|
185 |
+
if (parseInt((this.max-this.min)/this.tickInterval, 10) != (this.max-this.min)/this.tickInterval) {
|
186 |
+
this.tickInterval = null;
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
// find out how many categories are in the lines and collect labels
|
191 |
+
var labels = [];
|
192 |
+
var numcats = 0;
|
193 |
+
var min = 0.5;
|
194 |
+
var max, val;
|
195 |
+
var isMerged = false;
|
196 |
+
for (var i=0; i<this._series.length; i++) {
|
197 |
+
var s = this._series[i];
|
198 |
+
for (var j=0; j<s.data.length; j++) {
|
199 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
200 |
+
val = s.data[j][0];
|
201 |
+
}
|
202 |
+
else {
|
203 |
+
val = s.data[j][1];
|
204 |
+
}
|
205 |
+
if ($.inArray(val, labels) == -1) {
|
206 |
+
isMerged = true;
|
207 |
+
numcats += 1;
|
208 |
+
labels.push(val);
|
209 |
+
}
|
210 |
+
}
|
211 |
+
}
|
212 |
+
|
213 |
+
if (isMerged && this.sortMergedLabels) {
|
214 |
+
labels.sort(function(a,b) { return a - b; });
|
215 |
+
}
|
216 |
+
|
217 |
+
// keep a reference to these tick labels to use for redrawing plot (see bug #57)
|
218 |
+
this.ticks = labels;
|
219 |
+
|
220 |
+
// now bin the data values to the right lables.
|
221 |
+
for (var i=0; i<this._series.length; i++) {
|
222 |
+
var s = this._series[i];
|
223 |
+
for (var j=0; j<s.data.length; j++) {
|
224 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
225 |
+
val = s.data[j][0];
|
226 |
+
}
|
227 |
+
else {
|
228 |
+
val = s.data[j][1];
|
229 |
+
}
|
230 |
+
// for category axis, force the values into category bins.
|
231 |
+
// we should have the value in the label array now.
|
232 |
+
var idx = $.inArray(val, labels)+1;
|
233 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
234 |
+
s.data[j][0] = idx;
|
235 |
+
}
|
236 |
+
else {
|
237 |
+
s.data[j][1] = idx;
|
238 |
+
}
|
239 |
+
}
|
240 |
+
}
|
241 |
+
|
242 |
+
// adjust with blanks if we have groups
|
243 |
+
if (this.groups > 1 && !this._grouped) {
|
244 |
+
var l = labels.length;
|
245 |
+
var skip = parseInt(l/this.groups, 10);
|
246 |
+
var count = 0;
|
247 |
+
for (var i=skip; i<l; i+=skip+1) {
|
248 |
+
labels[i] = ' ';
|
249 |
+
}
|
250 |
+
this._grouped = true;
|
251 |
+
}
|
252 |
+
|
253 |
+
max = numcats + 0.5;
|
254 |
+
if (this.numberTicks == null) {
|
255 |
+
this.numberTicks = 2*numcats + 1;
|
256 |
+
}
|
257 |
+
|
258 |
+
var range = max - min;
|
259 |
+
this.min = min;
|
260 |
+
this.max = max;
|
261 |
+
var track = 0;
|
262 |
+
|
263 |
+
// todo: adjust this so more ticks displayed.
|
264 |
+
var maxVisibleTicks = parseInt(3+dim/10, 10);
|
265 |
+
var skip = parseInt(numcats/maxVisibleTicks, 10);
|
266 |
+
|
267 |
+
if (this.tickInterval == null) {
|
268 |
+
|
269 |
+
this.tickInterval = range / (this.numberTicks-1);
|
270 |
+
|
271 |
+
}
|
272 |
+
// if tickInterval is specified, we will ignore any computed maximum.
|
273 |
+
for (var i=0; i<this.numberTicks; i++){
|
274 |
+
tt = this.min + i * this.tickInterval;
|
275 |
+
var t = new this.tickRenderer(this.tickOptions);
|
276 |
+
// if even tick, it isn't a category, it's a divider
|
277 |
+
if (i/2 == parseInt(i/2, 10)) {
|
278 |
+
t.showLabel = false;
|
279 |
+
t.showMark = true;
|
280 |
+
}
|
281 |
+
else {
|
282 |
+
if (skip>0 && track<skip) {
|
283 |
+
t.showLabel = false;
|
284 |
+
track += 1;
|
285 |
+
}
|
286 |
+
else {
|
287 |
+
t.showLabel = true;
|
288 |
+
track = 0;
|
289 |
+
}
|
290 |
+
t.label = t.formatter(t.formatString, labels[(i-1)/2]);
|
291 |
+
t.showMark = false;
|
292 |
+
t.showGridline = false;
|
293 |
+
}
|
294 |
+
t.setTick(tt, this.name);
|
295 |
+
this._ticks.push(t);
|
296 |
+
}
|
297 |
+
}
|
298 |
+
|
299 |
+
};
|
300 |
+
|
301 |
+
// called with scope of axis
|
302 |
+
$.jqplot.CategoryAxisRenderer.prototype.draw = function(ctx, plot) {
|
303 |
+
if (this.show) {
|
304 |
+
// populate the axis label and value properties.
|
305 |
+
// createTicks is a method on the renderer, but
|
306 |
+
// call it within the scope of the axis.
|
307 |
+
this.renderer.createTicks.call(this);
|
308 |
+
// fill a div with axes labels in the right direction.
|
309 |
+
// Need to pregenerate each axis to get it's bounds and
|
310 |
+
// position it and the labels correctly on the plot.
|
311 |
+
var dim=0;
|
312 |
+
var temp;
|
313 |
+
// Added for theming.
|
314 |
+
if (this._elem) {
|
315 |
+
// this._elem.empty();
|
316 |
+
// Memory Leaks patch
|
317 |
+
this._elem.emptyForce();
|
318 |
+
}
|
319 |
+
|
320 |
+
this._elem = this._elem || $('<div class="jqplot-axis jqplot-'+this.name+'" style="position:absolute;"></div>');
|
321 |
+
|
322 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
323 |
+
this._elem.width(this._plotDimensions.width);
|
324 |
+
}
|
325 |
+
else {
|
326 |
+
this._elem.height(this._plotDimensions.height);
|
327 |
+
}
|
328 |
+
|
329 |
+
// create a _label object.
|
330 |
+
this.labelOptions.axis = this.name;
|
331 |
+
this._label = new this.labelRenderer(this.labelOptions);
|
332 |
+
if (this._label.show) {
|
333 |
+
var elem = this._label.draw(ctx, plot);
|
334 |
+
elem.appendTo(this._elem);
|
335 |
+
}
|
336 |
+
|
337 |
+
var t = this._ticks;
|
338 |
+
for (var i=0; i<t.length; i++) {
|
339 |
+
var tick = t[i];
|
340 |
+
if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
|
341 |
+
var elem = tick.draw(ctx, plot);
|
342 |
+
elem.appendTo(this._elem);
|
343 |
+
}
|
344 |
+
}
|
345 |
+
|
346 |
+
this._groupLabels = [];
|
347 |
+
// now make group labels
|
348 |
+
for (var i=0; i<this.groupLabels.length; i++)
|
349 |
+
{
|
350 |
+
var elem = $('<div style="position:absolute;" class="jqplot-'+this.name+'-groupLabel"></div>');
|
351 |
+
elem.html(this.groupLabels[i]);
|
352 |
+
this._groupLabels.push(elem);
|
353 |
+
elem.appendTo(this._elem);
|
354 |
+
}
|
355 |
+
}
|
356 |
+
return this._elem;
|
357 |
+
};
|
358 |
+
|
359 |
+
// called with scope of axis
|
360 |
+
$.jqplot.CategoryAxisRenderer.prototype.set = function() {
|
361 |
+
var dim = 0;
|
362 |
+
var temp;
|
363 |
+
var w = 0;
|
364 |
+
var h = 0;
|
365 |
+
var lshow = (this._label == null) ? false : this._label.show;
|
366 |
+
if (this.show) {
|
367 |
+
var t = this._ticks;
|
368 |
+
for (var i=0; i<t.length; i++) {
|
369 |
+
var tick = t[i];
|
370 |
+
if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
|
371 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
372 |
+
temp = tick._elem.outerHeight(true);
|
373 |
+
}
|
374 |
+
else {
|
375 |
+
temp = tick._elem.outerWidth(true);
|
376 |
+
}
|
377 |
+
if (temp > dim) {
|
378 |
+
dim = temp;
|
379 |
+
}
|
380 |
+
}
|
381 |
+
}
|
382 |
+
|
383 |
+
var dim2 = 0;
|
384 |
+
for (var i=0; i<this._groupLabels.length; i++) {
|
385 |
+
var l = this._groupLabels[i];
|
386 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
387 |
+
temp = l.outerHeight(true);
|
388 |
+
}
|
389 |
+
else {
|
390 |
+
temp = l.outerWidth(true);
|
391 |
+
}
|
392 |
+
if (temp > dim2) {
|
393 |
+
dim2 = temp;
|
394 |
+
}
|
395 |
+
}
|
396 |
+
|
397 |
+
if (lshow) {
|
398 |
+
w = this._label._elem.outerWidth(true);
|
399 |
+
h = this._label._elem.outerHeight(true);
|
400 |
+
}
|
401 |
+
if (this.name == 'xaxis') {
|
402 |
+
dim += dim2 + h;
|
403 |
+
this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'});
|
404 |
+
}
|
405 |
+
else if (this.name == 'x2axis') {
|
406 |
+
dim += dim2 + h;
|
407 |
+
this._elem.css({'height':dim+'px', left:'0px', top:'0px'});
|
408 |
+
}
|
409 |
+
else if (this.name == 'yaxis') {
|
410 |
+
dim += dim2 + w;
|
411 |
+
this._elem.css({'width':dim+'px', left:'0px', top:'0px'});
|
412 |
+
if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
|
413 |
+
this._label._elem.css('width', w+'px');
|
414 |
+
}
|
415 |
+
}
|
416 |
+
else {
|
417 |
+
dim += dim2 + w;
|
418 |
+
this._elem.css({'width':dim+'px', right:'0px', top:'0px'});
|
419 |
+
if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
|
420 |
+
this._label._elem.css('width', w+'px');
|
421 |
+
}
|
422 |
+
}
|
423 |
+
}
|
424 |
+
};
|
425 |
+
|
426 |
+
// called with scope of axis
|
427 |
+
$.jqplot.CategoryAxisRenderer.prototype.pack = function(pos, offsets) {
|
428 |
+
var ticks = this._ticks;
|
429 |
+
var max = this.max;
|
430 |
+
var min = this.min;
|
431 |
+
var offmax = offsets.max;
|
432 |
+
var offmin = offsets.min;
|
433 |
+
var lshow = (this._label == null) ? false : this._label.show;
|
434 |
+
var i;
|
435 |
+
|
436 |
+
for (var p in pos) {
|
437 |
+
this._elem.css(p, pos[p]);
|
438 |
+
}
|
439 |
+
|
440 |
+
this._offsets = offsets;
|
441 |
+
// pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
|
442 |
+
var pixellength = offmax - offmin;
|
443 |
+
var unitlength = max - min;
|
444 |
+
|
445 |
+
if (!this.reverse) {
|
446 |
+
// point to unit and unit to point conversions references to Plot DOM element top left corner.
|
447 |
+
|
448 |
+
this.u2p = function(u){
|
449 |
+
return (u - min) * pixellength / unitlength + offmin;
|
450 |
+
};
|
451 |
+
|
452 |
+
this.p2u = function(p){
|
453 |
+
return (p - offmin) * unitlength / pixellength + min;
|
454 |
+
};
|
455 |
+
|
456 |
+
if (this.name == 'xaxis' || this.name == 'x2axis'){
|
457 |
+
this.series_u2p = function(u){
|
458 |
+
return (u - min) * pixellength / unitlength;
|
459 |
+
};
|
460 |
+
this.series_p2u = function(p){
|
461 |
+
return p * unitlength / pixellength + min;
|
462 |
+
};
|
463 |
+
}
|
464 |
+
|
465 |
+
else {
|
466 |
+
this.series_u2p = function(u){
|
467 |
+
return (u - max) * pixellength / unitlength;
|
468 |
+
};
|
469 |
+
this.series_p2u = function(p){
|
470 |
+
return p * unitlength / pixellength + max;
|
471 |
+
};
|
472 |
+
}
|
473 |
+
}
|
474 |
+
|
475 |
+
else {
|
476 |
+
// point to unit and unit to point conversions references to Plot DOM element top left corner.
|
477 |
+
|
478 |
+
this.u2p = function(u){
|
479 |
+
return offmin + (max - u) * pixellength / unitlength;
|
480 |
+
};
|
481 |
+
|
482 |
+
this.p2u = function(p){
|
483 |
+
return min + (p - offmin) * unitlength / pixellength;
|
484 |
+
};
|
485 |
+
|
486 |
+
if (this.name == 'xaxis' || this.name == 'x2axis'){
|
487 |
+
this.series_u2p = function(u){
|
488 |
+
return (max - u) * pixellength / unitlength;
|
489 |
+
};
|
490 |
+
this.series_p2u = function(p){
|
491 |
+
return p * unitlength / pixellength + max;
|
492 |
+
};
|
493 |
+
}
|
494 |
+
|
495 |
+
else {
|
496 |
+
this.series_u2p = function(u){
|
497 |
+
return (min - u) * pixellength / unitlength;
|
498 |
+
};
|
499 |
+
this.series_p2u = function(p){
|
500 |
+
return p * unitlength / pixellength + min;
|
501 |
+
};
|
502 |
+
}
|
503 |
+
|
504 |
+
}
|
505 |
+
|
506 |
+
|
507 |
+
if (this.show) {
|
508 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
509 |
+
for (i=0; i<ticks.length; i++) {
|
510 |
+
var t = ticks[i];
|
511 |
+
if (t.show && t.showLabel) {
|
512 |
+
var shim;
|
513 |
+
|
514 |
+
if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
|
515 |
+
// will need to adjust auto positioning based on which axis this is.
|
516 |
+
var temp = (this.name == 'xaxis') ? 1 : -1;
|
517 |
+
switch (t.labelPosition) {
|
518 |
+
case 'auto':
|
519 |
+
// position at end
|
520 |
+
if (temp * t.angle < 0) {
|
521 |
+
shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
522 |
+
}
|
523 |
+
// position at start
|
524 |
+
else {
|
525 |
+
shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
|
526 |
+
}
|
527 |
+
break;
|
528 |
+
case 'end':
|
529 |
+
shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
530 |
+
break;
|
531 |
+
case 'start':
|
532 |
+
shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
|
533 |
+
break;
|
534 |
+
case 'middle':
|
535 |
+
shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
536 |
+
break;
|
537 |
+
default:
|
538 |
+
shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
539 |
+
break;
|
540 |
+
}
|
541 |
+
}
|
542 |
+
else {
|
543 |
+
shim = -t.getWidth()/2;
|
544 |
+
}
|
545 |
+
var val = this.u2p(t.value) + shim + 'px';
|
546 |
+
t._elem.css('left', val);
|
547 |
+
t.pack();
|
548 |
+
}
|
549 |
+
}
|
550 |
+
|
551 |
+
var labeledge=['bottom', 0];
|
552 |
+
if (lshow) {
|
553 |
+
var w = this._label._elem.outerWidth(true);
|
554 |
+
this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
|
555 |
+
if (this.name == 'xaxis') {
|
556 |
+
this._label._elem.css('bottom', '0px');
|
557 |
+
labeledge = ['bottom', this._label._elem.outerHeight(true)];
|
558 |
+
}
|
559 |
+
else {
|
560 |
+
this._label._elem.css('top', '0px');
|
561 |
+
labeledge = ['top', this._label._elem.outerHeight(true)];
|
562 |
+
}
|
563 |
+
this._label.pack();
|
564 |
+
}
|
565 |
+
|
566 |
+
// draw the group labels
|
567 |
+
var step = parseInt(this._ticks.length/this.groups, 10);
|
568 |
+
for (i=0; i<this._groupLabels.length; i++) {
|
569 |
+
var mid = 0;
|
570 |
+
var count = 0;
|
571 |
+
for (var j=i*step; j<=(i+1)*step; j++) {
|
572 |
+
if (this._ticks[j]._elem && this._ticks[j].label != " ") {
|
573 |
+
var t = this._ticks[j]._elem;
|
574 |
+
var p = t.position();
|
575 |
+
mid += p.left + t.outerWidth(true)/2;
|
576 |
+
count++;
|
577 |
+
}
|
578 |
+
}
|
579 |
+
mid = mid/count;
|
580 |
+
this._groupLabels[i].css({'left':(mid - this._groupLabels[i].outerWidth(true)/2)});
|
581 |
+
this._groupLabels[i].css(labeledge[0], labeledge[1]);
|
582 |
+
}
|
583 |
+
}
|
584 |
+
else {
|
585 |
+
for (i=0; i<ticks.length; i++) {
|
586 |
+
var t = ticks[i];
|
587 |
+
if (t.show && t.showLabel) {
|
588 |
+
var shim;
|
589 |
+
if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
|
590 |
+
// will need to adjust auto positioning based on which axis this is.
|
591 |
+
var temp = (this.name == 'yaxis') ? 1 : -1;
|
592 |
+
switch (t.labelPosition) {
|
593 |
+
case 'auto':
|
594 |
+
// position at end
|
595 |
+
case 'end':
|
596 |
+
if (temp * t.angle < 0) {
|
597 |
+
shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
|
598 |
+
}
|
599 |
+
else {
|
600 |
+
shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
|
601 |
+
}
|
602 |
+
break;
|
603 |
+
case 'start':
|
604 |
+
if (t.angle > 0) {
|
605 |
+
shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
|
606 |
+
}
|
607 |
+
else {
|
608 |
+
shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
|
609 |
+
}
|
610 |
+
break;
|
611 |
+
case 'middle':
|
612 |
+
// if (t.angle > 0) {
|
613 |
+
// shim = -t.getHeight()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
614 |
+
// }
|
615 |
+
// else {
|
616 |
+
// shim = -t.getHeight()/2 - t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
|
617 |
+
// }
|
618 |
+
shim = -t.getHeight()/2;
|
619 |
+
break;
|
620 |
+
default:
|
621 |
+
shim = -t.getHeight()/2;
|
622 |
+
break;
|
623 |
+
}
|
624 |
+
}
|
625 |
+
else {
|
626 |
+
shim = -t.getHeight()/2;
|
627 |
+
}
|
628 |
+
|
629 |
+
var val = this.u2p(t.value) + shim + 'px';
|
630 |
+
t._elem.css('top', val);
|
631 |
+
t.pack();
|
632 |
+
}
|
633 |
+
}
|
634 |
+
|
635 |
+
var labeledge=['left', 0];
|
636 |
+
if (lshow) {
|
637 |
+
var h = this._label._elem.outerHeight(true);
|
638 |
+
this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
|
639 |
+
if (this.name == 'yaxis') {
|
640 |
+
this._label._elem.css('left', '0px');
|
641 |
+
labeledge = ['left', this._label._elem.outerWidth(true)];
|
642 |
+
}
|
643 |
+
else {
|
644 |
+
this._label._elem.css('right', '0px');
|
645 |
+
labeledge = ['right', this._label._elem.outerWidth(true)];
|
646 |
+
}
|
647 |
+
this._label.pack();
|
648 |
+
}
|
649 |
+
|
650 |
+
// draw the group labels, position top here, do left after label position.
|
651 |
+
var step = parseInt(this._ticks.length/this.groups, 10);
|
652 |
+
for (i=0; i<this._groupLabels.length; i++) {
|
653 |
+
var mid = 0;
|
654 |
+
var count = 0;
|
655 |
+
for (var j=i*step; j<=(i+1)*step; j++) {
|
656 |
+
if (this._ticks[j]._elem && this._ticks[j].label != " ") {
|
657 |
+
var t = this._ticks[j]._elem;
|
658 |
+
var p = t.position();
|
659 |
+
mid += p.top + t.outerHeight()/2;
|
660 |
+
count++;
|
661 |
+
}
|
662 |
+
}
|
663 |
+
mid = mid/count;
|
664 |
+
this._groupLabels[i].css({'top':mid - this._groupLabels[i].outerHeight()/2});
|
665 |
+
this._groupLabels[i].css(labeledge[0], labeledge[1]);
|
666 |
+
|
667 |
+
}
|
668 |
+
}
|
669 |
+
}
|
670 |
+
};
|
671 |
+
|
672 |
+
|
673 |
+
})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.categoryAxisRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(a){a.jqplot.CategoryAxisRenderer=function(b){a.jqplot.LinearAxisRenderer.call(this);this.sortMergedLabels=false};a.jqplot.CategoryAxisRenderer.prototype=new a.jqplot.LinearAxisRenderer();a.jqplot.CategoryAxisRenderer.prototype.constructor=a.jqplot.CategoryAxisRenderer;a.jqplot.CategoryAxisRenderer.prototype.init=function(e){this.groups=1;this.groupLabels=[];this._groupLabels=[];this._grouped=false;this._barsPerGroup=null;this.reverse=false;a.extend(true,this,{tickOptions:{formatString:"%d"}},e);var b=this._dataBounds;for(var f=0;f<this._series.length;f++){var g=this._series[f];if(g.groups){this.groups=g.groups}var h=g.data;for(var c=0;c<h.length;c++){if(this.name=="xaxis"||this.name=="x2axis"){if(h[c][0]<b.min||b.min==null){b.min=h[c][0]}if(h[c][0]>b.max||b.max==null){b.max=h[c][0]}}else{if(h[c][1]<b.min||b.min==null){b.min=h[c][1]}if(h[c][1]>b.max||b.max==null){b.max=h[c][1]}}}}if(this.groupLabels.length){this.groups=this.groupLabels.length}};a.jqplot.CategoryAxisRenderer.prototype.createTicks=function(){var D=this._ticks;var z=this.ticks;var F=this.name;var C=this._dataBounds;var v,A;var q,w;var d,c;var b,x;if(z.length){if(this.groups>1&&!this._grouped){var r=z.length;var p=parseInt(r/this.groups,10);var e=0;for(var x=p;x<r;x+=p){z.splice(x+e,0," ");e++}this._grouped=true}this.min=0.5;this.max=z.length+0.5;var m=this.max-this.min;this.numberTicks=2*z.length+1;for(x=0;x<z.length;x++){b=this.min+2*x*m/(this.numberTicks-1);var h=new this.tickRenderer(this.tickOptions);h.showLabel=false;h.setTick(b,this.name);this._ticks.push(h);var h=new this.tickRenderer(this.tickOptions);h.label=z[x];h.showMark=false;h.showGridline=false;h.setTick(b+0.5,this.name);this._ticks.push(h)}var h=new this.tickRenderer(this.tickOptions);h.showLabel=false;h.setTick(b+1,this.name);this._ticks.push(h)}else{if(F=="xaxis"||F=="x2axis"){v=this._plotDimensions.width}else{v=this._plotDimensions.height}if(this.min!=null&&this.max!=null&&this.numberTicks!=null){this.tickInterval=null}if(this.min!=null&&this.max!=null&&this.tickInterval!=null){if(parseInt((this.max-this.min)/this.tickInterval,10)!=(this.max-this.min)/this.tickInterval){this.tickInterval=null}}var y=[];var B=0;var q=0.5;var w,E;var f=false;for(var x=0;x<this._series.length;x++){var k=this._series[x];for(var u=0;u<k.data.length;u++){if(this.name=="xaxis"||this.name=="x2axis"){E=k.data[u][0]}else{E=k.data[u][1]}if(a.inArray(E,y)==-1){f=true;B+=1;y.push(E)}}}if(f&&this.sortMergedLabels){y.sort(function(j,i){return j-i})}this.ticks=y;for(var x=0;x<this._series.length;x++){var k=this._series[x];for(var u=0;u<k.data.length;u++){if(this.name=="xaxis"||this.name=="x2axis"){E=k.data[u][0]}else{E=k.data[u][1]}var n=a.inArray(E,y)+1;if(this.name=="xaxis"||this.name=="x2axis"){k.data[u][0]=n}else{k.data[u][1]=n}}}if(this.groups>1&&!this._grouped){var r=y.length;var p=parseInt(r/this.groups,10);var e=0;for(var x=p;x<r;x+=p+1){y[x]=" "}this._grouped=true}w=B+0.5;if(this.numberTicks==null){this.numberTicks=2*B+1}var m=w-q;this.min=q;this.max=w;var o=0;var g=parseInt(3+v/10,10);var p=parseInt(B/g,10);if(this.tickInterval==null){this.tickInterval=m/(this.numberTicks-1)}for(var x=0;x<this.numberTicks;x++){b=this.min+x*this.tickInterval;var h=new this.tickRenderer(this.tickOptions);if(x/2==parseInt(x/2,10)){h.showLabel=false;h.showMark=true}else{if(p>0&&o<p){h.showLabel=false;o+=1}else{h.showLabel=true;o=0}h.label=h.formatter(h.formatString,y[(x-1)/2]);h.showMark=false;h.showGridline=false}h.setTick(b,this.name);this._ticks.push(h)}}};a.jqplot.CategoryAxisRenderer.prototype.draw=function(b,j){if(this.show){this.renderer.createTicks.call(this);var h=0;var c;if(this._elem){this._elem.emptyForce()}this._elem=this._elem||a('<div class="jqplot-axis jqplot-'+this.name+'" style="position:absolute;"></div>');if(this.name=="xaxis"||this.name=="x2axis"){this._elem.width(this._plotDimensions.width)}else{this._elem.height(this._plotDimensions.height)}this.labelOptions.axis=this.name;this._label=new this.labelRenderer(this.labelOptions);if(this._label.show){var g=this._label.draw(b,j);g.appendTo(this._elem)}var f=this._ticks;for(var e=0;e<f.length;e++){var d=f[e];if(d.showLabel&&(!d.isMinorTick||this.showMinorTicks)){var g=d.draw(b,j);g.appendTo(this._elem)}}this._groupLabels=[];for(var e=0;e<this.groupLabels.length;e++){var g=a('<div style="position:absolute;" class="jqplot-'+this.name+'-groupLabel"></div>');g.html(this.groupLabels[e]);this._groupLabels.push(g);g.appendTo(this._elem)}}return this._elem};a.jqplot.CategoryAxisRenderer.prototype.set=function(){var e=0;var m;var k=0;var f=0;var d=(this._label==null)?false:this._label.show;if(this.show){var n=this._ticks;for(var c=0;c<n.length;c++){var g=n[c];if(g.showLabel&&(!g.isMinorTick||this.showMinorTicks)){if(this.name=="xaxis"||this.name=="x2axis"){m=g._elem.outerHeight(true)}else{m=g._elem.outerWidth(true)}if(m>e){e=m}}}var j=0;for(var c=0;c<this._groupLabels.length;c++){var b=this._groupLabels[c];if(this.name=="xaxis"||this.name=="x2axis"){m=b.outerHeight(true)}else{m=b.outerWidth(true)}if(m>j){j=m}}if(d){k=this._label._elem.outerWidth(true);f=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){e+=j+f;this._elem.css({height:e+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){e+=j+f;this._elem.css({height:e+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){e+=j+k;this._elem.css({width:e+"px",left:"0px",top:"0px"});if(d&&this._label.constructor==a.jqplot.AxisLabelRenderer){this._label._elem.css("width",k+"px")}}else{e+=j+k;this._elem.css({width:e+"px",right:"0px",top:"0px"});if(d&&this._label.constructor==a.jqplot.AxisLabelRenderer){this._label._elem.css("width",k+"px")}}}}}};a.jqplot.CategoryAxisRenderer.prototype.pack=function(e,c){var C=this._ticks;var v=this.max;var s=this.min;var n=c.max;var l=c.min;var q=(this._label==null)?false:this._label.show;var x;for(var r in e){this._elem.css(r,e[r])}this._offsets=c;var g=n-l;var k=v-s;if(!this.reverse){this.u2p=function(h){return(h-s)*g/k+l};this.p2u=function(h){return(h-l)*k/g+s};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(h){return(h-s)*g/k};this.series_p2u=function(h){return h*k/g+s}}else{this.series_u2p=function(h){return(h-v)*g/k};this.series_p2u=function(h){return h*k/g+v}}}else{this.u2p=function(h){return l+(v-h)*g/k};this.p2u=function(h){return s+(h-l)*k/g};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(h){return(v-h)*g/k};this.series_p2u=function(h){return h*k/g+v}}else{this.series_u2p=function(h){return(s-h)*g/k};this.series_p2u=function(h){return h*k/g+s}}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(x=0;x<C.length;x++){var o=C[x];if(o.show&&o.showLabel){var b;if(o.constructor==a.jqplot.CanvasAxisTickRenderer&&o.angle){var A=(this.name=="xaxis")?1:-1;switch(o.labelPosition){case"auto":if(A*o.angle<0){b=-o.getWidth()+o._textRenderer.height*Math.sin(-o._textRenderer.angle)/2}else{b=-o._textRenderer.height*Math.sin(o._textRenderer.angle)/2}break;case"end":b=-o.getWidth()+o._textRenderer.height*Math.sin(-o._textRenderer.angle)/2;break;case"start":b=-o._textRenderer.height*Math.sin(o._textRenderer.angle)/2;break;case"middle":b=-o.getWidth()/2+o._textRenderer.height*Math.sin(-o._textRenderer.angle)/2;break;default:b=-o.getWidth()/2+o._textRenderer.height*Math.sin(-o._textRenderer.angle)/2;break}}else{b=-o.getWidth()/2}var D=this.u2p(o.value)+b+"px";o._elem.css("left",D);o.pack()}}var z=["bottom",0];if(q){var m=this._label._elem.outerWidth(true);this._label._elem.css("left",l+g/2-m/2+"px");if(this.name=="xaxis"){this._label._elem.css("bottom","0px");z=["bottom",this._label._elem.outerHeight(true)]}else{this._label._elem.css("top","0px");z=["top",this._label._elem.outerHeight(true)]}this._label.pack()}var d=parseInt(this._ticks.length/this.groups,10);for(x=0;x<this._groupLabels.length;x++){var B=0;var f=0;for(var u=x*d;u<=(x+1)*d;u++){if(this._ticks[u]._elem&&this._ticks[u].label!=" "){var o=this._ticks[u]._elem;var r=o.position();B+=r.left+o.outerWidth(true)/2;f++}}B=B/f;this._groupLabels[x].css({left:(B-this._groupLabels[x].outerWidth(true)/2)});this._groupLabels[x].css(z[0],z[1])}}else{for(x=0;x<C.length;x++){var o=C[x];if(o.show&&o.showLabel){var b;if(o.constructor==a.jqplot.CanvasAxisTickRenderer&&o.angle){var A=(this.name=="yaxis")?1:-1;switch(o.labelPosition){case"auto":case"end":if(A*o.angle<0){b=-o._textRenderer.height*Math.cos(-o._textRenderer.angle)/2}else{b=-o.getHeight()+o._textRenderer.height*Math.cos(o._textRenderer.angle)/2}break;case"start":if(o.angle>0){b=-o._textRenderer.height*Math.cos(-o._textRenderer.angle)/2}else{b=-o.getHeight()+o._textRenderer.height*Math.cos(o._textRenderer.angle)/2}break;case"middle":b=-o.getHeight()/2;break;default:b=-o.getHeight()/2;break}}else{b=-o.getHeight()/2}var D=this.u2p(o.value)+b+"px";o._elem.css("top",D);o.pack()}}var z=["left",0];if(q){var y=this._label._elem.outerHeight(true);this._label._elem.css("top",n-g/2-y/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px");z=["left",this._label._elem.outerWidth(true)]}else{this._label._elem.css("right","0px");z=["right",this._label._elem.outerWidth(true)]}this._label.pack()}var d=parseInt(this._ticks.length/this.groups,10);for(x=0;x<this._groupLabels.length;x++){var B=0;var f=0;for(var u=x*d;u<=(x+1)*d;u++){if(this._ticks[u]._elem&&this._ticks[u].label!=" "){var o=this._ticks[u]._elem;var r=o.position();B+=r.top+o.outerHeight()/2;f++}}B=B/f;this._groupLabels[x].css({top:B-this._groupLabels[x].outerHeight()/2});this._groupLabels[x].css(z[0],z[1])}}}}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.ciParser.js
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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.ciParser
|
34 |
+
* Data Renderer function which converts a custom JSON data object into jqPlot data format.
|
35 |
+
* Set this as a callable on the jqplot dataRenderer plot option:
|
36 |
+
*
|
37 |
+
* > plot = $.jqplot('mychart', [data], { dataRenderer: $.jqplot.ciParser, ... });
|
38 |
+
*
|
39 |
+
* Where data is an object in JSON format or a JSON encoded string conforming to the
|
40 |
+
* City Index API spec.
|
41 |
+
*
|
42 |
+
* Note that calling the renderer function is handled internally by jqPlot. The
|
43 |
+
* user does not have to call the function. The parameters described below will
|
44 |
+
* automatically be passed to the ciParser function.
|
45 |
+
*
|
46 |
+
* Parameters:
|
47 |
+
* data - JSON encoded string or object.
|
48 |
+
* plot - reference to jqPlot Plot object.
|
49 |
+
*
|
50 |
+
* Returns:
|
51 |
+
* data array in jqPlot format.
|
52 |
+
*
|
53 |
+
*/
|
54 |
+
$.jqplot.ciParser = function (data, plot) {
|
55 |
+
var ret = [],
|
56 |
+
line,
|
57 |
+
temp,
|
58 |
+
i, j, k, kk;
|
59 |
+
|
60 |
+
if (typeof(data) == "string") {
|
61 |
+
data = $.jqplot.JSON.parse(data, handleStrings);
|
62 |
+
}
|
63 |
+
|
64 |
+
else if (typeof(data) == "object") {
|
65 |
+
for (k in data) {
|
66 |
+
for (i=0; i<data[k].length; i++) {
|
67 |
+
for (kk in data[k][i]) {
|
68 |
+
data[k][i][kk] = handleStrings(kk, data[k][i][kk]);
|
69 |
+
}
|
70 |
+
}
|
71 |
+
}
|
72 |
+
}
|
73 |
+
|
74 |
+
else {
|
75 |
+
return null;
|
76 |
+
}
|
77 |
+
|
78 |
+
// function handleStrings
|
79 |
+
// Checks any JSON encoded strings to see if they are
|
80 |
+
// encoded dates. If so, pull out the timestamp.
|
81 |
+
// Expects dates to be represented by js timestamps.
|
82 |
+
|
83 |
+
function handleStrings(key, value) {
|
84 |
+
var a;
|
85 |
+
if (value != null) {
|
86 |
+
if (value.toString().indexOf('Date') >= 0) {
|
87 |
+
//here we will try to extract the ticks from the Date string in the "value" fields of JSON returned data
|
88 |
+
a = /^\/Date\((-?[0-9]+)\)\/$/.exec(value);
|
89 |
+
if (a) {
|
90 |
+
return parseInt(a[1], 10);
|
91 |
+
}
|
92 |
+
}
|
93 |
+
return value;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
for (var prop in data) {
|
98 |
+
line = [];
|
99 |
+
temp = data[prop];
|
100 |
+
switch (prop) {
|
101 |
+
case "PriceTicks":
|
102 |
+
for (i=0; i<temp.length; i++) {
|
103 |
+
line.push([temp[i]['TickDate'], temp[i]['Price']]);
|
104 |
+
}
|
105 |
+
break;
|
106 |
+
case "PriceBars":
|
107 |
+
for (i=0; i<temp.length; i++) {
|
108 |
+
line.push([temp[i]['BarDate'], temp[i]['Open'], temp[i]['High'], temp[i]['Low'], temp[i]['Close']]);
|
109 |
+
}
|
110 |
+
break;
|
111 |
+
}
|
112 |
+
ret.push(line);
|
113 |
+
}
|
114 |
+
return ret;
|
115 |
+
};
|
116 |
+
})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.ciParser.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(a){a.jqplot.ciParser=function(g,l){var m=[],o,n,h,f,e,c;if(typeof(g)=="string"){g=a.jqplot.JSON.parse(g,d)}else{if(typeof(g)=="object"){for(e in g){for(h=0;h<g[e].length;h++){for(c in g[e][h]){g[e][h][c]=d(c,g[e][h][c])}}}}else{return null}}function d(j,k){var i;if(k!=null){if(k.toString().indexOf("Date")>=0){i=/^\/Date\((-?[0-9]+)\)\/$/.exec(k);if(i){return parseInt(i[1],10)}}return k}}for(var b in g){o=[];n=g[b];switch(b){case"PriceTicks":for(h=0;h<n.length;h++){o.push([n[h]["TickDate"],n[h]["Price"]])}break;case"PriceBars":for(h=0;h<n.length;h++){o.push([n[h]["BarDate"],n[h]["Open"],n[h]["High"],n[h]["Low"],n[h]["Close"]])}break}m.push(o)}return m}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.cursor.js
ADDED
@@ -0,0 +1,1108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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 |
+
/**
|
34 |
+
* Class: $.jqplot.Cursor
|
35 |
+
* Plugin class representing the cursor as displayed on the plot.
|
36 |
+
*/
|
37 |
+
$.jqplot.Cursor = function(options) {
|
38 |
+
// Group: Properties
|
39 |
+
//
|
40 |
+
// prop: style
|
41 |
+
// CSS spec for cursor style
|
42 |
+
this.style = 'crosshair';
|
43 |
+
this.previousCursor = 'auto';
|
44 |
+
// prop: show
|
45 |
+
// wether to show the cursor or not.
|
46 |
+
this.show = $.jqplot.config.enablePlugins;
|
47 |
+
// prop: showTooltip
|
48 |
+
// show a cursor position tooltip. Location of the tooltip
|
49 |
+
// will be controlled by followMouse and tooltipLocation.
|
50 |
+
this.showTooltip = true;
|
51 |
+
// prop: followMouse
|
52 |
+
// Tooltip follows the mouse, it is not at a fixed location.
|
53 |
+
// Tooltip will show on the grid at the location given by
|
54 |
+
// tooltipLocation, offset from the grid edge by tooltipOffset.
|
55 |
+
this.followMouse = false;
|
56 |
+
// prop: tooltipLocation
|
57 |
+
// Where to position tooltip. If followMouse is true, this is
|
58 |
+
// relative to the cursor, otherwise, it is relative to the grid.
|
59 |
+
// One of 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw'
|
60 |
+
this.tooltipLocation = 'se';
|
61 |
+
// prop: tooltipOffset
|
62 |
+
// Pixel offset of tooltip from the grid boudaries or cursor center.
|
63 |
+
this.tooltipOffset = 6;
|
64 |
+
// prop: showTooltipGridPosition
|
65 |
+
// show the grid pixel coordinates of the mouse.
|
66 |
+
this.showTooltipGridPosition = false;
|
67 |
+
// prop: showTooltipUnitPosition
|
68 |
+
// show the unit (data) coordinates of the mouse.
|
69 |
+
this.showTooltipUnitPosition = true;
|
70 |
+
// prop: showTooltipDataPosition
|
71 |
+
// Used with showVerticalLine to show intersecting data points in the tooltip.
|
72 |
+
this.showTooltipDataPosition = false;
|
73 |
+
// prop: tooltipFormatString
|
74 |
+
// sprintf format string for the tooltip.
|
75 |
+
// Uses Ash Searle's javascript sprintf implementation
|
76 |
+
// found here: http://hexmen.com/blog/2007/03/printf-sprintf/
|
77 |
+
// See http://perldoc.perl.org/functions/sprintf.html for reference
|
78 |
+
// Note, if showTooltipDataPosition is true, the default tooltipFormatString
|
79 |
+
// will be set to the cursorLegendFormatString, not the default given here.
|
80 |
+
this.tooltipFormatString = '%.4P, %.4P';
|
81 |
+
// prop: useAxesFormatters
|
82 |
+
// Use the x and y axes formatters to format the text in the tooltip.
|
83 |
+
this.useAxesFormatters = true;
|
84 |
+
// prop: tooltipAxisGroups
|
85 |
+
// Show position for the specified axes.
|
86 |
+
// This is an array like [['xaxis', 'yaxis'], ['xaxis', 'y2axis']]
|
87 |
+
// Default is to compute automatically for all visible axes.
|
88 |
+
this.tooltipAxisGroups = [];
|
89 |
+
// prop: zoom
|
90 |
+
// Enable plot zooming.
|
91 |
+
this.zoom = false;
|
92 |
+
// zoomProxy and zoomTarget properties are not directly set by user.
|
93 |
+
// They Will be set through call to zoomProxy method.
|
94 |
+
this.zoomProxy = false;
|
95 |
+
this.zoomTarget = false;
|
96 |
+
// prop: looseZoom
|
97 |
+
// Will expand zoom range to provide more rounded tick values.
|
98 |
+
// Works only with linear, log and date axes.
|
99 |
+
this.looseZoom = true;
|
100 |
+
// prop: clickReset
|
101 |
+
// Will reset plot zoom if single click on plot without drag.
|
102 |
+
this.clickReset = false;
|
103 |
+
// prop: dblClickReset
|
104 |
+
// Will reset plot zoom if double click on plot without drag.
|
105 |
+
this.dblClickReset = true;
|
106 |
+
// prop: showVerticalLine
|
107 |
+
// draw a vertical line across the plot which follows the cursor.
|
108 |
+
// When the line is near a data point, a special legend and/or tooltip can
|
109 |
+
// be updated with the data values.
|
110 |
+
this.showVerticalLine = false;
|
111 |
+
// prop: showHorizontalLine
|
112 |
+
// draw a horizontal line across the plot which follows the cursor.
|
113 |
+
this.showHorizontalLine = false;
|
114 |
+
// prop: constrainZoomTo
|
115 |
+
// 'none', 'x' or 'y'
|
116 |
+
this.constrainZoomTo = 'none';
|
117 |
+
// // prop: autoscaleConstraint
|
118 |
+
// // when a constrained axis is specified, true will
|
119 |
+
// // auatoscale the adjacent axis.
|
120 |
+
// this.autoscaleConstraint = true;
|
121 |
+
this.shapeRenderer = new $.jqplot.ShapeRenderer();
|
122 |
+
this._zoom = {start:[], end:[], started: false, zooming:false, isZoomed:false, axes:{start:{}, end:{}}, gridpos:{}, datapos:{}};
|
123 |
+
this._tooltipElem;
|
124 |
+
this.zoomCanvas;
|
125 |
+
this.cursorCanvas;
|
126 |
+
// prop: intersectionThreshold
|
127 |
+
// pixel distance from data point or marker to consider cursor lines intersecting with point.
|
128 |
+
// If data point markers are not shown, this should be >= 1 or will often miss point intersections.
|
129 |
+
this.intersectionThreshold = 2;
|
130 |
+
// prop: showCursorLegend
|
131 |
+
// Replace the plot legend with an enhanced legend displaying intersection information.
|
132 |
+
this.showCursorLegend = false;
|
133 |
+
// prop: cursorLegendFormatString
|
134 |
+
// Format string used in the cursor legend. If showTooltipDataPosition is true,
|
135 |
+
// this will also be the default format string used by tooltipFormatString.
|
136 |
+
this.cursorLegendFormatString = $.jqplot.Cursor.cursorLegendFormatString;
|
137 |
+
// whether the cursor is over the grid or not.
|
138 |
+
this._oldHandlers = {onselectstart: null, ondrag: null, onmousedown: null};
|
139 |
+
// prop: constrainOutsideZoom
|
140 |
+
// True to limit actual zoom area to edges of grid, even when zooming
|
141 |
+
// outside of plot area. That is, can't zoom out by mousing outside plot.
|
142 |
+
this.constrainOutsideZoom = true;
|
143 |
+
// prop: showTooltipOutsideZoom
|
144 |
+
// True will keep updating the tooltip when zooming of the grid.
|
145 |
+
this.showTooltipOutsideZoom = false;
|
146 |
+
// true if mouse is over grid, false if not.
|
147 |
+
this.onGrid = false;
|
148 |
+
$.extend(true, this, options);
|
149 |
+
};
|
150 |
+
|
151 |
+
$.jqplot.Cursor.cursorLegendFormatString = '%s x:%s, y:%s';
|
152 |
+
|
153 |
+
// called with scope of plot
|
154 |
+
$.jqplot.Cursor.init = function (target, data, opts){
|
155 |
+
// add a cursor attribute to the plot
|
156 |
+
var options = opts || {};
|
157 |
+
this.plugins.cursor = new $.jqplot.Cursor(options.cursor);
|
158 |
+
var c = this.plugins.cursor;
|
159 |
+
|
160 |
+
if (c.show) {
|
161 |
+
$.jqplot.eventListenerHooks.push(['jqplotMouseEnter', handleMouseEnter]);
|
162 |
+
$.jqplot.eventListenerHooks.push(['jqplotMouseLeave', handleMouseLeave]);
|
163 |
+
$.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMouseMove]);
|
164 |
+
|
165 |
+
if (c.showCursorLegend) {
|
166 |
+
opts.legend = opts.legend || {};
|
167 |
+
opts.legend.renderer = $.jqplot.CursorLegendRenderer;
|
168 |
+
opts.legend.formatString = this.plugins.cursor.cursorLegendFormatString;
|
169 |
+
opts.legend.show = true;
|
170 |
+
}
|
171 |
+
|
172 |
+
if (c.zoom) {
|
173 |
+
$.jqplot.eventListenerHooks.push(['jqplotMouseDown', handleMouseDown]);
|
174 |
+
|
175 |
+
if (c.clickReset) {
|
176 |
+
$.jqplot.eventListenerHooks.push(['jqplotClick', handleClick]);
|
177 |
+
}
|
178 |
+
|
179 |
+
if (c.dblClickReset) {
|
180 |
+
$.jqplot.eventListenerHooks.push(['jqplotDblClick', handleDblClick]);
|
181 |
+
}
|
182 |
+
}
|
183 |
+
|
184 |
+
this.resetZoom = function() {
|
185 |
+
var axes = this.axes;
|
186 |
+
if (!c.zoomProxy) {
|
187 |
+
for (var ax in axes) {
|
188 |
+
axes[ax].reset();
|
189 |
+
axes[ax]._ticks = [];
|
190 |
+
// fake out tick creation algorithm to make sure original auto
|
191 |
+
// computed format string is used if _overrideFormatString is true
|
192 |
+
if (c._zoom.axes[ax] !== undefined) {
|
193 |
+
axes[ax]._autoFormatString = c._zoom.axes[ax].tickFormatString;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
this.redraw();
|
197 |
+
}
|
198 |
+
else {
|
199 |
+
var ctx = this.plugins.cursor.zoomCanvas._ctx;
|
200 |
+
ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
|
201 |
+
ctx = null;
|
202 |
+
}
|
203 |
+
this.plugins.cursor._zoom.isZoomed = false;
|
204 |
+
this.target.trigger('jqplotResetZoom', [this, this.plugins.cursor]);
|
205 |
+
};
|
206 |
+
|
207 |
+
|
208 |
+
if (c.showTooltipDataPosition) {
|
209 |
+
c.showTooltipUnitPosition = false;
|
210 |
+
c.showTooltipGridPosition = false;
|
211 |
+
if (options.cursor.tooltipFormatString == undefined) {
|
212 |
+
c.tooltipFormatString = $.jqplot.Cursor.cursorLegendFormatString;
|
213 |
+
}
|
214 |
+
}
|
215 |
+
}
|
216 |
+
};
|
217 |
+
|
218 |
+
// called with context of plot
|
219 |
+
$.jqplot.Cursor.postDraw = function() {
|
220 |
+
var c = this.plugins.cursor;
|
221 |
+
|
222 |
+
// Memory Leaks patch
|
223 |
+
if (c.zoomCanvas) {
|
224 |
+
c.zoomCanvas.resetCanvas();
|
225 |
+
c.zoomCanvas = null;
|
226 |
+
}
|
227 |
+
|
228 |
+
if (c.cursorCanvas) {
|
229 |
+
c.cursorCanvas.resetCanvas();
|
230 |
+
c.cursorCanvas = null;
|
231 |
+
}
|
232 |
+
|
233 |
+
if (c._tooltipElem) {
|
234 |
+
c._tooltipElem.emptyForce();
|
235 |
+
c._tooltipElem = null;
|
236 |
+
}
|
237 |
+
|
238 |
+
|
239 |
+
if (c.zoom) {
|
240 |
+
c.zoomCanvas = new $.jqplot.GenericCanvas();
|
241 |
+
this.eventCanvas._elem.before(c.zoomCanvas.createElement(this._gridPadding, 'jqplot-zoom-canvas', this._plotDimensions, this));
|
242 |
+
c.zoomCanvas.setContext();
|
243 |
+
}
|
244 |
+
|
245 |
+
var elem = document.createElement('div');
|
246 |
+
c._tooltipElem = $(elem);
|
247 |
+
elem = null;
|
248 |
+
c._tooltipElem.addClass('jqplot-cursor-tooltip');
|
249 |
+
c._tooltipElem.css({position:'absolute', display:'none'});
|
250 |
+
|
251 |
+
|
252 |
+
if (c.zoomCanvas) {
|
253 |
+
c.zoomCanvas._elem.before(c._tooltipElem);
|
254 |
+
}
|
255 |
+
|
256 |
+
else {
|
257 |
+
this.eventCanvas._elem.before(c._tooltipElem);
|
258 |
+
}
|
259 |
+
|
260 |
+
if (c.showVerticalLine || c.showHorizontalLine) {
|
261 |
+
c.cursorCanvas = new $.jqplot.GenericCanvas();
|
262 |
+
this.eventCanvas._elem.before(c.cursorCanvas.createElement(this._gridPadding, 'jqplot-cursor-canvas', this._plotDimensions, this));
|
263 |
+
c.cursorCanvas.setContext();
|
264 |
+
}
|
265 |
+
|
266 |
+
// if we are showing the positions in unit coordinates, and no axes groups
|
267 |
+
// were specified, create a default set.
|
268 |
+
if (c.showTooltipUnitPosition){
|
269 |
+
if (c.tooltipAxisGroups.length === 0) {
|
270 |
+
var series = this.series;
|
271 |
+
var s;
|
272 |
+
var temp = [];
|
273 |
+
for (var i=0; i<series.length; i++) {
|
274 |
+
s = series[i];
|
275 |
+
var ax = s.xaxis+','+s.yaxis;
|
276 |
+
if ($.inArray(ax, temp) == -1) {
|
277 |
+
temp.push(ax);
|
278 |
+
}
|
279 |
+
}
|
280 |
+
for (var i=0; i<temp.length; i++) {
|
281 |
+
c.tooltipAxisGroups.push(temp[i].split(','));
|
282 |
+
}
|
283 |
+
}
|
284 |
+
}
|
285 |
+
};
|
286 |
+
|
287 |
+
// Group: methods
|
288 |
+
//
|
289 |
+
// method: $.jqplot.Cursor.zoomProxy
|
290 |
+
// links targetPlot to controllerPlot so that plot zooming of
|
291 |
+
// targetPlot will be controlled by zooming on the controllerPlot.
|
292 |
+
// controllerPlot will not actually zoom, but acts as an
|
293 |
+
// overview plot. Note, the zoom options must be set to true for
|
294 |
+
// zoomProxy to work.
|
295 |
+
$.jqplot.Cursor.zoomProxy = function(targetPlot, controllerPlot) {
|
296 |
+
var tc = targetPlot.plugins.cursor;
|
297 |
+
var cc = controllerPlot.plugins.cursor;
|
298 |
+
tc.zoomTarget = true;
|
299 |
+
tc.zoom = true;
|
300 |
+
tc.style = 'auto';
|
301 |
+
tc.dblClickReset = false;
|
302 |
+
cc.zoom = true;
|
303 |
+
cc.zoomProxy = true;
|
304 |
+
|
305 |
+
controllerPlot.target.bind('jqplotZoom', plotZoom);
|
306 |
+
controllerPlot.target.bind('jqplotResetZoom', plotReset);
|
307 |
+
|
308 |
+
function plotZoom(ev, gridpos, datapos, plot, cursor) {
|
309 |
+
tc.doZoom(gridpos, datapos, targetPlot, cursor);
|
310 |
+
}
|
311 |
+
|
312 |
+
function plotReset(ev, plot, cursor) {
|
313 |
+
targetPlot.resetZoom();
|
314 |
+
}
|
315 |
+
};
|
316 |
+
|
317 |
+
$.jqplot.Cursor.prototype.resetZoom = function(plot, cursor) {
|
318 |
+
var axes = plot.axes;
|
319 |
+
var cax = cursor._zoom.axes;
|
320 |
+
if (!plot.plugins.cursor.zoomProxy && cursor._zoom.isZoomed) {
|
321 |
+
for (var ax in axes) {
|
322 |
+
// axes[ax]._ticks = [];
|
323 |
+
// axes[ax].min = cax[ax].min;
|
324 |
+
// axes[ax].max = cax[ax].max;
|
325 |
+
// axes[ax].numberTicks = cax[ax].numberTicks;
|
326 |
+
// axes[ax].tickInterval = cax[ax].tickInterval;
|
327 |
+
// // for date axes
|
328 |
+
// axes[ax].daTickInterval = cax[ax].daTickInterval;
|
329 |
+
axes[ax].reset();
|
330 |
+
axes[ax]._ticks = [];
|
331 |
+
// fake out tick creation algorithm to make sure original auto
|
332 |
+
// computed format string is used if _overrideFormatString is true
|
333 |
+
axes[ax]._autoFormatString = cax[ax].tickFormatString;
|
334 |
+
}
|
335 |
+
plot.redraw();
|
336 |
+
cursor._zoom.isZoomed = false;
|
337 |
+
}
|
338 |
+
else {
|
339 |
+
var ctx = cursor.zoomCanvas._ctx;
|
340 |
+
ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
|
341 |
+
ctx = null;
|
342 |
+
}
|
343 |
+
plot.target.trigger('jqplotResetZoom', [plot, cursor]);
|
344 |
+
};
|
345 |
+
|
346 |
+
$.jqplot.Cursor.resetZoom = function(plot) {
|
347 |
+
plot.resetZoom();
|
348 |
+
};
|
349 |
+
|
350 |
+
$.jqplot.Cursor.prototype.doZoom = function (gridpos, datapos, plot, cursor) {
|
351 |
+
var c = cursor;
|
352 |
+
var axes = plot.axes;
|
353 |
+
var zaxes = c._zoom.axes;
|
354 |
+
var start = zaxes.start;
|
355 |
+
var end = zaxes.end;
|
356 |
+
var min, max, dp, span,
|
357 |
+
newmin, newmax, curax, _numberTicks, ret;
|
358 |
+
var ctx = plot.plugins.cursor.zoomCanvas._ctx;
|
359 |
+
// don't zoom if zoom area is too small (in pixels)
|
360 |
+
if ((c.constrainZoomTo == 'none' && Math.abs(gridpos.x - c._zoom.start[0]) > 6 && Math.abs(gridpos.y - c._zoom.start[1]) > 6) || (c.constrainZoomTo == 'x' && Math.abs(gridpos.x - c._zoom.start[0]) > 6) || (c.constrainZoomTo == 'y' && Math.abs(gridpos.y - c._zoom.start[1]) > 6)) {
|
361 |
+
if (!plot.plugins.cursor.zoomProxy) {
|
362 |
+
for (var ax in datapos) {
|
363 |
+
// make a copy of the original axes to revert back.
|
364 |
+
if (c._zoom.axes[ax] == undefined) {
|
365 |
+
c._zoom.axes[ax] = {};
|
366 |
+
c._zoom.axes[ax].numberTicks = axes[ax].numberTicks;
|
367 |
+
c._zoom.axes[ax].tickInterval = axes[ax].tickInterval;
|
368 |
+
// for date axes...
|
369 |
+
c._zoom.axes[ax].daTickInterval = axes[ax].daTickInterval;
|
370 |
+
c._zoom.axes[ax].min = axes[ax].min;
|
371 |
+
c._zoom.axes[ax].max = axes[ax].max;
|
372 |
+
c._zoom.axes[ax].tickFormatString = (axes[ax].tickOptions != null) ? axes[ax].tickOptions.formatString : '';
|
373 |
+
}
|
374 |
+
|
375 |
+
|
376 |
+
if ((c.constrainZoomTo == 'none') || (c.constrainZoomTo == 'x' && ax.charAt(0) == 'x') || (c.constrainZoomTo == 'y' && ax.charAt(0) == 'y')) {
|
377 |
+
dp = datapos[ax];
|
378 |
+
if (dp != null) {
|
379 |
+
if (dp > start[ax]) {
|
380 |
+
newmin = start[ax];
|
381 |
+
newmax = dp;
|
382 |
+
}
|
383 |
+
else {
|
384 |
+
span = start[ax] - dp;
|
385 |
+
newmin = dp;
|
386 |
+
newmax = start[ax];
|
387 |
+
}
|
388 |
+
|
389 |
+
curax = axes[ax];
|
390 |
+
|
391 |
+
_numberTicks = null;
|
392 |
+
|
393 |
+
// if aligning this axis, use number of ticks from previous axis.
|
394 |
+
// Do I need to reset somehow if alignTicks is changed and then graph is replotted??
|
395 |
+
if (curax.alignTicks) {
|
396 |
+
if (curax.name === 'x2axis' && plot.axes.xaxis.show) {
|
397 |
+
_numberTicks = plot.axes.xaxis.numberTicks;
|
398 |
+
}
|
399 |
+
else if (curax.name.charAt(0) === 'y' && curax.name !== 'yaxis' && curax.name !== 'yMidAxis' && plot.axes.yaxis.show) {
|
400 |
+
_numberTicks = plot.axes.yaxis.numberTicks;
|
401 |
+
}
|
402 |
+
}
|
403 |
+
|
404 |
+
if (this.looseZoom && (axes[ax].renderer.constructor === $.jqplot.LinearAxisRenderer || axes[ax].renderer.constructor === $.jqplot.LogAxisRenderer )) { //} || axes[ax].renderer.constructor === $.jqplot.DateAxisRenderer)) {
|
405 |
+
|
406 |
+
ret = $.jqplot.LinearTickGenerator(newmin, newmax, curax._scalefact, _numberTicks);
|
407 |
+
|
408 |
+
// if new minimum is less than "true" minimum of axis display, adjust it
|
409 |
+
if (axes[ax].tickInset && ret[0] < axes[ax].min + axes[ax].tickInset * axes[ax].tickInterval) {
|
410 |
+
ret[0] += ret[4];
|
411 |
+
ret[2] -= 1;
|
412 |
+
}
|
413 |
+
|
414 |
+
// if new maximum is greater than "true" max of axis display, adjust it
|
415 |
+
if (axes[ax].tickInset && ret[1] > axes[ax].max - axes[ax].tickInset * axes[ax].tickInterval) {
|
416 |
+
ret[1] -= ret[4];
|
417 |
+
ret[2] -= 1;
|
418 |
+
}
|
419 |
+
|
420 |
+
// for log axes, don't fall below current minimum, this will look bad and can't have 0 in range anyway.
|
421 |
+
if (axes[ax].renderer.constructor === $.jqplot.LogAxisRenderer && ret[0] < axes[ax].min) {
|
422 |
+
// remove a tick and shift min up
|
423 |
+
ret[0] += ret[4];
|
424 |
+
ret[2] -= 1;
|
425 |
+
}
|
426 |
+
|
427 |
+
axes[ax].min = ret[0];
|
428 |
+
axes[ax].max = ret[1];
|
429 |
+
axes[ax]._autoFormatString = ret[3];
|
430 |
+
axes[ax].numberTicks = ret[2];
|
431 |
+
axes[ax].tickInterval = ret[4];
|
432 |
+
// for date axes...
|
433 |
+
axes[ax].daTickInterval = [ret[4]/1000, 'seconds'];
|
434 |
+
}
|
435 |
+
else {
|
436 |
+
axes[ax].min = newmin;
|
437 |
+
axes[ax].max = newmax;
|
438 |
+
axes[ax].tickInterval = null;
|
439 |
+
axes[ax].numberTicks = null;
|
440 |
+
// for date axes...
|
441 |
+
axes[ax].daTickInterval = null;
|
442 |
+
}
|
443 |
+
|
444 |
+
axes[ax]._ticks = [];
|
445 |
+
}
|
446 |
+
}
|
447 |
+
|
448 |
+
// if ((c.constrainZoomTo == 'x' && ax.charAt(0) == 'y' && c.autoscaleConstraint) || (c.constrainZoomTo == 'y' && ax.charAt(0) == 'x' && c.autoscaleConstraint)) {
|
449 |
+
// dp = datapos[ax];
|
450 |
+
// if (dp != null) {
|
451 |
+
// axes[ax].max == null;
|
452 |
+
// axes[ax].min = null;
|
453 |
+
// }
|
454 |
+
// }
|
455 |
+
}
|
456 |
+
ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
|
457 |
+
plot.redraw();
|
458 |
+
c._zoom.isZoomed = true;
|
459 |
+
ctx = null;
|
460 |
+
}
|
461 |
+
plot.target.trigger('jqplotZoom', [gridpos, datapos, plot, cursor]);
|
462 |
+
}
|
463 |
+
};
|
464 |
+
|
465 |
+
$.jqplot.preInitHooks.push($.jqplot.Cursor.init);
|
466 |
+
$.jqplot.postDrawHooks.push($.jqplot.Cursor.postDraw);
|
467 |
+
|
468 |
+
function updateTooltip(gridpos, datapos, plot) {
|
469 |
+
var c = plot.plugins.cursor;
|
470 |
+
var s = '';
|
471 |
+
var addbr = false;
|
472 |
+
if (c.showTooltipGridPosition) {
|
473 |
+
s = gridpos.x+', '+gridpos.y;
|
474 |
+
addbr = true;
|
475 |
+
}
|
476 |
+
if (c.showTooltipUnitPosition) {
|
477 |
+
var g;
|
478 |
+
for (var i=0; i<c.tooltipAxisGroups.length; i++) {
|
479 |
+
g = c.tooltipAxisGroups[i];
|
480 |
+
if (addbr) {
|
481 |
+
s += '<br />';
|
482 |
+
}
|
483 |
+
if (c.useAxesFormatters) {
|
484 |
+
for (var j=0; j<g.length; j++) {
|
485 |
+
if (j) {
|
486 |
+
s += ', ';
|
487 |
+
}
|
488 |
+
var af = plot.axes[g[j]]._ticks[0].formatter;
|
489 |
+
var afstr = plot.axes[g[j]]._ticks[0].formatString;
|
490 |
+
s += af(afstr, datapos[g[j]]);
|
491 |
+
}
|
492 |
+
}
|
493 |
+
else {
|
494 |
+
s += $.jqplot.sprintf(c.tooltipFormatString, datapos[g[0]], datapos[g[1]]);
|
495 |
+
}
|
496 |
+
addbr = true;
|
497 |
+
}
|
498 |
+
}
|
499 |
+
|
500 |
+
if (c.showTooltipDataPosition) {
|
501 |
+
var series = plot.series;
|
502 |
+
var ret = getIntersectingPoints(plot, gridpos.x, gridpos.y);
|
503 |
+
var addbr = false;
|
504 |
+
|
505 |
+
for (var i = 0; i< series.length; i++) {
|
506 |
+
if (series[i].show) {
|
507 |
+
var idx = series[i].index;
|
508 |
+
var label = series[i].label.toString();
|
509 |
+
var cellid = $.inArray(idx, ret.indices);
|
510 |
+
var sx = undefined;
|
511 |
+
var sy = undefined;
|
512 |
+
if (cellid != -1) {
|
513 |
+
var data = ret.data[cellid].data;
|
514 |
+
if (c.useAxesFormatters) {
|
515 |
+
var xf = series[i]._xaxis._ticks[0].formatter;
|
516 |
+
var yf = series[i]._yaxis._ticks[0].formatter;
|
517 |
+
var xfstr = series[i]._xaxis._ticks[0].formatString;
|
518 |
+
var yfstr = series[i]._yaxis._ticks[0].formatString;
|
519 |
+
sx = xf(xfstr, data[0]);
|
520 |
+
sy = yf(yfstr, data[1]);
|
521 |
+
}
|
522 |
+
else {
|
523 |
+
sx = data[0];
|
524 |
+
sy = data[1];
|
525 |
+
}
|
526 |
+
if (addbr) {
|
527 |
+
s += '<br />';
|
528 |
+
}
|
529 |
+
s += $.jqplot.sprintf(c.tooltipFormatString, label, sx, sy);
|
530 |
+
addbr = true;
|
531 |
+
}
|
532 |
+
}
|
533 |
+
}
|
534 |
+
|
535 |
+
}
|
536 |
+
c._tooltipElem.html(s);
|
537 |
+
}
|
538 |
+
|
539 |
+
function moveLine(gridpos, plot) {
|
540 |
+
var c = plot.plugins.cursor;
|
541 |
+
var ctx = c.cursorCanvas._ctx;
|
542 |
+
ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
|
543 |
+
if (c.showVerticalLine) {
|
544 |
+
c.shapeRenderer.draw(ctx, [[gridpos.x, 0], [gridpos.x, ctx.canvas.height]]);
|
545 |
+
}
|
546 |
+
if (c.showHorizontalLine) {
|
547 |
+
c.shapeRenderer.draw(ctx, [[0, gridpos.y], [ctx.canvas.width, gridpos.y]]);
|
548 |
+
}
|
549 |
+
var ret = getIntersectingPoints(plot, gridpos.x, gridpos.y);
|
550 |
+
if (c.showCursorLegend) {
|
551 |
+
var cells = $(plot.targetId + ' td.jqplot-cursor-legend-label');
|
552 |
+
for (var i=0; i<cells.length; i++) {
|
553 |
+
var idx = $(cells[i]).data('seriesIndex');
|
554 |
+
var series = plot.series[idx];
|
555 |
+
var label = series.label.toString();
|
556 |
+
var cellid = $.inArray(idx, ret.indices);
|
557 |
+
var sx = undefined;
|
558 |
+
var sy = undefined;
|
559 |
+
if (cellid != -1) {
|
560 |
+
var data = ret.data[cellid].data;
|
561 |
+
if (c.useAxesFormatters) {
|
562 |
+
var xf = series._xaxis._ticks[0].formatter;
|
563 |
+
var yf = series._yaxis._ticks[0].formatter;
|
564 |
+
var xfstr = series._xaxis._ticks[0].formatString;
|
565 |
+
var yfstr = series._yaxis._ticks[0].formatString;
|
566 |
+
sx = xf(xfstr, data[0]);
|
567 |
+
sy = yf(yfstr, data[1]);
|
568 |
+
}
|
569 |
+
else {
|
570 |
+
sx = data[0];
|
571 |
+
sy = data[1];
|
572 |
+
}
|
573 |
+
}
|
574 |
+
if (plot.legend.escapeHtml) {
|
575 |
+
$(cells[i]).text($.jqplot.sprintf(c.cursorLegendFormatString, label, sx, sy));
|
576 |
+
}
|
577 |
+
else {
|
578 |
+
$(cells[i]).html($.jqplot.sprintf(c.cursorLegendFormatString, label, sx, sy));
|
579 |
+
}
|
580 |
+
}
|
581 |
+
}
|
582 |
+
ctx = null;
|
583 |
+
}
|
584 |
+
|
585 |
+
function getIntersectingPoints(plot, x, y) {
|
586 |
+
var ret = {indices:[], data:[]};
|
587 |
+
var s, i, d0, d, j, r, p;
|
588 |
+
var threshold;
|
589 |
+
var c = plot.plugins.cursor;
|
590 |
+
for (var i=0; i<plot.series.length; i++) {
|
591 |
+
s = plot.series[i];
|
592 |
+
r = s.renderer;
|
593 |
+
if (s.show) {
|
594 |
+
threshold = c.intersectionThreshold;
|
595 |
+
if (s.showMarker) {
|
596 |
+
threshold += s.markerRenderer.size/2;
|
597 |
+
}
|
598 |
+
for (var j=0; j<s.gridData.length; j++) {
|
599 |
+
p = s.gridData[j];
|
600 |
+
// check vertical line
|
601 |
+
if (c.showVerticalLine) {
|
602 |
+
if (Math.abs(x-p[0]) <= threshold) {
|
603 |
+
ret.indices.push(i);
|
604 |
+
ret.data.push({seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]});
|
605 |
+
}
|
606 |
+
}
|
607 |
+
}
|
608 |
+
}
|
609 |
+
}
|
610 |
+
return ret;
|
611 |
+
}
|
612 |
+
|
613 |
+
function moveTooltip(gridpos, plot) {
|
614 |
+
var c = plot.plugins.cursor;
|
615 |
+
var elem = c._tooltipElem;
|
616 |
+
switch (c.tooltipLocation) {
|
617 |
+
case 'nw':
|
618 |
+
var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - c.tooltipOffset;
|
619 |
+
var y = gridpos.y + plot._gridPadding.top - c.tooltipOffset - elem.outerHeight(true);
|
620 |
+
break;
|
621 |
+
case 'n':
|
622 |
+
var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
|
623 |
+
var y = gridpos.y + plot._gridPadding.top - c.tooltipOffset - elem.outerHeight(true);
|
624 |
+
break;
|
625 |
+
case 'ne':
|
626 |
+
var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset;
|
627 |
+
var y = gridpos.y + plot._gridPadding.top - c.tooltipOffset - elem.outerHeight(true);
|
628 |
+
break;
|
629 |
+
case 'e':
|
630 |
+
var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset;
|
631 |
+
var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
|
632 |
+
break;
|
633 |
+
case 'se':
|
634 |
+
var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset;
|
635 |
+
var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset;
|
636 |
+
break;
|
637 |
+
case 's':
|
638 |
+
var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2;
|
639 |
+
var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset;
|
640 |
+
break;
|
641 |
+
case 'sw':
|
642 |
+
var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - c.tooltipOffset;
|
643 |
+
var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset;
|
644 |
+
break;
|
645 |
+
case 'w':
|
646 |
+
var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - c.tooltipOffset;
|
647 |
+
var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2;
|
648 |
+
break;
|
649 |
+
default:
|
650 |
+
var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset;
|
651 |
+
var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset;
|
652 |
+
break;
|
653 |
+
}
|
654 |
+
|
655 |
+
elem.css('left', x);
|
656 |
+
elem.css('top', y);
|
657 |
+
elem = null;
|
658 |
+
}
|
659 |
+
|
660 |
+
function positionTooltip(plot) {
|
661 |
+
// fake a grid for positioning
|
662 |
+
var grid = plot._gridPadding;
|
663 |
+
var c = plot.plugins.cursor;
|
664 |
+
var elem = c._tooltipElem;
|
665 |
+
switch (c.tooltipLocation) {
|
666 |
+
case 'nw':
|
667 |
+
var a = grid.left + c.tooltipOffset;
|
668 |
+
var b = grid.top + c.tooltipOffset;
|
669 |
+
elem.css('left', a);
|
670 |
+
elem.css('top', b);
|
671 |
+
break;
|
672 |
+
case 'n':
|
673 |
+
var a = (grid.left + (plot._plotDimensions.width - grid.right))/2 - elem.outerWidth(true)/2;
|
674 |
+
var b = grid.top + c.tooltipOffset;
|
675 |
+
elem.css('left', a);
|
676 |
+
elem.css('top', b);
|
677 |
+
break;
|
678 |
+
case 'ne':
|
679 |
+
var a = grid.right + c.tooltipOffset;
|
680 |
+
var b = grid.top + c.tooltipOffset;
|
681 |
+
elem.css({right:a, top:b});
|
682 |
+
break;
|
683 |
+
case 'e':
|
684 |
+
var a = grid.right + c.tooltipOffset;
|
685 |
+
var b = (grid.top + (plot._plotDimensions.height - grid.bottom))/2 - elem.outerHeight(true)/2;
|
686 |
+
elem.css({right:a, top:b});
|
687 |
+
break;
|
688 |
+
case 'se':
|
689 |
+
var a = grid.right + c.tooltipOffset;
|
690 |
+
var b = grid.bottom + c.tooltipOffset;
|
691 |
+
elem.css({right:a, bottom:b});
|
692 |
+
break;
|
693 |
+
case 's':
|
694 |
+
var a = (grid.left + (plot._plotDimensions.width - grid.right))/2 - elem.outerWidth(true)/2;
|
695 |
+
var b = grid.bottom + c.tooltipOffset;
|
696 |
+
elem.css({left:a, bottom:b});
|
697 |
+
break;
|
698 |
+
case 'sw':
|
699 |
+
var a = grid.left + c.tooltipOffset;
|
700 |
+
var b = grid.bottom + c.tooltipOffset;
|
701 |
+
elem.css({left:a, bottom:b});
|
702 |
+
break;
|
703 |
+
case 'w':
|
704 |
+
var a = grid.left + c.tooltipOffset;
|
705 |
+
var b = (grid.top + (plot._plotDimensions.height - grid.bottom))/2 - elem.outerHeight(true)/2;
|
706 |
+
elem.css({left:a, top:b});
|
707 |
+
break;
|
708 |
+
default: // same as 'se'
|
709 |
+
var a = grid.right - c.tooltipOffset;
|
710 |
+
var b = grid.bottom + c.tooltipOffset;
|
711 |
+
elem.css({right:a, bottom:b});
|
712 |
+
break;
|
713 |
+
}
|
714 |
+
elem = null;
|
715 |
+
}
|
716 |
+
|
717 |
+
function handleClick (ev, gridpos, datapos, neighbor, plot) {
|
718 |
+
ev.preventDefault();
|
719 |
+
ev.stopImmediatePropagation();
|
720 |
+
var c = plot.plugins.cursor;
|
721 |
+
if (c.clickReset) {
|
722 |
+
c.resetZoom(plot, c);
|
723 |
+
}
|
724 |
+
var sel = window.getSelection;
|
725 |
+
if (document.selection && document.selection.empty)
|
726 |
+
{
|
727 |
+
document.selection.empty();
|
728 |
+
}
|
729 |
+
else if (sel && !sel().isCollapsed) {
|
730 |
+
sel().collapse();
|
731 |
+
}
|
732 |
+
return false;
|
733 |
+
}
|
734 |
+
|
735 |
+
function handleDblClick (ev, gridpos, datapos, neighbor, plot) {
|
736 |
+
ev.preventDefault();
|
737 |
+
ev.stopImmediatePropagation();
|
738 |
+
var c = plot.plugins.cursor;
|
739 |
+
if (c.dblClickReset) {
|
740 |
+
c.resetZoom(plot, c);
|
741 |
+
}
|
742 |
+
var sel = window.getSelection;
|
743 |
+
if (document.selection && document.selection.empty)
|
744 |
+
{
|
745 |
+
document.selection.empty();
|
746 |
+
}
|
747 |
+
else if (sel && !sel().isCollapsed) {
|
748 |
+
sel().collapse();
|
749 |
+
}
|
750 |
+
return false;
|
751 |
+
}
|
752 |
+
|
753 |
+
function handleMouseLeave(ev, gridpos, datapos, neighbor, plot) {
|
754 |
+
var c = plot.plugins.cursor;
|
755 |
+
c.onGrid = false;
|
756 |
+
if (c.show) {
|
757 |
+
$(ev.target).css('cursor', c.previousCursor);
|
758 |
+
if (c.showTooltip && !(c._zoom.zooming && c.showTooltipOutsideZoom && !c.constrainOutsideZoom)) {
|
759 |
+
c._tooltipElem.empty();
|
760 |
+
c._tooltipElem.hide();
|
761 |
+
}
|
762 |
+
if (c.zoom) {
|
763 |
+
c._zoom.gridpos = gridpos;
|
764 |
+
c._zoom.datapos = datapos;
|
765 |
+
}
|
766 |
+
if (c.showVerticalLine || c.showHorizontalLine) {
|
767 |
+
var ctx = c.cursorCanvas._ctx;
|
768 |
+
ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
|
769 |
+
ctx = null;
|
770 |
+
}
|
771 |
+
if (c.showCursorLegend) {
|
772 |
+
var cells = $(plot.targetId + ' td.jqplot-cursor-legend-label');
|
773 |
+
for (var i=0; i<cells.length; i++) {
|
774 |
+
var idx = $(cells[i]).data('seriesIndex');
|
775 |
+
var series = plot.series[idx];
|
776 |
+
var label = series.label.toString();
|
777 |
+
if (plot.legend.escapeHtml) {
|
778 |
+
$(cells[i]).text($.jqplot.sprintf(c.cursorLegendFormatString, label, undefined, undefined));
|
779 |
+
}
|
780 |
+
else {
|
781 |
+
$(cells[i]).html($.jqplot.sprintf(c.cursorLegendFormatString, label, undefined, undefined));
|
782 |
+
}
|
783 |
+
|
784 |
+
}
|
785 |
+
}
|
786 |
+
}
|
787 |
+
}
|
788 |
+
|
789 |
+
function handleMouseEnter(ev, gridpos, datapos, neighbor, plot) {
|
790 |
+
var c = plot.plugins.cursor;
|
791 |
+
c.onGrid = true;
|
792 |
+
if (c.show) {
|
793 |
+
c.previousCursor = ev.target.style.cursor;
|
794 |
+
ev.target.style.cursor = c.style;
|
795 |
+
if (c.showTooltip) {
|
796 |
+
updateTooltip(gridpos, datapos, plot);
|
797 |
+
if (c.followMouse) {
|
798 |
+
moveTooltip(gridpos, plot);
|
799 |
+
}
|
800 |
+
else {
|
801 |
+
positionTooltip(plot);
|
802 |
+
}
|
803 |
+
c._tooltipElem.show();
|
804 |
+
}
|
805 |
+
if (c.showVerticalLine || c.showHorizontalLine) {
|
806 |
+
moveLine(gridpos, plot);
|
807 |
+
}
|
808 |
+
}
|
809 |
+
|
810 |
+
}
|
811 |
+
|
812 |
+
function handleMouseMove(ev, gridpos, datapos, neighbor, plot) {
|
813 |
+
var c = plot.plugins.cursor;
|
814 |
+
if (c.show) {
|
815 |
+
if (c.showTooltip) {
|
816 |
+
updateTooltip(gridpos, datapos, plot);
|
817 |
+
if (c.followMouse) {
|
818 |
+
moveTooltip(gridpos, plot);
|
819 |
+
}
|
820 |
+
}
|
821 |
+
if (c.showVerticalLine || c.showHorizontalLine) {
|
822 |
+
moveLine(gridpos, plot);
|
823 |
+
}
|
824 |
+
}
|
825 |
+
}
|
826 |
+
|
827 |
+
function getEventPosition(ev) {
|
828 |
+
var plot = ev.data.plot;
|
829 |
+
var go = plot.eventCanvas._elem.offset();
|
830 |
+
var gridPos = {x:ev.pageX - go.left, y:ev.pageY - go.top};
|
831 |
+
//////
|
832 |
+
// TO DO: handle yMidAxis
|
833 |
+
//////
|
834 |
+
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};
|
835 |
+
var an = ['xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis', 'yMidAxis'];
|
836 |
+
var ax = plot.axes;
|
837 |
+
var n, axis;
|
838 |
+
for (n=11; n>0; n--) {
|
839 |
+
axis = an[n-1];
|
840 |
+
if (ax[axis].show) {
|
841 |
+
dataPos[axis] = ax[axis].series_p2u(gridPos[axis.charAt(0)]);
|
842 |
+
}
|
843 |
+
}
|
844 |
+
|
845 |
+
return {offsets:go, gridPos:gridPos, dataPos:dataPos};
|
846 |
+
}
|
847 |
+
|
848 |
+
function handleZoomMove(ev) {
|
849 |
+
var plot = ev.data.plot;
|
850 |
+
var c = plot.plugins.cursor;
|
851 |
+
// don't do anything if not on grid.
|
852 |
+
if (c.show && c.zoom && c._zoom.started && !c.zoomTarget) {
|
853 |
+
ev.preventDefault();
|
854 |
+
var ctx = c.zoomCanvas._ctx;
|
855 |
+
var positions = getEventPosition(ev);
|
856 |
+
var gridpos = positions.gridPos;
|
857 |
+
var datapos = positions.dataPos;
|
858 |
+
c._zoom.gridpos = gridpos;
|
859 |
+
c._zoom.datapos = datapos;
|
860 |
+
c._zoom.zooming = true;
|
861 |
+
var xpos = gridpos.x;
|
862 |
+
var ypos = gridpos.y;
|
863 |
+
var height = ctx.canvas.height;
|
864 |
+
var width = ctx.canvas.width;
|
865 |
+
if (c.showTooltip && !c.onGrid && c.showTooltipOutsideZoom) {
|
866 |
+
updateTooltip(gridpos, datapos, plot);
|
867 |
+
if (c.followMouse) {
|
868 |
+
moveTooltip(gridpos, plot);
|
869 |
+
}
|
870 |
+
}
|
871 |
+
if (c.constrainZoomTo == 'x') {
|
872 |
+
c._zoom.end = [xpos, height];
|
873 |
+
}
|
874 |
+
else if (c.constrainZoomTo == 'y') {
|
875 |
+
c._zoom.end = [width, ypos];
|
876 |
+
}
|
877 |
+
else {
|
878 |
+
c._zoom.end = [xpos, ypos];
|
879 |
+
}
|
880 |
+
var sel = window.getSelection;
|
881 |
+
if (document.selection && document.selection.empty)
|
882 |
+
{
|
883 |
+
document.selection.empty();
|
884 |
+
}
|
885 |
+
else if (sel && !sel().isCollapsed) {
|
886 |
+
sel().collapse();
|
887 |
+
}
|
888 |
+
drawZoomBox.call(c);
|
889 |
+
ctx = null;
|
890 |
+
}
|
891 |
+
}
|
892 |
+
|
893 |
+
function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
|
894 |
+
var c = plot.plugins.cursor;
|
895 |
+
if(plot.plugins.mobile){
|
896 |
+
$(document).one('vmouseup.jqplot_cursor', {plot:plot}, handleMouseUp);
|
897 |
+
} else {
|
898 |
+
$(document).one('mouseup.jqplot_cursor', {plot:plot}, handleMouseUp);
|
899 |
+
}
|
900 |
+
var axes = plot.axes;
|
901 |
+
if (document.onselectstart != undefined) {
|
902 |
+
c._oldHandlers.onselectstart = document.onselectstart;
|
903 |
+
document.onselectstart = function () { return false; };
|
904 |
+
}
|
905 |
+
if (document.ondrag != undefined) {
|
906 |
+
c._oldHandlers.ondrag = document.ondrag;
|
907 |
+
document.ondrag = function () { return false; };
|
908 |
+
}
|
909 |
+
if (document.onmousedown != undefined) {
|
910 |
+
c._oldHandlers.onmousedown = document.onmousedown;
|
911 |
+
document.onmousedown = function () { return false; };
|
912 |
+
}
|
913 |
+
if (c.zoom) {
|
914 |
+
if (!c.zoomProxy) {
|
915 |
+
var ctx = c.zoomCanvas._ctx;
|
916 |
+
ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
|
917 |
+
ctx = null;
|
918 |
+
}
|
919 |
+
if (c.constrainZoomTo == 'x') {
|
920 |
+
c._zoom.start = [gridpos.x, 0];
|
921 |
+
}
|
922 |
+
else if (c.constrainZoomTo == 'y') {
|
923 |
+
c._zoom.start = [0, gridpos.y];
|
924 |
+
}
|
925 |
+
else {
|
926 |
+
c._zoom.start = [gridpos.x, gridpos.y];
|
927 |
+
}
|
928 |
+
c._zoom.started = true;
|
929 |
+
for (var ax in datapos) {
|
930 |
+
// get zoom starting position.
|
931 |
+
c._zoom.axes.start[ax] = datapos[ax];
|
932 |
+
}
|
933 |
+
if(plot.plugins.mobile){
|
934 |
+
$(document).bind('vmousemove.jqplotCursor', {plot:plot}, handleZoomMove);
|
935 |
+
} else {
|
936 |
+
$(document).bind('mousemove.jqplotCursor', {plot:plot}, handleZoomMove);
|
937 |
+
}
|
938 |
+
|
939 |
+
}
|
940 |
+
}
|
941 |
+
|
942 |
+
function handleMouseUp(ev) {
|
943 |
+
var plot = ev.data.plot;
|
944 |
+
var c = plot.plugins.cursor;
|
945 |
+
if (c.zoom && c._zoom.zooming && !c.zoomTarget) {
|
946 |
+
var xpos = c._zoom.gridpos.x;
|
947 |
+
var ypos = c._zoom.gridpos.y;
|
948 |
+
var datapos = c._zoom.datapos;
|
949 |
+
var height = c.zoomCanvas._ctx.canvas.height;
|
950 |
+
var width = c.zoomCanvas._ctx.canvas.width;
|
951 |
+
var axes = plot.axes;
|
952 |
+
|
953 |
+
if (c.constrainOutsideZoom && !c.onGrid) {
|
954 |
+
if (xpos < 0) { xpos = 0; }
|
955 |
+
else if (xpos > width) { xpos = width; }
|
956 |
+
if (ypos < 0) { ypos = 0; }
|
957 |
+
else if (ypos > height) { ypos = height; }
|
958 |
+
|
959 |
+
for (var axis in datapos) {
|
960 |
+
if (datapos[axis]) {
|
961 |
+
if (axis.charAt(0) == 'x') {
|
962 |
+
datapos[axis] = axes[axis].series_p2u(xpos);
|
963 |
+
}
|
964 |
+
else {
|
965 |
+
datapos[axis] = axes[axis].series_p2u(ypos);
|
966 |
+
}
|
967 |
+
}
|
968 |
+
}
|
969 |
+
}
|
970 |
+
|
971 |
+
if (c.constrainZoomTo == 'x') {
|
972 |
+
ypos = height;
|
973 |
+
}
|
974 |
+
else if (c.constrainZoomTo == 'y') {
|
975 |
+
xpos = width;
|
976 |
+
}
|
977 |
+
c._zoom.end = [xpos, ypos];
|
978 |
+
c._zoom.gridpos = {x:xpos, y:ypos};
|
979 |
+
|
980 |
+
c.doZoom(c._zoom.gridpos, datapos, plot, c);
|
981 |
+
}
|
982 |
+
c._zoom.started = false;
|
983 |
+
c._zoom.zooming = false;
|
984 |
+
|
985 |
+
$(document).unbind('mousemove.jqplotCursor', handleZoomMove);
|
986 |
+
|
987 |
+
if (document.onselectstart != undefined && c._oldHandlers.onselectstart != null){
|
988 |
+
document.onselectstart = c._oldHandlers.onselectstart;
|
989 |
+
c._oldHandlers.onselectstart = null;
|
990 |
+
}
|
991 |
+
if (document.ondrag != undefined && c._oldHandlers.ondrag != null){
|
992 |
+
document.ondrag = c._oldHandlers.ondrag;
|
993 |
+
c._oldHandlers.ondrag = null;
|
994 |
+
}
|
995 |
+
if (document.onmousedown != undefined && c._oldHandlers.onmousedown != null){
|
996 |
+
document.onmousedown = c._oldHandlers.onmousedown;
|
997 |
+
c._oldHandlers.onmousedown = null;
|
998 |
+
}
|
999 |
+
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
function drawZoomBox() {
|
1003 |
+
var start = this._zoom.start;
|
1004 |
+
var end = this._zoom.end;
|
1005 |
+
var ctx = this.zoomCanvas._ctx;
|
1006 |
+
var l, t, h, w;
|
1007 |
+
if (end[0] > start[0]) {
|
1008 |
+
l = start[0];
|
1009 |
+
w = end[0] - start[0];
|
1010 |
+
}
|
1011 |
+
else {
|
1012 |
+
l = end[0];
|
1013 |
+
w = start[0] - end[0];
|
1014 |
+
}
|
1015 |
+
if (end[1] > start[1]) {
|
1016 |
+
t = start[1];
|
1017 |
+
h = end[1] - start[1];
|
1018 |
+
}
|
1019 |
+
else {
|
1020 |
+
t = end[1];
|
1021 |
+
h = start[1] - end[1];
|
1022 |
+
}
|
1023 |
+
ctx.fillStyle = 'rgba(0,0,0,0.2)';
|
1024 |
+
ctx.strokeStyle = '#999999';
|
1025 |
+
ctx.lineWidth = 1.0;
|
1026 |
+
ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height);
|
1027 |
+
ctx.fillRect(0,0,ctx.canvas.width, ctx.canvas.height);
|
1028 |
+
ctx.clearRect(l, t, w, h);
|
1029 |
+
// IE won't show transparent fill rect, so stroke a rect also.
|
1030 |
+
ctx.strokeRect(l,t,w,h);
|
1031 |
+
ctx = null;
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
$.jqplot.CursorLegendRenderer = function(options) {
|
1035 |
+
$.jqplot.TableLegendRenderer.call(this, options);
|
1036 |
+
this.formatString = '%s';
|
1037 |
+
};
|
1038 |
+
|
1039 |
+
$.jqplot.CursorLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
|
1040 |
+
$.jqplot.CursorLegendRenderer.prototype.constructor = $.jqplot.CursorLegendRenderer;
|
1041 |
+
|
1042 |
+
// called in context of a Legend
|
1043 |
+
$.jqplot.CursorLegendRenderer.prototype.draw = function() {
|
1044 |
+
if (this._elem) {
|
1045 |
+
this._elem.emptyForce();
|
1046 |
+
this._elem = null;
|
1047 |
+
}
|
1048 |
+
if (this.show) {
|
1049 |
+
var series = this._series, s;
|
1050 |
+
// make a table. one line label per row.
|
1051 |
+
var elem = document.createElement('div');
|
1052 |
+
this._elem = $(elem);
|
1053 |
+
elem = null;
|
1054 |
+
this._elem.addClass('jqplot-legend jqplot-cursor-legend');
|
1055 |
+
this._elem.css('position', 'absolute');
|
1056 |
+
|
1057 |
+
var pad = false;
|
1058 |
+
for (var i = 0; i< series.length; i++) {
|
1059 |
+
s = series[i];
|
1060 |
+
if (s.show && s.showLabel) {
|
1061 |
+
var lt = $.jqplot.sprintf(this.formatString, s.label.toString());
|
1062 |
+
if (lt) {
|
1063 |
+
var color = s.color;
|
1064 |
+
if (s._stack && !s.fill) {
|
1065 |
+
color = '';
|
1066 |
+
}
|
1067 |
+
addrow.call(this, lt, color, pad, i);
|
1068 |
+
pad = true;
|
1069 |
+
}
|
1070 |
+
// let plugins add more rows to legend. Used by trend line plugin.
|
1071 |
+
for (var j=0; j<$.jqplot.addLegendRowHooks.length; j++) {
|
1072 |
+
var item = $.jqplot.addLegendRowHooks[j].call(this, s);
|
1073 |
+
if (item) {
|
1074 |
+
addrow.call(this, item.label, item.color, pad);
|
1075 |
+
pad = true;
|
1076 |
+
}
|
1077 |
+
}
|
1078 |
+
}
|
1079 |
+
}
|
1080 |
+
series = s = null;
|
1081 |
+
delete series;
|
1082 |
+
delete s;
|
1083 |
+
}
|
1084 |
+
|
1085 |
+
function addrow(label, color, pad, idx) {
|
1086 |
+
var rs = (pad) ? this.rowSpacing : '0';
|
1087 |
+
var tr = $('<tr class="jqplot-legend jqplot-cursor-legend"></tr>').appendTo(this._elem);
|
1088 |
+
tr.data('seriesIndex', idx);
|
1089 |
+
$('<td class="jqplot-legend jqplot-cursor-legend-swatch" style="padding-top:'+rs+';">'+
|
1090 |
+
'<div style="border:1px solid #cccccc;padding:0.2em;">'+
|
1091 |
+
'<div class="jqplot-cursor-legend-swatch" style="background-color:'+color+';"></div>'+
|
1092 |
+
'</div></td>').appendTo(tr);
|
1093 |
+
var td = $('<td class="jqplot-legend jqplot-cursor-legend-label" style="vertical-align:middle;padding-top:'+rs+';"></td>');
|
1094 |
+
td.appendTo(tr);
|
1095 |
+
td.data('seriesIndex', idx);
|
1096 |
+
if (this.escapeHtml) {
|
1097 |
+
td.text(label);
|
1098 |
+
}
|
1099 |
+
else {
|
1100 |
+
td.html(label);
|
1101 |
+
}
|
1102 |
+
tr = null;
|
1103 |
+
td = null;
|
1104 |
+
}
|
1105 |
+
return this._elem;
|
1106 |
+
};
|
1107 |
+
|
1108 |
+
})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.cursor.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(j){j.jqplot.Cursor=function(q){this.style="crosshair";this.previousCursor="auto";this.show=j.jqplot.config.enablePlugins;this.showTooltip=true;this.followMouse=false;this.tooltipLocation="se";this.tooltipOffset=6;this.showTooltipGridPosition=false;this.showTooltipUnitPosition=true;this.showTooltipDataPosition=false;this.tooltipFormatString="%.4P, %.4P";this.useAxesFormatters=true;this.tooltipAxisGroups=[];this.zoom=false;this.zoomProxy=false;this.zoomTarget=false;this.looseZoom=true;this.clickReset=false;this.dblClickReset=true;this.showVerticalLine=false;this.showHorizontalLine=false;this.constrainZoomTo="none";this.shapeRenderer=new j.jqplot.ShapeRenderer();this._zoom={start:[],end:[],started:false,zooming:false,isZoomed:false,axes:{start:{},end:{}},gridpos:{},datapos:{}};this._tooltipElem;this.zoomCanvas;this.cursorCanvas;this.intersectionThreshold=2;this.showCursorLegend=false;this.cursorLegendFormatString=j.jqplot.Cursor.cursorLegendFormatString;this._oldHandlers={onselectstart:null,ondrag:null,onmousedown:null};this.constrainOutsideZoom=true;this.showTooltipOutsideZoom=false;this.onGrid=false;j.extend(true,this,q)};j.jqplot.Cursor.cursorLegendFormatString="%s x:%s, y:%s";j.jqplot.Cursor.init=function(t,s,r){var q=r||{};this.plugins.cursor=new j.jqplot.Cursor(q.cursor);var u=this.plugins.cursor;if(u.show){j.jqplot.eventListenerHooks.push(["jqplotMouseEnter",b]);j.jqplot.eventListenerHooks.push(["jqplotMouseLeave",f]);j.jqplot.eventListenerHooks.push(["jqplotMouseMove",i]);if(u.showCursorLegend){r.legend=r.legend||{};r.legend.renderer=j.jqplot.CursorLegendRenderer;r.legend.formatString=this.plugins.cursor.cursorLegendFormatString;r.legend.show=true}if(u.zoom){j.jqplot.eventListenerHooks.push(["jqplotMouseDown",a]);if(u.clickReset){j.jqplot.eventListenerHooks.push(["jqplotClick",k])}if(u.dblClickReset){j.jqplot.eventListenerHooks.push(["jqplotDblClick",c])}}this.resetZoom=function(){var x=this.axes;if(!u.zoomProxy){for(var w in x){x[w].reset();x[w]._ticks=[];if(u._zoom.axes[w]!==undefined){x[w]._autoFormatString=u._zoom.axes[w].tickFormatString}}this.redraw()}else{var v=this.plugins.cursor.zoomCanvas._ctx;v.clearRect(0,0,v.canvas.width,v.canvas.height);v=null}this.plugins.cursor._zoom.isZoomed=false;this.target.trigger("jqplotResetZoom",[this,this.plugins.cursor])};if(u.showTooltipDataPosition){u.showTooltipUnitPosition=false;u.showTooltipGridPosition=false;if(q.cursor.tooltipFormatString==undefined){u.tooltipFormatString=j.jqplot.Cursor.cursorLegendFormatString}}}};j.jqplot.Cursor.postDraw=function(){var x=this.plugins.cursor;if(x.zoomCanvas){x.zoomCanvas.resetCanvas();x.zoomCanvas=null}if(x.cursorCanvas){x.cursorCanvas.resetCanvas();x.cursorCanvas=null}if(x._tooltipElem){x._tooltipElem.emptyForce();x._tooltipElem=null}if(x.zoom){x.zoomCanvas=new j.jqplot.GenericCanvas();this.eventCanvas._elem.before(x.zoomCanvas.createElement(this._gridPadding,"jqplot-zoom-canvas",this._plotDimensions,this));x.zoomCanvas.setContext()}var v=document.createElement("div");x._tooltipElem=j(v);v=null;x._tooltipElem.addClass("jqplot-cursor-tooltip");x._tooltipElem.css({position:"absolute",display:"none"});if(x.zoomCanvas){x.zoomCanvas._elem.before(x._tooltipElem)}else{this.eventCanvas._elem.before(x._tooltipElem)}if(x.showVerticalLine||x.showHorizontalLine){x.cursorCanvas=new j.jqplot.GenericCanvas();this.eventCanvas._elem.before(x.cursorCanvas.createElement(this._gridPadding,"jqplot-cursor-canvas",this._plotDimensions,this));x.cursorCanvas.setContext()}if(x.showTooltipUnitPosition){if(x.tooltipAxisGroups.length===0){var t=this.series;var u;var q=[];for(var r=0;r<t.length;r++){u=t[r];var w=u.xaxis+","+u.yaxis;if(j.inArray(w,q)==-1){q.push(w)}}for(var r=0;r<q.length;r++){x.tooltipAxisGroups.push(q[r].split(","))}}}};j.jqplot.Cursor.zoomProxy=function(v,r){var q=v.plugins.cursor;var u=r.plugins.cursor;q.zoomTarget=true;q.zoom=true;q.style="auto";q.dblClickReset=false;u.zoom=true;u.zoomProxy=true;r.target.bind("jqplotZoom",t);r.target.bind("jqplotResetZoom",s);function t(x,w,z,y,A){q.doZoom(w,z,v,A)}function s(w,x,y){v.resetZoom()}};j.jqplot.Cursor.prototype.resetZoom=function(u,v){var t=u.axes;var s=v._zoom.axes;if(!u.plugins.cursor.zoomProxy&&v._zoom.isZoomed){for(var r in t){t[r].reset();t[r]._ticks=[];t[r]._autoFormatString=s[r].tickFormatString}u.redraw();v._zoom.isZoomed=false}else{var q=v.zoomCanvas._ctx;q.clearRect(0,0,q.canvas.width,q.canvas.height);q=null}u.target.trigger("jqplotResetZoom",[u,v])};j.jqplot.Cursor.resetZoom=function(q){q.resetZoom()};j.jqplot.Cursor.prototype.doZoom=function(G,t,C,u){var I=u;var F=C.axes;var r=I._zoom.axes;var w=r.start;var s=r.end;var B,E,z,D,v,x,q,H,J;var A=C.plugins.cursor.zoomCanvas._ctx;if((I.constrainZoomTo=="none"&&Math.abs(G.x-I._zoom.start[0])>6&&Math.abs(G.y-I._zoom.start[1])>6)||(I.constrainZoomTo=="x"&&Math.abs(G.x-I._zoom.start[0])>6)||(I.constrainZoomTo=="y"&&Math.abs(G.y-I._zoom.start[1])>6)){if(!C.plugins.cursor.zoomProxy){for(var y in t){if(I._zoom.axes[y]==undefined){I._zoom.axes[y]={};I._zoom.axes[y].numberTicks=F[y].numberTicks;I._zoom.axes[y].tickInterval=F[y].tickInterval;I._zoom.axes[y].daTickInterval=F[y].daTickInterval;I._zoom.axes[y].min=F[y].min;I._zoom.axes[y].max=F[y].max;I._zoom.axes[y].tickFormatString=(F[y].tickOptions!=null)?F[y].tickOptions.formatString:""}if((I.constrainZoomTo=="none")||(I.constrainZoomTo=="x"&&y.charAt(0)=="x")||(I.constrainZoomTo=="y"&&y.charAt(0)=="y")){z=t[y];if(z!=null){if(z>w[y]){v=w[y];x=z}else{D=w[y]-z;v=z;x=w[y]}q=F[y];H=null;if(q.alignTicks){if(q.name==="x2axis"&&C.axes.xaxis.show){H=C.axes.xaxis.numberTicks}else{if(q.name.charAt(0)==="y"&&q.name!=="yaxis"&&q.name!=="yMidAxis"&&C.axes.yaxis.show){H=C.axes.yaxis.numberTicks}}}if(this.looseZoom&&(F[y].renderer.constructor===j.jqplot.LinearAxisRenderer||F[y].renderer.constructor===j.jqplot.LogAxisRenderer)){J=j.jqplot.LinearTickGenerator(v,x,q._scalefact,H);if(F[y].tickInset&&J[0]<F[y].min+F[y].tickInset*F[y].tickInterval){J[0]+=J[4];J[2]-=1}if(F[y].tickInset&&J[1]>F[y].max-F[y].tickInset*F[y].tickInterval){J[1]-=J[4];J[2]-=1}if(F[y].renderer.constructor===j.jqplot.LogAxisRenderer&&J[0]<F[y].min){J[0]+=J[4];J[2]-=1}F[y].min=J[0];F[y].max=J[1];F[y]._autoFormatString=J[3];F[y].numberTicks=J[2];F[y].tickInterval=J[4];F[y].daTickInterval=[J[4]/1000,"seconds"]}else{F[y].min=v;F[y].max=x;F[y].tickInterval=null;F[y].numberTicks=null;F[y].daTickInterval=null}F[y]._ticks=[]}}}A.clearRect(0,0,A.canvas.width,A.canvas.height);C.redraw();I._zoom.isZoomed=true;A=null}C.target.trigger("jqplotZoom",[G,t,C,u])}};j.jqplot.preInitHooks.push(j.jqplot.Cursor.init);j.jqplot.postDrawHooks.push(j.jqplot.Cursor.postDraw);function e(G,r,C){var J=C.plugins.cursor;var w="";var N=false;if(J.showTooltipGridPosition){w=G.x+", "+G.y;N=true}if(J.showTooltipUnitPosition){var F;for(var E=0;E<J.tooltipAxisGroups.length;E++){F=J.tooltipAxisGroups[E];if(N){w+="<br />"}if(J.useAxesFormatters){for(var D=0;D<F.length;D++){if(D){w+=", "}var H=C.axes[F[D]]._ticks[0].formatter;var B=C.axes[F[D]]._ticks[0].formatString;w+=H(B,r[F[D]])}}else{w+=j.jqplot.sprintf(J.tooltipFormatString,r[F[0]],r[F[1]])}N=true}}if(J.showTooltipDataPosition){var u=C.series;var M=d(C,G.x,G.y);var N=false;for(var E=0;E<u.length;E++){if(u[E].show){var y=u[E].index;var t=u[E].label.toString();var I=j.inArray(y,M.indices);var z=undefined;var x=undefined;if(I!=-1){var L=M.data[I].data;if(J.useAxesFormatters){var A=u[E]._xaxis._ticks[0].formatter;var q=u[E]._yaxis._ticks[0].formatter;var K=u[E]._xaxis._ticks[0].formatString;var v=u[E]._yaxis._ticks[0].formatString;z=A(K,L[0]);x=q(v,L[1])}else{z=L[0];x=L[1]}if(N){w+="<br />"}w+=j.jqplot.sprintf(J.tooltipFormatString,t,z,x);N=true}}}}J._tooltipElem.html(w)}function g(C,A){var E=A.plugins.cursor;var z=E.cursorCanvas._ctx;z.clearRect(0,0,z.canvas.width,z.canvas.height);if(E.showVerticalLine){E.shapeRenderer.draw(z,[[C.x,0],[C.x,z.canvas.height]])}if(E.showHorizontalLine){E.shapeRenderer.draw(z,[[0,C.y],[z.canvas.width,C.y]])}var G=d(A,C.x,C.y);if(E.showCursorLegend){var r=j(A.targetId+" td.jqplot-cursor-legend-label");for(var B=0;B<r.length;B++){var v=j(r[B]).data("seriesIndex");var t=A.series[v];var s=t.label.toString();var D=j.inArray(v,G.indices);var x=undefined;var w=undefined;if(D!=-1){var H=G.data[D].data;if(E.useAxesFormatters){var y=t._xaxis._ticks[0].formatter;var q=t._yaxis._ticks[0].formatter;var F=t._xaxis._ticks[0].formatString;var u=t._yaxis._ticks[0].formatString;x=y(F,H[0]);w=q(u,H[1])}else{x=H[0];w=H[1]}}if(A.legend.escapeHtml){j(r[B]).text(j.jqplot.sprintf(E.cursorLegendFormatString,s,x,w))}else{j(r[B]).html(j.jqplot.sprintf(E.cursorLegendFormatString,s,x,w))}}}z=null}function d(A,F,E){var B={indices:[],data:[]};var G,w,u,C,v,q,t;var z;var D=A.plugins.cursor;for(var w=0;w<A.series.length;w++){G=A.series[w];q=G.renderer;if(G.show){z=D.intersectionThreshold;if(G.showMarker){z+=G.markerRenderer.size/2}for(var v=0;v<G.gridData.length;v++){t=G.gridData[v];if(D.showVerticalLine){if(Math.abs(F-t[0])<=z){B.indices.push(w);B.data.push({seriesIndex:w,pointIndex:v,gridData:t,data:G.data[v]})}}}}}return B}function n(r,t){var v=t.plugins.cursor;var s=v._tooltipElem;switch(v.tooltipLocation){case"nw":var q=r.x+t._gridPadding.left-s.outerWidth(true)-v.tooltipOffset;var u=r.y+t._gridPadding.top-v.tooltipOffset-s.outerHeight(true);break;case"n":var q=r.x+t._gridPadding.left-s.outerWidth(true)/2;var u=r.y+t._gridPadding.top-v.tooltipOffset-s.outerHeight(true);break;case"ne":var q=r.x+t._gridPadding.left+v.tooltipOffset;var u=r.y+t._gridPadding.top-v.tooltipOffset-s.outerHeight(true);break;case"e":var q=r.x+t._gridPadding.left+v.tooltipOffset;var u=r.y+t._gridPadding.top-s.outerHeight(true)/2;break;case"se":var q=r.x+t._gridPadding.left+v.tooltipOffset;var u=r.y+t._gridPadding.top+v.tooltipOffset;break;case"s":var q=r.x+t._gridPadding.left-s.outerWidth(true)/2;var u=r.y+t._gridPadding.top+v.tooltipOffset;break;case"sw":var q=r.x+t._gridPadding.left-s.outerWidth(true)-v.tooltipOffset;var u=r.y+t._gridPadding.top+v.tooltipOffset;break;case"w":var q=r.x+t._gridPadding.left-s.outerWidth(true)-v.tooltipOffset;var u=r.y+t._gridPadding.top-s.outerHeight(true)/2;break;default:var q=r.x+t._gridPadding.left+v.tooltipOffset;var u=r.y+t._gridPadding.top+v.tooltipOffset;break}s.css("left",q);s.css("top",u);s=null}function m(u){var s=u._gridPadding;var v=u.plugins.cursor;var t=v._tooltipElem;switch(v.tooltipLocation){case"nw":var r=s.left+v.tooltipOffset;var q=s.top+v.tooltipOffset;t.css("left",r);t.css("top",q);break;case"n":var r=(s.left+(u._plotDimensions.width-s.right))/2-t.outerWidth(true)/2;var q=s.top+v.tooltipOffset;t.css("left",r);t.css("top",q);break;case"ne":var r=s.right+v.tooltipOffset;var q=s.top+v.tooltipOffset;t.css({right:r,top:q});break;case"e":var r=s.right+v.tooltipOffset;var q=(s.top+(u._plotDimensions.height-s.bottom))/2-t.outerHeight(true)/2;t.css({right:r,top:q});break;case"se":var r=s.right+v.tooltipOffset;var q=s.bottom+v.tooltipOffset;t.css({right:r,bottom:q});break;case"s":var r=(s.left+(u._plotDimensions.width-s.right))/2-t.outerWidth(true)/2;var q=s.bottom+v.tooltipOffset;t.css({left:r,bottom:q});break;case"sw":var r=s.left+v.tooltipOffset;var q=s.bottom+v.tooltipOffset;t.css({left:r,bottom:q});break;case"w":var r=s.left+v.tooltipOffset;var q=(s.top+(u._plotDimensions.height-s.bottom))/2-t.outerHeight(true)/2;t.css({left:r,top:q});break;default:var r=s.right-v.tooltipOffset;var q=s.bottom+v.tooltipOffset;t.css({right:r,bottom:q});break}t=null}function k(r,q,v,u,t){r.preventDefault();r.stopImmediatePropagation();var w=t.plugins.cursor;if(w.clickReset){w.resetZoom(t,w)}var s=window.getSelection;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(s&&!s().isCollapsed){s().collapse()}}return false}function c(r,q,v,u,t){r.preventDefault();r.stopImmediatePropagation();var w=t.plugins.cursor;if(w.dblClickReset){w.resetZoom(t,w)}var s=window.getSelection;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(s&&!s().isCollapsed){s().collapse()}}return false}function f(w,t,q,z,u){var v=u.plugins.cursor;v.onGrid=false;if(v.show){j(w.target).css("cursor",v.previousCursor);if(v.showTooltip&&!(v._zoom.zooming&&v.showTooltipOutsideZoom&&!v.constrainOutsideZoom)){v._tooltipElem.empty();v._tooltipElem.hide()}if(v.zoom){v._zoom.gridpos=t;v._zoom.datapos=q}if(v.showVerticalLine||v.showHorizontalLine){var B=v.cursorCanvas._ctx;B.clearRect(0,0,B.canvas.width,B.canvas.height);B=null}if(v.showCursorLegend){var A=j(u.targetId+" td.jqplot-cursor-legend-label");for(var s=0;s<A.length;s++){var y=j(A[s]).data("seriesIndex");var r=u.series[y];var x=r.label.toString();if(u.legend.escapeHtml){j(A[s]).text(j.jqplot.sprintf(v.cursorLegendFormatString,x,undefined,undefined))}else{j(A[s]).html(j.jqplot.sprintf(v.cursorLegendFormatString,x,undefined,undefined))}}}}}function b(r,q,u,t,s){var v=s.plugins.cursor;v.onGrid=true;if(v.show){v.previousCursor=r.target.style.cursor;r.target.style.cursor=v.style;if(v.showTooltip){e(q,u,s);if(v.followMouse){n(q,s)}else{m(s)}v._tooltipElem.show()}if(v.showVerticalLine||v.showHorizontalLine){g(q,s)}}}function i(r,q,u,t,s){var v=s.plugins.cursor;if(v.show){if(v.showTooltip){e(q,u,s);if(v.followMouse){n(q,s)}}if(v.showVerticalLine||v.showHorizontalLine){g(q,s)}}}function o(y){var x=y.data.plot;var t=x.eventCanvas._elem.offset();var w={x:y.pageX-t.left,y:y.pageY-t.top};var u={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null,yMidAxis:null};var v=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"];var q=x.axes;var r,s;for(r=11;r>0;r--){s=v[r-1];if(q[s].show){u[s]=q[s].series_p2u(w[s.charAt(0)])}}return{offsets:t,gridPos:w,dataPos:u}}function h(z){var x=z.data.plot;var y=x.plugins.cursor;if(y.show&&y.zoom&&y._zoom.started&&!y.zoomTarget){z.preventDefault();var B=y.zoomCanvas._ctx;var v=o(z);var w=v.gridPos;var t=v.dataPos;y._zoom.gridpos=w;y._zoom.datapos=t;y._zoom.zooming=true;var u=w.x;var s=w.y;var A=B.canvas.height;var q=B.canvas.width;if(y.showTooltip&&!y.onGrid&&y.showTooltipOutsideZoom){e(w,t,x);if(y.followMouse){n(w,x)}}if(y.constrainZoomTo=="x"){y._zoom.end=[u,A]}else{if(y.constrainZoomTo=="y"){y._zoom.end=[q,s]}else{y._zoom.end=[u,s]}}var r=window.getSelection;if(document.selection&&document.selection.empty){document.selection.empty()}else{if(r&&!r().isCollapsed){r().collapse()}}l.call(y);B=null}}function a(w,s,r,x,t){var v=t.plugins.cursor;if(t.plugins.mobile){j(document).one("vmouseup.jqplot_cursor",{plot:t},p)}else{j(document).one("mouseup.jqplot_cursor",{plot:t},p)}var u=t.axes;if(document.onselectstart!=undefined){v._oldHandlers.onselectstart=document.onselectstart;document.onselectstart=function(){return false}}if(document.ondrag!=undefined){v._oldHandlers.ondrag=document.ondrag;document.ondrag=function(){return false}}if(document.onmousedown!=undefined){v._oldHandlers.onmousedown=document.onmousedown;document.onmousedown=function(){return false}}if(v.zoom){if(!v.zoomProxy){var y=v.zoomCanvas._ctx;y.clearRect(0,0,y.canvas.width,y.canvas.height);y=null}if(v.constrainZoomTo=="x"){v._zoom.start=[s.x,0]}else{if(v.constrainZoomTo=="y"){v._zoom.start=[0,s.y]}else{v._zoom.start=[s.x,s.y]}}v._zoom.started=true;for(var q in r){v._zoom.axes.start[q]=r[q]}if(t.plugins.mobile){j(document).bind("vmousemove.jqplotCursor",{plot:t},h)}else{j(document).bind("mousemove.jqplotCursor",{plot:t},h)}}}function p(y){var v=y.data.plot;var x=v.plugins.cursor;if(x.zoom&&x._zoom.zooming&&!x.zoomTarget){var u=x._zoom.gridpos.x;var r=x._zoom.gridpos.y;var t=x._zoom.datapos;var z=x.zoomCanvas._ctx.canvas.height;var q=x.zoomCanvas._ctx.canvas.width;var w=v.axes;if(x.constrainOutsideZoom&&!x.onGrid){if(u<0){u=0}else{if(u>q){u=q}}if(r<0){r=0}else{if(r>z){r=z}}for(var s in t){if(t[s]){if(s.charAt(0)=="x"){t[s]=w[s].series_p2u(u)}else{t[s]=w[s].series_p2u(r)}}}}if(x.constrainZoomTo=="x"){r=z}else{if(x.constrainZoomTo=="y"){u=q}}x._zoom.end=[u,r];x._zoom.gridpos={x:u,y:r};x.doZoom(x._zoom.gridpos,t,v,x)}x._zoom.started=false;x._zoom.zooming=false;j(document).unbind("mousemove.jqplotCursor",h);if(document.onselectstart!=undefined&&x._oldHandlers.onselectstart!=null){document.onselectstart=x._oldHandlers.onselectstart;x._oldHandlers.onselectstart=null}if(document.ondrag!=undefined&&x._oldHandlers.ondrag!=null){document.ondrag=x._oldHandlers.ondrag;x._oldHandlers.ondrag=null}if(document.onmousedown!=undefined&&x._oldHandlers.onmousedown!=null){document.onmousedown=x._oldHandlers.onmousedown;x._oldHandlers.onmousedown=null}}function l(){var y=this._zoom.start;var u=this._zoom.end;var s=this.zoomCanvas._ctx;var r,v,x,q;if(u[0]>y[0]){r=y[0];q=u[0]-y[0]}else{r=u[0];q=y[0]-u[0]}if(u[1]>y[1]){v=y[1];x=u[1]-y[1]}else{v=u[1];x=y[1]-u[1]}s.fillStyle="rgba(0,0,0,0.2)";s.strokeStyle="#999999";s.lineWidth=1;s.clearRect(0,0,s.canvas.width,s.canvas.height);s.fillRect(0,0,s.canvas.width,s.canvas.height);s.clearRect(r,v,q,x);s.strokeRect(r,v,q,x);s=null}j.jqplot.CursorLegendRenderer=function(q){j.jqplot.TableLegendRenderer.call(this,q);this.formatString="%s"};j.jqplot.CursorLegendRenderer.prototype=new j.jqplot.TableLegendRenderer();j.jqplot.CursorLegendRenderer.prototype.constructor=j.jqplot.CursorLegendRenderer;j.jqplot.CursorLegendRenderer.prototype.draw=function(){if(this._elem){this._elem.emptyForce();this._elem=null}if(this.show){var w=this._series,A;var r=document.createElement("div");this._elem=j(r);r=null;this._elem.addClass("jqplot-legend jqplot-cursor-legend");this._elem.css("position","absolute");var q=false;for(var x=0;x<w.length;x++){A=w[x];if(A.show&&A.showLabel){var v=j.jqplot.sprintf(this.formatString,A.label.toString());if(v){var t=A.color;if(A._stack&&!A.fill){t=""}z.call(this,v,t,q,x);q=true}for(var u=0;u<j.jqplot.addLegendRowHooks.length;u++){var y=j.jqplot.addLegendRowHooks[u].call(this,A);if(y){z.call(this,y.label,y.color,q);q=true}}}}w=A=null;delete w;delete A}function z(D,C,F,s){var B=(F)?this.rowSpacing:"0";var E=j('<tr class="jqplot-legend jqplot-cursor-legend"></tr>').appendTo(this._elem);E.data("seriesIndex",s);j('<td class="jqplot-legend jqplot-cursor-legend-swatch" style="padding-top:'+B+';"><div style="border:1px solid #cccccc;padding:0.2em;"><div class="jqplot-cursor-legend-swatch" style="background-color:'+C+';"></div></div></td>').appendTo(E);var G=j('<td class="jqplot-legend jqplot-cursor-legend-label" style="vertical-align:middle;padding-top:'+B+';"></td>');G.appendTo(E);G.data("seriesIndex",s);if(this.escapeHtml){G.text(D)}else{G.html(D)}E=null;G=null}return this._elem}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.dateAxisRenderer.js
ADDED
@@ -0,0 +1,737 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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 it's 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 |
+
|
338 |
+
var tickInterval = this.tickInterval;
|
339 |
+
|
340 |
+
// if we already have ticks, use them.
|
341 |
+
// ticks must be in order of increasing value.
|
342 |
+
|
343 |
+
min = ((this.min != null) ? new $.jsDate(this.min).getTime() : db.min);
|
344 |
+
max = ((this.max != null) ? new $.jsDate(this.max).getTime() : db.max);
|
345 |
+
|
346 |
+
// see if we're zooming. if we are, don't use the min and max we're given,
|
347 |
+
// but compute some nice ones. They will be reset later.
|
348 |
+
|
349 |
+
var cursor = plot.plugins.cursor;
|
350 |
+
|
351 |
+
if (cursor && cursor._zoom && cursor._zoom.zooming) {
|
352 |
+
this.min = null;
|
353 |
+
this.max = null;
|
354 |
+
}
|
355 |
+
|
356 |
+
var range = max - min;
|
357 |
+
|
358 |
+
if (this.tickOptions == null || !this.tickOptions.formatString) {
|
359 |
+
this._overrideFormatString = true;
|
360 |
+
}
|
361 |
+
|
362 |
+
if (userTicks.length) {
|
363 |
+
// ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
|
364 |
+
for (i=0; i<userTicks.length; i++){
|
365 |
+
var ut = userTicks[i];
|
366 |
+
var t = new this.tickRenderer(this.tickOptions);
|
367 |
+
if (ut.constructor == Array) {
|
368 |
+
t.value = new $.jsDate(ut[0]).getTime();
|
369 |
+
t.label = ut[1];
|
370 |
+
if (!this.showTicks) {
|
371 |
+
t.showLabel = false;
|
372 |
+
t.showMark = false;
|
373 |
+
}
|
374 |
+
else if (!this.showTickMarks) {
|
375 |
+
t.showMark = false;
|
376 |
+
}
|
377 |
+
t.setTick(t.value, this.name);
|
378 |
+
this._ticks.push(t);
|
379 |
+
}
|
380 |
+
|
381 |
+
else {
|
382 |
+
t.value = new $.jsDate(ut).getTime();
|
383 |
+
if (!this.showTicks) {
|
384 |
+
t.showLabel = false;
|
385 |
+
t.showMark = false;
|
386 |
+
}
|
387 |
+
else if (!this.showTickMarks) {
|
388 |
+
t.showMark = false;
|
389 |
+
}
|
390 |
+
t.setTick(t.value, this.name);
|
391 |
+
this._ticks.push(t);
|
392 |
+
}
|
393 |
+
}
|
394 |
+
this.numberTicks = userTicks.length;
|
395 |
+
this.min = this._ticks[0].value;
|
396 |
+
this.max = this._ticks[this.numberTicks-1].value;
|
397 |
+
this.daTickInterval = [(this.max - this.min) / (this.numberTicks - 1)/1000, 'seconds'];
|
398 |
+
}
|
399 |
+
|
400 |
+
////////
|
401 |
+
// We don't have any ticks yet, let's make some!
|
402 |
+
////////
|
403 |
+
|
404 |
+
// special case when there is only one point, make three tick marks to center the point
|
405 |
+
else if (this.min == null && this.max == null && db.min == db.max)
|
406 |
+
{
|
407 |
+
var onePointOpts = $.extend(true, {}, this.tickOptions, {name: this.name, value: null});
|
408 |
+
var delta = 300000;
|
409 |
+
this.min = db.min - delta;
|
410 |
+
this.max = db.max + delta;
|
411 |
+
this.numberTicks = 3;
|
412 |
+
|
413 |
+
for(var i=this.min;i<=this.max;i+= delta)
|
414 |
+
{
|
415 |
+
onePointOpts.value = i;
|
416 |
+
|
417 |
+
var t = new this.tickRenderer(onePointOpts);
|
418 |
+
|
419 |
+
if (this._overrideFormatString && this._autoFormatString != '') {
|
420 |
+
t.formatString = this._autoFormatString;
|
421 |
+
}
|
422 |
+
|
423 |
+
t.showLabel = false;
|
424 |
+
t.showMark = false;
|
425 |
+
|
426 |
+
this._ticks.push(t);
|
427 |
+
}
|
428 |
+
|
429 |
+
if(this.showTicks) {
|
430 |
+
this._ticks[1].showLabel = true;
|
431 |
+
}
|
432 |
+
if(this.showTickMarks) {
|
433 |
+
this._ticks[1].showTickMarks = true;
|
434 |
+
}
|
435 |
+
}
|
436 |
+
// if user specified min and max are null, we set those to make best ticks.
|
437 |
+
else if (this.min == null && this.max == null) {
|
438 |
+
|
439 |
+
var opts = $.extend(true, {}, this.tickOptions, {name: this.name, value: null});
|
440 |
+
|
441 |
+
// want to find a nice interval
|
442 |
+
var nttarget,
|
443 |
+
titarget;
|
444 |
+
|
445 |
+
// if no tickInterval or numberTicks options specified, make a good guess.
|
446 |
+
if (!this.tickInterval && !this.numberTicks) {
|
447 |
+
var tdim = Math.max(dim, threshold+1);
|
448 |
+
// how many ticks to put on the axis?
|
449 |
+
// date labels tend to be long. If ticks not rotated,
|
450 |
+
// don't use too many and have a high spacing factor.
|
451 |
+
// If we are rotating ticks, use a lower factor.
|
452 |
+
var spacingFactor = 115;
|
453 |
+
if (this.tickRenderer === $.jqplot.CanvasAxisTickRenderer && this.tickOptions.angle) {
|
454 |
+
spacingFactor = 115 - 40 * Math.abs(Math.sin(this.tickOptions.angle/180*Math.PI));
|
455 |
+
}
|
456 |
+
|
457 |
+
nttarget = Math.ceil((tdim-threshold)/spacingFactor + 1);
|
458 |
+
titarget = (max - min) / (nttarget - 1);
|
459 |
+
}
|
460 |
+
|
461 |
+
// If tickInterval is specified, we'll try to honor it.
|
462 |
+
// Not gauranteed to get this interval, but we'll get as close as
|
463 |
+
// we can.
|
464 |
+
// tickInterval will be used before numberTicks, that is if
|
465 |
+
// both are specified, numberTicks will be ignored.
|
466 |
+
else if (this.tickInterval) {
|
467 |
+
titarget = this.tickInterval;
|
468 |
+
}
|
469 |
+
|
470 |
+
// if numberTicks specified, try to honor it.
|
471 |
+
// Not gauranteed, but will try to get close.
|
472 |
+
else if (this.numberTicks) {
|
473 |
+
nttarget = this.numberTicks;
|
474 |
+
titarget = (max - min) / (nttarget - 1);
|
475 |
+
}
|
476 |
+
|
477 |
+
// If we can use an interval of 2 weeks or less, pick best one
|
478 |
+
if (titarget <= 19*day) {
|
479 |
+
var ret = bestDateInterval(min, max, titarget);
|
480 |
+
var tempti = ret[0];
|
481 |
+
this._autoFormatString = ret[1];
|
482 |
+
|
483 |
+
min = Math.floor(min/tempti) * tempti;
|
484 |
+
min = new $.jsDate(min);
|
485 |
+
min = min.getTime() + min.getUtcOffset();
|
486 |
+
|
487 |
+
nttarget = Math.ceil((max - min) / tempti) + 1;
|
488 |
+
this.min = min;
|
489 |
+
this.max = min + (nttarget - 1) * tempti;
|
490 |
+
|
491 |
+
// if max is less than max, add an interval
|
492 |
+
if (this.max < max) {
|
493 |
+
this.max += tempti;
|
494 |
+
nttarget += 1;
|
495 |
+
}
|
496 |
+
this.tickInterval = tempti;
|
497 |
+
this.numberTicks = nttarget;
|
498 |
+
|
499 |
+
for (var i=0; i<nttarget; i++) {
|
500 |
+
opts.value = this.min + i * tempti;
|
501 |
+
t = new this.tickRenderer(opts);
|
502 |
+
|
503 |
+
if (this._overrideFormatString && this._autoFormatString != '') {
|
504 |
+
t.formatString = this._autoFormatString;
|
505 |
+
}
|
506 |
+
if (!this.showTicks) {
|
507 |
+
t.showLabel = false;
|
508 |
+
t.showMark = false;
|
509 |
+
}
|
510 |
+
else if (!this.showTickMarks) {
|
511 |
+
t.showMark = false;
|
512 |
+
}
|
513 |
+
this._ticks.push(t);
|
514 |
+
}
|
515 |
+
|
516 |
+
insetMult = this.tickInterval;
|
517 |
+
}
|
518 |
+
|
519 |
+
// should we use a monthly interval?
|
520 |
+
else if (titarget <= 9 * month) {
|
521 |
+
|
522 |
+
this._autoFormatString = '%v';
|
523 |
+
|
524 |
+
// how many months in an interval?
|
525 |
+
var intv = Math.round(titarget/month);
|
526 |
+
if (intv < 1) {
|
527 |
+
intv = 1;
|
528 |
+
}
|
529 |
+
else if (intv > 6) {
|
530 |
+
intv = 6;
|
531 |
+
}
|
532 |
+
|
533 |
+
// figure out the starting month and ending month.
|
534 |
+
var mstart = new $.jsDate(min).setDate(1).setHours(0,0,0,0);
|
535 |
+
|
536 |
+
// See if max ends exactly on a month
|
537 |
+
var tempmend = new $.jsDate(max);
|
538 |
+
var mend = new $.jsDate(max).setDate(1).setHours(0,0,0,0);
|
539 |
+
|
540 |
+
if (tempmend.getTime() !== mend.getTime()) {
|
541 |
+
mend = mend.add(1, 'month');
|
542 |
+
}
|
543 |
+
|
544 |
+
var nmonths = mend.diff(mstart, 'month');
|
545 |
+
|
546 |
+
nttarget = Math.ceil(nmonths/intv) + 1;
|
547 |
+
|
548 |
+
this.min = mstart.getTime();
|
549 |
+
this.max = mstart.clone().add((nttarget - 1) * intv, 'month').getTime();
|
550 |
+
this.numberTicks = nttarget;
|
551 |
+
|
552 |
+
for (var i=0; i<nttarget; i++) {
|
553 |
+
if (i === 0) {
|
554 |
+
opts.value = mstart.getTime();
|
555 |
+
}
|
556 |
+
else {
|
557 |
+
opts.value = mstart.add(intv, 'month').getTime();
|
558 |
+
}
|
559 |
+
t = new this.tickRenderer(opts);
|
560 |
+
|
561 |
+
if (this._overrideFormatString && this._autoFormatString != '') {
|
562 |
+
t.formatString = this._autoFormatString;
|
563 |
+
}
|
564 |
+
if (!this.showTicks) {
|
565 |
+
t.showLabel = false;
|
566 |
+
t.showMark = false;
|
567 |
+
}
|
568 |
+
else if (!this.showTickMarks) {
|
569 |
+
t.showMark = false;
|
570 |
+
}
|
571 |
+
this._ticks.push(t);
|
572 |
+
}
|
573 |
+
|
574 |
+
insetMult = intv * month;
|
575 |
+
}
|
576 |
+
|
577 |
+
// use yearly intervals
|
578 |
+
else {
|
579 |
+
|
580 |
+
this._autoFormatString = '%v';
|
581 |
+
|
582 |
+
// how many years in an interval?
|
583 |
+
var intv = Math.round(titarget/year);
|
584 |
+
if (intv < 1) {
|
585 |
+
intv = 1;
|
586 |
+
}
|
587 |
+
|
588 |
+
// figure out the starting and ending years.
|
589 |
+
var mstart = new $.jsDate(min).setMonth(0, 1).setHours(0,0,0,0);
|
590 |
+
var mend = new $.jsDate(max).add(1, 'year').setMonth(0, 1).setHours(0,0,0,0);
|
591 |
+
|
592 |
+
var nyears = mend.diff(mstart, 'year');
|
593 |
+
|
594 |
+
nttarget = Math.ceil(nyears/intv) + 1;
|
595 |
+
|
596 |
+
this.min = mstart.getTime();
|
597 |
+
this.max = mstart.clone().add((nttarget - 1) * intv, 'year').getTime();
|
598 |
+
this.numberTicks = nttarget;
|
599 |
+
|
600 |
+
for (var i=0; i<nttarget; i++) {
|
601 |
+
if (i === 0) {
|
602 |
+
opts.value = mstart.getTime();
|
603 |
+
}
|
604 |
+
else {
|
605 |
+
opts.value = mstart.add(intv, 'year').getTime();
|
606 |
+
}
|
607 |
+
t = new this.tickRenderer(opts);
|
608 |
+
|
609 |
+
if (this._overrideFormatString && this._autoFormatString != '') {
|
610 |
+
t.formatString = this._autoFormatString;
|
611 |
+
}
|
612 |
+
if (!this.showTicks) {
|
613 |
+
t.showLabel = false;
|
614 |
+
t.showMark = false;
|
615 |
+
}
|
616 |
+
else if (!this.showTickMarks) {
|
617 |
+
t.showMark = false;
|
618 |
+
}
|
619 |
+
this._ticks.push(t);
|
620 |
+
}
|
621 |
+
|
622 |
+
insetMult = intv * year;
|
623 |
+
}
|
624 |
+
}
|
625 |
+
|
626 |
+
////////
|
627 |
+
// Some option(s) specified, work around that.
|
628 |
+
////////
|
629 |
+
|
630 |
+
else {
|
631 |
+
if (name == 'xaxis' || name == 'x2axis') {
|
632 |
+
dim = this._plotDimensions.width;
|
633 |
+
}
|
634 |
+
else {
|
635 |
+
dim = this._plotDimensions.height;
|
636 |
+
}
|
637 |
+
|
638 |
+
// if min, max and number of ticks specified, user can't specify interval.
|
639 |
+
if (this.min != null && this.max != null && this.numberTicks != null) {
|
640 |
+
this.tickInterval = null;
|
641 |
+
}
|
642 |
+
|
643 |
+
// if user specified a tick interval, convert to usable.
|
644 |
+
if (this.tickInterval != null)
|
645 |
+
{
|
646 |
+
// if interval is a number or can be converted to one, use it.
|
647 |
+
// Assume it is in SECONDS!!!
|
648 |
+
if (Number(this.tickInterval)) {
|
649 |
+
this.daTickInterval = [Number(this.tickInterval), 'seconds'];
|
650 |
+
}
|
651 |
+
// else, parse out something we can build from.
|
652 |
+
else if (typeof this.tickInterval == "string") {
|
653 |
+
var parts = this.tickInterval.split(' ');
|
654 |
+
if (parts.length == 1) {
|
655 |
+
this.daTickInterval = [1, parts[0]];
|
656 |
+
}
|
657 |
+
else if (parts.length == 2) {
|
658 |
+
this.daTickInterval = [parts[0], parts[1]];
|
659 |
+
}
|
660 |
+
}
|
661 |
+
}
|
662 |
+
|
663 |
+
// if min and max are same, space them out a bit
|
664 |
+
if (min == max) {
|
665 |
+
var adj = 24*60*60*500; // 1/2 day
|
666 |
+
min -= adj;
|
667 |
+
max += adj;
|
668 |
+
}
|
669 |
+
|
670 |
+
range = max - min;
|
671 |
+
|
672 |
+
var optNumTicks = 2 + parseInt(Math.max(0, dim-100)/100, 10);
|
673 |
+
|
674 |
+
|
675 |
+
var rmin, rmax;
|
676 |
+
|
677 |
+
rmin = (this.min != null) ? new $.jsDate(this.min).getTime() : min - range/2*(this.padMin - 1);
|
678 |
+
rmax = (this.max != null) ? new $.jsDate(this.max).getTime() : max + range/2*(this.padMax - 1);
|
679 |
+
this.min = rmin;
|
680 |
+
this.max = rmax;
|
681 |
+
range = this.max - this.min;
|
682 |
+
|
683 |
+
if (this.numberTicks == null){
|
684 |
+
// if tickInterval is specified by user, we will ignore computed maximum.
|
685 |
+
// max will be equal or greater to fit even # of ticks.
|
686 |
+
if (this.daTickInterval != null) {
|
687 |
+
var nc = new $.jsDate(this.max).diff(this.min, this.daTickInterval[1], true);
|
688 |
+
this.numberTicks = Math.ceil(nc/this.daTickInterval[0]) +1;
|
689 |
+
// this.max = new $.jsDate(this.min).add(this.numberTicks-1, this.daTickInterval[1]).getTime();
|
690 |
+
this.max = new $.jsDate(this.min).add((this.numberTicks-1) * this.daTickInterval[0], this.daTickInterval[1]).getTime();
|
691 |
+
}
|
692 |
+
else if (dim > 200) {
|
693 |
+
this.numberTicks = parseInt(3+(dim-200)/100, 10);
|
694 |
+
}
|
695 |
+
else {
|
696 |
+
this.numberTicks = 2;
|
697 |
+
}
|
698 |
+
}
|
699 |
+
|
700 |
+
insetMult = range / (this.numberTicks-1)/1000;
|
701 |
+
|
702 |
+
if (this.daTickInterval == null) {
|
703 |
+
this.daTickInterval = [insetMult, 'seconds'];
|
704 |
+
}
|
705 |
+
|
706 |
+
|
707 |
+
for (var i=0; i<this.numberTicks; i++){
|
708 |
+
var min = new $.jsDate(this.min);
|
709 |
+
tt = min.add(i*this.daTickInterval[0], this.daTickInterval[1]).getTime();
|
710 |
+
var t = new this.tickRenderer(this.tickOptions);
|
711 |
+
// var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
|
712 |
+
if (!this.showTicks) {
|
713 |
+
t.showLabel = false;
|
714 |
+
t.showMark = false;
|
715 |
+
}
|
716 |
+
else if (!this.showTickMarks) {
|
717 |
+
t.showMark = false;
|
718 |
+
}
|
719 |
+
t.setTick(tt, this.name);
|
720 |
+
this._ticks.push(t);
|
721 |
+
}
|
722 |
+
}
|
723 |
+
|
724 |
+
if (this.tickInset) {
|
725 |
+
this.min = this.min - this.tickInset * insetMult;
|
726 |
+
this.max = this.max + this.tickInset * insetMult;
|
727 |
+
}
|
728 |
+
|
729 |
+
if (this._daTickInterval == null) {
|
730 |
+
this._daTickInterval = this.daTickInterval;
|
731 |
+
}
|
732 |
+
|
733 |
+
ticks = null;
|
734 |
+
};
|
735 |
+
|
736 |
+
})(jQuery);
|
737 |
+
|
backend/settings/assets/js/jqPlot/plugins/jqplot.dateAxisRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(h){h.jqplot.DateAxisRenderer=function(){h.jqplot.LinearAxisRenderer.call(this);this.date=new h.jsDate()};var c=1000;var e=60*c;var f=60*e;var l=24*f;var b=7*l;var j=30.4368499*l;var k=365.242199*l;var g=[31,28,31,30,31,30,31,30,31,30,31,30];var i=["%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"];var m=[0.1*c,0.2*c,0.5*c,c,2*c,5*c,10*c,15*c,30*c,e,2*e,5*e,10*e,15*e,30*e,f,2*f,4*f,6*f,8*f,12*f,l,2*l,3*l,4*l,5*l,b,2*b];var d=[];function a(p,s,t){var o=Number.MAX_VALUE;var u,r,v;for(var q=0,n=m.length;q<n;q++){u=Math.abs(t-m[q]);if(u<o){o=u;r=m[q];v=i[q]}}return[r,v]}h.jqplot.DateAxisRenderer.prototype=new h.jqplot.LinearAxisRenderer();h.jqplot.DateAxisRenderer.prototype.constructor=h.jqplot.DateAxisRenderer;h.jqplot.DateTickFormatter=function(n,o){if(!n){n="%Y/%m/%d"}return h.jsDate.strftime(o,n)};h.jqplot.DateAxisRenderer.prototype.init=function(E){this.tickOptions.formatter=h.jqplot.DateTickFormatter;this.tickInset=0;this.drawBaseline=true;this.baselineWidth=null;this.baselineColor=null;this.daTickInterval=null;this._daTickInterval=null;h.extend(true,this,E);var C=this._dataBounds,u,x,D,y,A,z,o;for(var t=0;t<this._series.length;t++){u={intervals:[],frequencies:{},sortedIntervals:[],min:null,max:null,mean:null};x=0;D=this._series[t];y=D.data;A=D._plotData;z=D._stackData;o=0;for(var r=0;r<y.length;r++){if(this.name=="xaxis"||this.name=="x2axis"){y[r][0]=new h.jsDate(y[r][0]).getTime();A[r][0]=new h.jsDate(y[r][0]).getTime();z[r][0]=new h.jsDate(y[r][0]).getTime();if((y[r][0]!=null&&y[r][0]<C.min)||C.min==null){C.min=y[r][0]}if((y[r][0]!=null&&y[r][0]>C.max)||C.max==null){C.max=y[r][0]}if(r>0){o=Math.abs(y[r][0]-y[r-1][0]);u.intervals.push(o);if(u.frequencies.hasOwnProperty(o)){u.frequencies[o]+=1}else{u.frequencies[o]=1}}x+=o}else{y[r][1]=new h.jsDate(y[r][1]).getTime();A[r][1]=new h.jsDate(y[r][1]).getTime();z[r][1]=new h.jsDate(y[r][1]).getTime();if((y[r][1]!=null&&y[r][1]<C.min)||C.min==null){C.min=y[r][1]}if((y[r][1]!=null&&y[r][1]>C.max)||C.max==null){C.max=y[r][1]}if(r>0){o=Math.abs(y[r][1]-y[r-1][1]);u.intervals.push(o);if(u.frequencies.hasOwnProperty(o)){u.frequencies[o]+=1}else{u.frequencies[o]=1}}}x+=o}if(D.renderer.bands){if(D.renderer.bands.hiData.length){var w=D.renderer.bands.hiData;for(var r=0,q=w.length;r<q;r++){if(this.name==="xaxis"||this.name==="x2axis"){w[r][0]=new h.jsDate(w[r][0]).getTime();if((w[r][0]!=null&&w[r][0]>C.max)||C.max==null){C.max=w[r][0]}}else{w[r][1]=new h.jsDate(w[r][1]).getTime();if((w[r][1]!=null&&w[r][1]>C.max)||C.max==null){C.max=w[r][1]}}}}if(D.renderer.bands.lowData.length){var w=D.renderer.bands.lowData;for(var r=0,q=w.length;r<q;r++){if(this.name==="xaxis"||this.name==="x2axis"){w[r][0]=new h.jsDate(w[r][0]).getTime();if((w[r][0]!=null&&w[r][0]<C.min)||C.min==null){C.min=w[r][0]}}else{w[r][1]=new h.jsDate(w[r][1]).getTime();if((w[r][1]!=null&&w[r][1]<C.min)||C.min==null){C.min=w[r][1]}}}}}var B=0,v=0;for(var p in u.frequencies){u.sortedIntervals.push({interval:p,frequency:u.frequencies[p]})}u.sortedIntervals.sort(function(s,n){return n.frequency-s.frequency});u.min=h.jqplot.arrayMin(u.intervals);u.max=h.jqplot.arrayMax(u.intervals);u.mean=x/y.length;this._intervalStats.push(u);u=x=D=y=A=z=null}C=null};h.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="";if(this._overrideFormatString&&this.tickOptions&&this.tickOptions.formatString){this.tickOptions.formatString=""}this.daTickInterval=this._daTickInterval};h.jqplot.DateAxisRenderer.prototype.createTicks=function(p){var W=this._ticks;var L=this.ticks;var F=this.name;var H=this._dataBounds;var M=this._intervalStats;var n=(this.name.charAt(0)==="x")?this._plotDimensions.width:this._plotDimensions.height;var w;var ad,J;var y,x;var ac,Z;var s=30;var O=1;var v=this.tickInterval;ad=((this.min!=null)?new h.jsDate(this.min).getTime():H.min);J=((this.max!=null)?new h.jsDate(this.max).getTime():H.max);var A=p.plugins.cursor;if(A&&A._zoom&&A._zoom.zooming){this.min=null;this.max=null}var B=J-ad;if(this.tickOptions==null||!this.tickOptions.formatString){this._overrideFormatString=true}if(L.length){for(Z=0;Z<L.length;Z++){var P=L[Z];var X=new this.tickRenderer(this.tickOptions);if(P.constructor==Array){X.value=new h.jsDate(P[0]).getTime();X.label=P[1];if(!this.showTicks){X.showLabel=false;X.showMark=false}else{if(!this.showTickMarks){X.showMark=false}}X.setTick(X.value,this.name);this._ticks.push(X)}else{X.value=new h.jsDate(P).getTime();if(!this.showTicks){X.showLabel=false;X.showMark=false}else{if(!this.showTickMarks){X.showMark=false}}X.setTick(X.value,this.name);this._ticks.push(X)}}this.numberTicks=L.length;this.min=this._ticks[0].value;this.max=this._ticks[this.numberTicks-1].value;this.daTickInterval=[(this.max-this.min)/(this.numberTicks-1)/1000,"seconds"]}else{if(this.min==null&&this.max==null&&H.min==H.max){var E=h.extend(true,{},this.tickOptions,{name:this.name,value:null});var S=300000;this.min=H.min-S;this.max=H.max+S;this.numberTicks=3;for(var Z=this.min;Z<=this.max;Z+=S){E.value=Z;var X=new this.tickRenderer(E);if(this._overrideFormatString&&this._autoFormatString!=""){X.formatString=this._autoFormatString}X.showLabel=false;X.showMark=false;this._ticks.push(X)}if(this.showTicks){this._ticks[1].showLabel=true}if(this.showTickMarks){this._ticks[1].showTickMarks=true}}else{if(this.min==null&&this.max==null){var N=h.extend(true,{},this.tickOptions,{name:this.name,value:null});var ab,I;if(!this.tickInterval&&!this.numberTicks){var R=Math.max(n,s+1);var Y=115;if(this.tickRenderer===h.jqplot.CanvasAxisTickRenderer&&this.tickOptions.angle){Y=115-40*Math.abs(Math.sin(this.tickOptions.angle/180*Math.PI))}ab=Math.ceil((R-s)/Y+1);I=(J-ad)/(ab-1)}else{if(this.tickInterval){I=this.tickInterval}else{if(this.numberTicks){ab=this.numberTicks;I=(J-ad)/(ab-1)}}}if(I<=19*l){var Q=a(ad,J,I);var r=Q[0];this._autoFormatString=Q[1];ad=Math.floor(ad/r)*r;ad=new h.jsDate(ad);ad=ad.getTime()+ad.getUtcOffset();ab=Math.ceil((J-ad)/r)+1;this.min=ad;this.max=ad+(ab-1)*r;if(this.max<J){this.max+=r;ab+=1}this.tickInterval=r;this.numberTicks=ab;for(var Z=0;Z<ab;Z++){N.value=this.min+Z*r;X=new this.tickRenderer(N);if(this._overrideFormatString&&this._autoFormatString!=""){X.formatString=this._autoFormatString}if(!this.showTicks){X.showLabel=false;X.showMark=false}else{if(!this.showTickMarks){X.showMark=false}}this._ticks.push(X)}O=this.tickInterval}else{if(I<=9*j){this._autoFormatString="%v";var D=Math.round(I/j);if(D<1){D=1}else{if(D>6){D=6}}var U=new h.jsDate(ad).setDate(1).setHours(0,0,0,0);var q=new h.jsDate(J);var z=new h.jsDate(J).setDate(1).setHours(0,0,0,0);if(q.getTime()!==z.getTime()){z=z.add(1,"month")}var T=z.diff(U,"month");ab=Math.ceil(T/D)+1;this.min=U.getTime();this.max=U.clone().add((ab-1)*D,"month").getTime();this.numberTicks=ab;for(var Z=0;Z<ab;Z++){if(Z===0){N.value=U.getTime()}else{N.value=U.add(D,"month").getTime()}X=new this.tickRenderer(N);if(this._overrideFormatString&&this._autoFormatString!=""){X.formatString=this._autoFormatString}if(!this.showTicks){X.showLabel=false;X.showMark=false}else{if(!this.showTickMarks){X.showMark=false}}this._ticks.push(X)}O=D*j}else{this._autoFormatString="%v";var D=Math.round(I/k);if(D<1){D=1}var U=new h.jsDate(ad).setMonth(0,1).setHours(0,0,0,0);var z=new h.jsDate(J).add(1,"year").setMonth(0,1).setHours(0,0,0,0);var K=z.diff(U,"year");ab=Math.ceil(K/D)+1;this.min=U.getTime();this.max=U.clone().add((ab-1)*D,"year").getTime();this.numberTicks=ab;for(var Z=0;Z<ab;Z++){if(Z===0){N.value=U.getTime()}else{N.value=U.add(D,"year").getTime()}X=new this.tickRenderer(N);if(this._overrideFormatString&&this._autoFormatString!=""){X.formatString=this._autoFormatString}if(!this.showTicks){X.showLabel=false;X.showMark=false}else{if(!this.showTickMarks){X.showMark=false}}this._ticks.push(X)}O=D*k}}}else{if(F=="xaxis"||F=="x2axis"){n=this._plotDimensions.width}else{n=this._plotDimensions.height}if(this.min!=null&&this.max!=null&&this.numberTicks!=null){this.tickInterval=null}if(this.tickInterval!=null){if(Number(this.tickInterval)){this.daTickInterval=[Number(this.tickInterval),"seconds"]}else{if(typeof this.tickInterval=="string"){var aa=this.tickInterval.split(" ");if(aa.length==1){this.daTickInterval=[1,aa[0]]}else{if(aa.length==2){this.daTickInterval=[aa[0],aa[1]]}}}}}if(ad==J){var o=24*60*60*500;ad-=o;J+=o}B=J-ad;var G=2+parseInt(Math.max(0,n-100)/100,10);var V,C;V=(this.min!=null)?new h.jsDate(this.min).getTime():ad-B/2*(this.padMin-1);C=(this.max!=null)?new h.jsDate(this.max).getTime():J+B/2*(this.padMax-1);this.min=V;this.max=C;B=this.max-this.min;if(this.numberTicks==null){if(this.daTickInterval!=null){var u=new h.jsDate(this.max).diff(this.min,this.daTickInterval[1],true);this.numberTicks=Math.ceil(u/this.daTickInterval[0])+1;this.max=new h.jsDate(this.min).add((this.numberTicks-1)*this.daTickInterval[0],this.daTickInterval[1]).getTime()}else{if(n>200){this.numberTicks=parseInt(3+(n-200)/100,10)}else{this.numberTicks=2}}}O=B/(this.numberTicks-1)/1000;if(this.daTickInterval==null){this.daTickInterval=[O,"seconds"]}for(var Z=0;Z<this.numberTicks;Z++){var ad=new h.jsDate(this.min);ac=ad.add(Z*this.daTickInterval[0],this.daTickInterval[1]).getTime();var X=new this.tickRenderer(this.tickOptions);if(!this.showTicks){X.showLabel=false;X.showMark=false}else{if(!this.showTickMarks){X.showMark=false}}X.setTick(ac,this.name);this._ticks.push(X)}}}}if(this.tickInset){this.min=this.min-this.tickInset*O;this.max=this.max+this.tickInset*O}if(this._daTickInterval==null){this._daTickInterval=this.daTickInterval}W=null}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.donutRenderer.js
ADDED
@@ -0,0 +1,805 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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.DonutRenderer
|
34 |
+
* Plugin renderer to draw a donut 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 |
+
* donut renderer plugin, for example:
|
40 |
+
*
|
41 |
+
* > <script type="text/javascript" src="plugins/jqplot.donutRenderer.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.DonutRenderer,
|
49 |
+
* > rendererOptions:{
|
50 |
+
* > sliceMargin: 2,
|
51 |
+
* > innerDiameter: 110,
|
52 |
+
* > startAngle: -90
|
53 |
+
* > }
|
54 |
+
* > }
|
55 |
+
* > });
|
56 |
+
*
|
57 |
+
* A donut plot will trigger events on the plot target
|
58 |
+
* according to user interaction. All events return the event object,
|
59 |
+
* the series index, the point (slice) index, and the point data for
|
60 |
+
* the appropriate slice.
|
61 |
+
*
|
62 |
+
* 'jqplotDataMouseOver' - triggered when user mouseing over a slice.
|
63 |
+
* 'jqplotDataHighlight' - triggered the first time user mouses over a slice,
|
64 |
+
* if highlighting is enabled.
|
65 |
+
* 'jqplotDataUnhighlight' - triggered when a user moves the mouse out of
|
66 |
+
* a highlighted slice.
|
67 |
+
* 'jqplotDataClick' - triggered when the user clicks on a slice.
|
68 |
+
* 'jqplotDataRightClick' - tiggered when the user right clicks on a slice if
|
69 |
+
* the "captureRightClick" option is set to true on the plot.
|
70 |
+
*/
|
71 |
+
$.jqplot.DonutRenderer = function(){
|
72 |
+
$.jqplot.LineRenderer.call(this);
|
73 |
+
};
|
74 |
+
|
75 |
+
$.jqplot.DonutRenderer.prototype = new $.jqplot.LineRenderer();
|
76 |
+
$.jqplot.DonutRenderer.prototype.constructor = $.jqplot.DonutRenderer;
|
77 |
+
|
78 |
+
// called with scope of a series
|
79 |
+
$.jqplot.DonutRenderer.prototype.init = function(options, plot) {
|
80 |
+
// Group: Properties
|
81 |
+
//
|
82 |
+
// prop: diameter
|
83 |
+
// Outer diameter of the donut, auto computed by default
|
84 |
+
this.diameter = null;
|
85 |
+
// prop: innerDiameter
|
86 |
+
// Inner diameter of the donut, auto calculated by default.
|
87 |
+
// If specified will override thickness value.
|
88 |
+
this.innerDiameter = null;
|
89 |
+
// prop: thickness
|
90 |
+
// thickness of the donut, auto computed by default
|
91 |
+
// Overridden by if innerDiameter is specified.
|
92 |
+
this.thickness = null;
|
93 |
+
// prop: padding
|
94 |
+
// padding between the donut and plot edges, legend, etc.
|
95 |
+
this.padding = 20;
|
96 |
+
// prop: sliceMargin
|
97 |
+
// angular spacing between donut slices in degrees.
|
98 |
+
this.sliceMargin = 0;
|
99 |
+
// prop: ringMargin
|
100 |
+
// pixel distance between rings, or multiple series in a donut plot.
|
101 |
+
// null will compute ringMargin based on sliceMargin.
|
102 |
+
this.ringMargin = null;
|
103 |
+
// prop: fill
|
104 |
+
// true or false, wether to fil the slices.
|
105 |
+
this.fill = true;
|
106 |
+
// prop: shadowOffset
|
107 |
+
// offset of the shadow from the slice and offset of
|
108 |
+
// each succesive stroke of the shadow from the last.
|
109 |
+
this.shadowOffset = 2;
|
110 |
+
// prop: shadowAlpha
|
111 |
+
// transparency of the shadow (0 = transparent, 1 = opaque)
|
112 |
+
this.shadowAlpha = 0.07;
|
113 |
+
// prop: shadowDepth
|
114 |
+
// number of strokes to apply to the shadow,
|
115 |
+
// each stroke offset shadowOffset from the last.
|
116 |
+
this.shadowDepth = 5;
|
117 |
+
// prop: highlightMouseOver
|
118 |
+
// True to highlight slice when moused over.
|
119 |
+
// This must be false to enable highlightMouseDown to highlight when clicking on a slice.
|
120 |
+
this.highlightMouseOver = true;
|
121 |
+
// prop: highlightMouseDown
|
122 |
+
// True to highlight when a mouse button is pressed over a slice.
|
123 |
+
// This will be disabled if highlightMouseOver is true.
|
124 |
+
this.highlightMouseDown = false;
|
125 |
+
// prop: highlightColors
|
126 |
+
// an array of colors to use when highlighting a slice.
|
127 |
+
this.highlightColors = [];
|
128 |
+
// prop: dataLabels
|
129 |
+
// Either 'label', 'value', 'percent' or an array of labels to place on the pie slices.
|
130 |
+
// Defaults to percentage of each pie slice.
|
131 |
+
this.dataLabels = 'percent';
|
132 |
+
// prop: showDataLabels
|
133 |
+
// true to show data labels on slices.
|
134 |
+
this.showDataLabels = false;
|
135 |
+
// prop: dataLabelFormatString
|
136 |
+
// Format string for data labels. If none, '%s' is used for "label" and for arrays, '%d' for value and '%d%%' for percentage.
|
137 |
+
this.dataLabelFormatString = null;
|
138 |
+
// prop: dataLabelThreshold
|
139 |
+
// Threshhold in percentage (0 - 100) of pie area, below which no label will be displayed.
|
140 |
+
// This applies to all label types, not just to percentage labels.
|
141 |
+
this.dataLabelThreshold = 3;
|
142 |
+
// prop: dataLabelPositionFactor
|
143 |
+
// A Multiplier (0-1) of the pie radius which controls position of label on slice.
|
144 |
+
// Increasing will slide label toward edge of pie, decreasing will slide label toward center of pie.
|
145 |
+
this.dataLabelPositionFactor = 0.4;
|
146 |
+
// prop: dataLabelNudge
|
147 |
+
// Number of pixels to slide the label away from (+) or toward (-) the center of the pie.
|
148 |
+
this.dataLabelNudge = 0;
|
149 |
+
// prop: startAngle
|
150 |
+
// Angle to start drawing donut in degrees.
|
151 |
+
// According to orientation of canvas coordinate system:
|
152 |
+
// 0 = on the positive x axis
|
153 |
+
// -90 = on the positive y axis.
|
154 |
+
// 90 = on the negaive y axis.
|
155 |
+
// 180 or - 180 = on the negative x axis.
|
156 |
+
this.startAngle = 0;
|
157 |
+
this.tickRenderer = $.jqplot.DonutTickRenderer;
|
158 |
+
// Used as check for conditions where donut shouldn't be drawn.
|
159 |
+
this._drawData = true;
|
160 |
+
this._type = 'donut';
|
161 |
+
|
162 |
+
// if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
|
163 |
+
if (options.highlightMouseDown && options.highlightMouseOver == null) {
|
164 |
+
options.highlightMouseOver = false;
|
165 |
+
}
|
166 |
+
|
167 |
+
$.extend(true, this, options);
|
168 |
+
if (this.diameter != null) {
|
169 |
+
this.diameter = this.diameter - this.sliceMargin;
|
170 |
+
}
|
171 |
+
this._diameter = null;
|
172 |
+
this._innerDiameter = null;
|
173 |
+
this._radius = null;
|
174 |
+
this._innerRadius = null;
|
175 |
+
this._thickness = null;
|
176 |
+
// references to the previous series in the plot to properly calculate diameters
|
177 |
+
// and thicknesses of nested rings.
|
178 |
+
this._previousSeries = [];
|
179 |
+
this._numberSeries = 1;
|
180 |
+
// array of [start,end] angles arrays, one for each slice. In radians.
|
181 |
+
this._sliceAngles = [];
|
182 |
+
// index of the currenty highlighted point, if any
|
183 |
+
this._highlightedPoint = null;
|
184 |
+
|
185 |
+
// set highlight colors if none provided
|
186 |
+
if (this.highlightColors.length == 0) {
|
187 |
+
for (var i=0; i<this.seriesColors.length; i++){
|
188 |
+
var rgba = $.jqplot.getColorComponents(this.seriesColors[i]);
|
189 |
+
var newrgb = [rgba[0], rgba[1], rgba[2]];
|
190 |
+
var sum = newrgb[0] + newrgb[1] + newrgb[2];
|
191 |
+
for (var j=0; j<3; j++) {
|
192 |
+
// when darkening, lowest color component can be is 60.
|
193 |
+
newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]);
|
194 |
+
newrgb[j] = parseInt(newrgb[j], 10);
|
195 |
+
}
|
196 |
+
this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
plot.postParseOptionsHooks.addOnce(postParseOptions);
|
201 |
+
plot.postInitHooks.addOnce(postInit);
|
202 |
+
plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
|
203 |
+
plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
|
204 |
+
plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
|
205 |
+
plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
|
206 |
+
plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
|
207 |
+
plot.postDrawHooks.addOnce(postPlotDraw);
|
208 |
+
|
209 |
+
|
210 |
+
};
|
211 |
+
|
212 |
+
$.jqplot.DonutRenderer.prototype.setGridData = function(plot) {
|
213 |
+
// set gridData property. This will hold angle in radians of each data point.
|
214 |
+
var stack = [];
|
215 |
+
var td = [];
|
216 |
+
var sa = this.startAngle/180*Math.PI;
|
217 |
+
var tot = 0;
|
218 |
+
// don't know if we have any valid data yet, so set plot to not draw.
|
219 |
+
this._drawData = false;
|
220 |
+
for (var i=0; i<this.data.length; i++){
|
221 |
+
if (this.data[i][1] != 0) {
|
222 |
+
// we have data, O.K. to draw.
|
223 |
+
this._drawData = true;
|
224 |
+
}
|
225 |
+
stack.push(this.data[i][1]);
|
226 |
+
td.push([this.data[i][0]]);
|
227 |
+
if (i>0) {
|
228 |
+
stack[i] += stack[i-1];
|
229 |
+
}
|
230 |
+
tot += this.data[i][1];
|
231 |
+
}
|
232 |
+
var fact = Math.PI*2/stack[stack.length - 1];
|
233 |
+
|
234 |
+
for (var i=0; i<stack.length; i++) {
|
235 |
+
td[i][1] = stack[i] * fact;
|
236 |
+
td[i][2] = this.data[i][1]/tot;
|
237 |
+
}
|
238 |
+
this.gridData = td;
|
239 |
+
};
|
240 |
+
|
241 |
+
$.jqplot.DonutRenderer.prototype.makeGridData = function(data, plot) {
|
242 |
+
var stack = [];
|
243 |
+
var td = [];
|
244 |
+
var tot = 0;
|
245 |
+
var sa = this.startAngle/180*Math.PI;
|
246 |
+
// don't know if we have any valid data yet, so set plot to not draw.
|
247 |
+
this._drawData = false;
|
248 |
+
for (var i=0; i<data.length; i++){
|
249 |
+
if (this.data[i][1] != 0) {
|
250 |
+
// we have data, O.K. to draw.
|
251 |
+
this._drawData = true;
|
252 |
+
}
|
253 |
+
stack.push(data[i][1]);
|
254 |
+
td.push([data[i][0]]);
|
255 |
+
if (i>0) {
|
256 |
+
stack[i] += stack[i-1];
|
257 |
+
}
|
258 |
+
tot += data[i][1];
|
259 |
+
}
|
260 |
+
var fact = Math.PI*2/stack[stack.length - 1];
|
261 |
+
|
262 |
+
for (var i=0; i<stack.length; i++) {
|
263 |
+
td[i][1] = stack[i] * fact;
|
264 |
+
td[i][2] = data[i][1]/tot;
|
265 |
+
}
|
266 |
+
return td;
|
267 |
+
};
|
268 |
+
|
269 |
+
$.jqplot.DonutRenderer.prototype.drawSlice = function (ctx, ang1, ang2, color, isShadow) {
|
270 |
+
var r = this._diameter / 2;
|
271 |
+
var ri = r - this._thickness;
|
272 |
+
var fill = this.fill;
|
273 |
+
// var lineWidth = this.lineWidth;
|
274 |
+
ctx.save();
|
275 |
+
ctx.translate(this._center[0], this._center[1]);
|
276 |
+
// ctx.translate(this.sliceMargin*Math.cos((ang1+ang2)/2), this.sliceMargin*Math.sin((ang1+ang2)/2));
|
277 |
+
|
278 |
+
if (isShadow) {
|
279 |
+
for (var i=0; i<this.shadowDepth; i++) {
|
280 |
+
ctx.save();
|
281 |
+
ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
|
282 |
+
doDraw();
|
283 |
+
}
|
284 |
+
}
|
285 |
+
|
286 |
+
else {
|
287 |
+
doDraw();
|
288 |
+
}
|
289 |
+
|
290 |
+
function doDraw () {
|
291 |
+
// Fix for IE and Chrome that can't seem to draw circles correctly.
|
292 |
+
// ang2 should always be <= 2 pi since that is the way the data is converted.
|
293 |
+
if (ang2 > 6.282 + this.startAngle) {
|
294 |
+
ang2 = 6.282 + this.startAngle;
|
295 |
+
if (ang1 > ang2) {
|
296 |
+
ang1 = 6.281 + this.startAngle;
|
297 |
+
}
|
298 |
+
}
|
299 |
+
// Fix for IE, where it can't seem to handle 0 degree angles. Also avoids
|
300 |
+
// ugly line on unfilled donuts.
|
301 |
+
if (ang1 >= ang2) {
|
302 |
+
return;
|
303 |
+
}
|
304 |
+
ctx.beginPath();
|
305 |
+
ctx.fillStyle = color;
|
306 |
+
ctx.strokeStyle = color;
|
307 |
+
// ctx.lineWidth = lineWidth;
|
308 |
+
ctx.arc(0, 0, r, ang1, ang2, false);
|
309 |
+
ctx.lineTo(ri*Math.cos(ang2), ri*Math.sin(ang2));
|
310 |
+
ctx.arc(0,0, ri, ang2, ang1, true);
|
311 |
+
ctx.closePath();
|
312 |
+
if (fill) {
|
313 |
+
ctx.fill();
|
314 |
+
}
|
315 |
+
else {
|
316 |
+
ctx.stroke();
|
317 |
+
}
|
318 |
+
}
|
319 |
+
|
320 |
+
if (isShadow) {
|
321 |
+
for (var i=0; i<this.shadowDepth; i++) {
|
322 |
+
ctx.restore();
|
323 |
+
}
|
324 |
+
}
|
325 |
+
|
326 |
+
ctx.restore();
|
327 |
+
};
|
328 |
+
|
329 |
+
// called with scope of series
|
330 |
+
$.jqplot.DonutRenderer.prototype.draw = function (ctx, gd, options, plot) {
|
331 |
+
var i;
|
332 |
+
var opts = (options != undefined) ? options : {};
|
333 |
+
// offset and direction of offset due to legend placement
|
334 |
+
var offx = 0;
|
335 |
+
var offy = 0;
|
336 |
+
var trans = 1;
|
337 |
+
// var colorGenerator = new this.colorGenerator(this.seriesColors);
|
338 |
+
if (options.legendInfo && options.legendInfo.placement == 'insideGrid') {
|
339 |
+
var li = options.legendInfo;
|
340 |
+
switch (li.location) {
|
341 |
+
case 'nw':
|
342 |
+
offx = li.width + li.xoffset;
|
343 |
+
break;
|
344 |
+
case 'w':
|
345 |
+
offx = li.width + li.xoffset;
|
346 |
+
break;
|
347 |
+
case 'sw':
|
348 |
+
offx = li.width + li.xoffset;
|
349 |
+
break;
|
350 |
+
case 'ne':
|
351 |
+
offx = li.width + li.xoffset;
|
352 |
+
trans = -1;
|
353 |
+
break;
|
354 |
+
case 'e':
|
355 |
+
offx = li.width + li.xoffset;
|
356 |
+
trans = -1;
|
357 |
+
break;
|
358 |
+
case 'se':
|
359 |
+
offx = li.width + li.xoffset;
|
360 |
+
trans = -1;
|
361 |
+
break;
|
362 |
+
case 'n':
|
363 |
+
offy = li.height + li.yoffset;
|
364 |
+
break;
|
365 |
+
case 's':
|
366 |
+
offy = li.height + li.yoffset;
|
367 |
+
trans = -1;
|
368 |
+
break;
|
369 |
+
default:
|
370 |
+
break;
|
371 |
+
}
|
372 |
+
}
|
373 |
+
|
374 |
+
var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
|
375 |
+
var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
|
376 |
+
var fill = (opts.fill != undefined) ? opts.fill : this.fill;
|
377 |
+
var cw = ctx.canvas.width;
|
378 |
+
var ch = ctx.canvas.height;
|
379 |
+
var w = cw - offx - 2 * this.padding;
|
380 |
+
var h = ch - offy - 2 * this.padding;
|
381 |
+
var mindim = Math.min(w,h);
|
382 |
+
var d = mindim;
|
383 |
+
var ringmargin = (this.ringMargin == null) ? this.sliceMargin * 2.0 : this.ringMargin;
|
384 |
+
|
385 |
+
for (var i=0; i<this._previousSeries.length; i++) {
|
386 |
+
d -= 2.0 * this._previousSeries[i]._thickness + 2.0 * ringmargin;
|
387 |
+
}
|
388 |
+
this._diameter = this.diameter || d;
|
389 |
+
if (this.innerDiameter != null) {
|
390 |
+
var od = (this._numberSeries > 1 && this.index > 0) ? this._previousSeries[0]._diameter : this._diameter;
|
391 |
+
this._thickness = this.thickness || (od - this.innerDiameter - 2.0*ringmargin*this._numberSeries) / this._numberSeries/2.0;
|
392 |
+
}
|
393 |
+
else {
|
394 |
+
this._thickness = this.thickness || mindim / 2 / (this._numberSeries + 1) * 0.85;
|
395 |
+
}
|
396 |
+
|
397 |
+
var r = this._radius = this._diameter/2;
|
398 |
+
this._innerRadius = this._radius - this._thickness;
|
399 |
+
var sa = this.startAngle / 180 * Math.PI;
|
400 |
+
this._center = [(cw - trans * offx)/2 + trans * offx, (ch - trans*offy)/2 + trans * offy];
|
401 |
+
|
402 |
+
if (this.shadow) {
|
403 |
+
var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
|
404 |
+
for (var i=0; i<gd.length; i++) {
|
405 |
+
var ang1 = (i == 0) ? sa : gd[i-1][1] + sa;
|
406 |
+
// Adjust ang1 and ang2 for sliceMargin
|
407 |
+
ang1 += this.sliceMargin/180*Math.PI;
|
408 |
+
this.renderer.drawSlice.call (this, ctx, ang1, gd[i][1]+sa, shadowColor, true);
|
409 |
+
}
|
410 |
+
|
411 |
+
}
|
412 |
+
for (var i=0; i<gd.length; i++) {
|
413 |
+
var ang1 = (i == 0) ? sa : gd[i-1][1] + sa;
|
414 |
+
// Adjust ang1 and ang2 for sliceMargin
|
415 |
+
ang1 += this.sliceMargin/180*Math.PI;
|
416 |
+
var ang2 = gd[i][1] + sa;
|
417 |
+
this._sliceAngles.push([ang1, ang2]);
|
418 |
+
this.renderer.drawSlice.call (this, ctx, ang1, ang2, this.seriesColors[i], false);
|
419 |
+
|
420 |
+
if (this.showDataLabels && gd[i][2]*100 >= this.dataLabelThreshold) {
|
421 |
+
var fstr, avgang = (ang1+ang2)/2, label;
|
422 |
+
|
423 |
+
if (this.dataLabels == 'label') {
|
424 |
+
fstr = this.dataLabelFormatString || '%s';
|
425 |
+
label = $.jqplot.sprintf(fstr, gd[i][0]);
|
426 |
+
}
|
427 |
+
else if (this.dataLabels == 'value') {
|
428 |
+
fstr = this.dataLabelFormatString || '%d';
|
429 |
+
label = $.jqplot.sprintf(fstr, this.data[i][1]);
|
430 |
+
}
|
431 |
+
else if (this.dataLabels == 'percent') {
|
432 |
+
fstr = this.dataLabelFormatString || '%d%%';
|
433 |
+
label = $.jqplot.sprintf(fstr, gd[i][2]*100);
|
434 |
+
}
|
435 |
+
else if (this.dataLabels.constructor == Array) {
|
436 |
+
fstr = this.dataLabelFormatString || '%s';
|
437 |
+
label = $.jqplot.sprintf(fstr, this.dataLabels[i]);
|
438 |
+
}
|
439 |
+
|
440 |
+
var fact = this._innerRadius + this._thickness * this.dataLabelPositionFactor + this.sliceMargin + this.dataLabelNudge;
|
441 |
+
|
442 |
+
var x = this._center[0] + Math.cos(avgang) * fact + this.canvas._offsets.left;
|
443 |
+
var y = this._center[1] + Math.sin(avgang) * fact + this.canvas._offsets.top;
|
444 |
+
|
445 |
+
var labelelem = $('<span class="jqplot-donut-series jqplot-data-label" style="position:absolute;">' + label + '</span>').insertBefore(plot.eventCanvas._elem);
|
446 |
+
x -= labelelem.width()/2;
|
447 |
+
y -= labelelem.height()/2;
|
448 |
+
x = Math.round(x);
|
449 |
+
y = Math.round(y);
|
450 |
+
labelelem.css({left: x, top: y});
|
451 |
+
}
|
452 |
+
}
|
453 |
+
|
454 |
+
};
|
455 |
+
|
456 |
+
$.jqplot.DonutAxisRenderer = function() {
|
457 |
+
$.jqplot.LinearAxisRenderer.call(this);
|
458 |
+
};
|
459 |
+
|
460 |
+
$.jqplot.DonutAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
|
461 |
+
$.jqplot.DonutAxisRenderer.prototype.constructor = $.jqplot.DonutAxisRenderer;
|
462 |
+
|
463 |
+
|
464 |
+
// There are no traditional axes on a donut chart. We just need to provide
|
465 |
+
// dummy objects with properties so the plot will render.
|
466 |
+
// called with scope of axis object.
|
467 |
+
$.jqplot.DonutAxisRenderer.prototype.init = function(options){
|
468 |
+
//
|
469 |
+
this.tickRenderer = $.jqplot.DonutTickRenderer;
|
470 |
+
$.extend(true, this, options);
|
471 |
+
// I don't think I'm going to need _dataBounds here.
|
472 |
+
// have to go Axis scaling in a way to fit chart onto plot area
|
473 |
+
// and provide u2p and p2u functionality for mouse cursor, etc.
|
474 |
+
// for convienence set _dataBounds to 0 and 100 and
|
475 |
+
// set min/max to 0 and 100.
|
476 |
+
this._dataBounds = {min:0, max:100};
|
477 |
+
this.min = 0;
|
478 |
+
this.max = 100;
|
479 |
+
this.showTicks = false;
|
480 |
+
this.ticks = [];
|
481 |
+
this.showMark = false;
|
482 |
+
this.show = false;
|
483 |
+
};
|
484 |
+
|
485 |
+
|
486 |
+
|
487 |
+
|
488 |
+
$.jqplot.DonutLegendRenderer = function(){
|
489 |
+
$.jqplot.TableLegendRenderer.call(this);
|
490 |
+
};
|
491 |
+
|
492 |
+
$.jqplot.DonutLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
|
493 |
+
$.jqplot.DonutLegendRenderer.prototype.constructor = $.jqplot.DonutLegendRenderer;
|
494 |
+
|
495 |
+
/**
|
496 |
+
* Class: $.jqplot.DonutLegendRenderer
|
497 |
+
* Legend Renderer specific to donut plots. Set by default
|
498 |
+
* when user creates a donut plot.
|
499 |
+
*/
|
500 |
+
$.jqplot.DonutLegendRenderer.prototype.init = function(options) {
|
501 |
+
// Group: Properties
|
502 |
+
//
|
503 |
+
// prop: numberRows
|
504 |
+
// Maximum number of rows in the legend. 0 or null for unlimited.
|
505 |
+
this.numberRows = null;
|
506 |
+
// prop: numberColumns
|
507 |
+
// Maximum number of columns in the legend. 0 or null for unlimited.
|
508 |
+
this.numberColumns = null;
|
509 |
+
$.extend(true, this, options);
|
510 |
+
};
|
511 |
+
|
512 |
+
// called with context of legend
|
513 |
+
$.jqplot.DonutLegendRenderer.prototype.draw = function() {
|
514 |
+
var legend = this;
|
515 |
+
if (this.show) {
|
516 |
+
var series = this._series;
|
517 |
+
var ss = 'position:absolute;';
|
518 |
+
ss += (this.background) ? 'background:'+this.background+';' : '';
|
519 |
+
ss += (this.border) ? 'border:'+this.border+';' : '';
|
520 |
+
ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
|
521 |
+
ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
|
522 |
+
ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
|
523 |
+
ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
|
524 |
+
ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
|
525 |
+
ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
|
526 |
+
ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
|
527 |
+
this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
|
528 |
+
// Donut charts legends don't go by number of series, but by number of data points
|
529 |
+
// in the series. Refactor things here for that.
|
530 |
+
|
531 |
+
var pad = false,
|
532 |
+
reverse = false,
|
533 |
+
nr, nc;
|
534 |
+
var s = series[0];
|
535 |
+
var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors);
|
536 |
+
|
537 |
+
if (s.show) {
|
538 |
+
var pd = s.data;
|
539 |
+
if (this.numberRows) {
|
540 |
+
nr = this.numberRows;
|
541 |
+
if (!this.numberColumns){
|
542 |
+
nc = Math.ceil(pd.length/nr);
|
543 |
+
}
|
544 |
+
else{
|
545 |
+
nc = this.numberColumns;
|
546 |
+
}
|
547 |
+
}
|
548 |
+
else if (this.numberColumns) {
|
549 |
+
nc = this.numberColumns;
|
550 |
+
nr = Math.ceil(pd.length/this.numberColumns);
|
551 |
+
}
|
552 |
+
else {
|
553 |
+
nr = pd.length;
|
554 |
+
nc = 1;
|
555 |
+
}
|
556 |
+
|
557 |
+
var i, j, tr, td1, td2, lt, rs, color;
|
558 |
+
var idx = 0;
|
559 |
+
|
560 |
+
for (i=0; i<nr; i++) {
|
561 |
+
if (reverse){
|
562 |
+
tr = $('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem);
|
563 |
+
}
|
564 |
+
else{
|
565 |
+
tr = $('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);
|
566 |
+
}
|
567 |
+
for (j=0; j<nc; j++) {
|
568 |
+
if (idx < pd.length){
|
569 |
+
lt = this.labels[idx] || pd[idx][0].toString();
|
570 |
+
color = colorGenerator.next();
|
571 |
+
if (!reverse){
|
572 |
+
if (i>0){
|
573 |
+
pad = true;
|
574 |
+
}
|
575 |
+
else{
|
576 |
+
pad = false;
|
577 |
+
}
|
578 |
+
}
|
579 |
+
else{
|
580 |
+
if (i == nr -1){
|
581 |
+
pad = false;
|
582 |
+
}
|
583 |
+
else{
|
584 |
+
pad = true;
|
585 |
+
}
|
586 |
+
}
|
587 |
+
rs = (pad) ? this.rowSpacing : '0';
|
588 |
+
|
589 |
+
td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
|
590 |
+
'<div><div class="jqplot-table-legend-swatch" style="border-color:'+color+';"></div>'+
|
591 |
+
'</div></td>');
|
592 |
+
td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
|
593 |
+
if (this.escapeHtml){
|
594 |
+
td2.text(lt);
|
595 |
+
}
|
596 |
+
else {
|
597 |
+
td2.html(lt);
|
598 |
+
}
|
599 |
+
if (reverse) {
|
600 |
+
td2.prependTo(tr);
|
601 |
+
td1.prependTo(tr);
|
602 |
+
}
|
603 |
+
else {
|
604 |
+
td1.appendTo(tr);
|
605 |
+
td2.appendTo(tr);
|
606 |
+
}
|
607 |
+
pad = true;
|
608 |
+
}
|
609 |
+
idx++;
|
610 |
+
}
|
611 |
+
}
|
612 |
+
}
|
613 |
+
}
|
614 |
+
return this._elem;
|
615 |
+
};
|
616 |
+
|
617 |
+
// setup default renderers for axes and legend so user doesn't have to
|
618 |
+
// called with scope of plot
|
619 |
+
function preInit(target, data, options) {
|
620 |
+
options = options || {};
|
621 |
+
options.axesDefaults = options.axesDefaults || {};
|
622 |
+
options.legend = options.legend || {};
|
623 |
+
options.seriesDefaults = options.seriesDefaults || {};
|
624 |
+
// only set these if there is a donut series
|
625 |
+
var setopts = false;
|
626 |
+
if (options.seriesDefaults.renderer == $.jqplot.DonutRenderer) {
|
627 |
+
setopts = true;
|
628 |
+
}
|
629 |
+
else if (options.series) {
|
630 |
+
for (var i=0; i < options.series.length; i++) {
|
631 |
+
if (options.series[i].renderer == $.jqplot.DonutRenderer) {
|
632 |
+
setopts = true;
|
633 |
+
}
|
634 |
+
}
|
635 |
+
}
|
636 |
+
|
637 |
+
if (setopts) {
|
638 |
+
options.axesDefaults.renderer = $.jqplot.DonutAxisRenderer;
|
639 |
+
options.legend.renderer = $.jqplot.DonutLegendRenderer;
|
640 |
+
options.legend.preDraw = true;
|
641 |
+
options.seriesDefaults.pointLabels = {show: false};
|
642 |
+
}
|
643 |
+
}
|
644 |
+
|
645 |
+
// called with scope of plot.
|
646 |
+
function postInit(target, data, options) {
|
647 |
+
// if multiple series, add a reference to the previous one so that
|
648 |
+
// donut rings can nest.
|
649 |
+
for (var i=1; i<this.series.length; i++) {
|
650 |
+
if (!this.series[i]._previousSeries.length){
|
651 |
+
for (var j=0; j<i; j++) {
|
652 |
+
if (this.series[i].renderer.constructor == $.jqplot.DonutRenderer && this.series[j].renderer.constructor == $.jqplot.DonutRenderer) {
|
653 |
+
this.series[i]._previousSeries.push(this.series[j]);
|
654 |
+
}
|
655 |
+
}
|
656 |
+
}
|
657 |
+
}
|
658 |
+
for (i=0; i<this.series.length; i++) {
|
659 |
+
if (this.series[i].renderer.constructor == $.jqplot.DonutRenderer) {
|
660 |
+
this.series[i]._numberSeries = this.series.length;
|
661 |
+
// don't allow mouseover and mousedown at same time.
|
662 |
+
if (this.series[i].highlightMouseOver) {
|
663 |
+
this.series[i].highlightMouseDown = false;
|
664 |
+
}
|
665 |
+
}
|
666 |
+
}
|
667 |
+
}
|
668 |
+
|
669 |
+
var postParseOptionsRun = false;
|
670 |
+
// called with scope of plot
|
671 |
+
function postParseOptions(options) {
|
672 |
+
for (var i=0; i<this.series.length; i++) {
|
673 |
+
this.series[i].seriesColors = this.seriesColors;
|
674 |
+
this.series[i].colorGenerator = $.jqplot.colorGenerator;
|
675 |
+
}
|
676 |
+
}
|
677 |
+
|
678 |
+
function highlight (plot, sidx, pidx) {
|
679 |
+
var s = plot.series[sidx];
|
680 |
+
var canvas = plot.plugins.donutRenderer.highlightCanvas;
|
681 |
+
canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
|
682 |
+
s._highlightedPoint = pidx;
|
683 |
+
plot.plugins.donutRenderer.highlightedSeriesIndex = sidx;
|
684 |
+
s.renderer.drawSlice.call(s, canvas._ctx, s._sliceAngles[pidx][0], s._sliceAngles[pidx][1], s.highlightColors[pidx], false);
|
685 |
+
}
|
686 |
+
|
687 |
+
function unhighlight (plot) {
|
688 |
+
var canvas = plot.plugins.donutRenderer.highlightCanvas;
|
689 |
+
canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
|
690 |
+
for (var i=0; i<plot.series.length; i++) {
|
691 |
+
plot.series[i]._highlightedPoint = null;
|
692 |
+
}
|
693 |
+
plot.plugins.donutRenderer.highlightedSeriesIndex = null;
|
694 |
+
plot.target.trigger('jqplotDataUnhighlight');
|
695 |
+
}
|
696 |
+
|
697 |
+
function handleMove(ev, gridpos, datapos, neighbor, plot) {
|
698 |
+
if (neighbor) {
|
699 |
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
700 |
+
var evt1 = jQuery.Event('jqplotDataMouseOver');
|
701 |
+
evt1.pageX = ev.pageX;
|
702 |
+
evt1.pageY = ev.pageY;
|
703 |
+
plot.target.trigger(evt1, ins);
|
704 |
+
if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.donutRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
|
705 |
+
var evt = jQuery.Event('jqplotDataHighlight');
|
706 |
+
evt.which = ev.which;
|
707 |
+
evt.pageX = ev.pageX;
|
708 |
+
evt.pageY = ev.pageY;
|
709 |
+
plot.target.trigger(evt, ins);
|
710 |
+
highlight (plot, ins[0], ins[1]);
|
711 |
+
}
|
712 |
+
}
|
713 |
+
else if (neighbor == null) {
|
714 |
+
unhighlight (plot);
|
715 |
+
}
|
716 |
+
}
|
717 |
+
|
718 |
+
function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
|
719 |
+
if (neighbor) {
|
720 |
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
721 |
+
if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.donutRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
|
722 |
+
var evt = jQuery.Event('jqplotDataHighlight');
|
723 |
+
evt.which = ev.which;
|
724 |
+
evt.pageX = ev.pageX;
|
725 |
+
evt.pageY = ev.pageY;
|
726 |
+
plot.target.trigger(evt, ins);
|
727 |
+
highlight (plot, ins[0], ins[1]);
|
728 |
+
}
|
729 |
+
}
|
730 |
+
else if (neighbor == null) {
|
731 |
+
unhighlight (plot);
|
732 |
+
}
|
733 |
+
}
|
734 |
+
|
735 |
+
function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
|
736 |
+
var idx = plot.plugins.donutRenderer.highlightedSeriesIndex;
|
737 |
+
if (idx != null && plot.series[idx].highlightMouseDown) {
|
738 |
+
unhighlight(plot);
|
739 |
+
}
|
740 |
+
}
|
741 |
+
|
742 |
+
function handleClick(ev, gridpos, datapos, neighbor, plot) {
|
743 |
+
if (neighbor) {
|
744 |
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
745 |
+
var evt = jQuery.Event('jqplotDataClick');
|
746 |
+
evt.which = ev.which;
|
747 |
+
evt.pageX = ev.pageX;
|
748 |
+
evt.pageY = ev.pageY;
|
749 |
+
plot.target.trigger(evt, ins);
|
750 |
+
}
|
751 |
+
}
|
752 |
+
|
753 |
+
function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
|
754 |
+
if (neighbor) {
|
755 |
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
756 |
+
var idx = plot.plugins.donutRenderer.highlightedSeriesIndex;
|
757 |
+
if (idx != null && plot.series[idx].highlightMouseDown) {
|
758 |
+
unhighlight(plot);
|
759 |
+
}
|
760 |
+
var evt = jQuery.Event('jqplotDataRightClick');
|
761 |
+
evt.which = ev.which;
|
762 |
+
evt.pageX = ev.pageX;
|
763 |
+
evt.pageY = ev.pageY;
|
764 |
+
plot.target.trigger(evt, ins);
|
765 |
+
}
|
766 |
+
}
|
767 |
+
|
768 |
+
// called within context of plot
|
769 |
+
// create a canvas which we can draw on.
|
770 |
+
// insert it before the eventCanvas, so eventCanvas will still capture events.
|
771 |
+
function postPlotDraw() {
|
772 |
+
// Memory Leaks patch
|
773 |
+
if (this.plugins.donutRenderer && this.plugins.donutRenderer.highlightCanvas) {
|
774 |
+
this.plugins.donutRenderer.highlightCanvas.resetCanvas();
|
775 |
+
this.plugins.donutRenderer.highlightCanvas = null;
|
776 |
+
}
|
777 |
+
|
778 |
+
this.plugins.donutRenderer = {highlightedSeriesIndex:null};
|
779 |
+
this.plugins.donutRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
|
780 |
+
// do we have any data labels? if so, put highlight canvas before those
|
781 |
+
// Fix for broken jquery :first selector with canvas (VML) elements.
|
782 |
+
var labels = $(this.targetId+' .jqplot-data-label');
|
783 |
+
if (labels.length) {
|
784 |
+
$(labels[0]).before(this.plugins.donutRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-donutRenderer-highlight-canvas', this._plotDimensions, this));
|
785 |
+
}
|
786 |
+
// else put highlight canvas before event canvas.
|
787 |
+
else {
|
788 |
+
this.eventCanvas._elem.before(this.plugins.donutRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-donutRenderer-highlight-canvas', this._plotDimensions, this));
|
789 |
+
}
|
790 |
+
var hctx = this.plugins.donutRenderer.highlightCanvas.setContext();
|
791 |
+
this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
|
792 |
+
}
|
793 |
+
|
794 |
+
$.jqplot.preInitHooks.push(preInit);
|
795 |
+
|
796 |
+
$.jqplot.DonutTickRenderer = function() {
|
797 |
+
$.jqplot.AxisTickRenderer.call(this);
|
798 |
+
};
|
799 |
+
|
800 |
+
$.jqplot.DonutTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
|
801 |
+
$.jqplot.DonutTickRenderer.prototype.constructor = $.jqplot.DonutTickRenderer;
|
802 |
+
|
803 |
+
})(jQuery);
|
804 |
+
|
805 |
+
|
backend/settings/assets/js/jqPlot/plugins/jqplot.donutRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(e){e.jqplot.DonutRenderer=function(){e.jqplot.LineRenderer.call(this)};e.jqplot.DonutRenderer.prototype=new e.jqplot.LineRenderer();e.jqplot.DonutRenderer.prototype.constructor=e.jqplot.DonutRenderer;e.jqplot.DonutRenderer.prototype.init=function(p,t){this.diameter=null;this.innerDiameter=null;this.thickness=null;this.padding=20;this.sliceMargin=0;this.ringMargin=null;this.fill=true;this.shadowOffset=2;this.shadowAlpha=0.07;this.shadowDepth=5;this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColors=[];this.dataLabels="percent";this.showDataLabels=false;this.dataLabelFormatString=null;this.dataLabelThreshold=3;this.dataLabelPositionFactor=0.4;this.dataLabelNudge=0;this.startAngle=0;this.tickRenderer=e.jqplot.DonutTickRenderer;this._drawData=true;this._type="donut";if(p.highlightMouseDown&&p.highlightMouseOver==null){p.highlightMouseOver=false}e.extend(true,this,p);if(this.diameter!=null){this.diameter=this.diameter-this.sliceMargin}this._diameter=null;this._innerDiameter=null;this._radius=null;this._innerRadius=null;this._thickness=null;this._previousSeries=[];this._numberSeries=1;this._sliceAngles=[];this._highlightedPoint=null;if(this.highlightColors.length==0){for(var r=0;r<this.seriesColors.length;r++){var q=e.jqplot.getColorComponents(this.seriesColors[r]);var n=[q[0],q[1],q[2]];var s=n[0]+n[1]+n[2];for(var o=0;o<3;o++){n[o]=(s>570)?n[o]*0.8:n[o]+0.3*(255-n[o]);n[o]=parseInt(n[o],10)}this.highlightColors.push("rgb("+n[0]+","+n[1]+","+n[2]+")")}}t.postParseOptionsHooks.addOnce(l);t.postInitHooks.addOnce(g);t.eventListenerHooks.addOnce("jqplotMouseMove",b);t.eventListenerHooks.addOnce("jqplotMouseDown",a);t.eventListenerHooks.addOnce("jqplotMouseUp",j);t.eventListenerHooks.addOnce("jqplotClick",f);t.eventListenerHooks.addOnce("jqplotRightClick",m);t.postDrawHooks.addOnce(h)};e.jqplot.DonutRenderer.prototype.setGridData=function(s){var o=[];var t=[];var n=this.startAngle/180*Math.PI;var r=0;this._drawData=false;for(var q=0;q<this.data.length;q++){if(this.data[q][1]!=0){this._drawData=true}o.push(this.data[q][1]);t.push([this.data[q][0]]);if(q>0){o[q]+=o[q-1]}r+=this.data[q][1]}var p=Math.PI*2/o[o.length-1];for(var q=0;q<o.length;q++){t[q][1]=o[q]*p;t[q][2]=this.data[q][1]/r}this.gridData=t};e.jqplot.DonutRenderer.prototype.makeGridData=function(s,t){var o=[];var u=[];var r=0;var n=this.startAngle/180*Math.PI;this._drawData=false;for(var q=0;q<s.length;q++){if(this.data[q][1]!=0){this._drawData=true}o.push(s[q][1]);u.push([s[q][0]]);if(q>0){o[q]+=o[q-1]}r+=s[q][1]}var p=Math.PI*2/o[o.length-1];for(var q=0;q<o.length;q++){u[q][1]=o[q]*p;u[q][2]=s[q][1]/r}return u};e.jqplot.DonutRenderer.prototype.drawSlice=function(x,u,t,p,s){var n=this._diameter/2;var v=n-this._thickness;var w=this.fill;x.save();x.translate(this._center[0],this._center[1]);if(s){for(var q=0;q<this.shadowDepth;q++){x.save();x.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI),this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));o()}}else{o()}function o(){if(t>6.282+this.startAngle){t=6.282+this.startAngle;if(u>t){u=6.281+this.startAngle}}if(u>=t){return}x.beginPath();x.fillStyle=p;x.strokeStyle=p;x.arc(0,0,n,u,t,false);x.lineTo(v*Math.cos(t),v*Math.sin(t));x.arc(0,0,v,t,u,true);x.closePath();if(w){x.fill()}else{x.stroke()}}if(s){for(var q=0;q<this.shadowDepth;q++){x.restore()}}x.restore()};e.jqplot.DonutRenderer.prototype.draw=function(N,V,t,P){var Q;var J=(t!=undefined)?t:{};var q=0;var p=0;var u=1;if(t.legendInfo&&t.legendInfo.placement=="insideGrid"){var I=t.legendInfo;switch(I.location){case"nw":q=I.width+I.xoffset;break;case"w":q=I.width+I.xoffset;break;case"sw":q=I.width+I.xoffset;break;case"ne":q=I.width+I.xoffset;u=-1;break;case"e":q=I.width+I.xoffset;u=-1;break;case"se":q=I.width+I.xoffset;u=-1;break;case"n":p=I.height+I.yoffset;break;case"s":p=I.height+I.yoffset;u=-1;break;default:break}}var B=(J.shadow!=undefined)?J.shadow:this.shadow;var W=(J.showLine!=undefined)?J.showLine:this.showLine;var O=(J.fill!=undefined)?J.fill:this.fill;var s=N.canvas.width;var H=N.canvas.height;var G=s-q-2*this.padding;var R=H-p-2*this.padding;var v=Math.min(G,R);var T=v;var X=(this.ringMargin==null)?this.sliceMargin*2:this.ringMargin;for(var Q=0;Q<this._previousSeries.length;Q++){T-=2*this._previousSeries[Q]._thickness+2*X}this._diameter=this.diameter||T;if(this.innerDiameter!=null){var M=(this._numberSeries>1&&this.index>0)?this._previousSeries[0]._diameter:this._diameter;this._thickness=this.thickness||(M-this.innerDiameter-2*X*this._numberSeries)/this._numberSeries/2}else{this._thickness=this.thickness||v/2/(this._numberSeries+1)*0.85}var K=this._radius=this._diameter/2;this._innerRadius=this._radius-this._thickness;var o=this.startAngle/180*Math.PI;this._center=[(s-u*q)/2+u*q,(H-u*p)/2+u*p];if(this.shadow){var L="rgba(0,0,0,"+this.shadowAlpha+")";for(var Q=0;Q<V.length;Q++){var A=(Q==0)?o:V[Q-1][1]+o;A+=this.sliceMargin/180*Math.PI;this.renderer.drawSlice.call(this,N,A,V[Q][1]+o,L,true)}}for(var Q=0;Q<V.length;Q++){var A=(Q==0)?o:V[Q-1][1]+o;A+=this.sliceMargin/180*Math.PI;var z=V[Q][1]+o;this._sliceAngles.push([A,z]);this.renderer.drawSlice.call(this,N,A,z,this.seriesColors[Q],false);if(this.showDataLabels&&V[Q][2]*100>=this.dataLabelThreshold){var S,U=(A+z)/2,C;if(this.dataLabels=="label"){S=this.dataLabelFormatString||"%s";C=e.jqplot.sprintf(S,V[Q][0])}else{if(this.dataLabels=="value"){S=this.dataLabelFormatString||"%d";C=e.jqplot.sprintf(S,this.data[Q][1])}else{if(this.dataLabels=="percent"){S=this.dataLabelFormatString||"%d%%";C=e.jqplot.sprintf(S,V[Q][2]*100)}else{if(this.dataLabels.constructor==Array){S=this.dataLabelFormatString||"%s";C=e.jqplot.sprintf(S,this.dataLabels[Q])}}}}var n=this._innerRadius+this._thickness*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge;var F=this._center[0]+Math.cos(U)*n+this.canvas._offsets.left;var E=this._center[1]+Math.sin(U)*n+this.canvas._offsets.top;var D=e('<span class="jqplot-donut-series jqplot-data-label" style="position:absolute;">'+C+"</span>").insertBefore(P.eventCanvas._elem);F-=D.width()/2;E-=D.height()/2;F=Math.round(F);E=Math.round(E);D.css({left:F,top:E})}}};e.jqplot.DonutAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)};e.jqplot.DonutAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer();e.jqplot.DonutAxisRenderer.prototype.constructor=e.jqplot.DonutAxisRenderer;e.jqplot.DonutAxisRenderer.prototype.init=function(n){this.tickRenderer=e.jqplot.DonutTickRenderer;e.extend(true,this,n);this._dataBounds={min:0,max:100};this.min=0;this.max=100;this.showTicks=false;this.ticks=[];this.showMark=false;this.show=false};e.jqplot.DonutLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)};e.jqplot.DonutLegendRenderer.prototype=new e.jqplot.TableLegendRenderer();e.jqplot.DonutLegendRenderer.prototype.constructor=e.jqplot.DonutLegendRenderer;e.jqplot.DonutLegendRenderer.prototype.init=function(n){this.numberRows=null;this.numberColumns=null;e.extend(true,this,n)};e.jqplot.DonutLegendRenderer.prototype.draw=function(){var q=this;if(this.show){var y=this._series;var B="position:absolute;";B+=(this.background)?"background:"+this.background+";":"";B+=(this.border)?"border:"+this.border+";":"";B+=(this.fontSize)?"font-size:"+this.fontSize+";":"";B+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";B+=(this.textColor)?"color:"+this.textColor+";":"";B+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";B+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";B+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";B+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=e('<table class="jqplot-table-legend" style="'+B+'"></table>');var F=false,x=false,n,v;var z=y[0];var o=new e.jqplot.ColorGenerator(z.seriesColors);if(z.show){var G=z.data;if(this.numberRows){n=this.numberRows;if(!this.numberColumns){v=Math.ceil(G.length/n)}else{v=this.numberColumns}}else{if(this.numberColumns){v=this.numberColumns;n=Math.ceil(G.length/this.numberColumns)}else{n=G.length;v=1}}var E,D,p,t,r,u,w,C;var A=0;for(E=0;E<n;E++){if(x){p=e('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem)}else{p=e('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem)}for(D=0;D<v;D++){if(A<G.length){u=this.labels[A]||G[A][0].toString();C=o.next();if(!x){if(E>0){F=true}else{F=false}}else{if(E==n-1){F=false}else{F=true}}w=(F)?this.rowSpacing:"0";t=e('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+w+';"><div><div class="jqplot-table-legend-swatch" style="border-color:'+C+';"></div></div></td>');r=e('<td class="jqplot-table-legend" style="padding-top:'+w+';"></td>');if(this.escapeHtml){r.text(u)}else{r.html(u)}if(x){r.prependTo(p);t.prependTo(p)}else{t.appendTo(p);r.appendTo(p)}F=true}A++}}}}return this._elem};function c(r,q,o){o=o||{};o.axesDefaults=o.axesDefaults||{};o.legend=o.legend||{};o.seriesDefaults=o.seriesDefaults||{};var n=false;if(o.seriesDefaults.renderer==e.jqplot.DonutRenderer){n=true}else{if(o.series){for(var p=0;p<o.series.length;p++){if(o.series[p].renderer==e.jqplot.DonutRenderer){n=true}}}}if(n){o.axesDefaults.renderer=e.jqplot.DonutAxisRenderer;o.legend.renderer=e.jqplot.DonutLegendRenderer;o.legend.preDraw=true;o.seriesDefaults.pointLabels={show:false}}}function g(r,q,o){for(var p=1;p<this.series.length;p++){if(!this.series[p]._previousSeries.length){for(var n=0;n<p;n++){if(this.series[p].renderer.constructor==e.jqplot.DonutRenderer&&this.series[n].renderer.constructor==e.jqplot.DonutRenderer){this.series[p]._previousSeries.push(this.series[n])}}}}for(p=0;p<this.series.length;p++){if(this.series[p].renderer.constructor==e.jqplot.DonutRenderer){this.series[p]._numberSeries=this.series.length;if(this.series[p].highlightMouseOver){this.series[p].highlightMouseDown=false}}}}var k=false;function l(n){for(var o=0;o<this.series.length;o++){this.series[o].seriesColors=this.seriesColors;this.series[o].colorGenerator=e.jqplot.colorGenerator}}function d(r,q,p){var o=r.series[q];var n=r.plugins.donutRenderer.highlightCanvas;n._ctx.clearRect(0,0,n._ctx.canvas.width,n._ctx.canvas.height);o._highlightedPoint=p;r.plugins.donutRenderer.highlightedSeriesIndex=q;o.renderer.drawSlice.call(o,n._ctx,o._sliceAngles[p][0],o._sliceAngles[p][1],o.highlightColors[p],false)}function i(p){var n=p.plugins.donutRenderer.highlightCanvas;n._ctx.clearRect(0,0,n._ctx.canvas.width,n._ctx.canvas.height);for(var o=0;o<p.series.length;o++){p.series[o]._highlightedPoint=null}p.plugins.donutRenderer.highlightedSeriesIndex=null;p.target.trigger("jqplotDataUnhighlight")}function b(r,q,u,t,s){if(t){var p=[t.seriesIndex,t.pointIndex,t.data];var o=jQuery.Event("jqplotDataMouseOver");o.pageX=r.pageX;o.pageY=r.pageY;s.target.trigger(o,p);if(s.series[p[0]].highlightMouseOver&&!(p[0]==s.plugins.donutRenderer.highlightedSeriesIndex&&p[1]==s.series[p[0]]._highlightedPoint)){var n=jQuery.Event("jqplotDataHighlight");n.which=r.which;n.pageX=r.pageX;n.pageY=r.pageY;s.target.trigger(n,p);d(s,p[0],p[1])}}else{if(t==null){i(s)}}}function a(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];if(r.series[o[0]].highlightMouseDown&&!(o[0]==r.plugins.donutRenderer.highlightedSeriesIndex&&o[1]==r.series[o[0]]._highlightedPoint)){var n=jQuery.Event("jqplotDataHighlight");n.which=q.which;n.pageX=q.pageX;n.pageY=q.pageY;r.target.trigger(n,o);d(r,o[0],o[1])}}else{if(s==null){i(r)}}}function j(p,o,s,r,q){var n=q.plugins.donutRenderer.highlightedSeriesIndex;if(n!=null&&q.series[n].highlightMouseDown){i(q)}}function f(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];var n=jQuery.Event("jqplotDataClick");n.which=q.which;n.pageX=q.pageX;n.pageY=q.pageY;r.target.trigger(n,o)}}function m(r,q,u,t,s){if(t){var p=[t.seriesIndex,t.pointIndex,t.data];var n=s.plugins.donutRenderer.highlightedSeriesIndex;if(n!=null&&s.series[n].highlightMouseDown){i(s)}var o=jQuery.Event("jqplotDataRightClick");o.which=r.which;o.pageX=r.pageX;o.pageY=r.pageY;s.target.trigger(o,p)}}function h(){if(this.plugins.donutRenderer&&this.plugins.donutRenderer.highlightCanvas){this.plugins.donutRenderer.highlightCanvas.resetCanvas();this.plugins.donutRenderer.highlightCanvas=null}this.plugins.donutRenderer={highlightedSeriesIndex:null};this.plugins.donutRenderer.highlightCanvas=new e.jqplot.GenericCanvas();var o=e(this.targetId+" .jqplot-data-label");if(o.length){e(o[0]).before(this.plugins.donutRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-donutRenderer-highlight-canvas",this._plotDimensions,this))}else{this.eventCanvas._elem.before(this.plugins.donutRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-donutRenderer-highlight-canvas",this._plotDimensions,this))}var n=this.plugins.donutRenderer.highlightCanvas.setContext();this.eventCanvas._elem.bind("mouseleave",{plot:this},function(p){i(p.data.plot)})}e.jqplot.preInitHooks.push(c);e.jqplot.DonutTickRenderer=function(){e.jqplot.AxisTickRenderer.call(this)};e.jqplot.DonutTickRenderer.prototype=new e.jqplot.AxisTickRenderer();e.jqplot.DonutTickRenderer.prototype.constructor=e.jqplot.DonutTickRenderer})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.dragable.js
ADDED
@@ -0,0 +1,225 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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 |
+
/**
|
34 |
+
* Class: $.jqplot.Dragable
|
35 |
+
* Plugin to make plotted points dragable by the user.
|
36 |
+
*/
|
37 |
+
$.jqplot.Dragable = function(options) {
|
38 |
+
// Group: Properties
|
39 |
+
this.markerRenderer = new $.jqplot.MarkerRenderer({shadow:false});
|
40 |
+
this.shapeRenderer = new $.jqplot.ShapeRenderer();
|
41 |
+
this.isDragging = false;
|
42 |
+
this.isOver = false;
|
43 |
+
this._ctx;
|
44 |
+
this._elem;
|
45 |
+
this._point;
|
46 |
+
this._gridData;
|
47 |
+
// prop: color
|
48 |
+
// CSS color spec for the dragged point (and adjacent line segment or bar).
|
49 |
+
this.color;
|
50 |
+
// prop: constrainTo
|
51 |
+
// Constrain dragging motion to an axis or to none.
|
52 |
+
// Allowable values are 'none', 'x', 'y'
|
53 |
+
this.constrainTo = 'none'; // 'x', 'y', or 'none';
|
54 |
+
$.extend(true, this, options);
|
55 |
+
};
|
56 |
+
|
57 |
+
function DragCanvas() {
|
58 |
+
$.jqplot.GenericCanvas.call(this);
|
59 |
+
this.isDragging = false;
|
60 |
+
this.isOver = false;
|
61 |
+
this._neighbor;
|
62 |
+
this._cursors = [];
|
63 |
+
}
|
64 |
+
|
65 |
+
DragCanvas.prototype = new $.jqplot.GenericCanvas();
|
66 |
+
DragCanvas.prototype.constructor = DragCanvas;
|
67 |
+
|
68 |
+
|
69 |
+
// called within scope of series
|
70 |
+
$.jqplot.Dragable.parseOptions = function (defaults, opts) {
|
71 |
+
var options = opts || {};
|
72 |
+
this.plugins.dragable = new $.jqplot.Dragable(options.dragable);
|
73 |
+
// since this function is called before series options are parsed,
|
74 |
+
// we can set this here and it will be overridden if needed.
|
75 |
+
this.isDragable = $.jqplot.config.enablePlugins;
|
76 |
+
};
|
77 |
+
|
78 |
+
// called within context of plot
|
79 |
+
// create a canvas which we can draw on.
|
80 |
+
// insert it before the eventCanvas, so eventCanvas will still capture events.
|
81 |
+
// add a new DragCanvas object to the plot plugins to handle drawing on this new canvas.
|
82 |
+
$.jqplot.Dragable.postPlotDraw = function() {
|
83 |
+
// Memory Leaks patch
|
84 |
+
if (this.plugins.dragable && this.plugins.dragable.highlightCanvas) {
|
85 |
+
this.plugins.dragable.highlightCanvas.resetCanvas();
|
86 |
+
this.plugins.dragable.highlightCanvas = null;
|
87 |
+
}
|
88 |
+
|
89 |
+
this.plugins.dragable = {previousCursor:'auto', isOver:false};
|
90 |
+
this.plugins.dragable.dragCanvas = new DragCanvas();
|
91 |
+
|
92 |
+
this.eventCanvas._elem.before(this.plugins.dragable.dragCanvas.createElement(this._gridPadding, 'jqplot-dragable-canvas', this._plotDimensions, this));
|
93 |
+
var dctx = this.plugins.dragable.dragCanvas.setContext();
|
94 |
+
};
|
95 |
+
|
96 |
+
//$.jqplot.preInitHooks.push($.jqplot.Dragable.init);
|
97 |
+
$.jqplot.preParseSeriesOptionsHooks.push($.jqplot.Dragable.parseOptions);
|
98 |
+
$.jqplot.postDrawHooks.push($.jqplot.Dragable.postPlotDraw);
|
99 |
+
$.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMove]);
|
100 |
+
$.jqplot.eventListenerHooks.push(['jqplotMouseDown', handleDown]);
|
101 |
+
$.jqplot.eventListenerHooks.push(['jqplotMouseUp', handleUp]);
|
102 |
+
|
103 |
+
|
104 |
+
function initDragPoint(plot, neighbor) {
|
105 |
+
var s = plot.series[neighbor.seriesIndex];
|
106 |
+
var drag = s.plugins.dragable;
|
107 |
+
|
108 |
+
// first, init the mark renderer for the dragged point
|
109 |
+
var smr = s.markerRenderer;
|
110 |
+
var mr = drag.markerRenderer;
|
111 |
+
mr.style = smr.style;
|
112 |
+
mr.lineWidth = smr.lineWidth + 2.5;
|
113 |
+
mr.size = smr.size + 5;
|
114 |
+
if (!drag.color) {
|
115 |
+
var rgba = $.jqplot.getColorComponents(smr.color);
|
116 |
+
var newrgb = [rgba[0], rgba[1], rgba[2]];
|
117 |
+
var alpha = (rgba[3] >= 0.6) ? rgba[3]*0.6 : rgba[3]*(2-rgba[3]);
|
118 |
+
drag.color = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+alpha+')';
|
119 |
+
}
|
120 |
+
mr.color = drag.color;
|
121 |
+
mr.init();
|
122 |
+
|
123 |
+
var start = (neighbor.pointIndex > 0) ? neighbor.pointIndex - 1 : 0;
|
124 |
+
var end = neighbor.pointIndex+2;
|
125 |
+
drag._gridData = s.gridData.slice(start, end);
|
126 |
+
}
|
127 |
+
|
128 |
+
function handleMove(ev, gridpos, datapos, neighbor, plot) {
|
129 |
+
if (plot.plugins.dragable.dragCanvas.isDragging) {
|
130 |
+
var dc = plot.plugins.dragable.dragCanvas;
|
131 |
+
var dp = dc._neighbor;
|
132 |
+
var s = plot.series[dp.seriesIndex];
|
133 |
+
var drag = s.plugins.dragable;
|
134 |
+
var gd = s.gridData;
|
135 |
+
|
136 |
+
// compute the new grid position with any constraints.
|
137 |
+
var x = (drag.constrainTo == 'y') ? dp.gridData[0] : gridpos.x;
|
138 |
+
var y = (drag.constrainTo == 'x') ? dp.gridData[1] : gridpos.y;
|
139 |
+
|
140 |
+
// compute data values for any listeners.
|
141 |
+
var xu = s._xaxis.series_p2u(x);
|
142 |
+
var yu = s._yaxis.series_p2u(y);
|
143 |
+
|
144 |
+
// clear the canvas then redraw effect at new position.
|
145 |
+
var ctx = dc._ctx;
|
146 |
+
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
147 |
+
|
148 |
+
// adjust our gridData for the new mouse position
|
149 |
+
if (dp.pointIndex > 0) {
|
150 |
+
drag._gridData[1] = [x, y];
|
151 |
+
}
|
152 |
+
else {
|
153 |
+
drag._gridData[0] = [x, y];
|
154 |
+
}
|
155 |
+
plot.series[dp.seriesIndex].draw(dc._ctx, {gridData:drag._gridData, shadow:false, preventJqPlotSeriesDrawTrigger:true, color:drag.color, markerOptions:{color:drag.color, shadow:false}, trendline:{show:false}});
|
156 |
+
plot.target.trigger('jqplotSeriesPointChange', [dp.seriesIndex, dp.pointIndex, [xu,yu], [x,y]]);
|
157 |
+
}
|
158 |
+
else if (neighbor != null) {
|
159 |
+
var series = plot.series[neighbor.seriesIndex];
|
160 |
+
if (series.isDragable) {
|
161 |
+
var dc = plot.plugins.dragable.dragCanvas;
|
162 |
+
if (!dc.isOver) {
|
163 |
+
dc._cursors.push(ev.target.style.cursor);
|
164 |
+
ev.target.style.cursor = "pointer";
|
165 |
+
}
|
166 |
+
dc.isOver = true;
|
167 |
+
}
|
168 |
+
}
|
169 |
+
else if (neighbor == null) {
|
170 |
+
var dc = plot.plugins.dragable.dragCanvas;
|
171 |
+
if (dc.isOver) {
|
172 |
+
ev.target.style.cursor = dc._cursors.pop();
|
173 |
+
dc.isOver = false;
|
174 |
+
}
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
function handleDown(ev, gridpos, datapos, neighbor, plot) {
|
179 |
+
var dc = plot.plugins.dragable.dragCanvas;
|
180 |
+
dc._cursors.push(ev.target.style.cursor);
|
181 |
+
if (neighbor != null) {
|
182 |
+
var s = plot.series[neighbor.seriesIndex];
|
183 |
+
var drag = s.plugins.dragable;
|
184 |
+
if (s.isDragable && !dc.isDragging) {
|
185 |
+
dc._neighbor = neighbor;
|
186 |
+
dc.isDragging = true;
|
187 |
+
initDragPoint(plot, neighbor);
|
188 |
+
drag.markerRenderer.draw(s.gridData[neighbor.pointIndex][0], s.gridData[neighbor.pointIndex][1], dc._ctx);
|
189 |
+
ev.target.style.cursor = "move";
|
190 |
+
plot.target.trigger('jqplotDragStart', [neighbor.seriesIndex, neighbor.pointIndex, gridpos, datapos]);
|
191 |
+
}
|
192 |
+
}
|
193 |
+
// Just in case of a hickup, we'll clear the drag canvas and reset.
|
194 |
+
else {
|
195 |
+
var ctx = dc._ctx;
|
196 |
+
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
197 |
+
dc.isDragging = false;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
function handleUp(ev, gridpos, datapos, neighbor, plot) {
|
202 |
+
if (plot.plugins.dragable.dragCanvas.isDragging) {
|
203 |
+
var dc = plot.plugins.dragable.dragCanvas;
|
204 |
+
// clear the canvas
|
205 |
+
var ctx = dc._ctx;
|
206 |
+
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
|
207 |
+
dc.isDragging = false;
|
208 |
+
// redraw the series canvas at the new point.
|
209 |
+
var dp = dc._neighbor;
|
210 |
+
var s = plot.series[dp.seriesIndex];
|
211 |
+
var drag = s.plugins.dragable;
|
212 |
+
// compute the new grid position with any constraints.
|
213 |
+
var x = (drag.constrainTo == 'y') ? dp.data[0] : datapos[s.xaxis];
|
214 |
+
var y = (drag.constrainTo == 'x') ? dp.data[1] : datapos[s.yaxis];
|
215 |
+
// var x = datapos[s.xaxis];
|
216 |
+
// var y = datapos[s.yaxis];
|
217 |
+
s.data[dp.pointIndex][0] = x;
|
218 |
+
s.data[dp.pointIndex][1] = y;
|
219 |
+
plot.drawSeries({preventJqPlotSeriesDrawTrigger:true}, dp.seriesIndex);
|
220 |
+
dc._neighbor = null;
|
221 |
+
ev.target.style.cursor = dc._cursors.pop();
|
222 |
+
plot.target.trigger('jqplotDragStop', [gridpos, datapos]);
|
223 |
+
}
|
224 |
+
}
|
225 |
+
})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.dragable.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(d){d.jqplot.Dragable=function(g){this.markerRenderer=new d.jqplot.MarkerRenderer({shadow:false});this.shapeRenderer=new d.jqplot.ShapeRenderer();this.isDragging=false;this.isOver=false;this._ctx;this._elem;this._point;this._gridData;this.color;this.constrainTo="none";d.extend(true,this,g)};function b(){d.jqplot.GenericCanvas.call(this);this.isDragging=false;this.isOver=false;this._neighbor;this._cursors=[]}b.prototype=new d.jqplot.GenericCanvas();b.prototype.constructor=b;d.jqplot.Dragable.parseOptions=function(i,h){var g=h||{};this.plugins.dragable=new d.jqplot.Dragable(g.dragable);this.isDragable=d.jqplot.config.enablePlugins};d.jqplot.Dragable.postPlotDraw=function(){if(this.plugins.dragable&&this.plugins.dragable.highlightCanvas){this.plugins.dragable.highlightCanvas.resetCanvas();this.plugins.dragable.highlightCanvas=null}this.plugins.dragable={previousCursor:"auto",isOver:false};this.plugins.dragable.dragCanvas=new b();this.eventCanvas._elem.before(this.plugins.dragable.dragCanvas.createElement(this._gridPadding,"jqplot-dragable-canvas",this._plotDimensions,this));var g=this.plugins.dragable.dragCanvas.setContext()};d.jqplot.preParseSeriesOptionsHooks.push(d.jqplot.Dragable.parseOptions);d.jqplot.postDrawHooks.push(d.jqplot.Dragable.postPlotDraw);d.jqplot.eventListenerHooks.push(["jqplotMouseMove",e]);d.jqplot.eventListenerHooks.push(["jqplotMouseDown",c]);d.jqplot.eventListenerHooks.push(["jqplotMouseUp",a]);function f(n,p){var q=n.series[p.seriesIndex];var m=q.plugins.dragable;var h=q.markerRenderer;var i=m.markerRenderer;i.style=h.style;i.lineWidth=h.lineWidth+2.5;i.size=h.size+5;if(!m.color){var l=d.jqplot.getColorComponents(h.color);var o=[l[0],l[1],l[2]];var k=(l[3]>=0.6)?l[3]*0.6:l[3]*(2-l[3]);m.color="rgba("+o[0]+","+o[1]+","+o[2]+","+k+")"}i.color=m.color;i.init();var g=(p.pointIndex>0)?p.pointIndex-1:0;var j=p.pointIndex+2;m._gridData=q.gridData.slice(g,j)}function e(o,l,h,t,m){if(m.plugins.dragable.dragCanvas.isDragging){var u=m.plugins.dragable.dragCanvas;var i=u._neighbor;var w=m.series[i.seriesIndex];var k=w.plugins.dragable;var r=w.gridData;var p=(k.constrainTo=="y")?i.gridData[0]:l.x;var n=(k.constrainTo=="x")?i.gridData[1]:l.y;var g=w._xaxis.series_p2u(p);var q=w._yaxis.series_p2u(n);var v=u._ctx;v.clearRect(0,0,v.canvas.width,v.canvas.height);if(i.pointIndex>0){k._gridData[1]=[p,n]}else{k._gridData[0]=[p,n]}m.series[i.seriesIndex].draw(u._ctx,{gridData:k._gridData,shadow:false,preventJqPlotSeriesDrawTrigger:true,color:k.color,markerOptions:{color:k.color,shadow:false},trendline:{show:false}});m.target.trigger("jqplotSeriesPointChange",[i.seriesIndex,i.pointIndex,[g,q],[p,n]])}else{if(t!=null){var j=m.series[t.seriesIndex];if(j.isDragable){var u=m.plugins.dragable.dragCanvas;if(!u.isOver){u._cursors.push(o.target.style.cursor);o.target.style.cursor="pointer"}u.isOver=true}}else{if(t==null){var u=m.plugins.dragable.dragCanvas;if(u.isOver){o.target.style.cursor=u._cursors.pop();u.isOver=false}}}}}function c(k,i,g,l,j){var m=j.plugins.dragable.dragCanvas;m._cursors.push(k.target.style.cursor);if(l!=null){var o=j.series[l.seriesIndex];var h=o.plugins.dragable;if(o.isDragable&&!m.isDragging){m._neighbor=l;m.isDragging=true;f(j,l);h.markerRenderer.draw(o.gridData[l.pointIndex][0],o.gridData[l.pointIndex][1],m._ctx);k.target.style.cursor="move";j.target.trigger("jqplotDragStart",[l.seriesIndex,l.pointIndex,i,g])}}else{var n=m._ctx;n.clearRect(0,0,n.canvas.width,n.canvas.height);m.isDragging=false}}function a(m,j,g,o,k){if(k.plugins.dragable.dragCanvas.isDragging){var p=k.plugins.dragable.dragCanvas;var q=p._ctx;q.clearRect(0,0,q.canvas.width,q.canvas.height);p.isDragging=false;var h=p._neighbor;var r=k.series[h.seriesIndex];var i=r.plugins.dragable;var n=(i.constrainTo=="y")?h.data[0]:g[r.xaxis];var l=(i.constrainTo=="x")?h.data[1]:g[r.yaxis];r.data[h.pointIndex][0]=n;r.data[h.pointIndex][1]=l;k.drawSeries({preventJqPlotSeriesDrawTrigger:true},h.seriesIndex);p._neighbor=null;m.target.style.cursor=p._cursors.pop();k.target.trigger("jqplotDragStop",[j,g])}}})(jQuery);
|
backend/settings/assets/js/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.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.enhancedLegendRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(c){c.jqplot.EnhancedLegendRenderer=function(){c.jqplot.TableLegendRenderer.call(this)};c.jqplot.EnhancedLegendRenderer.prototype=new c.jqplot.TableLegendRenderer();c.jqplot.EnhancedLegendRenderer.prototype.constructor=c.jqplot.EnhancedLegendRenderer;c.jqplot.EnhancedLegendRenderer.prototype.init=function(d){this.numberRows=null;this.numberColumns=null;this.seriesToggle="normal";this.seriesToggleReplot=false;this.disableIEFading=true;c.extend(true,this,d);if(this.seriesToggle){c.jqplot.postDrawHooks.push(b)}};c.jqplot.EnhancedLegendRenderer.prototype.draw=function(m,y){var f=this;if(this.show){var r=this._series;var u;var w="position:absolute;";w+=(this.background)?"background:"+this.background+";":"";w+=(this.border)?"border:"+this.border+";":"";w+=(this.fontSize)?"font-size:"+this.fontSize+";":"";w+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";w+=(this.textColor)?"color:"+this.textColor+";":"";w+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";w+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";w+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";w+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=c('<table class="jqplot-table-legend" style="'+w+'"></table>');if(this.seriesToggle){this._elem.css("z-index","3")}var C=false,q=false,d,o;if(this.numberRows){d=this.numberRows;if(!this.numberColumns){o=Math.ceil(r.length/d)}else{o=this.numberColumns}}else{if(this.numberColumns){o=this.numberColumns;d=Math.ceil(r.length/this.numberColumns)}else{d=r.length;o=1}}var B,z,e,l,k,n,p,t,h,g;var v=0;for(B=r.length-1;B>=0;B--){if(o==1&&r[B]._stack||r[B].renderer.constructor==c.jqplot.BezierCurveRenderer){q=true}}for(B=0;B<d;B++){e=c(document.createElement("tr"));e.addClass("jqplot-table-legend");if(q){e.prependTo(this._elem)}else{e.appendTo(this._elem)}for(z=0;z<o;z++){if(v<r.length&&(r[v].show||r[v].showLabel)){u=r[v];n=this.labels[v]||u.label.toString();if(n){var x=u.color;if(!q){if(B>0){C=true}else{C=false}}else{if(B==d-1){C=false}else{C=true}}p=(C)?this.rowSpacing:"0";l=c(document.createElement("td"));l.addClass("jqplot-table-legend jqplot-table-legend-swatch");l.css({textAlign:"center",paddingTop:p});h=c(document.createElement("div"));h.addClass("jqplot-table-legend-swatch-outline");g=c(document.createElement("div"));g.addClass("jqplot-table-legend-swatch");g.css({backgroundColor:x,borderColor:x});l.append(h.append(g));k=c(document.createElement("td"));k.addClass("jqplot-table-legend jqplot-table-legend-label");k.css("paddingTop",p);if(this.escapeHtml){k.text(n)}else{k.html(n)}if(q){if(this.showLabels){k.prependTo(e)}if(this.showSwatches){l.prependTo(e)}}else{if(this.showSwatches){l.appendTo(e)}if(this.showLabels){k.appendTo(e)}}if(this.seriesToggle){var A;if(typeof(this.seriesToggle)==="string"||typeof(this.seriesToggle)==="number"){if(!c.jqplot.use_excanvas||!this.disableIEFading){A=this.seriesToggle}}if(this.showSwatches){l.bind("click",{series:u,speed:A,plot:y,replot:this.seriesToggleReplot},a);l.addClass("jqplot-seriesToggle")}if(this.showLabels){k.bind("click",{series:u,speed:A,plot:y,replot:this.seriesToggleReplot},a);k.addClass("jqplot-seriesToggle")}if(!u.show&&u.showLabel){l.addClass("jqplot-series-hidden");k.addClass("jqplot-series-hidden")}}C=true}}v++}l=k=h=g=null}}return this._elem};var a=function(j){var i=j.data,m=i.series,k=i.replot,h=i.plot,f=i.speed,l=m.index,g=false;if(m.canvas._elem.is(":hidden")||!m.show){g=true}var e=function(){if(k){var n={};if(c.isPlainObject(k)){c.extend(true,n,k)}h.replot(n);if(g&&f){var d=h.series[l];if(d.shadowCanvas._elem){d.shadowCanvas._elem.hide().fadeIn(f)}d.canvas._elem.hide().fadeIn(f);d.canvas._elem.nextAll(".jqplot-point-label.jqplot-series-"+d.index).hide().fadeIn(f)}}else{var d=h.series[l];if(d.canvas._elem.is(":hidden")||!d.show){if(typeof h.options.legend.showSwatches==="undefined"||h.options.legend.showSwatches===true){h.legend._elem.find("td").eq(l*2).addClass("jqplot-series-hidden")}if(typeof h.options.legend.showLabels==="undefined"||h.options.legend.showLabels===true){h.legend._elem.find("td").eq((l*2)+1).addClass("jqplot-series-hidden")}}else{if(typeof h.options.legend.showSwatches==="undefined"||h.options.legend.showSwatches===true){h.legend._elem.find("td").eq(l*2).removeClass("jqplot-series-hidden")}if(typeof h.options.legend.showLabels==="undefined"||h.options.legend.showLabels===true){h.legend._elem.find("td").eq((l*2)+1).removeClass("jqplot-series-hidden")}}}};m.toggleDisplay(j,e)};var b=function(){if(this.legend.renderer.constructor==c.jqplot.EnhancedLegendRenderer&&this.legend.seriesToggle){var d=this.legend._elem.detach();this.eventCanvas._elem.after(d)}}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.funnelRenderer.js
ADDED
@@ -0,0 +1,943 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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.FunnelRenderer
|
34 |
+
* Plugin renderer to draw a funnel chart.
|
35 |
+
* x values, if present, will be used as labels.
|
36 |
+
* y values give area size.
|
37 |
+
*
|
38 |
+
* Funnel charts will draw a single series
|
39 |
+
* only.
|
40 |
+
*
|
41 |
+
* To use this renderer, you need to include the
|
42 |
+
* funnel renderer plugin, for example:
|
43 |
+
*
|
44 |
+
* > <script type="text/javascript" src="plugins/jqplot.funnelRenderer.js"></script>
|
45 |
+
*
|
46 |
+
* Properties described here are passed into the $.jqplot function
|
47 |
+
* as options on the series renderer. For example:
|
48 |
+
*
|
49 |
+
* > plot2 = $.jqplot('chart2', [s1, s2], {
|
50 |
+
* > seriesDefaults: {
|
51 |
+
* > renderer:$.jqplot.FunnelRenderer,
|
52 |
+
* > rendererOptions:{
|
53 |
+
* > sectionMargin: 12,
|
54 |
+
* > widthRatio: 0.3
|
55 |
+
* > }
|
56 |
+
* > }
|
57 |
+
* > });
|
58 |
+
*
|
59 |
+
* IMPORTANT
|
60 |
+
*
|
61 |
+
* *The funnel renderer will reorder data in descending order* so the largest value in
|
62 |
+
* the data set is first and displayed on top of the funnel. Data will then
|
63 |
+
* be displayed in descending order down the funnel. The area of each funnel
|
64 |
+
* section will correspond to the value of each data point relative to the sum
|
65 |
+
* of all values. That is section area is proportional to section value divided by
|
66 |
+
* sum of all section values.
|
67 |
+
*
|
68 |
+
* If your data is not in descending order when passed into the plot, *it will be
|
69 |
+
* reordered* when stored in the series.data property. A copy of the unordered
|
70 |
+
* data is kept in the series._unorderedData property.
|
71 |
+
*
|
72 |
+
* A funnel plot will trigger events on the plot target
|
73 |
+
* according to user interaction. All events return the event object,
|
74 |
+
* the series index, the point (section) index, and the point data for
|
75 |
+
* the appropriate section. *Note* the point index will referr to the ordered
|
76 |
+
* data, not the original unordered data.
|
77 |
+
*
|
78 |
+
* 'jqplotDataMouseOver' - triggered when mousing over a section.
|
79 |
+
* 'jqplotDataHighlight' - triggered the first time user mouses over a section,
|
80 |
+
* if highlighting is enabled.
|
81 |
+
* 'jqplotDataUnhighlight' - triggered when a user moves the mouse out of
|
82 |
+
* a highlighted section.
|
83 |
+
* 'jqplotDataClick' - triggered when the user clicks on a section.
|
84 |
+
* 'jqplotDataRightClick' - tiggered when the user right clicks on a section if
|
85 |
+
* the "captureRightClick" option is set to true on the plot.
|
86 |
+
*/
|
87 |
+
$.jqplot.FunnelRenderer = function(){
|
88 |
+
$.jqplot.LineRenderer.call(this);
|
89 |
+
};
|
90 |
+
|
91 |
+
$.jqplot.FunnelRenderer.prototype = new $.jqplot.LineRenderer();
|
92 |
+
$.jqplot.FunnelRenderer.prototype.constructor = $.jqplot.FunnelRenderer;
|
93 |
+
|
94 |
+
// called with scope of a series
|
95 |
+
$.jqplot.FunnelRenderer.prototype.init = function(options, plot) {
|
96 |
+
// Group: Properties
|
97 |
+
//
|
98 |
+
// prop: padding
|
99 |
+
// padding between the funnel and plot edges, legend, etc.
|
100 |
+
this.padding = {top: 20, right: 20, bottom: 20, left: 20};
|
101 |
+
// prop: sectionMargin
|
102 |
+
// spacing between funnel sections in pixels.
|
103 |
+
this.sectionMargin = 6;
|
104 |
+
// prop: fill
|
105 |
+
// true or false, wether to fill the areas.
|
106 |
+
this.fill = true;
|
107 |
+
// prop: shadowOffset
|
108 |
+
// offset of the shadow from the area and offset of
|
109 |
+
// each succesive stroke of the shadow from the last.
|
110 |
+
this.shadowOffset = 2;
|
111 |
+
// prop: shadowAlpha
|
112 |
+
// transparency of the shadow (0 = transparent, 1 = opaque)
|
113 |
+
this.shadowAlpha = 0.07;
|
114 |
+
// prop: shadowDepth
|
115 |
+
// number of strokes to apply to the shadow,
|
116 |
+
// each stroke offset shadowOffset from the last.
|
117 |
+
this.shadowDepth = 5;
|
118 |
+
// prop: highlightMouseOver
|
119 |
+
// True to highlight area when moused over.
|
120 |
+
// This must be false to enable highlightMouseDown to highlight when clicking on a area.
|
121 |
+
this.highlightMouseOver = true;
|
122 |
+
// prop: highlightMouseDown
|
123 |
+
// True to highlight when a mouse button is pressed over a area.
|
124 |
+
// This will be disabled if highlightMouseOver is true.
|
125 |
+
this.highlightMouseDown = false;
|
126 |
+
// prop: highlightColors
|
127 |
+
// array of colors to use when highlighting an area.
|
128 |
+
this.highlightColors = [];
|
129 |
+
// prop: widthRatio
|
130 |
+
// The ratio of the width of the top of the funnel to the bottom.
|
131 |
+
// a ratio of 0 will make an upside down pyramid.
|
132 |
+
this.widthRatio = 0.2;
|
133 |
+
// prop: lineWidth
|
134 |
+
// width of line if areas are stroked and not filled.
|
135 |
+
this.lineWidth = 2;
|
136 |
+
// prop: dataLabels
|
137 |
+
// Either 'label', 'value', 'percent' or an array of labels to place on the pie slices.
|
138 |
+
// Defaults to percentage of each pie slice.
|
139 |
+
this.dataLabels = 'percent';
|
140 |
+
// prop: showDataLabels
|
141 |
+
// true to show data labels on slices.
|
142 |
+
this.showDataLabels = false;
|
143 |
+
// prop: dataLabelFormatString
|
144 |
+
// Format string for data labels. If none, '%s' is used for "label" and for arrays, '%d' for value and '%d%%' for percentage.
|
145 |
+
this.dataLabelFormatString = null;
|
146 |
+
// prop: dataLabelThreshold
|
147 |
+
// Threshhold in percentage (0 - 100) of pie area, below which no label will be displayed.
|
148 |
+
// This applies to all label types, not just to percentage labels.
|
149 |
+
this.dataLabelThreshold = 3;
|
150 |
+
this._type = 'funnel';
|
151 |
+
|
152 |
+
this.tickRenderer = $.jqplot.FunnelTickRenderer;
|
153 |
+
|
154 |
+
// if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver
|
155 |
+
if (options.highlightMouseDown && options.highlightMouseOver == null) {
|
156 |
+
options.highlightMouseOver = false;
|
157 |
+
}
|
158 |
+
|
159 |
+
$.extend(true, this, options);
|
160 |
+
|
161 |
+
// index of the currenty highlighted point, if any
|
162 |
+
this._highlightedPoint = null;
|
163 |
+
|
164 |
+
// lengths of bases, or horizontal sides of areas of trapezoid.
|
165 |
+
this._bases = [];
|
166 |
+
// total area
|
167 |
+
this._atot;
|
168 |
+
// areas of segments.
|
169 |
+
this._areas = [];
|
170 |
+
// vertical lengths of segments.
|
171 |
+
this._lengths = [];
|
172 |
+
// angle of the funnel to vertical.
|
173 |
+
this._angle;
|
174 |
+
this._dataIndices = [];
|
175 |
+
|
176 |
+
// sort data
|
177 |
+
this._unorderedData = $.extend(true, [], this.data);
|
178 |
+
var idxs = $.extend(true, [], this.data);
|
179 |
+
for (var i=0; i<idxs.length; i++) {
|
180 |
+
idxs[i].push(i);
|
181 |
+
}
|
182 |
+
this.data.sort( function (a, b) { return b[1] - a[1]; } );
|
183 |
+
idxs.sort( function (a, b) { return b[1] - a[1]; });
|
184 |
+
for (var i=0; i<idxs.length; i++) {
|
185 |
+
this._dataIndices.push(idxs[i][2]);
|
186 |
+
}
|
187 |
+
|
188 |
+
// set highlight colors if none provided
|
189 |
+
if (this.highlightColors.length == 0) {
|
190 |
+
for (var i=0; i<this.seriesColors.length; i++){
|
191 |
+
var rgba = $.jqplot.getColorComponents(this.seriesColors[i]);
|
192 |
+
var newrgb = [rgba[0], rgba[1], rgba[2]];
|
193 |
+
var sum = newrgb[0] + newrgb[1] + newrgb[2];
|
194 |
+
for (var j=0; j<3; j++) {
|
195 |
+
// when darkening, lowest color component can be is 60.
|
196 |
+
newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.4 * (255 - newrgb[j]);
|
197 |
+
newrgb[j] = parseInt(newrgb[j], 10);
|
198 |
+
}
|
199 |
+
this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')');
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
plot.postParseOptionsHooks.addOnce(postParseOptions);
|
204 |
+
plot.postInitHooks.addOnce(postInit);
|
205 |
+
plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
|
206 |
+
plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
|
207 |
+
plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
|
208 |
+
plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
|
209 |
+
plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick);
|
210 |
+
plot.postDrawHooks.addOnce(postPlotDraw);
|
211 |
+
|
212 |
+
};
|
213 |
+
|
214 |
+
// gridData will be of form [label, percentage of total]
|
215 |
+
$.jqplot.FunnelRenderer.prototype.setGridData = function(plot) {
|
216 |
+
// set gridData property. This will hold angle in radians of each data point.
|
217 |
+
var sum = 0;
|
218 |
+
var td = [];
|
219 |
+
for (var i=0; i<this.data.length; i++){
|
220 |
+
sum += this.data[i][1];
|
221 |
+
td.push([this.data[i][0], this.data[i][1]]);
|
222 |
+
}
|
223 |
+
|
224 |
+
// normalize y values, so areas are proportional.
|
225 |
+
for (var i=0; i<td.length; i++) {
|
226 |
+
td[i][1] = td[i][1]/sum;
|
227 |
+
}
|
228 |
+
|
229 |
+
this._bases = new Array(td.length + 1);
|
230 |
+
this._lengths = new Array(td.length);
|
231 |
+
|
232 |
+
this.gridData = td;
|
233 |
+
};
|
234 |
+
|
235 |
+
$.jqplot.FunnelRenderer.prototype.makeGridData = function(data, plot) {
|
236 |
+
// set gridData property. This will hold angle in radians of each data point.
|
237 |
+
var sum = 0;
|
238 |
+
var td = [];
|
239 |
+
for (var i=0; i<this.data.length; i++){
|
240 |
+
sum += this.data[i][1];
|
241 |
+
td.push([this.data[i][0], this.data[i][1]]);
|
242 |
+
}
|
243 |
+
|
244 |
+
// normalize y values, so areas are proportional.
|
245 |
+
for (var i=0; i<td.length; i++) {
|
246 |
+
td[i][1] = td[i][1]/sum;
|
247 |
+
}
|
248 |
+
|
249 |
+
this._bases = new Array(td.length + 1);
|
250 |
+
this._lengths = new Array(td.length);
|
251 |
+
|
252 |
+
return td;
|
253 |
+
};
|
254 |
+
|
255 |
+
$.jqplot.FunnelRenderer.prototype.drawSection = function (ctx, vertices, color, isShadow) {
|
256 |
+
var fill = this.fill;
|
257 |
+
var lineWidth = this.lineWidth;
|
258 |
+
ctx.save();
|
259 |
+
|
260 |
+
if (isShadow) {
|
261 |
+
for (var i=0; i<this.shadowDepth; i++) {
|
262 |
+
ctx.save();
|
263 |
+
ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
|
264 |
+
doDraw();
|
265 |
+
}
|
266 |
+
}
|
267 |
+
|
268 |
+
else {
|
269 |
+
doDraw();
|
270 |
+
}
|
271 |
+
|
272 |
+
function doDraw () {
|
273 |
+
ctx.beginPath();
|
274 |
+
ctx.fillStyle = color;
|
275 |
+
ctx.strokeStyle = color;
|
276 |
+
ctx.lineWidth = lineWidth;
|
277 |
+
ctx.moveTo(vertices[0][0], vertices[0][1]);
|
278 |
+
for (var i=1; i<4; i++) {
|
279 |
+
ctx.lineTo(vertices[i][0], vertices[i][1]);
|
280 |
+
}
|
281 |
+
ctx.closePath();
|
282 |
+
if (fill) {
|
283 |
+
ctx.fill();
|
284 |
+
}
|
285 |
+
else {
|
286 |
+
ctx.stroke();
|
287 |
+
}
|
288 |
+
}
|
289 |
+
|
290 |
+
if (isShadow) {
|
291 |
+
for (var i=0; i<this.shadowDepth; i++) {
|
292 |
+
ctx.restore();
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
ctx.restore();
|
297 |
+
};
|
298 |
+
|
299 |
+
// called with scope of series
|
300 |
+
$.jqplot.FunnelRenderer.prototype.draw = function (ctx, gd, options, plot) {
|
301 |
+
var i;
|
302 |
+
var opts = (options != undefined) ? options : {};
|
303 |
+
// offset and direction of offset due to legend placement
|
304 |
+
var offx = 0;
|
305 |
+
var offy = 0;
|
306 |
+
var trans = 1;
|
307 |
+
this._areas = [];
|
308 |
+
// var colorGenerator = new this.colorGenerator(this.seriesColors);
|
309 |
+
if (options.legendInfo && options.legendInfo.placement == 'insideGrid') {
|
310 |
+
var li = options.legendInfo;
|
311 |
+
switch (li.location) {
|
312 |
+
case 'nw':
|
313 |
+
offx = li.width + li.xoffset;
|
314 |
+
break;
|
315 |
+
case 'w':
|
316 |
+
offx = li.width + li.xoffset;
|
317 |
+
break;
|
318 |
+
case 'sw':
|
319 |
+
offx = li.width + li.xoffset;
|
320 |
+
break;
|
321 |
+
case 'ne':
|
322 |
+
offx = li.width + li.xoffset;
|
323 |
+
trans = -1;
|
324 |
+
break;
|
325 |
+
case 'e':
|
326 |
+
offx = li.width + li.xoffset;
|
327 |
+
trans = -1;
|
328 |
+
break;
|
329 |
+
case 'se':
|
330 |
+
offx = li.width + li.xoffset;
|
331 |
+
trans = -1;
|
332 |
+
break;
|
333 |
+
case 'n':
|
334 |
+
offy = li.height + li.yoffset;
|
335 |
+
break;
|
336 |
+
case 's':
|
337 |
+
offy = li.height + li.yoffset;
|
338 |
+
trans = -1;
|
339 |
+
break;
|
340 |
+
default:
|
341 |
+
break;
|
342 |
+
}
|
343 |
+
}
|
344 |
+
|
345 |
+
var loff = (trans==1) ? this.padding.left + offx : this.padding.left;
|
346 |
+
var toff = (trans==1) ? this.padding.top + offy : this.padding.top;
|
347 |
+
var roff = (trans==-1) ? this.padding.right + offx : this.padding.right;
|
348 |
+
var boff = (trans==-1) ? this.padding.bottom + offy : this.padding.bottom;
|
349 |
+
|
350 |
+
var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
|
351 |
+
var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
|
352 |
+
var fill = (opts.fill != undefined) ? opts.fill : this.fill;
|
353 |
+
var cw = ctx.canvas.width;
|
354 |
+
var ch = ctx.canvas.height;
|
355 |
+
this._bases[0] = cw - loff - roff;
|
356 |
+
var ltot = this._length = ch - toff - boff;
|
357 |
+
|
358 |
+
var hend = this._bases[0]*this.widthRatio;
|
359 |
+
this._atot = ltot/2 * (this._bases[0] + this._bases[0]*this.widthRatio);
|
360 |
+
|
361 |
+
this._angle = Math.atan((this._bases[0] - hend)/2/ltot);
|
362 |
+
|
363 |
+
for (i=0; i<gd.length; i++) {
|
364 |
+
this._areas.push(gd[i][1] * this._atot);
|
365 |
+
}
|
366 |
+
|
367 |
+
|
368 |
+
var guess, err, count, lsum=0;
|
369 |
+
var tolerance = 0.0001;
|
370 |
+
|
371 |
+
for (i=0; i<this._areas.length; i++) {
|
372 |
+
guess = this._areas[i]/this._bases[i];
|
373 |
+
err = 999999;
|
374 |
+
this._lengths[i] = guess;
|
375 |
+
count = 0;
|
376 |
+
while (err > this._lengths[i]*tolerance && count < 100) {
|
377 |
+
this._lengths[i] = this._areas[i]/(this._bases[i] - this._lengths[i] * Math.tan(this._angle));
|
378 |
+
err = Math.abs(this._lengths[i] - guess);
|
379 |
+
this._bases[i+1] = this._bases[i] - (2*this._lengths[i]*Math.tan(this._angle));
|
380 |
+
guess = this._lengths[i];
|
381 |
+
count++;
|
382 |
+
}
|
383 |
+
lsum += this._lengths[i];
|
384 |
+
}
|
385 |
+
|
386 |
+
// figure out vertices of each section
|
387 |
+
this._vertices = new Array(gd.length);
|
388 |
+
|
389 |
+
// these are 4 coners of entire trapezoid
|
390 |
+
var p0 = [loff, toff],
|
391 |
+
p1 = [loff+this._bases[0], toff],
|
392 |
+
p2 = [loff + (this._bases[0] - this._bases[this._bases.length-1])/2, toff + this._length],
|
393 |
+
p3 = [p2[0] + this._bases[this._bases.length-1], p2[1]];
|
394 |
+
|
395 |
+
// equations of right and left sides, returns x, y values given height of section (y value)
|
396 |
+
function findleft (l) {
|
397 |
+
var m = (p0[1] - p2[1])/(p0[0] - p2[0]);
|
398 |
+
var b = p0[1] - m*p0[0];
|
399 |
+
var y = l + p0[1];
|
400 |
+
|
401 |
+
return [(y - b)/m, y];
|
402 |
+
}
|
403 |
+
|
404 |
+
function findright (l) {
|
405 |
+
var m = (p1[1] - p3[1])/(p1[0] - p3[0]);
|
406 |
+
var b = p1[1] - m*p1[0];
|
407 |
+
var y = l + p1[1];
|
408 |
+
|
409 |
+
return [(y - b)/m, y];
|
410 |
+
}
|
411 |
+
|
412 |
+
var x = offx, y = offy;
|
413 |
+
var h=0, adj=0;
|
414 |
+
|
415 |
+
for (i=0; i<gd.length; i++) {
|
416 |
+
this._vertices[i] = new Array();
|
417 |
+
var v = this._vertices[i];
|
418 |
+
var sm = this.sectionMargin;
|
419 |
+
if (i == 0) {
|
420 |
+
adj = 0;
|
421 |
+
}
|
422 |
+
if (i == 1) {
|
423 |
+
adj = sm/3;
|
424 |
+
}
|
425 |
+
else if (i > 0 && i < gd.length-1) {
|
426 |
+
adj = sm/2;
|
427 |
+
}
|
428 |
+
else if (i == gd.length -1) {
|
429 |
+
adj = 2*sm/3;
|
430 |
+
}
|
431 |
+
v.push(findleft(h+adj));
|
432 |
+
v.push(findright(h+adj));
|
433 |
+
h += this._lengths[i];
|
434 |
+
if (i == 0) {
|
435 |
+
adj = -2*sm/3;
|
436 |
+
}
|
437 |
+
else if (i > 0 && i < gd.length-1) {
|
438 |
+
adj = -sm/2;
|
439 |
+
}
|
440 |
+
else if (i == gd.length - 1) {
|
441 |
+
adj = 0;
|
442 |
+
}
|
443 |
+
v.push(findright(h+adj));
|
444 |
+
v.push(findleft(h+adj));
|
445 |
+
|
446 |
+
}
|
447 |
+
|
448 |
+
if (this.shadow) {
|
449 |
+
var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
|
450 |
+
for (var i=0; i<gd.length; i++) {
|
451 |
+
this.renderer.drawSection.call (this, ctx, this._vertices[i], shadowColor, true);
|
452 |
+
}
|
453 |
+
|
454 |
+
}
|
455 |
+
for (var i=0; i<gd.length; i++) {
|
456 |
+
var v = this._vertices[i];
|
457 |
+
this.renderer.drawSection.call (this, ctx, v, this.seriesColors[i]);
|
458 |
+
|
459 |
+
if (this.showDataLabels && gd[i][1]*100 >= this.dataLabelThreshold) {
|
460 |
+
var fstr, label;
|
461 |
+
|
462 |
+
if (this.dataLabels == 'label') {
|
463 |
+
fstr = this.dataLabelFormatString || '%s';
|
464 |
+
label = $.jqplot.sprintf(fstr, gd[i][0]);
|
465 |
+
}
|
466 |
+
else if (this.dataLabels == 'value') {
|
467 |
+
fstr = this.dataLabelFormatString || '%d';
|
468 |
+
label = $.jqplot.sprintf(fstr, this.data[i][1]);
|
469 |
+
}
|
470 |
+
else if (this.dataLabels == 'percent') {
|
471 |
+
fstr = this.dataLabelFormatString || '%d%%';
|
472 |
+
label = $.jqplot.sprintf(fstr, gd[i][1]*100);
|
473 |
+
}
|
474 |
+
else if (this.dataLabels.constructor == Array) {
|
475 |
+
fstr = this.dataLabelFormatString || '%s';
|
476 |
+
label = $.jqplot.sprintf(fstr, this.dataLabels[this._dataIndices[i]]);
|
477 |
+
}
|
478 |
+
|
479 |
+
var fact = (this._radius ) * this.dataLabelPositionFactor + this.sliceMargin + this.dataLabelNudge;
|
480 |
+
|
481 |
+
var x = (v[0][0] + v[1][0])/2 + this.canvas._offsets.left;
|
482 |
+
var y = (v[1][1] + v[2][1])/2 + this.canvas._offsets.top;
|
483 |
+
|
484 |
+
var labelelem = $('<span class="jqplot-funnel-series jqplot-data-label" style="position:absolute;">' + label + '</span>').insertBefore(plot.eventCanvas._elem);
|
485 |
+
x -= labelelem.width()/2;
|
486 |
+
y -= labelelem.height()/2;
|
487 |
+
x = Math.round(x);
|
488 |
+
y = Math.round(y);
|
489 |
+
labelelem.css({left: x, top: y});
|
490 |
+
}
|
491 |
+
|
492 |
+
}
|
493 |
+
|
494 |
+
};
|
495 |
+
|
496 |
+
$.jqplot.FunnelAxisRenderer = function() {
|
497 |
+
$.jqplot.LinearAxisRenderer.call(this);
|
498 |
+
};
|
499 |
+
|
500 |
+
$.jqplot.FunnelAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
|
501 |
+
$.jqplot.FunnelAxisRenderer.prototype.constructor = $.jqplot.FunnelAxisRenderer;
|
502 |
+
|
503 |
+
|
504 |
+
// There are no traditional axes on a funnel chart. We just need to provide
|
505 |
+
// dummy objects with properties so the plot will render.
|
506 |
+
// called with scope of axis object.
|
507 |
+
$.jqplot.FunnelAxisRenderer.prototype.init = function(options){
|
508 |
+
//
|
509 |
+
this.tickRenderer = $.jqplot.FunnelTickRenderer;
|
510 |
+
$.extend(true, this, options);
|
511 |
+
// I don't think I'm going to need _dataBounds here.
|
512 |
+
// have to go Axis scaling in a way to fit chart onto plot area
|
513 |
+
// and provide u2p and p2u functionality for mouse cursor, etc.
|
514 |
+
// for convienence set _dataBounds to 0 and 100 and
|
515 |
+
// set min/max to 0 and 100.
|
516 |
+
this._dataBounds = {min:0, max:100};
|
517 |
+
this.min = 0;
|
518 |
+
this.max = 100;
|
519 |
+
this.showTicks = false;
|
520 |
+
this.ticks = [];
|
521 |
+
this.showMark = false;
|
522 |
+
this.show = false;
|
523 |
+
};
|
524 |
+
|
525 |
+
|
526 |
+
|
527 |
+
/**
|
528 |
+
* Class: $.jqplot.FunnelLegendRenderer
|
529 |
+
* Legend Renderer specific to funnel plots. Set by default
|
530 |
+
* when the user creates a funnel plot.
|
531 |
+
*/
|
532 |
+
$.jqplot.FunnelLegendRenderer = function(){
|
533 |
+
$.jqplot.TableLegendRenderer.call(this);
|
534 |
+
};
|
535 |
+
|
536 |
+
$.jqplot.FunnelLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
|
537 |
+
$.jqplot.FunnelLegendRenderer.prototype.constructor = $.jqplot.FunnelLegendRenderer;
|
538 |
+
|
539 |
+
$.jqplot.FunnelLegendRenderer.prototype.init = function(options) {
|
540 |
+
// Group: Properties
|
541 |
+
//
|
542 |
+
// prop: numberRows
|
543 |
+
// Maximum number of rows in the legend. 0 or null for unlimited.
|
544 |
+
this.numberRows = null;
|
545 |
+
// prop: numberColumns
|
546 |
+
// Maximum number of columns in the legend. 0 or null for unlimited.
|
547 |
+
this.numberColumns = null;
|
548 |
+
$.extend(true, this, options);
|
549 |
+
};
|
550 |
+
|
551 |
+
// called with context of legend
|
552 |
+
$.jqplot.FunnelLegendRenderer.prototype.draw = function() {
|
553 |
+
var legend = this;
|
554 |
+
if (this.show) {
|
555 |
+
var series = this._series;
|
556 |
+
var ss = 'position:absolute;';
|
557 |
+
ss += (this.background) ? 'background:'+this.background+';' : '';
|
558 |
+
ss += (this.border) ? 'border:'+this.border+';' : '';
|
559 |
+
ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
|
560 |
+
ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
|
561 |
+
ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
|
562 |
+
ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
|
563 |
+
ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
|
564 |
+
ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
|
565 |
+
ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
|
566 |
+
this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
|
567 |
+
// Funnel charts legends don't go by number of series, but by number of data points
|
568 |
+
// in the series. Refactor things here for that.
|
569 |
+
|
570 |
+
var pad = false,
|
571 |
+
reverse = false,
|
572 |
+
nr, nc;
|
573 |
+
var s = series[0];
|
574 |
+
var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors);
|
575 |
+
|
576 |
+
if (s.show) {
|
577 |
+
var pd = s.data;
|
578 |
+
if (this.numberRows) {
|
579 |
+
nr = this.numberRows;
|
580 |
+
if (!this.numberColumns){
|
581 |
+
nc = Math.ceil(pd.length/nr);
|
582 |
+
}
|
583 |
+
else{
|
584 |
+
nc = this.numberColumns;
|
585 |
+
}
|
586 |
+
}
|
587 |
+
else if (this.numberColumns) {
|
588 |
+
nc = this.numberColumns;
|
589 |
+
nr = Math.ceil(pd.length/this.numberColumns);
|
590 |
+
}
|
591 |
+
else {
|
592 |
+
nr = pd.length;
|
593 |
+
nc = 1;
|
594 |
+
}
|
595 |
+
|
596 |
+
var i, j, tr, td1, td2, lt, rs, color;
|
597 |
+
var idx = 0;
|
598 |
+
|
599 |
+
for (i=0; i<nr; i++) {
|
600 |
+
if (reverse){
|
601 |
+
tr = $('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem);
|
602 |
+
}
|
603 |
+
else{
|
604 |
+
tr = $('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);
|
605 |
+
}
|
606 |
+
for (j=0; j<nc; j++) {
|
607 |
+
if (idx < pd.length){
|
608 |
+
lt = this.labels[idx] || pd[idx][0].toString();
|
609 |
+
color = colorGenerator.next();
|
610 |
+
if (!reverse){
|
611 |
+
if (i>0){
|
612 |
+
pad = true;
|
613 |
+
}
|
614 |
+
else{
|
615 |
+
pad = false;
|
616 |
+
}
|
617 |
+
}
|
618 |
+
else{
|
619 |
+
if (i == nr -1){
|
620 |
+
pad = false;
|
621 |
+
}
|
622 |
+
else{
|
623 |
+
pad = true;
|
624 |
+
}
|
625 |
+
}
|
626 |
+
rs = (pad) ? this.rowSpacing : '0';
|
627 |
+
|
628 |
+
td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
|
629 |
+
'<div><div class="jqplot-table-legend-swatch" style="border-color:'+color+';"></div>'+
|
630 |
+
'</div></td>');
|
631 |
+
td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
|
632 |
+
if (this.escapeHtml){
|
633 |
+
td2.text(lt);
|
634 |
+
}
|
635 |
+
else {
|
636 |
+
td2.html(lt);
|
637 |
+
}
|
638 |
+
if (reverse) {
|
639 |
+
td2.prependTo(tr);
|
640 |
+
td1.prependTo(tr);
|
641 |
+
}
|
642 |
+
else {
|
643 |
+
td1.appendTo(tr);
|
644 |
+
td2.appendTo(tr);
|
645 |
+
}
|
646 |
+
pad = true;
|
647 |
+
}
|
648 |
+
idx++;
|
649 |
+
}
|
650 |
+
}
|
651 |
+
}
|
652 |
+
}
|
653 |
+
return this._elem;
|
654 |
+
};
|
655 |
+
|
656 |
+
// $.jqplot.FunnelLegendRenderer.prototype.pack = function(offsets) {
|
657 |
+
// if (this.show) {
|
658 |
+
// // fake a grid for positioning
|
659 |
+
// var grid = {_top:offsets.top, _left:offsets.left, _right:offsets.right, _bottom:this._plotDimensions.height - offsets.bottom};
|
660 |
+
// if (this.placement == 'insideGrid') {
|
661 |
+
// switch (this.location) {
|
662 |
+
// case 'nw':
|
663 |
+
// var a = grid._left + this.xoffset;
|
664 |
+
// var b = grid._top + this.yoffset;
|
665 |
+
// this._elem.css('left', a);
|
666 |
+
// this._elem.css('top', b);
|
667 |
+
// break;
|
668 |
+
// case 'n':
|
669 |
+
// var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
|
670 |
+
// var b = grid._top + this.yoffset;
|
671 |
+
// this._elem.css('left', a);
|
672 |
+
// this._elem.css('top', b);
|
673 |
+
// break;
|
674 |
+
// case 'ne':
|
675 |
+
// var a = offsets.right + this.xoffset;
|
676 |
+
// var b = grid._top + this.yoffset;
|
677 |
+
// this._elem.css({right:a, top:b});
|
678 |
+
// break;
|
679 |
+
// case 'e':
|
680 |
+
// var a = offsets.right + this.xoffset;
|
681 |
+
// var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
|
682 |
+
// this._elem.css({right:a, top:b});
|
683 |
+
// break;
|
684 |
+
// case 'se':
|
685 |
+
// var a = offsets.right + this.xoffset;
|
686 |
+
// var b = offsets.bottom + this.yoffset;
|
687 |
+
// this._elem.css({right:a, bottom:b});
|
688 |
+
// break;
|
689 |
+
// case 's':
|
690 |
+
// var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
|
691 |
+
// var b = offsets.bottom + this.yoffset;
|
692 |
+
// this._elem.css({left:a, bottom:b});
|
693 |
+
// break;
|
694 |
+
// case 'sw':
|
695 |
+
// var a = grid._left + this.xoffset;
|
696 |
+
// var b = offsets.bottom + this.yoffset;
|
697 |
+
// this._elem.css({left:a, bottom:b});
|
698 |
+
// break;
|
699 |
+
// case 'w':
|
700 |
+
// var a = grid._left + this.xoffset;
|
701 |
+
// var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
|
702 |
+
// this._elem.css({left:a, top:b});
|
703 |
+
// break;
|
704 |
+
// default: // same as 'se'
|
705 |
+
// var a = grid._right - this.xoffset;
|
706 |
+
// var b = grid._bottom + this.yoffset;
|
707 |
+
// this._elem.css({right:a, bottom:b});
|
708 |
+
// break;
|
709 |
+
// }
|
710 |
+
//
|
711 |
+
// }
|
712 |
+
// else {
|
713 |
+
// switch (this.location) {
|
714 |
+
// case 'nw':
|
715 |
+
// var a = this._plotDimensions.width - grid._left + this.xoffset;
|
716 |
+
// var b = grid._top + this.yoffset;
|
717 |
+
// this._elem.css('right', a);
|
718 |
+
// this._elem.css('top', b);
|
719 |
+
// break;
|
720 |
+
// case 'n':
|
721 |
+
// var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
|
722 |
+
// var b = this._plotDimensions.height - grid._top + this.yoffset;
|
723 |
+
// this._elem.css('left', a);
|
724 |
+
// this._elem.css('bottom', b);
|
725 |
+
// break;
|
726 |
+
// case 'ne':
|
727 |
+
// var a = this._plotDimensions.width - offsets.right + this.xoffset;
|
728 |
+
// var b = grid._top + this.yoffset;
|
729 |
+
// this._elem.css({left:a, top:b});
|
730 |
+
// break;
|
731 |
+
// case 'e':
|
732 |
+
// var a = this._plotDimensions.width - offsets.right + this.xoffset;
|
733 |
+
// var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
|
734 |
+
// this._elem.css({left:a, top:b});
|
735 |
+
// break;
|
736 |
+
// case 'se':
|
737 |
+
// var a = this._plotDimensions.width - offsets.right + this.xoffset;
|
738 |
+
// var b = offsets.bottom + this.yoffset;
|
739 |
+
// this._elem.css({left:a, bottom:b});
|
740 |
+
// break;
|
741 |
+
// case 's':
|
742 |
+
// var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
|
743 |
+
// var b = this._plotDimensions.height - offsets.bottom + this.yoffset;
|
744 |
+
// this._elem.css({left:a, top:b});
|
745 |
+
// break;
|
746 |
+
// case 'sw':
|
747 |
+
// var a = this._plotDimensions.width - grid._left + this.xoffset;
|
748 |
+
// var b = offsets.bottom + this.yoffset;
|
749 |
+
// this._elem.css({right:a, bottom:b});
|
750 |
+
// break;
|
751 |
+
// case 'w':
|
752 |
+
// var a = this._plotDimensions.width - grid._left + this.xoffset;
|
753 |
+
// var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
|
754 |
+
// this._elem.css({right:a, top:b});
|
755 |
+
// break;
|
756 |
+
// default: // same as 'se'
|
757 |
+
// var a = grid._right - this.xoffset;
|
758 |
+
// var b = grid._bottom + this.yoffset;
|
759 |
+
// this._elem.css({right:a, bottom:b});
|
760 |
+
// break;
|
761 |
+
// }
|
762 |
+
// }
|
763 |
+
// }
|
764 |
+
// };
|
765 |
+
|
766 |
+
// setup default renderers for axes and legend so user doesn't have to
|
767 |
+
// called with scope of plot
|
768 |
+
function preInit(target, data, options) {
|
769 |
+
options = options || {};
|
770 |
+
options.axesDefaults = options.axesDefaults || {};
|
771 |
+
options.legend = options.legend || {};
|
772 |
+
options.seriesDefaults = options.seriesDefaults || {};
|
773 |
+
// only set these if there is a funnel series
|
774 |
+
var setopts = false;
|
775 |
+
if (options.seriesDefaults.renderer == $.jqplot.FunnelRenderer) {
|
776 |
+
setopts = true;
|
777 |
+
}
|
778 |
+
else if (options.series) {
|
779 |
+
for (var i=0; i < options.series.length; i++) {
|
780 |
+
if (options.series[i].renderer == $.jqplot.FunnelRenderer) {
|
781 |
+
setopts = true;
|
782 |
+
}
|
783 |
+
}
|
784 |
+
}
|
785 |
+
|
786 |
+
if (setopts) {
|
787 |
+
options.axesDefaults.renderer = $.jqplot.FunnelAxisRenderer;
|
788 |
+
options.legend.renderer = $.jqplot.FunnelLegendRenderer;
|
789 |
+
options.legend.preDraw = true;
|
790 |
+
options.sortData = false;
|
791 |
+
options.seriesDefaults.pointLabels = {show: false};
|
792 |
+
}
|
793 |
+
}
|
794 |
+
|
795 |
+
function postInit(target, data, options) {
|
796 |
+
// if multiple series, add a reference to the previous one so that
|
797 |
+
// funnel rings can nest.
|
798 |
+
for (var i=0; i<this.series.length; i++) {
|
799 |
+
if (this.series[i].renderer.constructor == $.jqplot.FunnelRenderer) {
|
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 |
+
var s = plot.series[sidx];
|
818 |
+
var canvas = plot.plugins.funnelRenderer.highlightCanvas;
|
819 |
+
canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height);
|
820 |
+
s._highlightedPoint = pidx;
|
821 |
+
plot.plugins.funnelRenderer.highlightedSeriesIndex = sidx;
|
822 |
+
s.renderer.drawSection.call(s, canvas._ctx, s._vertices[pidx], s.highlightColors[pidx], false);
|
823 |
+
}
|
824 |
+
|
825 |
+
function unhighlight (plot) {
|
826 |
+
var canvas = plot.plugins.funnelRenderer.highlightCanvas;
|
827 |
+
canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height);
|
828 |
+
for (var i=0; i<plot.series.length; i++) {
|
829 |
+
plot.series[i]._highlightedPoint = null;
|
830 |
+
}
|
831 |
+
plot.plugins.funnelRenderer.highlightedSeriesIndex = null;
|
832 |
+
plot.target.trigger('jqplotDataUnhighlight');
|
833 |
+
}
|
834 |
+
|
835 |
+
function handleMove(ev, gridpos, datapos, neighbor, plot) {
|
836 |
+
if (neighbor) {
|
837 |
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
838 |
+
var evt1 = jQuery.Event('jqplotDataMouseOver');
|
839 |
+
evt1.pageX = ev.pageX;
|
840 |
+
evt1.pageY = ev.pageY;
|
841 |
+
plot.target.trigger(evt1, ins);
|
842 |
+
if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.funnelRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
|
843 |
+
var evt = jQuery.Event('jqplotDataHighlight');
|
844 |
+
evt.which = ev.which;
|
845 |
+
evt.pageX = ev.pageX;
|
846 |
+
evt.pageY = ev.pageY;
|
847 |
+
plot.target.trigger(evt, ins);
|
848 |
+
highlight (plot, ins[0], ins[1]);
|
849 |
+
}
|
850 |
+
}
|
851 |
+
else if (neighbor == null) {
|
852 |
+
unhighlight (plot);
|
853 |
+
}
|
854 |
+
}
|
855 |
+
|
856 |
+
function handleMouseDown(ev, gridpos, datapos, neighbor, plot) {
|
857 |
+
if (neighbor) {
|
858 |
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
859 |
+
if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.funnelRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) {
|
860 |
+
var evt = jQuery.Event('jqplotDataHighlight');
|
861 |
+
evt.which = ev.which;
|
862 |
+
evt.pageX = ev.pageX;
|
863 |
+
evt.pageY = ev.pageY;
|
864 |
+
plot.target.trigger(evt, ins);
|
865 |
+
highlight (plot, ins[0], ins[1]);
|
866 |
+
}
|
867 |
+
}
|
868 |
+
else if (neighbor == null) {
|
869 |
+
unhighlight (plot);
|
870 |
+
}
|
871 |
+
}
|
872 |
+
|
873 |
+
function handleMouseUp(ev, gridpos, datapos, neighbor, plot) {
|
874 |
+
var idx = plot.plugins.funnelRenderer.highlightedSeriesIndex;
|
875 |
+
if (idx != null && plot.series[idx].highlightMouseDown) {
|
876 |
+
unhighlight(plot);
|
877 |
+
}
|
878 |
+
}
|
879 |
+
|
880 |
+
function handleClick(ev, gridpos, datapos, neighbor, plot) {
|
881 |
+
if (neighbor) {
|
882 |
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
883 |
+
var evt = jQuery.Event('jqplotDataClick');
|
884 |
+
evt.which = ev.which;
|
885 |
+
evt.pageX = ev.pageX;
|
886 |
+
evt.pageY = ev.pageY;
|
887 |
+
plot.target.trigger(evt, ins);
|
888 |
+
}
|
889 |
+
}
|
890 |
+
|
891 |
+
function handleRightClick(ev, gridpos, datapos, neighbor, plot) {
|
892 |
+
if (neighbor) {
|
893 |
+
var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
|
894 |
+
var idx = plot.plugins.funnelRenderer.highlightedSeriesIndex;
|
895 |
+
if (idx != null && plot.series[idx].highlightMouseDown) {
|
896 |
+
unhighlight(plot);
|
897 |
+
}
|
898 |
+
var evt = jQuery.Event('jqplotDataRightClick');
|
899 |
+
evt.which = ev.which;
|
900 |
+
evt.pageX = ev.pageX;
|
901 |
+
evt.pageY = ev.pageY;
|
902 |
+
plot.target.trigger(evt, ins);
|
903 |
+
}
|
904 |
+
}
|
905 |
+
|
906 |
+
// called within context of plot
|
907 |
+
// create a canvas which we can draw on.
|
908 |
+
// insert it before the eventCanvas, so eventCanvas will still capture events.
|
909 |
+
function postPlotDraw() {
|
910 |
+
// Memory Leaks patch
|
911 |
+
if (this.plugins.funnelRenderer && this.plugins.funnelRenderer.highlightCanvas) {
|
912 |
+
this.plugins.funnelRenderer.highlightCanvas.resetCanvas();
|
913 |
+
this.plugins.funnelRenderer.highlightCanvas = null;
|
914 |
+
}
|
915 |
+
|
916 |
+
this.plugins.funnelRenderer = {};
|
917 |
+
this.plugins.funnelRenderer.highlightCanvas = new $.jqplot.GenericCanvas();
|
918 |
+
|
919 |
+
// do we have any data labels? if so, put highlight canvas before those
|
920 |
+
var labels = $(this.targetId+' .jqplot-data-label');
|
921 |
+
if (labels.length) {
|
922 |
+
$(labels[0]).before(this.plugins.funnelRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-funnelRenderer-highlight-canvas', this._plotDimensions, this));
|
923 |
+
}
|
924 |
+
// else put highlight canvas before event canvas.
|
925 |
+
else {
|
926 |
+
this.eventCanvas._elem.before(this.plugins.funnelRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-funnelRenderer-highlight-canvas', this._plotDimensions, this));
|
927 |
+
}
|
928 |
+
var hctx = this.plugins.funnelRenderer.highlightCanvas.setContext();
|
929 |
+
this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });
|
930 |
+
}
|
931 |
+
|
932 |
+
$.jqplot.preInitHooks.push(preInit);
|
933 |
+
|
934 |
+
$.jqplot.FunnelTickRenderer = function() {
|
935 |
+
$.jqplot.AxisTickRenderer.call(this);
|
936 |
+
};
|
937 |
+
|
938 |
+
$.jqplot.FunnelTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
|
939 |
+
$.jqplot.FunnelTickRenderer.prototype.constructor = $.jqplot.FunnelTickRenderer;
|
940 |
+
|
941 |
+
})(jQuery);
|
942 |
+
|
943 |
+
|
backend/settings/assets/js/jqPlot/plugins/jqplot.funnelRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(e){e.jqplot.FunnelRenderer=function(){e.jqplot.LineRenderer.call(this)};e.jqplot.FunnelRenderer.prototype=new e.jqplot.LineRenderer();e.jqplot.FunnelRenderer.prototype.constructor=e.jqplot.FunnelRenderer;e.jqplot.FunnelRenderer.prototype.init=function(p,t){this.padding={top:20,right:20,bottom:20,left:20};this.sectionMargin=6;this.fill=true;this.shadowOffset=2;this.shadowAlpha=0.07;this.shadowDepth=5;this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColors=[];this.widthRatio=0.2;this.lineWidth=2;this.dataLabels="percent";this.showDataLabels=false;this.dataLabelFormatString=null;this.dataLabelThreshold=3;this._type="funnel";this.tickRenderer=e.jqplot.FunnelTickRenderer;if(p.highlightMouseDown&&p.highlightMouseOver==null){p.highlightMouseOver=false}e.extend(true,this,p);this._highlightedPoint=null;this._bases=[];this._atot;this._areas=[];this._lengths=[];this._angle;this._dataIndices=[];this._unorderedData=e.extend(true,[],this.data);var o=e.extend(true,[],this.data);for(var r=0;r<o.length;r++){o[r].push(r)}this.data.sort(function(v,u){return u[1]-v[1]});o.sort(function(v,u){return u[1]-v[1]});for(var r=0;r<o.length;r++){this._dataIndices.push(o[r][2])}if(this.highlightColors.length==0){for(var r=0;r<this.seriesColors.length;r++){var q=e.jqplot.getColorComponents(this.seriesColors[r]);var m=[q[0],q[1],q[2]];var s=m[0]+m[1]+m[2];for(var n=0;n<3;n++){m[n]=(s>570)?m[n]*0.8:m[n]+0.4*(255-m[n]);m[n]=parseInt(m[n],10)}this.highlightColors.push("rgb("+m[0]+","+m[1]+","+m[2]+")")}}t.postParseOptionsHooks.addOnce(k);t.postInitHooks.addOnce(g);t.eventListenerHooks.addOnce("jqplotMouseMove",a);t.eventListenerHooks.addOnce("jqplotMouseDown",b);t.eventListenerHooks.addOnce("jqplotMouseUp",j);t.eventListenerHooks.addOnce("jqplotClick",f);t.eventListenerHooks.addOnce("jqplotRightClick",l);t.postDrawHooks.addOnce(h)};e.jqplot.FunnelRenderer.prototype.setGridData=function(o){var n=0;var p=[];for(var m=0;m<this.data.length;m++){n+=this.data[m][1];p.push([this.data[m][0],this.data[m][1]])}for(var m=0;m<p.length;m++){p[m][1]=p[m][1]/n}this._bases=new Array(p.length+1);this._lengths=new Array(p.length);this.gridData=p};e.jqplot.FunnelRenderer.prototype.makeGridData=function(o,p){var n=0;var q=[];for(var m=0;m<this.data.length;m++){n+=this.data[m][1];q.push([this.data[m][0],this.data[m][1]])}for(var m=0;m<q.length;m++){q[m][1]=q[m][1]/n}this._bases=new Array(q.length+1);this._lengths=new Array(q.length);return q};e.jqplot.FunnelRenderer.prototype.drawSection=function(n,p,o,s){var t=this.fill;var m=this.lineWidth;n.save();if(s){for(var r=0;r<this.shadowDepth;r++){n.save();n.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI),this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));q()}}else{q()}function q(){n.beginPath();n.fillStyle=o;n.strokeStyle=o;n.lineWidth=m;n.moveTo(p[0][0],p[0][1]);for(var u=1;u<4;u++){n.lineTo(p[u][0],p[u][1])}n.closePath();if(t){n.fill()}else{n.stroke()}}if(s){for(var r=0;r<this.shadowDepth;r++){n.restore()}}n.restore()};e.jqplot.FunnelRenderer.prototype.draw=function(G,B,J,p){var Y;var L=(J!=undefined)?J:{};var w=0;var u=0;var R=1;this._areas=[];if(J.legendInfo&&J.legendInfo.placement=="insideGrid"){var O=J.legendInfo;switch(O.location){case"nw":w=O.width+O.xoffset;break;case"w":w=O.width+O.xoffset;break;case"sw":w=O.width+O.xoffset;break;case"ne":w=O.width+O.xoffset;R=-1;break;case"e":w=O.width+O.xoffset;R=-1;break;case"se":w=O.width+O.xoffset;R=-1;break;case"n":u=O.height+O.yoffset;break;case"s":u=O.height+O.yoffset;R=-1;break;default:break}}var t=(R==1)?this.padding.left+w:this.padding.left;var F=(R==1)?this.padding.top+u:this.padding.top;var M=(R==-1)?this.padding.right+w:this.padding.right;var o=(R==-1)?this.padding.bottom+u:this.padding.bottom;var P=(L.shadow!=undefined)?L.shadow:this.shadow;var q=(L.showLine!=undefined)?L.showLine:this.showLine;var C=(L.fill!=undefined)?L.fill:this.fill;var H=G.canvas.width;var N=G.canvas.height;this._bases[0]=H-t-M;var I=this._length=N-F-o;var r=this._bases[0]*this.widthRatio;this._atot=I/2*(this._bases[0]+this._bases[0]*this.widthRatio);this._angle=Math.atan((this._bases[0]-r)/2/I);for(Y=0;Y<B.length;Y++){this._areas.push(B[Y][1]*this._atot)}var E,aa,W,Q=0;var n=0.0001;for(Y=0;Y<this._areas.length;Y++){E=this._areas[Y]/this._bases[Y];aa=999999;this._lengths[Y]=E;W=0;while(aa>this._lengths[Y]*n&&W<100){this._lengths[Y]=this._areas[Y]/(this._bases[Y]-this._lengths[Y]*Math.tan(this._angle));aa=Math.abs(this._lengths[Y]-E);this._bases[Y+1]=this._bases[Y]-(2*this._lengths[Y]*Math.tan(this._angle));E=this._lengths[Y];W++}Q+=this._lengths[Y]}this._vertices=new Array(B.length);var ae=[t,F],ad=[t+this._bases[0],F],ac=[t+(this._bases[0]-this._bases[this._bases.length-1])/2,F+this._length],ab=[ac[0]+this._bases[this._bases.length-1],ac[1]];function V(ag){var x=(ae[1]-ac[1])/(ae[0]-ac[0]);var v=ae[1]-x*ae[0];var ah=ag+ae[1];return[(ah-v)/x,ah]}function D(ag){var x=(ad[1]-ab[1])/(ad[0]-ab[0]);var v=ad[1]-x*ad[0];var ah=ag+ad[1];return[(ah-v)/x,ah]}var T=w,S=u;var Z=0,m=0;for(Y=0;Y<B.length;Y++){this._vertices[Y]=new Array();var U=this._vertices[Y];var A=this.sectionMargin;if(Y==0){m=0}if(Y==1){m=A/3}else{if(Y>0&&Y<B.length-1){m=A/2}else{if(Y==B.length-1){m=2*A/3}}}U.push(V(Z+m));U.push(D(Z+m));Z+=this._lengths[Y];if(Y==0){m=-2*A/3}else{if(Y>0&&Y<B.length-1){m=-A/2}else{if(Y==B.length-1){m=0}}}U.push(D(Z+m));U.push(V(Z+m))}if(this.shadow){var af="rgba(0,0,0,"+this.shadowAlpha+")";for(var Y=0;Y<B.length;Y++){this.renderer.drawSection.call(this,G,this._vertices[Y],af,true)}}for(var Y=0;Y<B.length;Y++){var U=this._vertices[Y];this.renderer.drawSection.call(this,G,U,this.seriesColors[Y]);if(this.showDataLabels&&B[Y][1]*100>=this.dataLabelThreshold){var K,X;if(this.dataLabels=="label"){K=this.dataLabelFormatString||"%s";X=e.jqplot.sprintf(K,B[Y][0])}else{if(this.dataLabels=="value"){K=this.dataLabelFormatString||"%d";X=e.jqplot.sprintf(K,this.data[Y][1])}else{if(this.dataLabels=="percent"){K=this.dataLabelFormatString||"%d%%";X=e.jqplot.sprintf(K,B[Y][1]*100)}else{if(this.dataLabels.constructor==Array){K=this.dataLabelFormatString||"%s";X=e.jqplot.sprintf(K,this.dataLabels[this._dataIndices[Y]])}}}}var s=(this._radius)*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge;var T=(U[0][0]+U[1][0])/2+this.canvas._offsets.left;var S=(U[1][1]+U[2][1])/2+this.canvas._offsets.top;var z=e('<span class="jqplot-funnel-series jqplot-data-label" style="position:absolute;">'+X+"</span>").insertBefore(p.eventCanvas._elem);T-=z.width()/2;S-=z.height()/2;T=Math.round(T);S=Math.round(S);z.css({left:T,top:S})}}};e.jqplot.FunnelAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)};e.jqplot.FunnelAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer();e.jqplot.FunnelAxisRenderer.prototype.constructor=e.jqplot.FunnelAxisRenderer;e.jqplot.FunnelAxisRenderer.prototype.init=function(m){this.tickRenderer=e.jqplot.FunnelTickRenderer;e.extend(true,this,m);this._dataBounds={min:0,max:100};this.min=0;this.max=100;this.showTicks=false;this.ticks=[];this.showMark=false;this.show=false};e.jqplot.FunnelLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)};e.jqplot.FunnelLegendRenderer.prototype=new e.jqplot.TableLegendRenderer();e.jqplot.FunnelLegendRenderer.prototype.constructor=e.jqplot.FunnelLegendRenderer;e.jqplot.FunnelLegendRenderer.prototype.init=function(m){this.numberRows=null;this.numberColumns=null;e.extend(true,this,m)};e.jqplot.FunnelLegendRenderer.prototype.draw=function(){var p=this;if(this.show){var x=this._series;var A="position:absolute;";A+=(this.background)?"background:"+this.background+";":"";A+=(this.border)?"border:"+this.border+";":"";A+=(this.fontSize)?"font-size:"+this.fontSize+";":"";A+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";A+=(this.textColor)?"color:"+this.textColor+";":"";A+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";A+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";A+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";A+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=e('<table class="jqplot-table-legend" style="'+A+'"></table>');var E=false,w=false,m,u;var y=x[0];var n=new e.jqplot.ColorGenerator(y.seriesColors);if(y.show){var F=y.data;if(this.numberRows){m=this.numberRows;if(!this.numberColumns){u=Math.ceil(F.length/m)}else{u=this.numberColumns}}else{if(this.numberColumns){u=this.numberColumns;m=Math.ceil(F.length/this.numberColumns)}else{m=F.length;u=1}}var D,C,o,r,q,t,v,B;var z=0;for(D=0;D<m;D++){if(w){o=e('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem)}else{o=e('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem)}for(C=0;C<u;C++){if(z<F.length){t=this.labels[z]||F[z][0].toString();B=n.next();if(!w){if(D>0){E=true}else{E=false}}else{if(D==m-1){E=false}else{E=true}}v=(E)?this.rowSpacing:"0";r=e('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+v+';"><div><div class="jqplot-table-legend-swatch" style="border-color:'+B+';"></div></div></td>');q=e('<td class="jqplot-table-legend" style="padding-top:'+v+';"></td>');if(this.escapeHtml){q.text(t)}else{q.html(t)}if(w){q.prependTo(o);r.prependTo(o)}else{r.appendTo(o);q.appendTo(o)}E=true}z++}}}}return this._elem};function c(q,p,n){n=n||{};n.axesDefaults=n.axesDefaults||{};n.legend=n.legend||{};n.seriesDefaults=n.seriesDefaults||{};var m=false;if(n.seriesDefaults.renderer==e.jqplot.FunnelRenderer){m=true}else{if(n.series){for(var o=0;o<n.series.length;o++){if(n.series[o].renderer==e.jqplot.FunnelRenderer){m=true}}}}if(m){n.axesDefaults.renderer=e.jqplot.FunnelAxisRenderer;n.legend.renderer=e.jqplot.FunnelLegendRenderer;n.legend.preDraw=true;n.sortData=false;n.seriesDefaults.pointLabels={show:false}}}function g(p,o,m){for(var n=0;n<this.series.length;n++){if(this.series[n].renderer.constructor==e.jqplot.FunnelRenderer){if(this.series[n].highlightMouseOver){this.series[n].highlightMouseDown=false}}}}function k(m){for(var n=0;n<this.series.length;n++){this.series[n].seriesColors=this.seriesColors;this.series[n].colorGenerator=e.jqplot.colorGenerator}}function d(q,p,o){var n=q.series[p];var m=q.plugins.funnelRenderer.highlightCanvas;m._ctx.clearRect(0,0,m._ctx.canvas.width,m._ctx.canvas.height);n._highlightedPoint=o;q.plugins.funnelRenderer.highlightedSeriesIndex=p;n.renderer.drawSection.call(n,m._ctx,n._vertices[o],n.highlightColors[o],false)}function i(o){var m=o.plugins.funnelRenderer.highlightCanvas;m._ctx.clearRect(0,0,m._ctx.canvas.width,m._ctx.canvas.height);for(var n=0;n<o.series.length;n++){o.series[n]._highlightedPoint=null}o.plugins.funnelRenderer.highlightedSeriesIndex=null;o.target.trigger("jqplotDataUnhighlight")}function a(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];var n=jQuery.Event("jqplotDataMouseOver");n.pageX=q.pageX;n.pageY=q.pageY;r.target.trigger(n,o);if(r.series[o[0]].highlightMouseOver&&!(o[0]==r.plugins.funnelRenderer.highlightedSeriesIndex&&o[1]==r.series[o[0]]._highlightedPoint)){var m=jQuery.Event("jqplotDataHighlight");m.which=q.which;m.pageX=q.pageX;m.pageY=q.pageY;r.target.trigger(m,o);d(r,o[0],o[1])}}else{if(s==null){i(r)}}}function b(p,o,s,r,q){if(r){var n=[r.seriesIndex,r.pointIndex,r.data];if(q.series[n[0]].highlightMouseDown&&!(n[0]==q.plugins.funnelRenderer.highlightedSeriesIndex&&n[1]==q.series[n[0]]._highlightedPoint)){var m=jQuery.Event("jqplotDataHighlight");m.which=p.which;m.pageX=p.pageX;m.pageY=p.pageY;q.target.trigger(m,n);d(q,n[0],n[1])}}else{if(r==null){i(q)}}}function j(o,n,r,q,p){var m=p.plugins.funnelRenderer.highlightedSeriesIndex;if(m!=null&&p.series[m].highlightMouseDown){i(p)}}function f(p,o,s,r,q){if(r){var n=[r.seriesIndex,r.pointIndex,r.data];var m=jQuery.Event("jqplotDataClick");m.which=p.which;m.pageX=p.pageX;m.pageY=p.pageY;q.target.trigger(m,n)}}function l(q,p,t,s,r){if(s){var o=[s.seriesIndex,s.pointIndex,s.data];var m=r.plugins.funnelRenderer.highlightedSeriesIndex;if(m!=null&&r.series[m].highlightMouseDown){i(r)}var n=jQuery.Event("jqplotDataRightClick");n.which=q.which;n.pageX=q.pageX;n.pageY=q.pageY;r.target.trigger(n,o)}}function h(){if(this.plugins.funnelRenderer&&this.plugins.funnelRenderer.highlightCanvas){this.plugins.funnelRenderer.highlightCanvas.resetCanvas();this.plugins.funnelRenderer.highlightCanvas=null}this.plugins.funnelRenderer={};this.plugins.funnelRenderer.highlightCanvas=new e.jqplot.GenericCanvas();var n=e(this.targetId+" .jqplot-data-label");if(n.length){e(n[0]).before(this.plugins.funnelRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-funnelRenderer-highlight-canvas",this._plotDimensions,this))}else{this.eventCanvas._elem.before(this.plugins.funnelRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-funnelRenderer-highlight-canvas",this._plotDimensions,this))}var m=this.plugins.funnelRenderer.highlightCanvas.setContext();this.eventCanvas._elem.bind("mouseleave",{plot:this},function(o){i(o.data.plot)})}e.jqplot.preInitHooks.push(c);e.jqplot.FunnelTickRenderer=function(){e.jqplot.AxisTickRenderer.call(this)};e.jqplot.FunnelTickRenderer.prototype=new e.jqplot.AxisTickRenderer();e.jqplot.FunnelTickRenderer.prototype.constructor=e.jqplot.FunnelTickRenderer})(jQuery);
|
backend/settings/assets/js/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.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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 wether 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 (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 (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);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.highlighter.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(d){d.jqplot.eventListenerHooks.push(["jqplotMouseMove",f]);d.jqplot.Highlighter=function(h){this.show=d.jqplot.config.enablePlugins;this.markerRenderer=new d.jqplot.MarkerRenderer({shadow:false});this.showMarker=true;this.lineWidthAdjust=2.5;this.sizeAdjust=5;this.showTooltip=true;this.tooltipLocation="nw";this.fadeTooltip=true;this.tooltipFadeSpeed="fast";this.tooltipOffset=2;this.tooltipAxes="both";this.tooltipSeparator=", ";this.tooltipContentEditor=null;this.useAxesFormatters=true;this.tooltipFormatString="%.5P";this.formatString=null;this.yvalues=1;this.bringSeriesToFront=false;this._tooltipElem;this.isHighlighting=false;this.currentNeighbor=null;d.extend(true,this,h)};var b=["nw","n","ne","e","se","s","sw","w"];var e={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7};var c=["se","s","sw","w","nw","n","ne","e"];d.jqplot.Highlighter.init=function(k,j,i){var h=i||{};this.plugins.highlighter=new d.jqplot.Highlighter(h.highlighter)};d.jqplot.Highlighter.parseOptions=function(i,h){this.showHighlight=true};d.jqplot.Highlighter.postPlotDraw=function(){if(this.plugins.highlighter&&this.plugins.highlighter.highlightCanvas){this.plugins.highlighter.highlightCanvas.resetCanvas();this.plugins.highlighter.highlightCanvas=null}if(this.plugins.highlighter&&this.plugins.highlighter._tooltipElem){this.plugins.highlighter._tooltipElem.emptyForce();this.plugins.highlighter._tooltipElem=null}this.plugins.highlighter.highlightCanvas=new d.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 h=document.createElement("div");this.plugins.highlighter._tooltipElem=d(h);h=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)};d.jqplot.preInitHooks.push(d.jqplot.Highlighter.init);d.jqplot.preParseSeriesOptionsHooks.push(d.jqplot.Highlighter.parseOptions);d.jqplot.postDrawHooks.push(d.jqplot.Highlighter.postPlotDraw);function a(m,o){var j=m.plugins.highlighter;var p=m.series[o.seriesIndex];var h=p.markerRenderer;var i=j.markerRenderer;i.style=h.style;i.lineWidth=h.lineWidth+j.lineWidthAdjust;i.size=h.size+j.sizeAdjust;var l=d.jqplot.getColorComponents(h.color);var n=[l[0],l[1],l[2]];var k=(l[3]>=0.6)?l[3]*0.6:l[3]*(2-l[3]);i.color="rgba("+n[0]+","+n[1]+","+n[2]+","+k+")";i.init();i.draw(p.gridData[o.pointIndex][0],p.gridData[o.pointIndex][1],j.highlightCanvas._ctx)}function g(A,q,m){var k=A.plugins.highlighter;var D=k._tooltipElem;var r=q.highlighter||{};var t=d.extend(true,{},k,r);if(t.useAxesFormatters){var w=q._xaxis._ticks[0].formatter;var h=q._yaxis._ticks[0].formatter;var E=q._xaxis._ticks[0].formatString;var s=q._yaxis._ticks[0].formatString;var z;var u=w(E,m.data[0]);var l=[];for(var B=1;B<t.yvalues+1;B++){l.push(h(s,m.data[B]))}if(typeof t.formatString==="string"){switch(t.tooltipAxes){case"both":case"xy":l.unshift(u);l.unshift(t.formatString);z=d.jqplot.sprintf.apply(d.jqplot.sprintf,l);break;case"yx":l.push(u);l.unshift(t.formatString);z=d.jqplot.sprintf.apply(d.jqplot.sprintf,l);break;case"x":z=d.jqplot.sprintf.apply(d.jqplot.sprintf,[t.formatString,u]);break;case"y":l.unshift(t.formatString);z=d.jqplot.sprintf.apply(d.jqplot.sprintf,l);break;default:l.unshift(u);l.unshift(t.formatString);z=d.jqplot.sprintf.apply(d.jqplot.sprintf,l);break}}else{switch(t.tooltipAxes){case"both":case"xy":z=u;for(var B=0;B<l.length;B++){z+=t.tooltipSeparator+l[B]}break;case"yx":z="";for(var B=0;B<l.length;B++){z+=l[B]+t.tooltipSeparator}z+=u;break;case"x":z=u;break;case"y":z=l.join(t.tooltipSeparator);break;default:z=u;for(var B=0;B<l.length;B++){z+=t.tooltipSeparator+l[B]}break}}}else{var z;if(typeof t.formatString==="string"){z=d.jqplot.sprintf.apply(d.jqplot.sprintf,[t.formatString].concat(m.data))}else{if(t.tooltipAxes=="both"||t.tooltipAxes=="xy"){z=d.jqplot.sprintf(t.tooltipFormatString,m.data[0])+t.tooltipSeparator+d.jqplot.sprintf(t.tooltipFormatString,m.data[1])}else{if(t.tooltipAxes=="yx"){z=d.jqplot.sprintf(t.tooltipFormatString,m.data[1])+t.tooltipSeparator+d.jqplot.sprintf(t.tooltipFormatString,m.data[0])}else{if(t.tooltipAxes=="x"){z=d.jqplot.sprintf(t.tooltipFormatString,m.data[0])}else{if(t.tooltipAxes=="y"){z=d.jqplot.sprintf(t.tooltipFormatString,m.data[1])}}}}}}if(d.isFunction(t.tooltipContentEditor)){z=t.tooltipContentEditor(z,m.seriesIndex,m.pointIndex,A)}D.html(z);var C={x:m.gridData[0],y:m.gridData[1]};var v=0;var j=0.707;if(q.markerRenderer.show==true){v=(q.markerRenderer.size+t.sizeAdjust)/2}var o=b;if(q.fillToZero&&q.fill&&m.data[1]<0){o=c}switch(o[e[t.tooltipLocation]]){case"nw":var p=C.x+A._gridPadding.left-D.outerWidth(true)-t.tooltipOffset-j*v;var n=C.y+A._gridPadding.top-t.tooltipOffset-D.outerHeight(true)-j*v;break;case"n":var p=C.x+A._gridPadding.left-D.outerWidth(true)/2;var n=C.y+A._gridPadding.top-t.tooltipOffset-D.outerHeight(true)-v;break;case"ne":var p=C.x+A._gridPadding.left+t.tooltipOffset+j*v;var n=C.y+A._gridPadding.top-t.tooltipOffset-D.outerHeight(true)-j*v;break;case"e":var p=C.x+A._gridPadding.left+t.tooltipOffset+v;var n=C.y+A._gridPadding.top-D.outerHeight(true)/2;break;case"se":var p=C.x+A._gridPadding.left+t.tooltipOffset+j*v;var n=C.y+A._gridPadding.top+t.tooltipOffset+j*v;break;case"s":var p=C.x+A._gridPadding.left-D.outerWidth(true)/2;var n=C.y+A._gridPadding.top+t.tooltipOffset+v;break;case"sw":var p=C.x+A._gridPadding.left-D.outerWidth(true)-t.tooltipOffset-j*v;var n=C.y+A._gridPadding.top+t.tooltipOffset+j*v;break;case"w":var p=C.x+A._gridPadding.left-D.outerWidth(true)-t.tooltipOffset-v;var n=C.y+A._gridPadding.top-D.outerHeight(true)/2;break;default:var p=C.x+A._gridPadding.left-D.outerWidth(true)-t.tooltipOffset-j*v;var n=C.y+A._gridPadding.top-t.tooltipOffset-D.outerHeight(true)-j*v;break}D.css("left",p);D.css("top",n);if(t.fadeTooltip){D.stop(true,true).fadeIn(t.tooltipFadeSpeed)}else{D.show()}D=null}function f(n,j,i,p,l){var h=l.plugins.highlighter;var m=l.plugins.cursor;if(h.show){if(p==null&&h.isHighlighting){var o=jQuery.Event("jqplotHighlighterUnhighlight");l.target.trigger(o);var q=h.highlightCanvas._ctx;q.clearRect(0,0,q.canvas.width,q.canvas.height);if(h.fadeTooltip){h._tooltipElem.fadeOut(h.tooltipFadeSpeed)}else{h._tooltipElem.hide()}if(h.bringSeriesToFront){l.restorePreviousSeriesOrder()}h.isHighlighting=false;h.currentNeighbor=null;q=null}else{if(p!=null&&l.series[p.seriesIndex].showHighlight&&!h.isHighlighting){var o=jQuery.Event("jqplotHighlighterHighlight");o.which=n.which;o.pageX=n.pageX;o.pageY=n.pageY;var k=[p.seriesIndex,p.pointIndex,p.data,l];l.target.trigger(o,k);h.isHighlighting=true;h.currentNeighbor=p;if(h.showMarker){a(l,p)}if(h.showTooltip&&(!m||!m._zoom.started)){g(l,l.series[p.seriesIndex],p)}if(h.bringSeriesToFront){l.moveSeriesToFront(p.seriesIndex)}}else{if(p!=null&&h.isHighlighting&&h.currentNeighbor!=p){if(l.series[p.seriesIndex].showHighlight){var q=h.highlightCanvas._ctx;q.clearRect(0,0,q.canvas.width,q.canvas.height);h.isHighlighting=true;h.currentNeighbor=p;if(h.showMarker){a(l,p)}if(h.showTooltip&&(!m||!m._zoom.started)){g(l,l.series[p.seriesIndex],p)}if(h.bringSeriesToFront){l.moveSeriesToFront(p.seriesIndex)}}}}}}}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.json2.js
ADDED
@@ -0,0 +1,475 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
2010-11-01 Chris Leonello
|
3 |
+
|
4 |
+
Slightly modified version of the original json2.js to put JSON
|
5 |
+
functions under the $.jqplot namespace.
|
6 |
+
|
7 |
+
licensing and orignal comments follow:
|
8 |
+
|
9 |
+
http://www.JSON.org/json2.js
|
10 |
+
2010-08-25
|
11 |
+
|
12 |
+
Public Domain.
|
13 |
+
|
14 |
+
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
15 |
+
|
16 |
+
See http://www.JSON.org/js.html
|
17 |
+
|
18 |
+
|
19 |
+
This code should be minified before deployment.
|
20 |
+
See http://javascript.crockford.com/jsmin.html
|
21 |
+
|
22 |
+
USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
|
23 |
+
NOT CONTROL.
|
24 |
+
|
25 |
+
|
26 |
+
This file creates a global JSON object containing two methods: stringify
|
27 |
+
and parse.
|
28 |
+
|
29 |
+
$.jqplot.JSON.stringify(value, replacer, space)
|
30 |
+
value any JavaScript value, usually an object or array.
|
31 |
+
|
32 |
+
replacer an optional parameter that determines how object
|
33 |
+
values are stringified for objects. It can be a
|
34 |
+
function or an array of strings.
|
35 |
+
|
36 |
+
space an optional parameter that specifies the indentation
|
37 |
+
of nested structures. If it is omitted, the text will
|
38 |
+
be packed without extra whitespace. If it is a number,
|
39 |
+
it will specify the number of spaces to indent at each
|
40 |
+
level. If it is a string (such as '\t' or ' '),
|
41 |
+
it contains the characters used to indent at each level.
|
42 |
+
|
43 |
+
This method produces a JSON text from a JavaScript value.
|
44 |
+
|
45 |
+
When an object value is found, if the object contains a toJSON
|
46 |
+
method, its toJSON method will be called and the result will be
|
47 |
+
stringified. A toJSON method does not serialize: it returns the
|
48 |
+
value represented by the name/value pair that should be serialized,
|
49 |
+
or undefined if nothing should be serialized. The toJSON method
|
50 |
+
will be passed the key associated with the value, and this will be
|
51 |
+
bound to the value
|
52 |
+
|
53 |
+
For example, this would serialize Dates as ISO strings.
|
54 |
+
|
55 |
+
Date.prototype.toJSON = function (key) {
|
56 |
+
function f(n) {
|
57 |
+
// Format integers to have at least two digits.
|
58 |
+
return n < 10 ? '0' + n : n;
|
59 |
+
}
|
60 |
+
|
61 |
+
return this.getUTCFullYear() + '-' +
|
62 |
+
f(this.getUTCMonth() + 1) + '-' +
|
63 |
+
f(this.getUTCDate()) + 'T' +
|
64 |
+
f(this.getUTCHours()) + ':' +
|
65 |
+
f(this.getUTCMinutes()) + ':' +
|
66 |
+
f(this.getUTCSeconds()) + 'Z';
|
67 |
+
};
|
68 |
+
|
69 |
+
You can provide an optional replacer method. It will be passed the
|
70 |
+
key and value of each member, with this bound to the containing
|
71 |
+
object. The value that is returned from your method will be
|
72 |
+
serialized. If your method returns undefined, then the member will
|
73 |
+
be excluded from the serialization.
|
74 |
+
|
75 |
+
If the replacer parameter is an array of strings, then it will be
|
76 |
+
used to select the members to be serialized. It filters the results
|
77 |
+
such that only members with keys listed in the replacer array are
|
78 |
+
stringified.
|
79 |
+
|
80 |
+
Values that do not have JSON representations, such as undefined or
|
81 |
+
functions, will not be serialized. Such values in objects will be
|
82 |
+
dropped; in arrays they will be replaced with null. You can use
|
83 |
+
a replacer function to replace those with JSON values.
|
84 |
+
$.jqplot.JSON.stringify(undefined) returns undefined.
|
85 |
+
|
86 |
+
The optional space parameter produces a stringification of the
|
87 |
+
value that is filled with line breaks and indentation to make it
|
88 |
+
easier to read.
|
89 |
+
|
90 |
+
If the space parameter is a non-empty string, then that string will
|
91 |
+
be used for indentation. If the space parameter is a number, then
|
92 |
+
the indentation will be that many spaces.
|
93 |
+
|
94 |
+
Example:
|
95 |
+
|
96 |
+
text = $.jqplot.JSON.stringify(['e', {pluribus: 'unum'}]);
|
97 |
+
// text is '["e",{"pluribus":"unum"}]'
|
98 |
+
|
99 |
+
|
100 |
+
text = $.jqplot.JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
|
101 |
+
// text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
102 |
+
|
103 |
+
text = $.jqplot.JSON.stringify([new Date()], function (key, value) {
|
104 |
+
return this[key] instanceof Date ?
|
105 |
+
'Date(' + this[key] + ')' : value;
|
106 |
+
});
|
107 |
+
// text is '["Date(---current time---)"]'
|
108 |
+
|
109 |
+
|
110 |
+
$.jqplot.JSON.parse(text, reviver)
|
111 |
+
This method parses a JSON text to produce an object or array.
|
112 |
+
It can throw a SyntaxError exception.
|
113 |
+
|
114 |
+
The optional reviver parameter is a function that can filter and
|
115 |
+
transform the results. It receives each of the keys and values,
|
116 |
+
and its return value is used instead of the original value.
|
117 |
+
If it returns what it received, then the structure is not modified.
|
118 |
+
If it returns undefined then the member is deleted.
|
119 |
+
|
120 |
+
Example:
|
121 |
+
|
122 |
+
// Parse the text. Values that look like ISO date strings will
|
123 |
+
// be converted to Date objects.
|
124 |
+
|
125 |
+
myData = $.jqplot.JSON.parse(text, function (key, value) {
|
126 |
+
var a;
|
127 |
+
if (typeof value === 'string') {
|
128 |
+
a =
|
129 |
+
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
130 |
+
if (a) {
|
131 |
+
return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
|
132 |
+
+a[5], +a[6]));
|
133 |
+
}
|
134 |
+
}
|
135 |
+
return value;
|
136 |
+
});
|
137 |
+
|
138 |
+
myData = $.jqplot.JSON.parse('["Date(09/09/2001)"]', function (key, value) {
|
139 |
+
var d;
|
140 |
+
if (typeof value === 'string' &&
|
141 |
+
value.slice(0, 5) === 'Date(' &&
|
142 |
+
value.slice(-1) === ')') {
|
143 |
+
d = new Date(value.slice(5, -1));
|
144 |
+
if (d) {
|
145 |
+
return d;
|
146 |
+
}
|
147 |
+
}
|
148 |
+
return value;
|
149 |
+
});
|
150 |
+
|
151 |
+
|
152 |
+
This is a reference implementation. You are free to copy, modify, or
|
153 |
+
redistribute.
|
154 |
+
*/
|
155 |
+
|
156 |
+
(function($) {
|
157 |
+
|
158 |
+
$.jqplot.JSON = window.JSON;
|
159 |
+
|
160 |
+
if (!window.JSON) {
|
161 |
+
$.jqplot.JSON = {};
|
162 |
+
}
|
163 |
+
|
164 |
+
function f(n) {
|
165 |
+
// Format integers to have at least two digits.
|
166 |
+
return n < 10 ? '0' + n : n;
|
167 |
+
}
|
168 |
+
|
169 |
+
if (typeof Date.prototype.toJSON !== 'function') {
|
170 |
+
|
171 |
+
Date.prototype.toJSON = function (key) {
|
172 |
+
|
173 |
+
return isFinite(this.valueOf()) ?
|
174 |
+
this.getUTCFullYear() + '-' +
|
175 |
+
f(this.getUTCMonth() + 1) + '-' +
|
176 |
+
f(this.getUTCDate()) + 'T' +
|
177 |
+
f(this.getUTCHours()) + ':' +
|
178 |
+
f(this.getUTCMinutes()) + ':' +
|
179 |
+
f(this.getUTCSeconds()) + 'Z' : null;
|
180 |
+
};
|
181 |
+
|
182 |
+
String.prototype.toJSON =
|
183 |
+
Number.prototype.toJSON =
|
184 |
+
Boolean.prototype.toJSON = function (key) {
|
185 |
+
return this.valueOf();
|
186 |
+
};
|
187 |
+
}
|
188 |
+
|
189 |
+
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
190 |
+
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
|
191 |
+
gap,
|
192 |
+
indent,
|
193 |
+
meta = { // table of character substitutions
|
194 |
+
'\b': '\\b',
|
195 |
+
'\t': '\\t',
|
196 |
+
'\n': '\\n',
|
197 |
+
'\f': '\\f',
|
198 |
+
'\r': '\\r',
|
199 |
+
'"' : '\\"',
|
200 |
+
'\\': '\\\\'
|
201 |
+
},
|
202 |
+
rep;
|
203 |
+
|
204 |
+
|
205 |
+
function quote(string) {
|
206 |
+
|
207 |
+
// If the string contains no control characters, no quote characters, and no
|
208 |
+
// backslash characters, then we can safely slap some quotes around it.
|
209 |
+
// Otherwise we must also replace the offending characters with safe escape
|
210 |
+
// sequences.
|
211 |
+
|
212 |
+
escapable.lastIndex = 0;
|
213 |
+
return escapable.test(string) ?
|
214 |
+
'"' + string.replace(escapable, function (a) {
|
215 |
+
var c = meta[a];
|
216 |
+
return typeof c === 'string' ? c :
|
217 |
+
'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
218 |
+
}) + '"' :
|
219 |
+
'"' + string + '"';
|
220 |
+
}
|
221 |
+
|
222 |
+
|
223 |
+
function str(key, holder) {
|
224 |
+
|
225 |
+
// Produce a string from holder[key].
|
226 |
+
|
227 |
+
var i, // The loop counter.
|
228 |
+
k, // The member key.
|
229 |
+
v, // The member value.
|
230 |
+
length,
|
231 |
+
mind = gap,
|
232 |
+
partial,
|
233 |
+
value = holder[key];
|
234 |
+
|
235 |
+
// If the value has a toJSON method, call it to obtain a replacement value.
|
236 |
+
|
237 |
+
if (value && typeof value === 'object' &&
|
238 |
+
typeof value.toJSON === 'function') {
|
239 |
+
value = value.toJSON(key);
|
240 |
+
}
|
241 |
+
|
242 |
+
// If we were called with a replacer function, then call the replacer to
|
243 |
+
// obtain a replacement value.
|
244 |
+
|
245 |
+
if (typeof rep === 'function') {
|
246 |
+
value = rep.call(holder, key, value);
|
247 |
+
}
|
248 |
+
|
249 |
+
// What happens next depends on the value's type.
|
250 |
+
|
251 |
+
switch (typeof value) {
|
252 |
+
case 'string':
|
253 |
+
return quote(value);
|
254 |
+
|
255 |
+
case 'number':
|
256 |
+
|
257 |
+
// JSON numbers must be finite. Encode non-finite numbers as null.
|
258 |
+
|
259 |
+
return isFinite(value) ? String(value) : 'null';
|
260 |
+
|
261 |
+
case 'boolean':
|
262 |
+
case 'null':
|
263 |
+
|
264 |
+
// If the value is a boolean or null, convert it to a string. Note:
|
265 |
+
// typeof null does not produce 'null'. The case is included here in
|
266 |
+
// the remote chance that this gets fixed someday.
|
267 |
+
|
268 |
+
return String(value);
|
269 |
+
|
270 |
+
// If the type is 'object', we might be dealing with an object or an array or
|
271 |
+
// null.
|
272 |
+
|
273 |
+
case 'object':
|
274 |
+
|
275 |
+
// Due to a specification blunder in ECMAScript, typeof null is 'object',
|
276 |
+
// so watch out for that case.
|
277 |
+
|
278 |
+
if (!value) {
|
279 |
+
return 'null';
|
280 |
+
}
|
281 |
+
|
282 |
+
// Make an array to hold the partial results of stringifying this object value.
|
283 |
+
|
284 |
+
gap += indent;
|
285 |
+
partial = [];
|
286 |
+
|
287 |
+
// Is the value an array?
|
288 |
+
|
289 |
+
if (Object.prototype.toString.apply(value) === '[object Array]') {
|
290 |
+
|
291 |
+
// The value is an array. Stringify every element. Use null as a placeholder
|
292 |
+
// for non-JSON values.
|
293 |
+
|
294 |
+
length = value.length;
|
295 |
+
for (i = 0; i < length; i += 1) {
|
296 |
+
partial[i] = str(i, value) || 'null';
|
297 |
+
}
|
298 |
+
|
299 |
+
// Join all of the elements together, separated with commas, and wrap them in
|
300 |
+
// brackets.
|
301 |
+
|
302 |
+
v = partial.length === 0 ? '[]' :
|
303 |
+
gap ? '[\n' + gap +
|
304 |
+
partial.join(',\n' + gap) + '\n' +
|
305 |
+
mind + ']' :
|
306 |
+
'[' + partial.join(',') + ']';
|
307 |
+
gap = mind;
|
308 |
+
return v;
|
309 |
+
}
|
310 |
+
|
311 |
+
// If the replacer is an array, use it to select the members to be stringified.
|
312 |
+
|
313 |
+
if (rep && typeof rep === 'object') {
|
314 |
+
length = rep.length;
|
315 |
+
for (i = 0; i < length; i += 1) {
|
316 |
+
k = rep[i];
|
317 |
+
if (typeof k === 'string') {
|
318 |
+
v = str(k, value);
|
319 |
+
if (v) {
|
320 |
+
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
321 |
+
}
|
322 |
+
}
|
323 |
+
}
|
324 |
+
} else {
|
325 |
+
|
326 |
+
// Otherwise, iterate through all of the keys in the object.
|
327 |
+
|
328 |
+
for (k in value) {
|
329 |
+
if (Object.hasOwnProperty.call(value, k)) {
|
330 |
+
v = str(k, value);
|
331 |
+
if (v) {
|
332 |
+
partial.push(quote(k) + (gap ? ': ' : ':') + v);
|
333 |
+
}
|
334 |
+
}
|
335 |
+
}
|
336 |
+
}
|
337 |
+
|
338 |
+
// Join all of the member texts together, separated with commas,
|
339 |
+
// and wrap them in braces.
|
340 |
+
|
341 |
+
v = partial.length === 0 ? '{}' :
|
342 |
+
gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
|
343 |
+
mind + '}' : '{' + partial.join(',') + '}';
|
344 |
+
gap = mind;
|
345 |
+
return v;
|
346 |
+
}
|
347 |
+
}
|
348 |
+
|
349 |
+
// If the JSON object does not yet have a stringify method, give it one.
|
350 |
+
|
351 |
+
if (typeof $.jqplot.JSON.stringify !== 'function') {
|
352 |
+
$.jqplot.JSON.stringify = function (value, replacer, space) {
|
353 |
+
|
354 |
+
// The stringify method takes a value and an optional replacer, and an optional
|
355 |
+
// space parameter, and returns a JSON text. The replacer can be a function
|
356 |
+
// that can replace values, or an array of strings that will select the keys.
|
357 |
+
// A default replacer method can be provided. Use of the space parameter can
|
358 |
+
// produce text that is more easily readable.
|
359 |
+
|
360 |
+
var i;
|
361 |
+
gap = '';
|
362 |
+
indent = '';
|
363 |
+
|
364 |
+
// If the space parameter is a number, make an indent string containing that
|
365 |
+
// many spaces.
|
366 |
+
|
367 |
+
if (typeof space === 'number') {
|
368 |
+
for (i = 0; i < space; i += 1) {
|
369 |
+
indent += ' ';
|
370 |
+
}
|
371 |
+
|
372 |
+
// If the space parameter is a string, it will be used as the indent string.
|
373 |
+
|
374 |
+
} else if (typeof space === 'string') {
|
375 |
+
indent = space;
|
376 |
+
}
|
377 |
+
|
378 |
+
// If there is a replacer, it must be a function or an array.
|
379 |
+
// Otherwise, throw an error.
|
380 |
+
|
381 |
+
rep = replacer;
|
382 |
+
if (replacer && typeof replacer !== 'function' &&
|
383 |
+
(typeof replacer !== 'object' ||
|
384 |
+
typeof replacer.length !== 'number')) {
|
385 |
+
throw new Error('$.jqplot.JSON.stringify');
|
386 |
+
}
|
387 |
+
|
388 |
+
// Make a fake root object containing our value under the key of ''.
|
389 |
+
// Return the result of stringifying the value.
|
390 |
+
|
391 |
+
return str('', {'': value});
|
392 |
+
};
|
393 |
+
}
|
394 |
+
|
395 |
+
|
396 |
+
// If the JSON object does not yet have a parse method, give it one.
|
397 |
+
|
398 |
+
if (typeof $.jqplot.JSON.parse !== 'function') {
|
399 |
+
$.jqplot.JSON.parse = function (text, reviver) {
|
400 |
+
|
401 |
+
// The parse method takes a text and an optional reviver function, and returns
|
402 |
+
// a JavaScript value if the text is a valid JSON text.
|
403 |
+
|
404 |
+
var j;
|
405 |
+
|
406 |
+
function walk(holder, key) {
|
407 |
+
|
408 |
+
// The walk method is used to recursively walk the resulting structure so
|
409 |
+
// that modifications can be made.
|
410 |
+
|
411 |
+
var k, v, value = holder[key];
|
412 |
+
if (value && typeof value === 'object') {
|
413 |
+
for (k in value) {
|
414 |
+
if (Object.hasOwnProperty.call(value, k)) {
|
415 |
+
v = walk(value, k);
|
416 |
+
if (v !== undefined) {
|
417 |
+
value[k] = v;
|
418 |
+
} else {
|
419 |
+
delete value[k];
|
420 |
+
}
|
421 |
+
}
|
422 |
+
}
|
423 |
+
}
|
424 |
+
return reviver.call(holder, key, value);
|
425 |
+
}
|
426 |
+
|
427 |
+
|
428 |
+
// Parsing happens in four stages. In the first stage, we replace certain
|
429 |
+
// Unicode characters with escape sequences. JavaScript handles many characters
|
430 |
+
// incorrectly, either silently deleting them, or treating them as line endings.
|
431 |
+
|
432 |
+
text = String(text);
|
433 |
+
cx.lastIndex = 0;
|
434 |
+
if (cx.test(text)) {
|
435 |
+
text = text.replace(cx, function (a) {
|
436 |
+
return '\\u' +
|
437 |
+
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
438 |
+
});
|
439 |
+
}
|
440 |
+
|
441 |
+
// In the second stage, we run the text against regular expressions that look
|
442 |
+
// for non-JSON patterns. We are especially concerned with '()' and 'new'
|
443 |
+
// because they can cause invocation, and '=' because it can cause mutation.
|
444 |
+
// But just to be safe, we want to reject all unexpected forms.
|
445 |
+
|
446 |
+
// We split the second stage into 4 regexp operations in order to work around
|
447 |
+
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
448 |
+
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
|
449 |
+
// replace all simple value tokens with ']' characters. Third, we delete all
|
450 |
+
// open brackets that follow a colon or comma or that begin the text. Finally,
|
451 |
+
// we look to see that the remaining characters are only whitespace or ']' or
|
452 |
+
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
|
453 |
+
|
454 |
+
if (/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
|
455 |
+
|
456 |
+
// In the third stage we use the eval function to compile the text into a
|
457 |
+
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
|
458 |
+
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
459 |
+
// in parens to eliminate the ambiguity.
|
460 |
+
|
461 |
+
j = eval('(' + text + ')');
|
462 |
+
|
463 |
+
// In the optional fourth stage, we recursively walk the new structure, passing
|
464 |
+
// each name/value pair to a reviver function for possible transformation.
|
465 |
+
|
466 |
+
return typeof reviver === 'function' ?
|
467 |
+
walk({'': j}, '') : j;
|
468 |
+
}
|
469 |
+
|
470 |
+
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
471 |
+
|
472 |
+
throw new SyntaxError('$.jqplot.JSON.parse');
|
473 |
+
};
|
474 |
+
}
|
475 |
+
})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.json2.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function($){$.jqplot.JSON=window.JSON;if(!window.JSON){$.jqplot.JSON={}}function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof $.jqplot.JSON.stringify!=="function"){$.jqplot.JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("$.jqplot.JSON.stringify")}return str("",{"":value})}}if(typeof $.jqplot.JSON.parse!=="function"){$.jqplot.JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("$.jqplot.JSON.parse")}}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.logAxisRenderer.js
ADDED
@@ -0,0 +1,529 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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.LogAxisRenderer
|
34 |
+
* A plugin for a jqPlot to render a logarithmic axis.
|
35 |
+
*
|
36 |
+
* To use this renderer, include the plugin in your source
|
37 |
+
* > <script type="text/javascript" language="javascript" src="plugins/jqplot.logAxisRenderer.js"></script>
|
38 |
+
*
|
39 |
+
* and supply the appropriate options to your plot
|
40 |
+
*
|
41 |
+
* > {axes:{xaxis:{renderer:$.jqplot.LogAxisRenderer}}}
|
42 |
+
**/
|
43 |
+
$.jqplot.LogAxisRenderer = function() {
|
44 |
+
$.jqplot.LinearAxisRenderer.call(this);
|
45 |
+
// prop: axisDefaults
|
46 |
+
// Default properties which will be applied directly to the series.
|
47 |
+
//
|
48 |
+
// Group: Properties
|
49 |
+
//
|
50 |
+
// Properties
|
51 |
+
//
|
52 |
+
// base - the logarithmic base, commonly 2, 10 or Math.E
|
53 |
+
// tickDistribution - Deprecated. "power" distribution of ticks
|
54 |
+
// always used. Option has no effect.
|
55 |
+
this.axisDefaults = {
|
56 |
+
base : 10,
|
57 |
+
tickDistribution :'power'
|
58 |
+
};
|
59 |
+
};
|
60 |
+
|
61 |
+
$.jqplot.LogAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
|
62 |
+
$.jqplot.LogAxisRenderer.prototype.constructor = $.jqplot.LogAxisRenderer;
|
63 |
+
|
64 |
+
$.jqplot.LogAxisRenderer.prototype.init = function(options) {
|
65 |
+
// prop: drawBaseline
|
66 |
+
// True to draw the axis baseline.
|
67 |
+
this.drawBaseline = true;
|
68 |
+
// prop: minorTicks
|
69 |
+
// Number of ticks to add between "major" ticks.
|
70 |
+
// Major ticks are ticks supplied by user or auto computed.
|
71 |
+
// Minor ticks cannot be created by user.
|
72 |
+
this.minorTicks = 'auto';
|
73 |
+
this._scalefact = 1.0;
|
74 |
+
|
75 |
+
$.extend(true, this, options);
|
76 |
+
|
77 |
+
this._autoFormatString = '%d';
|
78 |
+
this._overrideFormatString = false;
|
79 |
+
|
80 |
+
for (var d in this.renderer.axisDefaults) {
|
81 |
+
if (this[d] == null) {
|
82 |
+
this[d] = this.renderer.axisDefaults[d];
|
83 |
+
}
|
84 |
+
}
|
85 |
+
|
86 |
+
this.resetDataBounds();
|
87 |
+
};
|
88 |
+
|
89 |
+
$.jqplot.LogAxisRenderer.prototype.createTicks = function(plot) {
|
90 |
+
// we're are operating on an axis here
|
91 |
+
var ticks = this._ticks;
|
92 |
+
var userTicks = this.ticks;
|
93 |
+
var name = this.name;
|
94 |
+
var db = this._dataBounds;
|
95 |
+
var dim = (this.name.charAt(0) === 'x') ? this._plotDimensions.width : this._plotDimensions.height;
|
96 |
+
var interval;
|
97 |
+
var min, max;
|
98 |
+
var pos1, pos2;
|
99 |
+
var tt, i;
|
100 |
+
|
101 |
+
var threshold = 30;
|
102 |
+
// For some reason scalefactor is screwing up ticks.
|
103 |
+
this._scalefact = (Math.max(dim, threshold+1) - threshold)/300;
|
104 |
+
|
105 |
+
// if we already have ticks, use them.
|
106 |
+
// ticks must be in order of increasing value.
|
107 |
+
if (userTicks.length) {
|
108 |
+
// ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
|
109 |
+
for (i=0; i<userTicks.length; i++){
|
110 |
+
var ut = userTicks[i];
|
111 |
+
var t = new this.tickRenderer(this.tickOptions);
|
112 |
+
if (ut.constructor == Array) {
|
113 |
+
t.value = ut[0];
|
114 |
+
t.label = ut[1];
|
115 |
+
if (!this.showTicks) {
|
116 |
+
t.showLabel = false;
|
117 |
+
t.showMark = false;
|
118 |
+
}
|
119 |
+
else if (!this.showTickMarks) {
|
120 |
+
t.showMark = false;
|
121 |
+
}
|
122 |
+
t.setTick(ut[0], this.name);
|
123 |
+
this._ticks.push(t);
|
124 |
+
}
|
125 |
+
|
126 |
+
else if ($.isPlainObject(ut)) {
|
127 |
+
$.extend(true, t, ut);
|
128 |
+
t.axis = this.name;
|
129 |
+
this._ticks.push(t);
|
130 |
+
}
|
131 |
+
|
132 |
+
else {
|
133 |
+
t.value = ut;
|
134 |
+
if (!this.showTicks) {
|
135 |
+
t.showLabel = false;
|
136 |
+
t.showMark = false;
|
137 |
+
}
|
138 |
+
else if (!this.showTickMarks) {
|
139 |
+
t.showMark = false;
|
140 |
+
}
|
141 |
+
t.setTick(ut, this.name);
|
142 |
+
this._ticks.push(t);
|
143 |
+
}
|
144 |
+
}
|
145 |
+
this.numberTicks = userTicks.length;
|
146 |
+
this.min = this._ticks[0].value;
|
147 |
+
this.max = this._ticks[this.numberTicks-1].value;
|
148 |
+
}
|
149 |
+
|
150 |
+
// we don't have any ticks yet, let's make some!
|
151 |
+
else if (this.min == null && this.max == null) {
|
152 |
+
min = db.min * (2 - this.padMin);
|
153 |
+
max = db.max * this.padMax;
|
154 |
+
|
155 |
+
// if min and max are same, space them out a bit
|
156 |
+
if (min == max) {
|
157 |
+
var adj = 0.05;
|
158 |
+
min = min*(1-adj);
|
159 |
+
max = max*(1+adj);
|
160 |
+
}
|
161 |
+
|
162 |
+
// perform some checks
|
163 |
+
if (this.min != null && this.min <= 0) {
|
164 |
+
throw('log axis minimum must be greater than 0');
|
165 |
+
}
|
166 |
+
if (this.max != null && this.max <= 0) {
|
167 |
+
throw('log axis maximum must be greater than 0');
|
168 |
+
}
|
169 |
+
|
170 |
+
function findCeil (val) {
|
171 |
+
var order = Math.pow(10, Math.floor(Math.log(val)/Math.LN10));
|
172 |
+
return Math.ceil(val/order) * order;
|
173 |
+
}
|
174 |
+
|
175 |
+
function findFloor(val) {
|
176 |
+
var order = Math.pow(10, Math.floor(Math.log(val)/Math.LN10));
|
177 |
+
return Math.floor(val/order) * order;
|
178 |
+
}
|
179 |
+
|
180 |
+
// var range = max - min;
|
181 |
+
var rmin, rmax;
|
182 |
+
|
183 |
+
// for power distribution, open up range to get a nice power of axis.renderer.base.
|
184 |
+
// power distribution won't respect the user's min/max settings.
|
185 |
+
rmin = Math.pow(this.base, Math.floor(Math.log(min)/Math.log(this.base)));
|
186 |
+
rmax = Math.pow(this.base, Math.ceil(Math.log(max)/Math.log(this.base)));
|
187 |
+
|
188 |
+
// // if min and max are same, space them out a bit
|
189 |
+
// if (rmin === rmax) {
|
190 |
+
// var adj = 0.05;
|
191 |
+
// rmin = rmin*(1-adj);
|
192 |
+
// rmax = rmax*(1+adj);
|
193 |
+
// }
|
194 |
+
|
195 |
+
var order = Math.round(Math.log(rmin)/Math.LN10);
|
196 |
+
|
197 |
+
if (this.tickOptions == null || !this.tickOptions.formatString) {
|
198 |
+
this._overrideFormatString = true;
|
199 |
+
}
|
200 |
+
|
201 |
+
this.min = rmin;
|
202 |
+
this.max = rmax;
|
203 |
+
var range = this.max - this.min;
|
204 |
+
|
205 |
+
var minorTicks = (this.minorTicks === 'auto') ? 0 : this.minorTicks;
|
206 |
+
var numberTicks;
|
207 |
+
if (this.numberTicks == null){
|
208 |
+
if (dim > 140) {
|
209 |
+
numberTicks = Math.round(Math.log(this.max/this.min)/Math.log(this.base) + 1);
|
210 |
+
if (numberTicks < 2) {
|
211 |
+
numberTicks = 2;
|
212 |
+
}
|
213 |
+
if (minorTicks === 0) {
|
214 |
+
var temp = dim/(numberTicks - 1);
|
215 |
+
if (temp < 100) {
|
216 |
+
minorTicks = 0;
|
217 |
+
}
|
218 |
+
else if (temp < 190) {
|
219 |
+
minorTicks = 1;
|
220 |
+
}
|
221 |
+
else if (temp < 250) {
|
222 |
+
minorTicks = 3;
|
223 |
+
}
|
224 |
+
else if (temp < 600) {
|
225 |
+
minorTicks = 4;
|
226 |
+
}
|
227 |
+
else {
|
228 |
+
minorTicks = 9;
|
229 |
+
}
|
230 |
+
}
|
231 |
+
}
|
232 |
+
else {
|
233 |
+
numberTicks = 2;
|
234 |
+
if (minorTicks === 0) {
|
235 |
+
minorTicks = 1;
|
236 |
+
}
|
237 |
+
minorTicks = 0;
|
238 |
+
}
|
239 |
+
}
|
240 |
+
else {
|
241 |
+
numberTicks = this.numberTicks;
|
242 |
+
}
|
243 |
+
|
244 |
+
if (order >= 0 && minorTicks !== 3) {
|
245 |
+
this._autoFormatString = '%d';
|
246 |
+
}
|
247 |
+
// Adjust format string for case with 3 ticks where we'll have like 1, 2.5, 5, 7.5, 10
|
248 |
+
else if (order <= 0 && minorTicks === 3) {
|
249 |
+
var temp = -(order - 1);
|
250 |
+
this._autoFormatString = '%.'+ Math.abs(order-1) + 'f';
|
251 |
+
}
|
252 |
+
|
253 |
+
// Adjust format string for values less than 1.
|
254 |
+
else if (order < 0) {
|
255 |
+
var temp = -order;
|
256 |
+
this._autoFormatString = '%.'+ Math.abs(order) + 'f';
|
257 |
+
}
|
258 |
+
|
259 |
+
else {
|
260 |
+
this._autoFormatString = '%d';
|
261 |
+
}
|
262 |
+
|
263 |
+
var to, t, val, tt1, spread, interval;
|
264 |
+
for (var i=0; i<numberTicks; i++){
|
265 |
+
tt = Math.pow(this.base, i - numberTicks + 1) * this.max;
|
266 |
+
|
267 |
+
t = new this.tickRenderer(this.tickOptions);
|
268 |
+
|
269 |
+
if (this._overrideFormatString) {
|
270 |
+
t.formatString = this._autoFormatString;
|
271 |
+
}
|
272 |
+
|
273 |
+
if (!this.showTicks) {
|
274 |
+
t.showLabel = false;
|
275 |
+
t.showMark = false;
|
276 |
+
}
|
277 |
+
else if (!this.showTickMarks) {
|
278 |
+
t.showMark = false;
|
279 |
+
}
|
280 |
+
t.setTick(tt, this.name);
|
281 |
+
this._ticks.push(t);
|
282 |
+
|
283 |
+
if (minorTicks && i<numberTicks-1) {
|
284 |
+
tt1 = Math.pow(this.base, i - numberTicks + 2) * this.max;
|
285 |
+
spread = tt1 - tt;
|
286 |
+
interval = tt1 / (minorTicks+1);
|
287 |
+
for (var j=minorTicks-1; j>=0; j--) {
|
288 |
+
val = tt1-interval*(j+1);
|
289 |
+
t = new this.tickRenderer(this.tickOptions);
|
290 |
+
|
291 |
+
if (this._overrideFormatString && this._autoFormatString != '') {
|
292 |
+
t.formatString = this._autoFormatString;
|
293 |
+
}
|
294 |
+
if (!this.showTicks) {
|
295 |
+
t.showLabel = false;
|
296 |
+
t.showMark = false;
|
297 |
+
}
|
298 |
+
else if (!this.showTickMarks) {
|
299 |
+
t.showMark = false;
|
300 |
+
}
|
301 |
+
t.setTick(val, this.name);
|
302 |
+
this._ticks.push(t);
|
303 |
+
}
|
304 |
+
}
|
305 |
+
}
|
306 |
+
}
|
307 |
+
|
308 |
+
// min and max are set as would be the case with zooming
|
309 |
+
else if (this.min != null && this.max != null) {
|
310 |
+
var opts = $.extend(true, {}, this.tickOptions, {name: this.name, value: null});
|
311 |
+
var nt, ti;
|
312 |
+
// don't have an interval yet, pick one that gives the most
|
313 |
+
// "round" ticks we can get.
|
314 |
+
if (this.numberTicks == null && this.tickInterval == null) {
|
315 |
+
// var threshold = 30;
|
316 |
+
var tdim = Math.max(dim, threshold+1);
|
317 |
+
var nttarget = Math.ceil((tdim-threshold)/35 + 1);
|
318 |
+
|
319 |
+
var ret = $.jqplot.LinearTickGenerator.bestConstrainedInterval(this.min, this.max, nttarget);
|
320 |
+
|
321 |
+
this._autoFormatString = ret[3];
|
322 |
+
nt = ret[2];
|
323 |
+
ti = ret[4];
|
324 |
+
|
325 |
+
for (var i=0; i<nt; i++) {
|
326 |
+
opts.value = this.min + i * ti;
|
327 |
+
t = new this.tickRenderer(opts);
|
328 |
+
|
329 |
+
if (this._overrideFormatString && this._autoFormatString != '') {
|
330 |
+
t.formatString = this._autoFormatString;
|
331 |
+
}
|
332 |
+
if (!this.showTicks) {
|
333 |
+
t.showLabel = false;
|
334 |
+
t.showMark = false;
|
335 |
+
}
|
336 |
+
else if (!this.showTickMarks) {
|
337 |
+
t.showMark = false;
|
338 |
+
}
|
339 |
+
this._ticks.push(t);
|
340 |
+
}
|
341 |
+
}
|
342 |
+
|
343 |
+
// for loose zoom, number ticks and interval are also set.
|
344 |
+
else if (this.numberTicks != null && this.tickInterval != null) {
|
345 |
+
nt = this.numberTicks;
|
346 |
+
for (var i=0; i<nt; i++) {
|
347 |
+
opts.value = this.min + i * this.tickInterval;
|
348 |
+
t = new this.tickRenderer(opts);
|
349 |
+
|
350 |
+
if (this._overrideFormatString && this._autoFormatString != '') {
|
351 |
+
t.formatString = this._autoFormatString;
|
352 |
+
}
|
353 |
+
if (!this.showTicks) {
|
354 |
+
t.showLabel = false;
|
355 |
+
t.showMark = false;
|
356 |
+
}
|
357 |
+
else if (!this.showTickMarks) {
|
358 |
+
t.showMark = false;
|
359 |
+
}
|
360 |
+
this._ticks.push(t);
|
361 |
+
}
|
362 |
+
}
|
363 |
+
}
|
364 |
+
};
|
365 |
+
|
366 |
+
$.jqplot.LogAxisRenderer.prototype.pack = function(pos, offsets) {
|
367 |
+
var lb = parseInt(this.base, 10);
|
368 |
+
var ticks = this._ticks;
|
369 |
+
var trans = function (v) { return Math.log(v)/Math.log(lb); };
|
370 |
+
var invtrans = function (v) { return Math.pow(Math.E, (Math.log(lb)*v)); };
|
371 |
+
var max = trans(this.max);
|
372 |
+
var min = trans(this.min);
|
373 |
+
var offmax = offsets.max;
|
374 |
+
var offmin = offsets.min;
|
375 |
+
var lshow = (this._label == null) ? false : this._label.show;
|
376 |
+
|
377 |
+
for (var p in pos) {
|
378 |
+
this._elem.css(p, pos[p]);
|
379 |
+
}
|
380 |
+
|
381 |
+
this._offsets = offsets;
|
382 |
+
// pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
|
383 |
+
var pixellength = offmax - offmin;
|
384 |
+
var unitlength = max - min;
|
385 |
+
|
386 |
+
// point to unit and unit to point conversions references to Plot DOM element top left corner.
|
387 |
+
this.p2u = function(p){
|
388 |
+
return invtrans((p - offmin) * unitlength / pixellength + min);
|
389 |
+
};
|
390 |
+
|
391 |
+
this.u2p = function(u){
|
392 |
+
return (trans(u) - min) * pixellength / unitlength + offmin;
|
393 |
+
};
|
394 |
+
|
395 |
+
if (this.name == 'xaxis' || this.name == 'x2axis'){
|
396 |
+
this.series_u2p = function(u){
|
397 |
+
return (trans(u) - min) * pixellength / unitlength;
|
398 |
+
};
|
399 |
+
this.series_p2u = function(p){
|
400 |
+
return invtrans(p * unitlength / pixellength + min);
|
401 |
+
};
|
402 |
+
}
|
403 |
+
// yaxis is max at top of canvas.
|
404 |
+
else {
|
405 |
+
this.series_u2p = function(u){
|
406 |
+
return (trans(u) - max) * pixellength / unitlength;
|
407 |
+
};
|
408 |
+
this.series_p2u = function(p){
|
409 |
+
return invtrans(p * unitlength / pixellength + max);
|
410 |
+
};
|
411 |
+
}
|
412 |
+
|
413 |
+
if (this.show) {
|
414 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
415 |
+
for (var i=0; i<ticks.length; i++) {
|
416 |
+
var t = ticks[i];
|
417 |
+
if (t.show && t.showLabel) {
|
418 |
+
var shim;
|
419 |
+
|
420 |
+
if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
|
421 |
+
switch (t.labelPosition) {
|
422 |
+
case 'auto':
|
423 |
+
// position at end
|
424 |
+
if (t.angle < 0) {
|
425 |
+
shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
426 |
+
}
|
427 |
+
// position at start
|
428 |
+
else {
|
429 |
+
shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
|
430 |
+
}
|
431 |
+
break;
|
432 |
+
case 'end':
|
433 |
+
shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
434 |
+
break;
|
435 |
+
case 'start':
|
436 |
+
shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
|
437 |
+
break;
|
438 |
+
case 'middle':
|
439 |
+
shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
440 |
+
break;
|
441 |
+
default:
|
442 |
+
shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
443 |
+
break;
|
444 |
+
}
|
445 |
+
}
|
446 |
+
else {
|
447 |
+
shim = -t.getWidth()/2;
|
448 |
+
}
|
449 |
+
// var shim = t.getWidth()/2;
|
450 |
+
var val = this.u2p(t.value) + shim + 'px';
|
451 |
+
t._elem.css('left', val);
|
452 |
+
t.pack();
|
453 |
+
}
|
454 |
+
}
|
455 |
+
if (lshow) {
|
456 |
+
var w = this._label._elem.outerWidth(true);
|
457 |
+
this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
|
458 |
+
if (this.name == 'xaxis') {
|
459 |
+
this._label._elem.css('bottom', '0px');
|
460 |
+
}
|
461 |
+
else {
|
462 |
+
this._label._elem.css('top', '0px');
|
463 |
+
}
|
464 |
+
this._label.pack();
|
465 |
+
}
|
466 |
+
}
|
467 |
+
else {
|
468 |
+
for (var i=0; i<ticks.length; i++) {
|
469 |
+
var t = ticks[i];
|
470 |
+
if (t.show && t.showLabel) {
|
471 |
+
var shim;
|
472 |
+
if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
|
473 |
+
switch (t.labelPosition) {
|
474 |
+
case 'auto':
|
475 |
+
// position at end
|
476 |
+
case 'end':
|
477 |
+
if (t.angle < 0) {
|
478 |
+
shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
|
479 |
+
}
|
480 |
+
else {
|
481 |
+
shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
|
482 |
+
}
|
483 |
+
break;
|
484 |
+
case 'start':
|
485 |
+
if (t.angle > 0) {
|
486 |
+
shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
|
487 |
+
}
|
488 |
+
else {
|
489 |
+
shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
|
490 |
+
}
|
491 |
+
break;
|
492 |
+
case 'middle':
|
493 |
+
// if (t.angle > 0) {
|
494 |
+
// shim = -t.getHeight()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
495 |
+
// }
|
496 |
+
// else {
|
497 |
+
// shim = -t.getHeight()/2 - t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
|
498 |
+
// }
|
499 |
+
shim = -t.getHeight()/2;
|
500 |
+
break;
|
501 |
+
default:
|
502 |
+
shim = -t.getHeight()/2;
|
503 |
+
break;
|
504 |
+
}
|
505 |
+
}
|
506 |
+
else {
|
507 |
+
shim = -t.getHeight()/2;
|
508 |
+
}
|
509 |
+
|
510 |
+
var val = this.u2p(t.value) + shim + 'px';
|
511 |
+
t._elem.css('top', val);
|
512 |
+
t.pack();
|
513 |
+
}
|
514 |
+
}
|
515 |
+
if (lshow) {
|
516 |
+
var h = this._label._elem.outerHeight(true);
|
517 |
+
this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
|
518 |
+
if (this.name == 'yaxis') {
|
519 |
+
this._label._elem.css('left', '0px');
|
520 |
+
}
|
521 |
+
else {
|
522 |
+
this._label._elem.css('right', '0px');
|
523 |
+
}
|
524 |
+
this._label.pack();
|
525 |
+
}
|
526 |
+
}
|
527 |
+
}
|
528 |
+
};
|
529 |
+
})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.logAxisRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(a){a.jqplot.LogAxisRenderer=function(){a.jqplot.LinearAxisRenderer.call(this);this.axisDefaults={base:10,tickDistribution:"power"}};a.jqplot.LogAxisRenderer.prototype=new a.jqplot.LinearAxisRenderer();a.jqplot.LogAxisRenderer.prototype.constructor=a.jqplot.LogAxisRenderer;a.jqplot.LogAxisRenderer.prototype.init=function(b){this.drawBaseline=true;this.minorTicks="auto";this._scalefact=1;a.extend(true,this,b);this._autoFormatString="%d";this._overrideFormatString=false;for(var c in this.renderer.axisDefaults){if(this[c]==null){this[c]=this.renderer.axisDefaults[c]}}this.resetDataBounds()};a.jqplot.LogAxisRenderer.prototype.createTicks=function(d){var G=this._ticks;var w=this.ticks;var s=this.name;var u=this._dataBounds;var b=(this.name.charAt(0)==="x")?this._plotDimensions.width:this._plotDimensions.height;var k;var N,v;var m,l;var M,K;var g=30;this._scalefact=(Math.max(b,g+1)-g)/300;if(w.length){for(K=0;K<w.length;K++){var A=w[K];var H=new this.tickRenderer(this.tickOptions);if(A.constructor==Array){H.value=A[0];H.label=A[1];if(!this.showTicks){H.showLabel=false;H.showMark=false}else{if(!this.showTickMarks){H.showMark=false}}H.setTick(A[0],this.name);this._ticks.push(H)}else{if(a.isPlainObject(A)){a.extend(true,H,A);H.axis=this.name;this._ticks.push(H)}else{H.value=A;if(!this.showTicks){H.showLabel=false;H.showMark=false}else{if(!this.showTickMarks){H.showMark=false}}H.setTick(A,this.name);this._ticks.push(H)}}}this.numberTicks=w.length;this.min=this._ticks[0].value;this.max=this._ticks[this.numberTicks-1].value}else{if(this.min==null&&this.max==null){N=u.min*(2-this.padMin);v=u.max*this.padMax;if(N==v){var c=0.05;N=N*(1-c);v=v*(1+c)}if(this.min!=null&&this.min<=0){throw ("log axis minimum must be greater than 0")}if(this.max!=null&&this.max<=0){throw ("log axis maximum must be greater than 0")}function f(j){var i=Math.pow(10,Math.floor(Math.log(j)/Math.LN10));return Math.ceil(j/i)*i}function x(j){var i=Math.pow(10,Math.floor(Math.log(j)/Math.LN10));return Math.floor(j/i)*i}var F,r;F=Math.pow(this.base,Math.floor(Math.log(N)/Math.log(this.base)));r=Math.pow(this.base,Math.ceil(Math.log(v)/Math.log(this.base)));var E=Math.round(Math.log(F)/Math.LN10);if(this.tickOptions==null||!this.tickOptions.formatString){this._overrideFormatString=true}this.min=F;this.max=r;var q=this.max-this.min;var C=(this.minorTicks==="auto")?0:this.minorTicks;var h;if(this.numberTicks==null){if(b>140){h=Math.round(Math.log(this.max/this.min)/Math.log(this.base)+1);if(h<2){h=2}if(C===0){var o=b/(h-1);if(o<100){C=0}else{if(o<190){C=1}else{if(o<250){C=3}else{if(o<600){C=4}else{C=9}}}}}}else{h=2;if(C===0){C=1}C=0}}else{h=this.numberTicks}if(E>=0&&C!==3){this._autoFormatString="%d"}else{if(E<=0&&C===3){var o=-(E-1);this._autoFormatString="%."+Math.abs(E-1)+"f"}else{if(E<0){var o=-E;this._autoFormatString="%."+Math.abs(E)+"f"}else{this._autoFormatString="%d"}}}var O,H,z,p,n,k;for(var K=0;K<h;K++){M=Math.pow(this.base,K-h+1)*this.max;H=new this.tickRenderer(this.tickOptions);if(this._overrideFormatString){H.formatString=this._autoFormatString}if(!this.showTicks){H.showLabel=false;H.showMark=false}else{if(!this.showTickMarks){H.showMark=false}}H.setTick(M,this.name);this._ticks.push(H);if(C&&K<h-1){p=Math.pow(this.base,K-h+2)*this.max;n=p-M;k=p/(C+1);for(var J=C-1;J>=0;J--){z=p-k*(J+1);H=new this.tickRenderer(this.tickOptions);if(this._overrideFormatString&&this._autoFormatString!=""){H.formatString=this._autoFormatString}if(!this.showTicks){H.showLabel=false;H.showMark=false}else{if(!this.showTickMarks){H.showMark=false}}H.setTick(z,this.name);this._ticks.push(H)}}}}else{if(this.min!=null&&this.max!=null){var y=a.extend(true,{},this.tickOptions,{name:this.name,value:null});var I,e;if(this.numberTicks==null&&this.tickInterval==null){var D=Math.max(b,g+1);var L=Math.ceil((D-g)/35+1);var B=a.jqplot.LinearTickGenerator.bestConstrainedInterval(this.min,this.max,L);this._autoFormatString=B[3];I=B[2];e=B[4];for(var K=0;K<I;K++){y.value=this.min+K*e;H=new this.tickRenderer(y);if(this._overrideFormatString&&this._autoFormatString!=""){H.formatString=this._autoFormatString}if(!this.showTicks){H.showLabel=false;H.showMark=false}else{if(!this.showTickMarks){H.showMark=false}}this._ticks.push(H)}}else{if(this.numberTicks!=null&&this.tickInterval!=null){I=this.numberTicks;for(var K=0;K<I;K++){y.value=this.min+K*this.tickInterval;H=new this.tickRenderer(y);if(this._overrideFormatString&&this._autoFormatString!=""){H.formatString=this._autoFormatString}if(!this.showTicks){H.showLabel=false;H.showMark=false}else{if(!this.showTickMarks){H.showMark=false}}this._ticks.push(H)}}}}}}};a.jqplot.LogAxisRenderer.prototype.pack=function(f,e){var r=parseInt(this.base,10);var y=this._ticks;var d=function(h){return Math.log(h)/Math.log(r)};var b=function(h){return Math.pow(Math.E,(Math.log(r)*h))};var u=d(this.max);var s=d(this.min);var m=e.max;var k=e.min;var o=(this._label==null)?false:this._label.show;for(var q in f){this._elem.css(q,f[q])}this._offsets=e;var g=m-k;var j=u-s;this.p2u=function(h){return b((h-k)*j/g+s)};this.u2p=function(h){return(d(h)-s)*g/j+k};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(h){return(d(h)-s)*g/j};this.series_p2u=function(h){return b(h*j/g+s)}}else{this.series_u2p=function(h){return(d(h)-u)*g/j};this.series_p2u=function(h){return b(h*j/g+u)}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(var v=0;v<y.length;v++){var n=y[v];if(n.show&&n.showLabel){var c;if(n.constructor==a.jqplot.CanvasAxisTickRenderer&&n.angle){switch(n.labelPosition){case"auto":if(n.angle<0){c=-n.getWidth()+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2}else{c=-n._textRenderer.height*Math.sin(n._textRenderer.angle)/2}break;case"end":c=-n.getWidth()+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break;case"start":c=-n._textRenderer.height*Math.sin(n._textRenderer.angle)/2;break;case"middle":c=-n.getWidth()/2+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break;default:c=-n.getWidth()/2+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break}}else{c=-n.getWidth()/2}var z=this.u2p(n.value)+c+"px";n._elem.css("left",z);n.pack()}}if(o){var l=this._label._elem.outerWidth(true);this._label._elem.css("left",k+g/2-l/2+"px");if(this.name=="xaxis"){this._label._elem.css("bottom","0px")}else{this._label._elem.css("top","0px")}this._label.pack()}}else{for(var v=0;v<y.length;v++){var n=y[v];if(n.show&&n.showLabel){var c;if(n.constructor==a.jqplot.CanvasAxisTickRenderer&&n.angle){switch(n.labelPosition){case"auto":case"end":if(n.angle<0){c=-n._textRenderer.height*Math.cos(-n._textRenderer.angle)/2}else{c=-n.getHeight()+n._textRenderer.height*Math.cos(n._textRenderer.angle)/2}break;case"start":if(n.angle>0){c=-n._textRenderer.height*Math.cos(-n._textRenderer.angle)/2}else{c=-n.getHeight()+n._textRenderer.height*Math.cos(n._textRenderer.angle)/2}break;case"middle":c=-n.getHeight()/2;break;default:c=-n.getHeight()/2;break}}else{c=-n.getHeight()/2}var z=this.u2p(n.value)+c+"px";n._elem.css("top",z);n.pack()}}if(o){var x=this._label._elem.outerHeight(true);this._label._elem.css("top",m-g/2-x/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.mekkoAxisRenderer.js
ADDED
@@ -0,0 +1,611 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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.MekkoAxisRenderer
|
33 |
+
// An axis renderer for a Mekko chart.
|
34 |
+
// Should be used with a Mekko chart where the mekkoRenderer is used on the series.
|
35 |
+
// Displays the Y axis as a range from 0 to 1 (0 to 100%) and the x axis with a tick
|
36 |
+
// for each series scaled to the sum of all the y values.
|
37 |
+
$.jqplot.MekkoAxisRenderer = function() {
|
38 |
+
};
|
39 |
+
|
40 |
+
// called with scope of axis object.
|
41 |
+
$.jqplot.MekkoAxisRenderer.prototype.init = function(options){
|
42 |
+
// prop: tickMode
|
43 |
+
// How to space the ticks on the axis.
|
44 |
+
// 'bar' will place a tick at the width of each bar.
|
45 |
+
// This is the default for the x axis.
|
46 |
+
// 'even' will place ticks at even intervals. This is
|
47 |
+
// the default for x2 axis and y axis. y axis cannot be changed.
|
48 |
+
this.tickMode;
|
49 |
+
// prop: barLabelRenderer
|
50 |
+
// renderer to use to draw labels under each bar.
|
51 |
+
this.barLabelRenderer = $.jqplot.AxisLabelRenderer;
|
52 |
+
// prop: barLabels
|
53 |
+
// array of labels to put under each bar.
|
54 |
+
this.barLabels = this.barLabels || [];
|
55 |
+
// prop: barLabelOptions
|
56 |
+
// options object to pass to the bar label renderer.
|
57 |
+
this.barLabelOptions = {};
|
58 |
+
this.tickOptions = $.extend(true, {showGridline:false}, this.tickOptions);
|
59 |
+
this._barLabels = [];
|
60 |
+
$.extend(true, this, options);
|
61 |
+
if (this.name == 'yaxis') {
|
62 |
+
this.tickOptions.formatString = this.tickOptions.formatString || "%d\%";
|
63 |
+
}
|
64 |
+
var db = this._dataBounds;
|
65 |
+
db.min = 0;
|
66 |
+
// for y axes, scale always go from 0 to 1 (0 to 100%)
|
67 |
+
if (this.name == 'yaxis' || this.name == 'y2axis') {
|
68 |
+
db.max = 100;
|
69 |
+
this.tickMode = 'even';
|
70 |
+
}
|
71 |
+
// For x axes, scale goes from 0 to sum of all y values.
|
72 |
+
else if (this.name == 'xaxis'){
|
73 |
+
this.tickMode = (this.tickMode == null) ? 'bar' : this.tickMode;
|
74 |
+
for (var i=0; i<this._series.length; i++) {
|
75 |
+
db.max += this._series[i]._sumy;
|
76 |
+
}
|
77 |
+
}
|
78 |
+
else if (this.name == 'x2axis'){
|
79 |
+
this.tickMode = (this.tickMode == null) ? 'even' : this.tickMode;
|
80 |
+
for (var i=0; i<this._series.length; i++) {
|
81 |
+
db.max += this._series[i]._sumy;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
};
|
85 |
+
|
86 |
+
// called with scope of axis
|
87 |
+
$.jqplot.MekkoAxisRenderer.prototype.draw = function(ctx, plot) {
|
88 |
+
if (this.show) {
|
89 |
+
// populate the axis label and value properties.
|
90 |
+
// createTicks is a method on the renderer, but
|
91 |
+
// call it within the scope of the axis.
|
92 |
+
this.renderer.createTicks.call(this);
|
93 |
+
// fill a div with axes labels in the right direction.
|
94 |
+
// Need to pregenerate each axis to get it's bounds and
|
95 |
+
// position it and the labels correctly on the plot.
|
96 |
+
var dim=0;
|
97 |
+
var temp;
|
98 |
+
|
99 |
+
var elem = document.createElement('div');
|
100 |
+
this._elem = $(elem);
|
101 |
+
this._elem.addClass('jqplot-axis jqplot-'+this.name);
|
102 |
+
this._elem.css('position', 'absolute');
|
103 |
+
elem = null;
|
104 |
+
|
105 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
106 |
+
this._elem.width(this._plotDimensions.width);
|
107 |
+
}
|
108 |
+
else {
|
109 |
+
this._elem.height(this._plotDimensions.height);
|
110 |
+
}
|
111 |
+
|
112 |
+
// draw the axis label
|
113 |
+
// create a _label object.
|
114 |
+
this.labelOptions.axis = this.name;
|
115 |
+
this._label = new this.labelRenderer(this.labelOptions);
|
116 |
+
if (this._label.show) {
|
117 |
+
this._elem.append(this._label.draw(ctx));
|
118 |
+
}
|
119 |
+
|
120 |
+
var t, tick, elem;
|
121 |
+
if (this.showTicks) {
|
122 |
+
t = this._ticks;
|
123 |
+
for (var i=0; i<t.length; i++) {
|
124 |
+
tick = t[i];
|
125 |
+
if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
|
126 |
+
this._elem.append(tick.draw(ctx));
|
127 |
+
}
|
128 |
+
}
|
129 |
+
}
|
130 |
+
|
131 |
+
// draw the series labels
|
132 |
+
for (i=0; i<this.barLabels.length; i++) {
|
133 |
+
this.barLabelOptions.axis = this.name;
|
134 |
+
this.barLabelOptions.label = this.barLabels[i];
|
135 |
+
this._barLabels.push(new this.barLabelRenderer(this.barLabelOptions));
|
136 |
+
if (this.tickMode != 'bar') {
|
137 |
+
this._barLabels[i].show = false;
|
138 |
+
}
|
139 |
+
if (this._barLabels[i].show) {
|
140 |
+
var elem = this._barLabels[i].draw(ctx, plot);
|
141 |
+
elem.removeClass('jqplot-'+this.name+'-label');
|
142 |
+
elem.addClass('jqplot-'+this.name+'-tick');
|
143 |
+
elem.addClass('jqplot-mekko-barLabel');
|
144 |
+
elem.appendTo(this._elem);
|
145 |
+
elem = null;
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
}
|
150 |
+
return this._elem;
|
151 |
+
};
|
152 |
+
|
153 |
+
// called with scope of an axis
|
154 |
+
$.jqplot.MekkoAxisRenderer.prototype.reset = function() {
|
155 |
+
this.min = this._min;
|
156 |
+
this.max = this._max;
|
157 |
+
this.tickInterval = this._tickInterval;
|
158 |
+
this.numberTicks = this._numberTicks;
|
159 |
+
// this._ticks = this.__ticks;
|
160 |
+
};
|
161 |
+
|
162 |
+
// called with scope of axis
|
163 |
+
$.jqplot.MekkoAxisRenderer.prototype.set = function() {
|
164 |
+
var dim = 0;
|
165 |
+
var temp;
|
166 |
+
var w = 0;
|
167 |
+
var h = 0;
|
168 |
+
var lshow = (this._label == null) ? false : this._label.show;
|
169 |
+
if (this.show && this.showTicks) {
|
170 |
+
var t = this._ticks;
|
171 |
+
for (var i=0; i<t.length; i++) {
|
172 |
+
var tick = t[i];
|
173 |
+
if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
|
174 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
175 |
+
temp = tick._elem.outerHeight(true);
|
176 |
+
}
|
177 |
+
else {
|
178 |
+
temp = tick._elem.outerWidth(true);
|
179 |
+
}
|
180 |
+
if (temp > dim) {
|
181 |
+
dim = temp;
|
182 |
+
}
|
183 |
+
}
|
184 |
+
}
|
185 |
+
|
186 |
+
if (lshow) {
|
187 |
+
w = this._label._elem.outerWidth(true);
|
188 |
+
h = this._label._elem.outerHeight(true);
|
189 |
+
}
|
190 |
+
if (this.name == 'xaxis') {
|
191 |
+
dim = dim + h;
|
192 |
+
this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'});
|
193 |
+
}
|
194 |
+
else if (this.name == 'x2axis') {
|
195 |
+
dim = dim + h;
|
196 |
+
this._elem.css({'height':dim+'px', left:'0px', top:'0px'});
|
197 |
+
}
|
198 |
+
else if (this.name == 'yaxis') {
|
199 |
+
dim = dim + w;
|
200 |
+
this._elem.css({'width':dim+'px', left:'0px', top:'0px'});
|
201 |
+
if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
|
202 |
+
this._label._elem.css('width', w+'px');
|
203 |
+
}
|
204 |
+
}
|
205 |
+
else {
|
206 |
+
dim = dim + w;
|
207 |
+
this._elem.css({'width':dim+'px', right:'0px', top:'0px'});
|
208 |
+
if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) {
|
209 |
+
this._label._elem.css('width', w+'px');
|
210 |
+
}
|
211 |
+
}
|
212 |
+
}
|
213 |
+
};
|
214 |
+
|
215 |
+
// called with scope of axis
|
216 |
+
$.jqplot.MekkoAxisRenderer.prototype.createTicks = function() {
|
217 |
+
// we're are operating on an axis here
|
218 |
+
var ticks = this._ticks;
|
219 |
+
var userTicks = this.ticks;
|
220 |
+
var name = this.name;
|
221 |
+
// databounds were set on axis initialization.
|
222 |
+
var db = this._dataBounds;
|
223 |
+
var dim, interval;
|
224 |
+
var min, max;
|
225 |
+
var pos1, pos2;
|
226 |
+
var t, tt, i, j;
|
227 |
+
|
228 |
+
// if we already have ticks, use them.
|
229 |
+
// ticks must be in order of increasing value.
|
230 |
+
|
231 |
+
if (userTicks.length) {
|
232 |
+
// ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
|
233 |
+
for (i=0; i<userTicks.length; i++){
|
234 |
+
var ut = userTicks[i];
|
235 |
+
var t = new this.tickRenderer(this.tickOptions);
|
236 |
+
if (ut.constructor == Array) {
|
237 |
+
t.value = ut[0];
|
238 |
+
t.label = ut[1];
|
239 |
+
if (!this.showTicks) {
|
240 |
+
t.showLabel = false;
|
241 |
+
t.showMark = false;
|
242 |
+
}
|
243 |
+
else if (!this.showTickMarks) {
|
244 |
+
t.showMark = false;
|
245 |
+
}
|
246 |
+
t.setTick(ut[0], this.name);
|
247 |
+
this._ticks.push(t);
|
248 |
+
}
|
249 |
+
|
250 |
+
else {
|
251 |
+
t.value = ut;
|
252 |
+
if (!this.showTicks) {
|
253 |
+
t.showLabel = false;
|
254 |
+
t.showMark = false;
|
255 |
+
}
|
256 |
+
else if (!this.showTickMarks) {
|
257 |
+
t.showMark = false;
|
258 |
+
}
|
259 |
+
t.setTick(ut, this.name);
|
260 |
+
this._ticks.push(t);
|
261 |
+
}
|
262 |
+
}
|
263 |
+
this.numberTicks = userTicks.length;
|
264 |
+
this.min = this._ticks[0].value;
|
265 |
+
this.max = this._ticks[this.numberTicks-1].value;
|
266 |
+
this.tickInterval = (this.max - this.min) / (this.numberTicks - 1);
|
267 |
+
}
|
268 |
+
|
269 |
+
// we don't have any ticks yet, let's make some!
|
270 |
+
else {
|
271 |
+
if (name == 'xaxis' || name == 'x2axis') {
|
272 |
+
dim = this._plotDimensions.width;
|
273 |
+
}
|
274 |
+
else {
|
275 |
+
dim = this._plotDimensions.height;
|
276 |
+
}
|
277 |
+
|
278 |
+
// if min, max and number of ticks specified, user can't specify interval.
|
279 |
+
if (this.min != null && this.max != null && this.numberTicks != null) {
|
280 |
+
this.tickInterval = null;
|
281 |
+
}
|
282 |
+
|
283 |
+
min = (this.min != null) ? this.min : db.min;
|
284 |
+
max = (this.max != null) ? this.max : db.max;
|
285 |
+
|
286 |
+
// if min and max are same, space them out a bit.+
|
287 |
+
if (min == max) {
|
288 |
+
var adj = 0.05;
|
289 |
+
if (min > 0) {
|
290 |
+
adj = Math.max(Math.log(min)/Math.LN10, 0.05);
|
291 |
+
}
|
292 |
+
min -= adj;
|
293 |
+
max += adj;
|
294 |
+
}
|
295 |
+
|
296 |
+
var range = max - min;
|
297 |
+
var rmin, rmax;
|
298 |
+
var temp, prev, curr;
|
299 |
+
var ynumticks = [3,5,6,11,21];
|
300 |
+
|
301 |
+
// yaxis divide ticks in nice intervals from 0 to 1.
|
302 |
+
if (this.name == 'yaxis' || this.name == 'y2axis') {
|
303 |
+
this.min = 0;
|
304 |
+
this.max = 100;
|
305 |
+
// user didn't specify number of ticks.
|
306 |
+
if (!this.numberTicks){
|
307 |
+
if (this.tickInterval) {
|
308 |
+
this.numberTicks = 3 + Math.ceil(range / this.tickInterval);
|
309 |
+
}
|
310 |
+
else {
|
311 |
+
temp = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
|
312 |
+
for (i=0; i<ynumticks.length; i++) {
|
313 |
+
curr = temp/ynumticks[i];
|
314 |
+
if (curr == 1) {
|
315 |
+
this.numberTicks = ynumticks[i];
|
316 |
+
break;
|
317 |
+
}
|
318 |
+
else if (curr > 1) {
|
319 |
+
prev = curr;
|
320 |
+
continue;
|
321 |
+
}
|
322 |
+
else if (curr < 1) {
|
323 |
+
// was prev or is curr closer to one?
|
324 |
+
if (Math.abs(prev - 1) < Math.abs(curr - 1)) {
|
325 |
+
this.numberTicks = ynumticks[i-1];
|
326 |
+
break;
|
327 |
+
}
|
328 |
+
else {
|
329 |
+
this.numberTicks = ynumticks[i];
|
330 |
+
break;
|
331 |
+
}
|
332 |
+
}
|
333 |
+
else if (i == ynumticks.length -1) {
|
334 |
+
this.numberTicks = ynumticks[i];
|
335 |
+
}
|
336 |
+
}
|
337 |
+
this.tickInterval = range / (this.numberTicks - 1);
|
338 |
+
}
|
339 |
+
}
|
340 |
+
|
341 |
+
// user did specify number of ticks.
|
342 |
+
else {
|
343 |
+
this.tickInterval = range / (this.numberTicks - 1);
|
344 |
+
}
|
345 |
+
|
346 |
+
for (var i=0; i<this.numberTicks; i++){
|
347 |
+
tt = this.min + i * this.tickInterval;
|
348 |
+
t = new this.tickRenderer(this.tickOptions);
|
349 |
+
// var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
|
350 |
+
if (!this.showTicks) {
|
351 |
+
t.showLabel = false;
|
352 |
+
t.showMark = false;
|
353 |
+
}
|
354 |
+
else if (!this.showTickMarks) {
|
355 |
+
t.showMark = false;
|
356 |
+
}
|
357 |
+
t.setTick(tt, this.name);
|
358 |
+
this._ticks.push(t);
|
359 |
+
}
|
360 |
+
}
|
361 |
+
|
362 |
+
// for x axes, have number ot ticks equal to number of series and ticks placed
|
363 |
+
// at sum of y values for each series.
|
364 |
+
else if (this.tickMode == 'bar') {
|
365 |
+
this.min = 0;
|
366 |
+
this.numberTicks = this._series.length + 1;
|
367 |
+
t = new this.tickRenderer(this.tickOptions);
|
368 |
+
if (!this.showTicks) {
|
369 |
+
t.showLabel = false;
|
370 |
+
t.showMark = false;
|
371 |
+
}
|
372 |
+
else if (!this.showTickMarks) {
|
373 |
+
t.showMark = false;
|
374 |
+
}
|
375 |
+
t.setTick(0, this.name);
|
376 |
+
this._ticks.push(t);
|
377 |
+
|
378 |
+
temp = 0;
|
379 |
+
|
380 |
+
for (i=1; i<this.numberTicks; i++){
|
381 |
+
temp += this._series[i-1]._sumy;
|
382 |
+
t = new this.tickRenderer(this.tickOptions);
|
383 |
+
if (!this.showTicks) {
|
384 |
+
t.showLabel = false;
|
385 |
+
t.showMark = false;
|
386 |
+
}
|
387 |
+
else if (!this.showTickMarks) {
|
388 |
+
t.showMark = false;
|
389 |
+
}
|
390 |
+
t.setTick(temp, this.name);
|
391 |
+
this._ticks.push(t);
|
392 |
+
}
|
393 |
+
this.max = this.max || temp;
|
394 |
+
|
395 |
+
// if user specified a max and it is greater than sum, add a tick
|
396 |
+
if (this.max > temp) {
|
397 |
+
t = new this.tickRenderer(this.tickOptions);
|
398 |
+
if (!this.showTicks) {
|
399 |
+
t.showLabel = false;
|
400 |
+
t.showMark = false;
|
401 |
+
}
|
402 |
+
else if (!this.showTickMarks) {
|
403 |
+
t.showMark = false;
|
404 |
+
}
|
405 |
+
t.setTick(this.max, this.name);
|
406 |
+
this._ticks.push(t);
|
407 |
+
|
408 |
+
}
|
409 |
+
}
|
410 |
+
|
411 |
+
else if (this.tickMode == 'even') {
|
412 |
+
this.min = 0;
|
413 |
+
this.max = this.max || db.max;
|
414 |
+
// get a desired number of ticks
|
415 |
+
var nt = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing);
|
416 |
+
range = this.max - this.min;
|
417 |
+
this.numberTicks = nt;
|
418 |
+
this.tickInterval = range / (this.numberTicks - 1);
|
419 |
+
|
420 |
+
for (i=0; i<this.numberTicks; i++){
|
421 |
+
tt = this.min + i * this.tickInterval;
|
422 |
+
t = new this.tickRenderer(this.tickOptions);
|
423 |
+
// var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
|
424 |
+
if (!this.showTicks) {
|
425 |
+
t.showLabel = false;
|
426 |
+
t.showMark = false;
|
427 |
+
}
|
428 |
+
else if (!this.showTickMarks) {
|
429 |
+
t.showMark = false;
|
430 |
+
}
|
431 |
+
t.setTick(tt, this.name);
|
432 |
+
this._ticks.push(t);
|
433 |
+
}
|
434 |
+
|
435 |
+
}
|
436 |
+
}
|
437 |
+
};
|
438 |
+
|
439 |
+
// called with scope of axis
|
440 |
+
$.jqplot.MekkoAxisRenderer.prototype.pack = function(pos, offsets) {
|
441 |
+
var ticks = this._ticks;
|
442 |
+
var max = this.max;
|
443 |
+
var min = this.min;
|
444 |
+
var offmax = offsets.max;
|
445 |
+
var offmin = offsets.min;
|
446 |
+
var lshow = (this._label == null) ? false : this._label.show;
|
447 |
+
|
448 |
+
for (var p in pos) {
|
449 |
+
this._elem.css(p, pos[p]);
|
450 |
+
}
|
451 |
+
|
452 |
+
this._offsets = offsets;
|
453 |
+
// pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
|
454 |
+
var pixellength = offmax - offmin;
|
455 |
+
var unitlength = max - min;
|
456 |
+
|
457 |
+
// point to unit and unit to point conversions references to Plot DOM element top left corner.
|
458 |
+
this.p2u = function(p){
|
459 |
+
return (p - offmin) * unitlength / pixellength + min;
|
460 |
+
};
|
461 |
+
|
462 |
+
this.u2p = function(u){
|
463 |
+
return (u - min) * pixellength / unitlength + offmin;
|
464 |
+
};
|
465 |
+
|
466 |
+
if (this.name == 'xaxis' || this.name == 'x2axis'){
|
467 |
+
this.series_u2p = function(u){
|
468 |
+
return (u - min) * pixellength / unitlength;
|
469 |
+
};
|
470 |
+
this.series_p2u = function(p){
|
471 |
+
return p * unitlength / pixellength + min;
|
472 |
+
};
|
473 |
+
}
|
474 |
+
|
475 |
+
else {
|
476 |
+
this.series_u2p = function(u){
|
477 |
+
return (u - max) * pixellength / unitlength;
|
478 |
+
};
|
479 |
+
this.series_p2u = function(p){
|
480 |
+
return p * unitlength / pixellength + max;
|
481 |
+
};
|
482 |
+
}
|
483 |
+
|
484 |
+
if (this.show) {
|
485 |
+
if (this.name == 'xaxis' || this.name == 'x2axis') {
|
486 |
+
for (var i=0; i<ticks.length; i++) {
|
487 |
+
var t = ticks[i];
|
488 |
+
if (t.show && t.showLabel) {
|
489 |
+
var shim;
|
490 |
+
|
491 |
+
if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
|
492 |
+
// will need to adjust auto positioning based on which axis this is.
|
493 |
+
var temp = (this.name == 'xaxis') ? 1 : -1;
|
494 |
+
switch (t.labelPosition) {
|
495 |
+
case 'auto':
|
496 |
+
// position at end
|
497 |
+
if (temp * t.angle < 0) {
|
498 |
+
shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
499 |
+
}
|
500 |
+
// position at start
|
501 |
+
else {
|
502 |
+
shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
|
503 |
+
}
|
504 |
+
break;
|
505 |
+
case 'end':
|
506 |
+
shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
507 |
+
break;
|
508 |
+
case 'start':
|
509 |
+
shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2;
|
510 |
+
break;
|
511 |
+
case 'middle':
|
512 |
+
shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
513 |
+
break;
|
514 |
+
default:
|
515 |
+
shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2;
|
516 |
+
break;
|
517 |
+
}
|
518 |
+
}
|
519 |
+
else {
|
520 |
+
shim = -t.getWidth()/2;
|
521 |
+
}
|
522 |
+
var val = this.u2p(t.value) + shim + 'px';
|
523 |
+
t._elem.css('left', val);
|
524 |
+
t.pack();
|
525 |
+
}
|
526 |
+
}
|
527 |
+
var w;
|
528 |
+
if (lshow) {
|
529 |
+
w = this._label._elem.outerWidth(true);
|
530 |
+
this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px');
|
531 |
+
if (this.name == 'xaxis') {
|
532 |
+
this._label._elem.css('bottom', '0px');
|
533 |
+
}
|
534 |
+
else {
|
535 |
+
this._label._elem.css('top', '0px');
|
536 |
+
}
|
537 |
+
this._label.pack();
|
538 |
+
}
|
539 |
+
// now show the labels under the bars.
|
540 |
+
var b, l, r;
|
541 |
+
for (var i=0; i<this.barLabels.length; i++) {
|
542 |
+
b = this._barLabels[i];
|
543 |
+
if (b.show) {
|
544 |
+
w = b.getWidth();
|
545 |
+
l = this._ticks[i].getLeft() + this._ticks[i].getWidth();
|
546 |
+
r = this._ticks[i+1].getLeft();
|
547 |
+
b._elem.css('left', (r+l-w)/2+'px');
|
548 |
+
b._elem.css('top', this._ticks[i]._elem.css('top'));
|
549 |
+
b.pack();
|
550 |
+
}
|
551 |
+
}
|
552 |
+
}
|
553 |
+
else {
|
554 |
+
for (var i=0; i<ticks.length; i++) {
|
555 |
+
var t = ticks[i];
|
556 |
+
if (t.show && t.showLabel) {
|
557 |
+
var shim;
|
558 |
+
if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) {
|
559 |
+
// will need to adjust auto positioning based on which axis this is.
|
560 |
+
var temp = (this.name == 'yaxis') ? 1 : -1;
|
561 |
+
switch (t.labelPosition) {
|
562 |
+
case 'auto':
|
563 |
+
// position at end
|
564 |
+
case 'end':
|
565 |
+
if (temp * t.angle < 0) {
|
566 |
+
shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
|
567 |
+
}
|
568 |
+
else {
|
569 |
+
shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
|
570 |
+
}
|
571 |
+
break;
|
572 |
+
case 'start':
|
573 |
+
if (t.angle > 0) {
|
574 |
+
shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2;
|
575 |
+
}
|
576 |
+
else {
|
577 |
+
shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2;
|
578 |
+
}
|
579 |
+
break;
|
580 |
+
case 'middle':
|
581 |
+
shim = -t.getHeight()/2;
|
582 |
+
break;
|
583 |
+
default:
|
584 |
+
shim = -t.getHeight()/2;
|
585 |
+
break;
|
586 |
+
}
|
587 |
+
}
|
588 |
+
else {
|
589 |
+
shim = -t.getHeight()/2;
|
590 |
+
}
|
591 |
+
|
592 |
+
var val = this.u2p(t.value) + shim + 'px';
|
593 |
+
t._elem.css('top', val);
|
594 |
+
t.pack();
|
595 |
+
}
|
596 |
+
}
|
597 |
+
if (lshow) {
|
598 |
+
var h = this._label._elem.outerHeight(true);
|
599 |
+
this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px');
|
600 |
+
if (this.name == 'yaxis') {
|
601 |
+
this._label._elem.css('left', '0px');
|
602 |
+
}
|
603 |
+
else {
|
604 |
+
this._label._elem.css('right', '0px');
|
605 |
+
}
|
606 |
+
this._label.pack();
|
607 |
+
}
|
608 |
+
}
|
609 |
+
}
|
610 |
+
};
|
611 |
+
})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.mekkoAxisRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(a){a.jqplot.MekkoAxisRenderer=function(){};a.jqplot.MekkoAxisRenderer.prototype.init=function(c){this.tickMode;this.barLabelRenderer=a.jqplot.AxisLabelRenderer;this.barLabels=this.barLabels||[];this.barLabelOptions={};this.tickOptions=a.extend(true,{showGridline:false},this.tickOptions);this._barLabels=[];a.extend(true,this,c);if(this.name=="yaxis"){this.tickOptions.formatString=this.tickOptions.formatString||"%d%"}var b=this._dataBounds;b.min=0;if(this.name=="yaxis"||this.name=="y2axis"){b.max=100;this.tickMode="even"}else{if(this.name=="xaxis"){this.tickMode=(this.tickMode==null)?"bar":this.tickMode;for(var d=0;d<this._series.length;d++){b.max+=this._series[d]._sumy}}else{if(this.name=="x2axis"){this.tickMode=(this.tickMode==null)?"even":this.tickMode;for(var d=0;d<this._series.length;d++){b.max+=this._series[d]._sumy}}}}};a.jqplot.MekkoAxisRenderer.prototype.draw=function(b,j){if(this.show){this.renderer.createTicks.call(this);var h=0;var c;var g=document.createElement("div");this._elem=a(g);this._elem.addClass("jqplot-axis jqplot-"+this.name);this._elem.css("position","absolute");g=null;if(this.name=="xaxis"||this.name=="x2axis"){this._elem.width(this._plotDimensions.width)}else{this._elem.height(this._plotDimensions.height)}this.labelOptions.axis=this.name;this._label=new this.labelRenderer(this.labelOptions);if(this._label.show){this._elem.append(this._label.draw(b))}var f,e,g;if(this.showTicks){f=this._ticks;for(var d=0;d<f.length;d++){e=f[d];if(e.showLabel&&(!e.isMinorTick||this.showMinorTicks)){this._elem.append(e.draw(b))}}}for(d=0;d<this.barLabels.length;d++){this.barLabelOptions.axis=this.name;this.barLabelOptions.label=this.barLabels[d];this._barLabels.push(new this.barLabelRenderer(this.barLabelOptions));if(this.tickMode!="bar"){this._barLabels[d].show=false}if(this._barLabels[d].show){var g=this._barLabels[d].draw(b,j);g.removeClass("jqplot-"+this.name+"-label");g.addClass("jqplot-"+this.name+"-tick");g.addClass("jqplot-mekko-barLabel");g.appendTo(this._elem);g=null}}}return this._elem};a.jqplot.MekkoAxisRenderer.prototype.reset=function(){this.min=this._min;this.max=this._max;this.tickInterval=this._tickInterval;this.numberTicks=this._numberTicks};a.jqplot.MekkoAxisRenderer.prototype.set=function(){var k=0;var d;var c=0;var j=0;var b=(this._label==null)?false:this._label.show;if(this.show&&this.showTicks){var g=this._ticks;for(var f=0;f<g.length;f++){var e=g[f];if(e.showLabel&&(!e.isMinorTick||this.showMinorTicks)){if(this.name=="xaxis"||this.name=="x2axis"){d=e._elem.outerHeight(true)}else{d=e._elem.outerWidth(true)}if(d>k){k=d}}}if(b){c=this._label._elem.outerWidth(true);j=this._label._elem.outerHeight(true)}if(this.name=="xaxis"){k=k+j;this._elem.css({height:k+"px",left:"0px",bottom:"0px"})}else{if(this.name=="x2axis"){k=k+j;this._elem.css({height:k+"px",left:"0px",top:"0px"})}else{if(this.name=="yaxis"){k=k+c;this._elem.css({width:k+"px",left:"0px",top:"0px"});if(b&&this._label.constructor==a.jqplot.AxisLabelRenderer){this._label._elem.css("width",c+"px")}}else{k=k+c;this._elem.css({width:k+"px",right:"0px",top:"0px"});if(b&&this._label.constructor==a.jqplot.AxisLabelRenderer){this._label._elem.css("width",c+"px")}}}}}};a.jqplot.MekkoAxisRenderer.prototype.createTicks=function(){var z=this._ticks;var w=this.ticks;var B=this.name;var y=this._dataBounds;var p,x;var n,r;var d,c;var h,b,s,q;if(w.length){for(s=0;s<w.length;s++){var e=w[s];var h=new this.tickRenderer(this.tickOptions);if(e.constructor==Array){h.value=e[0];h.label=e[1];if(!this.showTicks){h.showLabel=false;h.showMark=false}else{if(!this.showTickMarks){h.showMark=false}}h.setTick(e[0],this.name);this._ticks.push(h)}else{h.value=e;if(!this.showTicks){h.showLabel=false;h.showMark=false}else{if(!this.showTickMarks){h.showMark=false}}h.setTick(e,this.name);this._ticks.push(h)}}this.numberTicks=w.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{if(B=="xaxis"||B=="x2axis"){p=this._plotDimensions.width}else{p=this._plotDimensions.height}if(this.min!=null&&this.max!=null&&this.numberTicks!=null){this.tickInterval=null}n=(this.min!=null)?this.min:y.min;r=(this.max!=null)?this.max:y.max;if(n==r){var g=0.05;if(n>0){g=Math.max(Math.log(n)/Math.LN10,0.05)}n-=g;r+=g}var k=r-n;var m,o;var v,l,u;var f=[3,5,6,11,21];if(this.name=="yaxis"||this.name=="y2axis"){this.min=0;this.max=100;if(!this.numberTicks){if(this.tickInterval){this.numberTicks=3+Math.ceil(k/this.tickInterval)}else{v=2+Math.ceil((p-(this.tickSpacing-1))/this.tickSpacing);for(s=0;s<f.length;s++){u=v/f[s];if(u==1){this.numberTicks=f[s];break}else{if(u>1){l=u;continue}else{if(u<1){if(Math.abs(l-1)<Math.abs(u-1)){this.numberTicks=f[s-1];break}else{this.numberTicks=f[s];break}}else{if(s==f.length-1){this.numberTicks=f[s]}}}}}this.tickInterval=k/(this.numberTicks-1)}}else{this.tickInterval=k/(this.numberTicks-1)}for(var s=0;s<this.numberTicks;s++){b=this.min+s*this.tickInterval;h=new this.tickRenderer(this.tickOptions);if(!this.showTicks){h.showLabel=false;h.showMark=false}else{if(!this.showTickMarks){h.showMark=false}}h.setTick(b,this.name);this._ticks.push(h)}}else{if(this.tickMode=="bar"){this.min=0;this.numberTicks=this._series.length+1;h=new this.tickRenderer(this.tickOptions);if(!this.showTicks){h.showLabel=false;h.showMark=false}else{if(!this.showTickMarks){h.showMark=false}}h.setTick(0,this.name);this._ticks.push(h);v=0;for(s=1;s<this.numberTicks;s++){v+=this._series[s-1]._sumy;h=new this.tickRenderer(this.tickOptions);if(!this.showTicks){h.showLabel=false;h.showMark=false}else{if(!this.showTickMarks){h.showMark=false}}h.setTick(v,this.name);this._ticks.push(h)}this.max=this.max||v;if(this.max>v){h=new this.tickRenderer(this.tickOptions);if(!this.showTicks){h.showLabel=false;h.showMark=false}else{if(!this.showTickMarks){h.showMark=false}}h.setTick(this.max,this.name);this._ticks.push(h)}}else{if(this.tickMode=="even"){this.min=0;this.max=this.max||y.max;var A=2+Math.ceil((p-(this.tickSpacing-1))/this.tickSpacing);k=this.max-this.min;this.numberTicks=A;this.tickInterval=k/(this.numberTicks-1);for(s=0;s<this.numberTicks;s++){b=this.min+s*this.tickInterval;h=new this.tickRenderer(this.tickOptions);if(!this.showTicks){h.showLabel=false;h.showMark=false}else{if(!this.showTickMarks){h.showMark=false}}h.setTick(b,this.name);this._ticks.push(h)}}}}}};a.jqplot.MekkoAxisRenderer.prototype.pack=function(e,d){var C=this._ticks;var x=this.max;var v=this.min;var m=d.max;var j=d.min;var o=(this._label==null)?false:this._label.show;for(var s in e){this._elem.css(s,e[s])}this._offsets=d;var f=m-j;var g=x-v;this.p2u=function(b){return(b-j)*g/f+v};this.u2p=function(b){return(b-v)*f/g+j};if(this.name=="xaxis"||this.name=="x2axis"){this.series_u2p=function(b){return(b-v)*f/g};this.series_p2u=function(b){return b*g/f+v}}else{this.series_u2p=function(b){return(b-x)*f/g};this.series_p2u=function(b){return b*g/f+x}}if(this.show){if(this.name=="xaxis"||this.name=="x2axis"){for(var y=0;y<C.length;y++){var n=C[y];if(n.show&&n.showLabel){var c;if(n.constructor==a.jqplot.CanvasAxisTickRenderer&&n.angle){var A=(this.name=="xaxis")?1:-1;switch(n.labelPosition){case"auto":if(A*n.angle<0){c=-n.getWidth()+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2}else{c=-n._textRenderer.height*Math.sin(n._textRenderer.angle)/2}break;case"end":c=-n.getWidth()+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break;case"start":c=-n._textRenderer.height*Math.sin(n._textRenderer.angle)/2;break;case"middle":c=-n.getWidth()/2+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break;default:c=-n.getWidth()/2+n._textRenderer.height*Math.sin(-n._textRenderer.angle)/2;break}}else{c=-n.getWidth()/2}var D=this.u2p(n.value)+c+"px";n._elem.css("left",D);n.pack()}}var k;if(o){k=this._label._elem.outerWidth(true);this._label._elem.css("left",j+f/2-k/2+"px");if(this.name=="xaxis"){this._label._elem.css("bottom","0px")}else{this._label._elem.css("top","0px")}this._label.pack()}var B,u,q;for(var y=0;y<this.barLabels.length;y++){B=this._barLabels[y];if(B.show){k=B.getWidth();u=this._ticks[y].getLeft()+this._ticks[y].getWidth();q=this._ticks[y+1].getLeft();B._elem.css("left",(q+u-k)/2+"px");B._elem.css("top",this._ticks[y]._elem.css("top"));B.pack()}}}else{for(var y=0;y<C.length;y++){var n=C[y];if(n.show&&n.showLabel){var c;if(n.constructor==a.jqplot.CanvasAxisTickRenderer&&n.angle){var A=(this.name=="yaxis")?1:-1;switch(n.labelPosition){case"auto":case"end":if(A*n.angle<0){c=-n._textRenderer.height*Math.cos(-n._textRenderer.angle)/2}else{c=-n.getHeight()+n._textRenderer.height*Math.cos(n._textRenderer.angle)/2}break;case"start":if(n.angle>0){c=-n._textRenderer.height*Math.cos(-n._textRenderer.angle)/2}else{c=-n.getHeight()+n._textRenderer.height*Math.cos(n._textRenderer.angle)/2}break;case"middle":c=-n.getHeight()/2;break;default:c=-n.getHeight()/2;break}}else{c=-n.getHeight()/2}var D=this.u2p(n.value)+c+"px";n._elem.css("top",D);n.pack()}}if(o){var z=this._label._elem.outerHeight(true);this._label._elem.css("top",m-f/2-z/2+"px");if(this.name=="yaxis"){this._label._elem.css("left","0px")}else{this._label._elem.css("right","0px")}this._label.pack()}}}}})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.mekkoRenderer.js
ADDED
@@ -0,0 +1,437 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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.MekkoRenderer
|
34 |
+
* Draws a Mekko style chart which shows 3 dimensional data on a 2 dimensional graph.
|
35 |
+
* the <$.jqplot.MekkoAxisRenderer> should be used with mekko charts. The mekko renderer
|
36 |
+
* overrides the default legend renderer with it's own $.jqplot.MekkoLegendRenderer
|
37 |
+
* which allows more flexibility to specify number of rows and columns in the legend.
|
38 |
+
*
|
39 |
+
* Data is specified per bar in the chart. You can specify data as an array of y values, or as
|
40 |
+
* an array of [label, value] pairs. Note that labels are used only on the first series.
|
41 |
+
* Labels on subsequent series are ignored:
|
42 |
+
*
|
43 |
+
* > bar1 = [['shirts', 8],['hats', 14],['shoes', 6],['gloves', 16],['dolls', 12]];
|
44 |
+
* > bar2 = [15,6,9,13,6];
|
45 |
+
* > bar3 = [['grumpy',4],['sneezy',2],['happy',7],['sleepy',9],['doc',7]];
|
46 |
+
*
|
47 |
+
* If you want to place labels for each bar under the axis, you use the barLabels option on
|
48 |
+
* the axes. The bar labels can be styled with the ".jqplot-mekko-barLabel" css class.
|
49 |
+
*
|
50 |
+
* > barLabels = ['Mickey Mouse', 'Donald Duck', 'Goofy'];
|
51 |
+
* > axes:{xaxis:{barLabels:barLabels}}
|
52 |
+
*
|
53 |
+
*/
|
54 |
+
|
55 |
+
|
56 |
+
$.jqplot.MekkoRenderer = function(){
|
57 |
+
this.shapeRenderer = new $.jqplot.ShapeRenderer();
|
58 |
+
// prop: borderColor
|
59 |
+
// color of the borders between areas on the chart
|
60 |
+
this.borderColor = null;
|
61 |
+
// prop: showBorders
|
62 |
+
// True to draw borders lines between areas on the chart.
|
63 |
+
// False will draw borders lines with the same color as the area.
|
64 |
+
this.showBorders = true;
|
65 |
+
};
|
66 |
+
|
67 |
+
// called with scope of series.
|
68 |
+
$.jqplot.MekkoRenderer.prototype.init = function(options, plot) {
|
69 |
+
this.fill = false;
|
70 |
+
this.fillRect = true;
|
71 |
+
this.strokeRect = true;
|
72 |
+
this.shadow = false;
|
73 |
+
// width of bar on x axis.
|
74 |
+
this._xwidth = 0;
|
75 |
+
this._xstart = 0;
|
76 |
+
$.extend(true, this.renderer, options);
|
77 |
+
// set the shape renderer options
|
78 |
+
var opts = {lineJoin:'miter', lineCap:'butt', isarc:false, fillRect:this.fillRect, strokeRect:this.strokeRect};
|
79 |
+
this.renderer.shapeRenderer.init(opts);
|
80 |
+
plot.axes.x2axis._series.push(this);
|
81 |
+
this._type = 'mekko';
|
82 |
+
};
|
83 |
+
|
84 |
+
// Method: setGridData
|
85 |
+
// converts the user data values to grid coordinates and stores them
|
86 |
+
// in the gridData array. Will convert user data into appropriate
|
87 |
+
// rectangles.
|
88 |
+
// Called with scope of a series.
|
89 |
+
$.jqplot.MekkoRenderer.prototype.setGridData = function(plot) {
|
90 |
+
// recalculate the grid data
|
91 |
+
var xp = this._xaxis.series_u2p;
|
92 |
+
var yp = this._yaxis.series_u2p;
|
93 |
+
var data = this._plotData;
|
94 |
+
this.gridData = [];
|
95 |
+
// figure out width on x axis.
|
96 |
+
// this._xwidth = this._sumy / plot._sumy * this.canvas.getWidth();
|
97 |
+
this._xwidth = xp(this._sumy) - xp(0);
|
98 |
+
if (this.index>0) {
|
99 |
+
this._xstart = plot.series[this.index-1]._xstart + plot.series[this.index-1]._xwidth;
|
100 |
+
}
|
101 |
+
var totheight = this.canvas.getHeight();
|
102 |
+
var sumy = 0;
|
103 |
+
var cury;
|
104 |
+
var curheight;
|
105 |
+
for (var i=0; i<data.length; i++) {
|
106 |
+
if (data[i] != null) {
|
107 |
+
sumy += data[i][1];
|
108 |
+
cury = totheight - (sumy / this._sumy * totheight);
|
109 |
+
curheight = data[i][1] / this._sumy * totheight;
|
110 |
+
this.gridData.push([this._xstart, cury, this._xwidth, curheight]);
|
111 |
+
}
|
112 |
+
}
|
113 |
+
};
|
114 |
+
|
115 |
+
// Method: makeGridData
|
116 |
+
// converts any arbitrary data values to grid coordinates and
|
117 |
+
// returns them. This method exists so that plugins can use a series'
|
118 |
+
// linerenderer to generate grid data points without overwriting the
|
119 |
+
// grid data associated with that series.
|
120 |
+
// Called with scope of a series.
|
121 |
+
$.jqplot.MekkoRenderer.prototype.makeGridData = function(data, plot) {
|
122 |
+
// recalculate the grid data
|
123 |
+
// figure out width on x axis.
|
124 |
+
var xp = this._xaxis.series_u2p;
|
125 |
+
var totheight = this.canvas.getHeight();
|
126 |
+
var sumy = 0;
|
127 |
+
var cury;
|
128 |
+
var curheight;
|
129 |
+
var gd = [];
|
130 |
+
for (var i=0; i<data.length; i++) {
|
131 |
+
if (data[i] != null) {
|
132 |
+
sumy += data[i][1];
|
133 |
+
cury = totheight - (sumy / this._sumy * totheight);
|
134 |
+
curheight = data[i][1] / this._sumy * totheight;
|
135 |
+
gd.push([this._xstart, cury, this._xwidth, curheight]);
|
136 |
+
}
|
137 |
+
}
|
138 |
+
return gd;
|
139 |
+
};
|
140 |
+
|
141 |
+
|
142 |
+
// called within scope of series.
|
143 |
+
$.jqplot.MekkoRenderer.prototype.draw = function(ctx, gd, options) {
|
144 |
+
var i;
|
145 |
+
var opts = (options != undefined) ? options : {};
|
146 |
+
var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
|
147 |
+
var colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors);
|
148 |
+
ctx.save();
|
149 |
+
if (gd.length) {
|
150 |
+
if (showLine) {
|
151 |
+
for (i=0; i<gd.length; i++){
|
152 |
+
opts.fillStyle = colorGenerator.next();
|
153 |
+
if (this.renderer.showBorders) {
|
154 |
+
opts.strokeStyle = this.renderer.borderColor;
|
155 |
+
}
|
156 |
+
else {
|
157 |
+
opts.strokeStyle = opts.fillStyle;
|
158 |
+
}
|
159 |
+
this.renderer.shapeRenderer.draw(ctx, gd[i], opts);
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
ctx.restore();
|
165 |
+
};
|
166 |
+
|
167 |
+
$.jqplot.MekkoRenderer.prototype.drawShadow = function(ctx, gd, options) {
|
168 |
+
// This is a no-op, no shadows on mekko charts.
|
169 |
+
};
|
170 |
+
|
171 |
+
/**
|
172 |
+
* Class: $.jqplot.MekkoLegendRenderer
|
173 |
+
* Legend renderer used by mekko charts with options for
|
174 |
+
* controlling number or rows and columns as well as placement
|
175 |
+
* outside of plot area.
|
176 |
+
*
|
177 |
+
*/
|
178 |
+
$.jqplot.MekkoLegendRenderer = function(){
|
179 |
+
//
|
180 |
+
};
|
181 |
+
|
182 |
+
$.jqplot.MekkoLegendRenderer.prototype.init = function(options) {
|
183 |
+
// prop: numberRows
|
184 |
+
// Maximum number of rows in the legend. 0 or null for unlimited.
|
185 |
+
this.numberRows = null;
|
186 |
+
// prop: numberColumns
|
187 |
+
// Maximum number of columns in the legend. 0 or null for unlimited.
|
188 |
+
this.numberColumns = null;
|
189 |
+
// this will override the placement option on the Legend object
|
190 |
+
this.placement = "outside";
|
191 |
+
$.extend(true, this, options);
|
192 |
+
};
|
193 |
+
|
194 |
+
// called with scope of legend
|
195 |
+
$.jqplot.MekkoLegendRenderer.prototype.draw = function() {
|
196 |
+
var legend = this;
|
197 |
+
if (this.show) {
|
198 |
+
var series = this._series;
|
199 |
+
var ss = 'position:absolute;';
|
200 |
+
ss += (this.background) ? 'background:'+this.background+';' : '';
|
201 |
+
ss += (this.border) ? 'border:'+this.border+';' : '';
|
202 |
+
ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
|
203 |
+
ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
|
204 |
+
ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
|
205 |
+
this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
|
206 |
+
// Mekko charts legends don't go by number of series, but by number of data points
|
207 |
+
// in the series. Refactor things here for that.
|
208 |
+
|
209 |
+
var pad = false,
|
210 |
+
reverse = true, // mekko charts are always stacked, so reverse
|
211 |
+
nr, nc;
|
212 |
+
var s = series[0];
|
213 |
+
var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors);
|
214 |
+
|
215 |
+
if (s.show) {
|
216 |
+
var pd = s.data;
|
217 |
+
if (this.numberRows) {
|
218 |
+
nr = this.numberRows;
|
219 |
+
if (!this.numberColumns){
|
220 |
+
nc = Math.ceil(pd.length/nr);
|
221 |
+
}
|
222 |
+
else{
|
223 |
+
nc = this.numberColumns;
|
224 |
+
}
|
225 |
+
}
|
226 |
+
else if (this.numberColumns) {
|
227 |
+
nc = this.numberColumns;
|
228 |
+
nr = Math.ceil(pd.length/this.numberColumns);
|
229 |
+
}
|
230 |
+
else {
|
231 |
+
nr = pd.length;
|
232 |
+
nc = 1;
|
233 |
+
}
|
234 |
+
|
235 |
+
var i, j, tr, td1, td2, lt, rs, color;
|
236 |
+
var idx = 0;
|
237 |
+
|
238 |
+
for (i=0; i<nr; i++) {
|
239 |
+
if (reverse){
|
240 |
+
tr = $('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem);
|
241 |
+
}
|
242 |
+
else{
|
243 |
+
tr = $('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);
|
244 |
+
}
|
245 |
+
for (j=0; j<nc; j++) {
|
246 |
+
if (idx < pd.length) {
|
247 |
+
lt = this.labels[idx] || pd[idx][0].toString();
|
248 |
+
color = colorGenerator.next();
|
249 |
+
if (!reverse){
|
250 |
+
if (i>0){
|
251 |
+
pad = true;
|
252 |
+
}
|
253 |
+
else{
|
254 |
+
pad = false;
|
255 |
+
}
|
256 |
+
}
|
257 |
+
else{
|
258 |
+
if (i == nr -1){
|
259 |
+
pad = false;
|
260 |
+
}
|
261 |
+
else{
|
262 |
+
pad = true;
|
263 |
+
}
|
264 |
+
}
|
265 |
+
rs = (pad) ? this.rowSpacing : '0';
|
266 |
+
|
267 |
+
td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
|
268 |
+
'<div><div class="jqplot-table-legend-swatch" style="border-color:'+color+';"></div>'+
|
269 |
+
'</div></td>');
|
270 |
+
td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
|
271 |
+
if (this.escapeHtml){
|
272 |
+
td2.text(lt);
|
273 |
+
}
|
274 |
+
else {
|
275 |
+
td2.html(lt);
|
276 |
+
}
|
277 |
+
if (reverse) {
|
278 |
+
td2.prependTo(tr);
|
279 |
+
td1.prependTo(tr);
|
280 |
+
}
|
281 |
+
else {
|
282 |
+
td1.appendTo(tr);
|
283 |
+
td2.appendTo(tr);
|
284 |
+
}
|
285 |
+
pad = true;
|
286 |
+
}
|
287 |
+
idx++;
|
288 |
+
}
|
289 |
+
}
|
290 |
+
|
291 |
+
tr = null;
|
292 |
+
td1 = null;
|
293 |
+
td2 = null;
|
294 |
+
}
|
295 |
+
}
|
296 |
+
return this._elem;
|
297 |
+
};
|
298 |
+
|
299 |
+
$.jqplot.MekkoLegendRenderer.prototype.pack = function(offsets) {
|
300 |
+
if (this.show) {
|
301 |
+
// fake a grid for positioning
|
302 |
+
var grid = {_top:offsets.top, _left:offsets.left, _right:offsets.right, _bottom:this._plotDimensions.height - offsets.bottom};
|
303 |
+
if (this.placement == 'insideGrid') {
|
304 |
+
switch (this.location) {
|
305 |
+
case 'nw':
|
306 |
+
var a = grid._left + this.xoffset;
|
307 |
+
var b = grid._top + this.yoffset;
|
308 |
+
this._elem.css('left', a);
|
309 |
+
this._elem.css('top', b);
|
310 |
+
break;
|
311 |
+
case 'n':
|
312 |
+
var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
|
313 |
+
var b = grid._top + this.yoffset;
|
314 |
+
this._elem.css('left', a);
|
315 |
+
this._elem.css('top', b);
|
316 |
+
break;
|
317 |
+
case 'ne':
|
318 |
+
var a = offsets.right + this.xoffset;
|
319 |
+
var b = grid._top + this.yoffset;
|
320 |
+
this._elem.css({right:a, top:b});
|
321 |
+
break;
|
322 |
+
case 'e':
|
323 |
+
var a = offsets.right + this.xoffset;
|
324 |
+
var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
|
325 |
+
this._elem.css({right:a, top:b});
|
326 |
+
break;
|
327 |
+
case 'se':
|
328 |
+
var a = offsets.right + this.xoffset;
|
329 |
+
var b = offsets.bottom + this.yoffset;
|
330 |
+
this._elem.css({right:a, bottom:b});
|
331 |
+
break;
|
332 |
+
case 's':
|
333 |
+
var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
|
334 |
+
var b = offsets.bottom + this.yoffset;
|
335 |
+
this._elem.css({left:a, bottom:b});
|
336 |
+
break;
|
337 |
+
case 'sw':
|
338 |
+
var a = grid._left + this.xoffset;
|
339 |
+
var b = offsets.bottom + this.yoffset;
|
340 |
+
this._elem.css({left:a, bottom:b});
|
341 |
+
break;
|
342 |
+
case 'w':
|
343 |
+
var a = grid._left + this.xoffset;
|
344 |
+
var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
|
345 |
+
this._elem.css({left:a, top:b});
|
346 |
+
break;
|
347 |
+
default: // same as 'se'
|
348 |
+
var a = grid._right - this.xoffset;
|
349 |
+
var b = grid._bottom + this.yoffset;
|
350 |
+
this._elem.css({right:a, bottom:b});
|
351 |
+
break;
|
352 |
+
}
|
353 |
+
|
354 |
+
}
|
355 |
+
else {
|
356 |
+
switch (this.location) {
|
357 |
+
case 'nw':
|
358 |
+
var a = this._plotDimensions.width - grid._left + this.xoffset;
|
359 |
+
var b = grid._top + this.yoffset;
|
360 |
+
this._elem.css('right', a);
|
361 |
+
this._elem.css('top', b);
|
362 |
+
break;
|
363 |
+
case 'n':
|
364 |
+
var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
|
365 |
+
var b = this._plotDimensions.height - grid._top + this.yoffset;
|
366 |
+
this._elem.css('left', a);
|
367 |
+
this._elem.css('bottom', b);
|
368 |
+
break;
|
369 |
+
case 'ne':
|
370 |
+
var a = this._plotDimensions.width - offsets.right + this.xoffset;
|
371 |
+
var b = grid._top + this.yoffset;
|
372 |
+
this._elem.css({left:a, top:b});
|
373 |
+
break;
|
374 |
+
case 'e':
|
375 |
+
var a = this._plotDimensions.width - offsets.right + this.xoffset;
|
376 |
+
var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
|
377 |
+
this._elem.css({left:a, top:b});
|
378 |
+
break;
|
379 |
+
case 'se':
|
380 |
+
var a = this._plotDimensions.width - offsets.right + this.xoffset;
|
381 |
+
var b = offsets.bottom + this.yoffset;
|
382 |
+
this._elem.css({left:a, bottom:b});
|
383 |
+
break;
|
384 |
+
case 's':
|
385 |
+
var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
|
386 |
+
var b = this._plotDimensions.height - offsets.bottom + this.yoffset;
|
387 |
+
this._elem.css({left:a, top:b});
|
388 |
+
break;
|
389 |
+
case 'sw':
|
390 |
+
var a = this._plotDimensions.width - grid._left + this.xoffset;
|
391 |
+
var b = offsets.bottom + this.yoffset;
|
392 |
+
this._elem.css({right:a, bottom:b});
|
393 |
+
break;
|
394 |
+
case 'w':
|
395 |
+
var a = this._plotDimensions.width - grid._left + this.xoffset;
|
396 |
+
var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
|
397 |
+
this._elem.css({right:a, top:b});
|
398 |
+
break;
|
399 |
+
default: // same as 'se'
|
400 |
+
var a = grid._right - this.xoffset;
|
401 |
+
var b = grid._bottom + this.yoffset;
|
402 |
+
this._elem.css({right:a, bottom:b});
|
403 |
+
break;
|
404 |
+
}
|
405 |
+
}
|
406 |
+
}
|
407 |
+
};
|
408 |
+
|
409 |
+
// setup default renderers for axes and legend so user doesn't have to
|
410 |
+
// called with scope of plot
|
411 |
+
function preInit(target, data, options) {
|
412 |
+
options = options || {};
|
413 |
+
options.axesDefaults = options.axesDefaults || {};
|
414 |
+
options.legend = options.legend || {};
|
415 |
+
options.seriesDefaults = options.seriesDefaults || {};
|
416 |
+
var setopts = false;
|
417 |
+
if (options.seriesDefaults.renderer == $.jqplot.MekkoRenderer) {
|
418 |
+
setopts = true;
|
419 |
+
}
|
420 |
+
else if (options.series) {
|
421 |
+
for (var i=0; i < options.series.length; i++) {
|
422 |
+
if (options.series[i].renderer == $.jqplot.MekkoRenderer) {
|
423 |
+
setopts = true;
|
424 |
+
}
|
425 |
+
}
|
426 |
+
}
|
427 |
+
|
428 |
+
if (setopts) {
|
429 |
+
options.axesDefaults.renderer = $.jqplot.MekkoAxisRenderer;
|
430 |
+
options.legend.renderer = $.jqplot.MekkoLegendRenderer;
|
431 |
+
options.legend.preDraw = true;
|
432 |
+
}
|
433 |
+
}
|
434 |
+
|
435 |
+
$.jqplot.preInitHooks.push(preInit);
|
436 |
+
|
437 |
+
})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.mekkoRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(b){b.jqplot.MekkoRenderer=function(){this.shapeRenderer=new b.jqplot.ShapeRenderer();this.borderColor=null;this.showBorders=true};b.jqplot.MekkoRenderer.prototype.init=function(c,e){this.fill=false;this.fillRect=true;this.strokeRect=true;this.shadow=false;this._xwidth=0;this._xstart=0;b.extend(true,this.renderer,c);var d={lineJoin:"miter",lineCap:"butt",isarc:false,fillRect:this.fillRect,strokeRect:this.strokeRect};this.renderer.shapeRenderer.init(d);e.axes.x2axis._series.push(this);this._type="mekko"};b.jqplot.MekkoRenderer.prototype.setGridData=function(h){var e=this._xaxis.series_u2p;var c=this._yaxis.series_u2p;var g=this._plotData;this.gridData=[];this._xwidth=e(this._sumy)-e(0);if(this.index>0){this._xstart=h.series[this.index-1]._xstart+h.series[this.index-1]._xwidth}var l=this.canvas.getHeight();var d=0;var k;var j;for(var f=0;f<g.length;f++){if(g[f]!=null){d+=g[f][1];k=l-(d/this._sumy*l);j=g[f][1]/this._sumy*l;this.gridData.push([this._xstart,k,this._xwidth,j])}}};b.jqplot.MekkoRenderer.prototype.makeGridData=function(f,g){var d=this._xaxis.series_u2p;var l=this.canvas.getHeight();var c=0;var j;var h;var k=[];for(var e=0;e<f.length;e++){if(f[e]!=null){c+=f[e][1];j=l-(c/this._sumy*l);h=f[e][1]/this._sumy*l;k.push([this._xstart,j,this._xwidth,h])}}return k};b.jqplot.MekkoRenderer.prototype.draw=function(c,h,d){var e;var g=(d!=undefined)?d:{};var f=(g.showLine!=undefined)?g.showLine:this.showLine;var j=new b.jqplot.ColorGenerator(this.seriesColors);c.save();if(h.length){if(f){for(e=0;e<h.length;e++){g.fillStyle=j.next();if(this.renderer.showBorders){g.strokeStyle=this.renderer.borderColor}else{g.strokeStyle=g.fillStyle}this.renderer.shapeRenderer.draw(c,h[e],g)}}}c.restore()};b.jqplot.MekkoRenderer.prototype.drawShadow=function(c,e,d){};b.jqplot.MekkoLegendRenderer=function(){};b.jqplot.MekkoLegendRenderer.prototype.init=function(c){this.numberRows=null;this.numberColumns=null;this.placement="outside";b.extend(true,this,c)};b.jqplot.MekkoLegendRenderer.prototype.draw=function(){var f=this;if(this.show){var o=this._series;var r="position:absolute;";r+=(this.background)?"background:"+this.background+";":"";r+=(this.border)?"border:"+this.border+";":"";r+=(this.fontSize)?"font-size:"+this.fontSize+";":"";r+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";r+=(this.textColor)?"color:"+this.textColor+";":"";this._elem=b('<table class="jqplot-table-legend" style="'+r+'"></table>');var w=false,n=true,c,l;var p=o[0];var d=new b.jqplot.ColorGenerator(p.seriesColors);if(p.show){var x=p.data;if(this.numberRows){c=this.numberRows;if(!this.numberColumns){l=Math.ceil(x.length/c)}else{l=this.numberColumns}}else{if(this.numberColumns){l=this.numberColumns;c=Math.ceil(x.length/this.numberColumns)}else{c=x.length;l=1}}var v,u,e,h,g,k,m,t;var q=0;for(v=0;v<c;v++){if(n){e=b('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem)}else{e=b('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem)}for(u=0;u<l;u++){if(q<x.length){k=this.labels[q]||x[q][0].toString();t=d.next();if(!n){if(v>0){w=true}else{w=false}}else{if(v==c-1){w=false}else{w=true}}m=(w)?this.rowSpacing:"0";h=b('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+m+';"><div><div class="jqplot-table-legend-swatch" style="border-color:'+t+';"></div></div></td>');g=b('<td class="jqplot-table-legend" style="padding-top:'+m+';"></td>');if(this.escapeHtml){g.text(k)}else{g.html(k)}if(n){g.prependTo(e);h.prependTo(e)}else{h.appendTo(e);g.appendTo(e)}w=true}q++}}e=null;h=null;g=null}}return this._elem};b.jqplot.MekkoLegendRenderer.prototype.pack=function(f){if(this.show){var e={_top:f.top,_left:f.left,_right:f.right,_bottom:this._plotDimensions.height-f.bottom};if(this.placement=="insideGrid"){switch(this.location){case"nw":var d=e._left+this.xoffset;var c=e._top+this.yoffset;this._elem.css("left",d);this._elem.css("top",c);break;case"n":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=e._top+this.yoffset;this._elem.css("left",d);this._elem.css("top",c);break;case"ne":var d=f.right+this.xoffset;var c=e._top+this.yoffset;this._elem.css({right:d,top:c});break;case"e":var d=f.right+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({right:d,top:c});break;case"se":var d=f.right+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({right:d,bottom:c});break;case"s":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=f.bottom+this.yoffset;this._elem.css({left:d,bottom:c});break;case"sw":var d=e._left+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({left:d,bottom:c});break;case"w":var d=e._left+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({left:d,top:c});break;default:var d=e._right-this.xoffset;var c=e._bottom+this.yoffset;this._elem.css({right:d,bottom:c});break}}else{switch(this.location){case"nw":var d=this._plotDimensions.width-e._left+this.xoffset;var c=e._top+this.yoffset;this._elem.css("right",d);this._elem.css("top",c);break;case"n":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=this._plotDimensions.height-e._top+this.yoffset;this._elem.css("left",d);this._elem.css("bottom",c);break;case"ne":var d=this._plotDimensions.width-f.right+this.xoffset;var c=e._top+this.yoffset;this._elem.css({left:d,top:c});break;case"e":var d=this._plotDimensions.width-f.right+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({left:d,top:c});break;case"se":var d=this._plotDimensions.width-f.right+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({left:d,bottom:c});break;case"s":var d=(f.left+(this._plotDimensions.width-f.right))/2-this.getWidth()/2;var c=this._plotDimensions.height-f.bottom+this.yoffset;this._elem.css({left:d,top:c});break;case"sw":var d=this._plotDimensions.width-e._left+this.xoffset;var c=f.bottom+this.yoffset;this._elem.css({right:d,bottom:c});break;case"w":var d=this._plotDimensions.width-e._left+this.xoffset;var c=(f.top+(this._plotDimensions.height-f.bottom))/2-this.getHeight()/2;this._elem.css({right:d,top:c});break;default:var d=e._right-this.xoffset;var c=e._bottom+this.yoffset;this._elem.css({right:d,bottom:c});break}}}};function a(g,f,d){d=d||{};d.axesDefaults=d.axesDefaults||{};d.legend=d.legend||{};d.seriesDefaults=d.seriesDefaults||{};var c=false;if(d.seriesDefaults.renderer==b.jqplot.MekkoRenderer){c=true}else{if(d.series){for(var e=0;e<d.series.length;e++){if(d.series[e].renderer==b.jqplot.MekkoRenderer){c=true}}}}if(c){d.axesDefaults.renderer=b.jqplot.MekkoAxisRenderer;d.legend.renderer=b.jqplot.MekkoLegendRenderer;d.legend.preDraw=true}}b.jqplot.preInitHooks.push(a)})(jQuery);
|
backend/settings/assets/js/jqPlot/plugins/jqplot.meterGaugeRenderer.js
ADDED
@@ -0,0 +1,1030 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4
|
6 |
+
* Revision: 1121
|
7 |
+
*
|
8 |
+
* Copyright (c) 2009-2012 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.MeterGaugeRenderer
|
34 |
+
* Plugin renderer to draw a meter gauge chart.
|
35 |
+
*
|
36 |
+
* Data consists of a single series with 1 data point to position the gauge needle.
|
37 |
+
*
|
38 |
+
* To use this renderer, you need to include the
|
39 |
+
* meter gauge renderer plugin, for example:
|
40 |
+
*
|
41 |
+
* > <script type="text/javascript" src="plugins/jqplot.meterGaugeRenderer.js"></script>
|
42 |
+
*
|
43 |
+
* Properties described here are passed into the $.jqplot function
|
44 |
+
* as options on the series renderer. For example:
|
45 |
+
*
|
46 |
+
* > plot0 = $.jqplot('chart0',[[18]],{
|
47 |
+
* > title: 'Network Speed',
|
48 |
+
* > seriesDefaults: {
|
49 |
+
* > renderer: $.jqplot.MeterGaugeRenderer,
|
50 |
+
* > rendererOptions: {
|
51 |
+
* > label: 'MB/s'
|
52 |
+
* > }
|
53 |
+
* > }
|
54 |
+
* > });
|
55 |
+
*
|
56 |
+
* A meterGauge plot does not support events.
|
57 |
+
*/
|
58 |
+
$.jqplot.MeterGaugeRenderer = function(){
|
59 |
+
$.jqplot.LineRenderer.call(this);
|
60 |
+
};
|
61 |
+
|
62 |
+
$.jqplot.MeterGaugeRenderer.prototype = new $.jqplot.LineRenderer();
|
63 |
+
$.jqplot.MeterGaugeRenderer.prototype.constructor = $.jqplot.MeterGaugeRenderer;
|
64 |
+
|
65 |
+
// called with scope of a series
|
66 |
+
$.jqplot.MeterGaugeRenderer.prototype.init = function(options) {
|
67 |
+
// Group: Properties
|
68 |
+
//
|
69 |
+
// prop: diameter
|
70 |
+
// Outer diameter of the meterGauge, auto computed by default
|
71 |
+
this.diameter = null;
|
72 |
+
// prop: padding
|
73 |
+
// padding between the meterGauge and plot edges, auto
|
74 |
+
// calculated by default.
|
75 |
+
this.padding = null;
|
76 |
+
// prop: shadowOffset
|
77 |
+
// offset of the shadow from the gauge ring and offset of
|
78 |
+
// each succesive stroke of the shadow from the last.
|
79 |
+
this.shadowOffset = 2;
|
80 |
+
// prop: shadowAlpha
|
81 |
+
// transparency of the shadow (0 = transparent, 1 = opaque)
|
82 |
+
this.shadowAlpha = 0.07;
|
83 |
+
// prop: shadowDepth
|
84 |
+
// number of strokes to apply to the shadow,
|
85 |
+
// each stroke offset shadowOffset from the last.
|
86 |
+
this.shadowDepth = 4;
|
87 |
+
// prop: background
|
88 |
+
// background color of the inside of the gauge.
|
89 |
+
this.background = "#efefef";
|
90 |
+
// prop: ringColor
|
91 |
+
// color of the outer ring, hub, and needle of the gauge.
|
92 |
+
this.ringColor = "#BBC6D0";
|
93 |
+
// needle color not implemented yet.
|
94 |
+
this.needleColor = "#C3D3E5";
|
95 |
+
// prop: tickColor
|
96 |
+
// color of the tick marks around the gauge.
|
97 |
+
this.tickColor = "989898";
|
98 |
+
// prop: ringWidth
|
99 |
+
// width of the ring around the gauge. Auto computed by default.
|
100 |
+
this.ringWidth = null;
|
101 |
+
// prop: min
|
102 |
+
// Minimum value on the gauge. Auto computed by default
|
103 |
+
this.min;
|
104 |
+
// prop: max
|
105 |
+
// Maximum value on the gauge. Auto computed by default
|
106 |
+
this.max;
|
107 |
+
// prop: ticks
|
108 |
+
// Array of tick values. Auto computed by default.
|
109 |
+
this.ticks = [];
|
110 |
+
// prop: showTicks
|
111 |
+
// true to show ticks around gauge.
|
112 |
+
this.showTicks = true;
|
113 |
+
// prop: showTickLabels
|
114 |
+
// true to show tick labels next to ticks.
|
115 |
+
this.showTickLabels = true;
|
116 |
+
// prop: label
|
117 |
+
// A gauge label like 'kph' or 'Volts'
|
118 |
+
this.label = null;
|
119 |
+
// prop: labelHeightAdjust
|
120 |
+
// Number of Pixels to offset the label up (-) or down (+) from its default position.
|
121 |
+
this.labelHeightAdjust = 0;
|
122 |
+
// prop: labelPosition
|
123 |
+
// Where to position the label, either 'inside' or 'bottom'.
|
124 |
+
this.labelPosition = 'inside';
|
125 |
+
// prop: intervals
|
126 |
+
// Array of ranges to be drawn around the gauge.
|
127 |
+
// Array of form:
|
128 |
+
// > [value1, value2, ...]
|
129 |
+
// indicating the values for the first, second, ... intervals.
|
130 |
+
this.intervals = [];
|
131 |
+
// prop: intervalColors
|
132 |
+
// Array of colors to use for the intervals.
|
133 |
+
this.intervalColors = [ "#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"];
|
134 |
+
// prop: intervalInnerRadius
|
135 |
+
// Radius of the inner circle of the interval ring.
|
136 |
+
this.intervalInnerRadius = null;
|
137 |
+
// prop: intervalOuterRadius
|
138 |
+
// Radius of the outer circle of the interval ring.
|
139 |
+
this.intervalOuterRadius = null;
|
140 |
+
this.tickRenderer = $.jqplot.MeterGaugeTickRenderer;
|
141 |
+
// ticks spaced every 1, 2, 2.5, 5, 10, 20, .1, .2, .25, .5, etc.
|
142 |
+
this.tickPositions = [1, 2, 2.5, 5, 10];
|
143 |
+
// prop: tickSpacing
|
144 |
+
// Degrees between ticks. This is a target number, if
|
145 |
+
// incompatible span and ticks are supplied, a suitable
|
146 |
+
// spacing close to this value will be computed.
|
147 |
+
this.tickSpacing = 30;
|
148 |
+
this.numberMinorTicks = null;
|
149 |
+
// prop: hubRadius
|
150 |
+
// Radius of the hub at the bottom center of gauge which the needle attaches to.
|
151 |
+
// Auto computed by default
|
152 |
+
this.hubRadius = null;
|
153 |
+
// prop: tickPadding
|
154 |
+
// padding of the tick marks to the outer ring and the tick labels to marks.
|
155 |
+
// Auto computed by default.
|
156 |
+
this.tickPadding = null;
|
157 |
+
// prop: needleThickness
|
158 |
+
// Maximum thickness the needle. Auto computed by default.
|
159 |
+
this.needleThickness = null;
|
160 |
+
// prop: needlePad
|
161 |
+
// Padding between needle and inner edge of the ring when the needle is at the min or max gauge value.
|
162 |
+
this.needlePad = 6;
|
163 |
+
// prop: pegNeedle
|
164 |
+
// True will stop needle just below/above the min/max values if data is below/above min/max,
|
165 |
+
// as if the meter is "pegged".
|
166 |
+
this.pegNeedle = true;
|
167 |
+
this._type = 'meterGauge';
|
168 |
+
|
169 |
+
$.extend(true, this, options);
|
170 |
+
this.type = null;
|
171 |
+
this.numberTicks = null;
|
172 |
+
this.tickInterval = null;
|
173 |
+
// span, the sweep (in degrees) from min to max. This gauge is
|
174 |
+
// a semi-circle.
|
175 |
+
this.span = 180;
|
176 |
+
// get rid of this nonsense
|
177 |
+
// this.innerSpan = this.span;
|
178 |
+
if (this.type == 'circular') {
|
179 |
+
this.semiCircular = false;
|
180 |
+
}
|
181 |
+
else if (this.type != 'circular') {
|
182 |
+
this.semiCircular = true;
|
183 |
+
}
|
184 |
+
else {
|
185 |
+
this.semiCircular = (this.span <= 180) ? true : false;
|
186 |
+
}
|
187 |
+
this._tickPoints = [];
|
188 |
+
// reference to label element.
|
189 |
+
this._labelElem = null;
|
190 |
+
|
191 |
+
// start the gauge at the beginning of the span
|
192 |
+
this.startAngle = (90 + (360 - this.span)/2) * Math.PI/180;
|
193 |
+
this.endAngle = (90 - (360 - this.span)/2) * Math.PI/180;
|
194 |
+
|
195 |
+
this.setmin = !!(this.min == null);
|
196 |
+
this.setmax = !!(this.max == null);
|
197 |
+
|
198 |
+
// if given intervals and is an array of values, create labels and colors.
|
199 |
+
if (this.intervals.length) {
|
200 |
+
if (this.intervals[0].length == null || this.intervals.length == 1) {
|
201 |
+
for (var i=0; i<this.intervals.length; i++) {
|
202 |
+
this.intervals[i] = [this.intervals[i], this.intervals[i], this.intervalColors[i]];
|
203 |
+
}
|
204 |
+
}
|
205 |
+
else if (this.intervals[0].length == 2) {
|
206 |
+
for (i=0; i<this.intervals.length; i++) {
|
207 |
+
this.intervals[i] = [this.intervals[i][0], this.intervals[i][1], this.intervalColors[i]];
|
208 |
+
}
|
209 |
+
}
|
210 |
+
}
|
211 |
+
|
212 |
+
// compute min, max and ticks if not supplied:
|
213 |
+
if (this.ticks.length) {
|
214 |
+
if (this.ticks[0].length == null || this.ticks[0].length == 1) {
|
215 |
+
for (var i=0; i<this.ticks.length; i++) {
|
216 |
+
this.ticks[i] = [this.ticks[i], this.ticks[i]];
|
217 |
+
}
|
218 |
+
}
|
219 |
+
this.min = (this.min == null) ? this.ticks[0][0] : this.min;
|
220 |
+
this.max = (this.max == null) ? this.ticks[this.ticks.length-1][0] : this.max;
|
221 |
+
this.setmin = false;
|
222 |
+
this.setmax = false;
|
223 |
+
this.numberTicks = this.ticks.length;
|
224 |
+
this.tickInterval = this.ticks[1][0] - this.ticks[0][0];
|
225 |
+
this.tickFactor = Math.floor(parseFloat((Math.log(this.tickInterval)/Math.log(10)).toFixed(11)));
|
226 |
+
// use the first interal to calculate minor ticks;
|
227 |
+
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
|
228 |
+
if (!this.numberMinorTicks) {
|
229 |
+
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
|
230 |
+
}
|
231 |
+
if (!this.numberMinorTicks) {
|
232 |
+
this.numberMinorTicks = 1;
|
233 |
+
}
|
234 |
+
}
|
235 |
+
|
236 |
+
else if (this.intervals.length) {
|
237 |
+
this.min = (this.min == null) ? 0 : this.min;
|
238 |
+
this.setmin = false;
|
239 |
+
if (this.max == null) {
|
240 |
+
if (this.intervals[this.intervals.length-1][0] >= this.data[0][1]) {
|
241 |
+
this.max = this.intervals[this.intervals.length-1][0];
|
242 |
+
this.setmax = false;
|
243 |
+
}
|
244 |
+
}
|
245 |
+
else {
|
246 |
+
this.setmax = false;
|
247 |
+
}
|
248 |
+
}
|
249 |
+
|
250 |
+
else {
|
251 |
+
// no ticks and no intervals supplied, put needle in middle
|
252 |
+
this.min = (this.min == null) ? 0 : this.min;
|
253 |
+
this.setmin = false;
|
254 |
+
if (this.max == null) {
|
255 |
+
this.max = this.data[0][1] * 1.25;
|
256 |
+
this.setmax = true;
|
257 |
+
}
|
258 |
+
else {
|
259 |
+
this.setmax = false;
|
260 |
+
}
|
261 |
+
}
|
262 |
+
};
|
263 |
+
|
264 |
+
$.jqplot.MeterGaugeRenderer.prototype.setGridData = function(plot) {
|
265 |
+
// set gridData property. This will hold angle in radians of each data point.
|
266 |
+
var stack = [];
|
267 |
+
var td = [];
|
268 |
+
var sa = this.startAngle;
|
269 |
+
for (var i=0; i<this.data.length; i++){
|
270 |
+
stack.push(this.data[i][1]);
|
271 |
+
td.push([this.data[i][0]]);
|
272 |
+
if (i>0) {
|
273 |
+
stack[i] += stack[i-1];
|
274 |
+
}
|
275 |
+
}
|
276 |
+
var fact = Math.PI*2/stack[stack.length - 1];
|
277 |
+
|
278 |
+
for (var i=0; i<stack.length; i++) {
|
279 |
+
td[i][1] = stack[i] * fact;
|
280 |
+
}
|
281 |
+
this.gridData = td;
|
282 |
+
};
|
283 |
+
|
284 |
+
$.jqplot.MeterGaugeRenderer.prototype.makeGridData = function(data, plot) {
|
285 |
+
var stack = [];
|
286 |
+
var td = [];
|
287 |
+
var sa = this.startAngle;
|
288 |
+
for (var i=0; i<data.length; i++){
|
289 |
+
stack.push(data[i][1]);
|
290 |
+
td.push([data[i][0]]);
|
291 |
+
if (i>0) {
|
292 |
+
stack[i] += stack[i-1];
|
293 |
+
}
|
294 |
+
}
|
295 |
+
var fact = Math.PI*2/stack[stack.length - 1];
|
296 |
+
|
297 |
+
for (var i=0; i<stack.length; i++) {
|
298 |
+
td[i][1] = stack[i] * fact;
|
299 |
+
}
|
300 |
+
return td;
|
301 |
+
};
|
302 |
+
|
303 |
+
|
304 |
+
function getnmt(pos, interval, fact) {
|
305 |
+
var temp;
|
306 |
+
for (var i=pos.length-1; i>=0; i--) {
|
307 |
+
temp = interval/(pos[i] * Math.pow(10, fact));
|
308 |
+
if (temp == 4 || temp == 5) {
|
309 |
+
return temp - 1;
|
310 |
+
}
|
311 |
+
}
|
312 |
+
return null;
|
313 |
+
}
|
314 |
+
|
315 |
+
// called with scope of series
|
316 |
+
$.jqplot.MeterGaugeRenderer.prototype.draw = function (ctx, gd, options) {
|
317 |
+
var i;
|
318 |
+
var opts = (options != undefined) ? options : {};
|
319 |
+
// offset and direction of offset due to legend placement
|
320 |
+
var offx = 0;
|
321 |
+
var offy = 0;
|
322 |
+
var trans = 1;
|
323 |
+
if (options.legendInfo && options.legendInfo.placement == 'inside') {
|
324 |
+
var li = options.legendInfo;
|
325 |
+
switch (li.location) {
|
326 |
+
case 'nw':
|
327 |
+
offx = li.width + li.xoffset;
|
328 |
+
break;
|
329 |
+
case 'w':
|
330 |
+
offx = li.width + li.xoffset;
|
331 |
+
break;
|
332 |
+
case 'sw':
|
333 |
+
offx = li.width + li.xoffset;
|
334 |
+
break;
|
335 |
+
case 'ne':
|
336 |
+
offx = li.width + li.xoffset;
|
337 |
+
trans = -1;
|
338 |
+
break;
|
339 |
+
case 'e':
|
340 |
+
offx = li.width + li.xoffset;
|
341 |
+
trans = -1;
|
342 |
+
break;
|
343 |
+
case 'se':
|
344 |
+
offx = li.width + li.xoffset;
|
345 |
+
trans = -1;
|
346 |
+
break;
|
347 |
+
case 'n':
|
348 |
+
offy = li.height + li.yoffset;
|
349 |
+
break;
|
350 |
+
case 's':
|
351 |
+
offy = li.height + li.yoffset;
|
352 |
+
trans = -1;
|
353 |
+
break;
|
354 |
+
default:
|
355 |
+
break;
|
356 |
+
}
|
357 |
+
}
|
358 |
+
|
359 |
+
|
360 |
+
|
361 |
+
// pre-draw so can get it's dimensions.
|
362 |
+
if (this.label) {
|
363 |
+
this._labelElem = $('<div class="jqplot-meterGauge-label" style="position:absolute;">'+this.label+'</div>');
|
364 |
+
this.canvas._elem.after(this._labelElem);
|
365 |
+
}
|
366 |
+
|
367 |
+
var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow;
|
368 |
+
var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine;
|
369 |
+
var fill = (opts.fill != undefined) ? opts.fill : this.fill;
|
370 |
+
var cw = ctx.canvas.width;
|
371 |
+
var ch = ctx.canvas.height;
|
372 |
+
if (this.padding == null) {
|
373 |
+
this.padding = Math.round(Math.min(cw, ch)/30);
|
374 |
+
}
|
375 |
+
var w = cw - offx - 2 * this.padding;
|
376 |
+
var h = ch - offy - 2 * this.padding;
|
377 |
+
if (this.labelPosition == 'bottom' && this.label) {
|
378 |
+
h -= this._labelElem.outerHeight(true);
|
379 |
+
}
|
380 |
+
var mindim = Math.min(w,h);
|
381 |
+
var d = mindim;
|
382 |
+
|
383 |
+
if (!this.diameter) {
|
384 |
+
if (this.semiCircular) {
|
385 |
+
if ( w >= 2*h) {
|
386 |
+
if (!this.ringWidth) {
|
387 |
+
this.ringWidth = 2*h/35;
|
388 |
+
}
|
389 |
+
this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8);
|
390 |
+
this.innerPad = this.ringWidth/2 + this.needleThickness/2 + this.needlePad;
|
391 |
+
this.diameter = 2 * (h - 2*this.innerPad);
|
392 |
+
}
|
393 |
+
else {
|
394 |
+
if (!this.ringWidth) {
|
395 |
+
this.ringWidth = w/35;
|
396 |
+
}
|
397 |
+
this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8);
|
398 |
+
this.innerPad = this.ringWidth/2 + this.needleThickness/2 + this.needlePad;
|
399 |
+
this.diameter = w - 2*this.innerPad - this.ringWidth - this.padding;
|
400 |
+
}
|
401 |
+
// center taking into account legend and over draw for gauge bottom below hub.
|
402 |
+
// this will be center of hub.
|
403 |
+
this._center = [(cw - trans * offx)/2 + trans * offx, (ch + trans*offy - this.padding - this.ringWidth - this.innerPad)];
|
404 |
+
}
|
405 |
+
else {
|
406 |
+
if (!this.ringWidth) {
|
407 |
+
this.ringWidth = d/35;
|
408 |
+
}
|
409 |
+
this.needleThickness = this.needleThickness || 2+Math.pow(this.ringWidth, 0.8);
|
410 |
+
this.innerPad = 0;
|
411 |
+
this.diameter = d - this.ringWidth;
|
412 |
+
// center in middle of canvas taking into account legend.
|
413 |
+
// will be center of hub.
|
414 |
+
this._center = [(cw-trans*offx)/2 + trans * offx, (ch-trans*offy)/2 + trans * offy];
|
415 |
+
}
|
416 |
+
}
|
417 |
+
|
418 |
+
|
419 |
+
if (this._labelElem && this.labelPosition == 'bottom') {
|
420 |
+
this._center[1] -= this._labelElem.outerHeight(true);
|
421 |
+
}
|
422 |
+
|
423 |
+
this._radius = this.diameter/2;
|
424 |
+
|
425 |
+
this.tickSpacing = 6000/this.diameter;
|
426 |
+
|
427 |
+
if (!this.hubRadius) {
|
428 |
+
this.hubRadius = this.diameter/18;
|
429 |
+
}
|
430 |
+
|
431 |
+
this.shadowOffset = 0.5 + this.ringWidth/9;
|
432 |
+
this.shadowWidth = this.ringWidth*1;
|
433 |
+
|
434 |
+
this.tickPadding = 3 + Math.pow(this.diameter/20, 0.7);
|
435 |
+
this.tickOuterRadius = this._radius - this.ringWidth/2 - this.tickPadding;
|
436 |
+
this.tickLength = (this.showTicks) ? this._radius/13 : 0;
|
437 |
+
|
438 |
+
if (this.ticks.length == 0) {
|
439 |
+
// no ticks, lets make some.
|
440 |
+
var max = this.max,
|
441 |
+
min = this.min,
|
442 |
+
setmax = this.setmax,
|
443 |
+
setmin = this.setmin,
|
444 |
+
ti = (max - min) * this.tickSpacing / this.span;
|
445 |
+
var tf = Math.floor(parseFloat((Math.log(ti)/Math.log(10)).toFixed(11)));
|
446 |
+
var tp = (ti/Math.pow(10, tf));
|
447 |
+
(tp > 2 && tp <= 2.5) ? tp = 2.5 : tp = Math.ceil(tp);
|
448 |
+
var t = this.tickPositions;
|
449 |
+
var tpindex, nt;
|
450 |
+
|
451 |
+
for (i=0; i<t.length; i++) {
|
452 |
+
if (tp == t[i] || i && t[i-1] < tp && tp < t[i]) {
|
453 |
+
ti = t[i]*Math.pow(10, tf);
|
454 |
+
tpindex = i;
|
455 |
+
}
|
456 |
+
}
|
457 |
+
|
458 |
+
for (i=0; i<t.length; i++) {
|
459 |
+
if (tp == t[i] || i && t[i-1] < tp && tp < t[i]) {
|
460 |
+
ti = t[i]*Math.pow(10, tf);
|
461 |
+
nt = Math.ceil((max - min) / ti);
|
462 |
+
}
|
463 |
+
}
|
464 |
+
|
465 |
+
// both max and min are free
|
466 |
+
if (setmax && setmin) {
|
467 |
+
var tmin = (min > 0) ? min - min % ti : min - min % ti - ti;
|
468 |
+
if (!this.forceZero) {
|
469 |
+
var diff = Math.min(min - tmin, 0.8*ti);
|
470 |
+
var ntp = Math.floor(diff/t[tpindex]);
|
471 |
+
if (ntp > 1) {
|
472 |
+
tmin = tmin + t[tpindex] * (ntp-1);
|
473 |
+
if (parseInt(tmin, 10) != tmin && parseInt(tmin-t[tpindex], 10) == tmin-t[tpindex]) {
|
474 |
+
tmin = tmin - t[tpindex];
|
475 |
+
}
|
476 |
+
}
|
477 |
+
}
|
478 |
+
if (min == tmin) {
|
479 |
+
min -= ti;
|
480 |
+
}
|
481 |
+
else {
|
482 |
+
// tmin should always be lower than dataMin
|
483 |
+
if (min - tmin > 0.23*ti) {
|
484 |
+
min = tmin;
|
485 |
+
}
|
486 |
+
else {
|
487 |
+
min = tmin -ti;
|
488 |
+
nt += 1;
|
489 |
+
}
|
490 |
+
}
|
491 |
+
nt += 1;
|
492 |
+
var tmax = min + (nt - 1) * ti;
|
493 |
+
if (max >= tmax) {
|
494 |
+
tmax += ti;
|
495 |
+
nt += 1;
|
496 |
+
}
|
497 |
+
// now tmax should always be mroe than dataMax
|
498 |
+
if (tmax - max < 0.23*ti) {
|
499 |
+
tmax += ti;
|
500 |
+
nt += 1;
|
501 |
+
}
|
502 |
+
this.max = max = tmax;
|
503 |
+
this.min = min;
|
504 |
+
|
505 |
+
this.tickInterval = ti;
|
506 |
+
this.numberTicks = nt;
|
507 |
+
var it;
|
508 |
+
for (i=0; i<nt; i++) {
|
509 |
+
it = parseFloat((min+i*ti).toFixed(11));
|
510 |
+
this.ticks.push([it, it]);
|
511 |
+
}
|
512 |
+
this.max = this.ticks[nt-1][1];
|
513 |
+
|
514 |
+
this.tickFactor = tf;
|
515 |
+
// determine number of minor ticks
|
516 |
+
|
517 |
+
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
|
518 |
+
|
519 |
+
if (!this.numberMinorTicks) {
|
520 |
+
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
|
521 |
+
}
|
522 |
+
}
|
523 |
+
// max is free, min is fixed
|
524 |
+
else if (setmax) {
|
525 |
+
var tmax = min + (nt - 1) * ti;
|
526 |
+
if (max >= tmax) {
|
527 |
+
max = tmax + ti;
|
528 |
+
nt += 1;
|
529 |
+
}
|
530 |
+
else {
|
531 |
+
max = tmax;
|
532 |
+
}
|
533 |
+
|
534 |
+
this.tickInterval = this.tickInterval || ti;
|
535 |
+
this.numberTicks = this.numberTicks || nt;
|
536 |
+
var it;
|
537 |
+
for (i=0; i<this.numberTicks; i++) {
|
538 |
+
it = parseFloat((min+i*this.tickInterval).toFixed(11));
|
539 |
+
this.ticks.push([it, it]);
|
540 |
+
}
|
541 |
+
this.max = this.ticks[this.numberTicks-1][1];
|
542 |
+
|
543 |
+
this.tickFactor = tf;
|
544 |
+
// determine number of minor ticks
|
545 |
+
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
|
546 |
+
|
547 |
+
if (!this.numberMinorTicks) {
|
548 |
+
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
|
549 |
+
}
|
550 |
+
}
|
551 |
+
|
552 |
+
// not setting max or min
|
553 |
+
if (!setmax && !setmin) {
|
554 |
+
var range = this.max - this.min;
|
555 |
+
tf = Math.floor(parseFloat((Math.log(range)/Math.log(10)).toFixed(11))) - 1;
|
556 |
+
var nticks = [5,6,4,7,3,8,9,10,2], res, numticks, nonSigDigits=0, sigRange;
|
557 |
+
// check to see how many zeros are at the end of the range
|
558 |
+
if (range > 1) {
|
559 |
+
var rstr = String(range);
|
560 |
+
if (rstr.search(/\./) == -1) {
|
561 |
+
var pos = rstr.search(/0+$/);
|
562 |
+
nonSigDigits = (pos > 0) ? rstr.length - pos - 1 : 0;
|
563 |
+
}
|
564 |
+
}
|
565 |
+
sigRange = range/Math.pow(10, nonSigDigits);
|
566 |
+
for (i=0; i<nticks.length; i++) {
|
567 |
+
res = sigRange/(nticks[i]-1);
|
568 |
+
if (res == parseInt(res, 10)) {
|
569 |
+
this.numberTicks = nticks[i];
|
570 |
+
this.tickInterval = range/(this.numberTicks-1);
|
571 |
+
this.tickFactor = tf+1;
|
572 |
+
break;
|
573 |
+
}
|
574 |
+
}
|
575 |
+
var it;
|
576 |
+
for (i=0; i<this.numberTicks; i++) {
|
577 |
+
it = parseFloat((this.min+i*this.tickInterval).toFixed(11));
|
578 |
+
this.ticks.push([it, it]);
|
579 |
+
}
|
580 |
+
// determine number of minor ticks
|
581 |
+
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor);
|
582 |
+
|
583 |
+
if (!this.numberMinorTicks) {
|
584 |
+
this.numberMinorTicks = getnmt(this.tickPositions, this.tickInterval, this.tickFactor-1);
|
585 |
+
}
|
586 |
+
|
587 |
+
if (!this.numberMinorTicks) {
|
588 |
+
this.numberMinorTicks = 1;
|
589 |
+
var nums = [4, 5, 3, 6, 2];
|
590 |
+
for (i=0; i<5; i++) {
|
591 |
+
var temp = this.tickInterval/nums[i];
|
592 |
+
if (temp == parseInt(temp, 10)) {
|
593 |
+
this.numberMinorTicks = nums[i]-1;
|
594 |
+
break;
|
595 |
+
}
|
596 |
+
}
|
597 |
+
}
|
598 |
+
}
|
599 |
+
}
|
600 |
+
|
601 |
+
|
602 |
+
var r = this._radius,
|
603 |
+
sa = this.startAngle,
|
604 |
+
ea = this.endAngle,
|
605 |
+
pi = Math.PI,
|
606 |
+
hpi = Math.PI/2;
|
607 |
+
|
608 |
+
if (this.semiCircular) {
|
609 |
+
var overAngle = Math.atan(this.innerPad/r),
|
610 |
+
outersa = this.outerStartAngle = sa - overAngle,
|
611 |
+
outerea = this.outerEndAngle = ea + overAngle,
|
612 |
+
hubsa = this.hubStartAngle = sa - Math.atan(this.innerPad/this.hubRadius*2),
|
613 |
+
hubea = this.hubEndAngle = ea + Math.atan(this.innerPad/this.hubRadius*2);
|
614 |
+
|
615 |
+
ctx.save();
|
616 |
+
|
617 |
+
ctx.translate(this._center[0], this._center[1]);
|
618 |
+
ctx.lineJoin = "round";
|
619 |
+
ctx.lineCap = "round";
|
620 |
+
|
621 |
+
// draw the innerbackground
|
622 |
+
ctx.save();
|
623 |
+
ctx.beginPath();
|
624 |
+
ctx.fillStyle = this.background;
|
625 |
+
ctx.arc(0, 0, r, outersa, outerea, false);
|
626 |
+
ctx.closePath();
|
627 |
+
ctx.fill();
|
628 |
+
ctx.restore();
|
629 |
+
|
630 |
+
// draw the shadow
|
631 |
+
// the outer ring.
|
632 |
+
var shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')';
|
633 |
+
ctx.save();
|
634 |
+
for (var i=0; i<this.shadowDepth; i++) {
|
635 |
+
ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
|
636 |
+
ctx.beginPath();
|
637 |
+
ctx.strokeStyle = shadowColor;
|
638 |
+
ctx.lineWidth = this.shadowWidth;
|
639 |
+
ctx.arc(0 ,0, r, outersa, outerea, false);
|
640 |
+
ctx.closePath();
|
641 |
+
ctx.stroke();
|
642 |
+
}
|
643 |
+
ctx.restore();
|
644 |
+
|
645 |
+
// the inner hub.
|
646 |
+
ctx.save();
|
647 |
+
var tempd = parseInt((this.shadowDepth+1)/2, 10);
|
648 |
+
for (var i=0; i<tempd; i++) {
|
649 |
+
ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));
|
650 |
+
ctx.beginPath();
|
651 |
+
ctx.fillStyle = shadowColor;
|
652 |
+
ctx.arc(0 ,0, this.hubRadius, hubsa, hubea, false);
|
653 |
+
ctx.closePath();
|
654 |
+
ctx.fill();
|
655 |
+
}
|
656 |
+
ctx.restore();
|
657 |
+
|
658 |
+
// draw the outer ring.
|
659 |
+
ctx.save();
|
660 |
+
ctx.beginPath();
|
661 |
+
ctx.strokeStyle = this.ringColor;
|
662 |
+
ctx.lineWidth = this.ringWidth;
|
663 |
+
ctx.arc(0 ,0, r, outersa, outerea, false);
|
664 |
+
ctx.closePath();
|
665 |
+
ctx.stroke();
|
666 |
+
ctx.restore();
|
667 |
+
|
668 |
+
// draw the hub
|
669 |
+
|
670 |
+
ctx.save();
|
671 |
+
ctx.beginPath();
|
672 |
+
ctx.fillStyle = this.ringColor;
|
673 |
+
ctx.arc(0 ,0, this.hubRadius,hubsa, hubea, false);
|
674 |
+
ctx.closePath();
|
675 |
+
ctx.fill();
|
676 |
+
ctx.restore();
|
677 |
+
|
678 |
+
// draw the ticks
|
679 |
+
if (this.showTicks) {
|
680 |
+
ctx.save();
|
681 |
+
var orad = this.tickOuterRadius,
|
682 |
+
tl = this.tickLength,
|
683 |
+
mtl = tl/2,
|
684 |
+
nmt = this.numberMinorTicks,
|
685 |
+
ts = this.span * Math.PI / 180 / (this.ticks.length-1),
|
686 |
+
mts = ts/(nmt + 1);
|
687 |
+
|
688 |
+
for (i = 0; i<this.ticks.length; i++) {
|
689 |
+
ctx.beginPath();
|
690 |
+
ctx.lineWidth = 1.5 + this.diameter/360;
|
691 |
+
ctx.strokeStyle = this.ringColor;
|
692 |
+
var wps = ts*i+sa;
|
693 |
+
ctx.moveTo(-orad * Math.cos(ts*i+sa), orad * Math.sin(ts*i+sa));
|
694 |
+
ctx.lineTo(-(orad-tl) * Math.cos(ts*i+sa), (orad - tl) * Math.sin(ts*i+sa));
|
695 |
+
this._tickPoints.push([(orad-tl) * Math.cos(ts*i+sa) + this._center[0] + this.canvas._offsets.left, (orad - tl) * Math.sin(ts*i+sa) + this._center[1] + this.canvas._offsets.top, ts*i+sa]);
|
696 |
+
ctx.stroke();
|
697 |
+
ctx.lineWidth = 1.0 + this.diameter/440;
|
698 |
+
if (i<this.ticks.length-1) {
|
699 |
+
for (var j=1; j<=nmt; j++) {
|
700 |
+
ctx.beginPath();
|
701 |
+
ctx.moveTo(-orad * Math.cos(ts*i+mts*j+sa), orad * Math.sin(ts*i+mts*j+sa));
|
702 |
+
ctx.lineTo(-(orad-mtl) * Math.cos(ts*i+mts*j+sa), (orad-mtl) * Math.sin(ts*i+mts*j+sa));
|
703 |
+
ctx.stroke();
|
704 |
+
}
|
705 |
+
}
|
706 |
+
}
|
707 |
+
ctx.restore();
|
708 |
+
}
|
709 |
+
|
710 |
+
// draw the tick labels
|
711 |
+
if (this.showTickLabels) {
|
712 |
+
var elem, l, t, ew, eh, dim, maxdim=0;
|
713 |
+
var tp = this.tickPadding * (1 - 1/(this.diameter/80+1));
|
714 |
+
for (i=0; i<this.ticks.length; i++) {
|
715 |
+
elem = $('<div class="jqplot-meterGauge-tick" style="position:absolute;">'+this.ticks[i][1]+'</div>');
|
716 |
+
this.canvas._elem.after(elem);
|
717 |
+
ew = elem.outerWidth(true);
|
718 |
+
eh = elem.outerHeight(true);
|
719 |
+
l = this._tickPoints[i][0] - ew * (this._tickPoints[i][2]-Math.PI)/Math.PI - tp * Math.cos(this._tickPoints[i][2]);
|
720 |
+
t = this._tickPoints[i][1] - eh/2 + eh/2 * Math.pow(Math.abs((Math.sin(this._tickPoints[i][2]))), 0.5) + tp/3 * Math.pow(Math.abs((Math.sin(this._tickPoints[i][2]))), 0.5) ;
|
721 |
+
// t = this._tickPoints[i][1] - eh/2 - eh/2 * Math.sin(this._tickPoints[i][2]) - tp/2 * Math.sin(this._tickPoints[i][2]);
|
722 |
+
elem.css({left:l, top:t});
|
723 |
+
dim = ew*Math.cos(this._tickPoints[i][2]) + eh*Math.sin(Math.PI/2+this._tickPoints[i][2]/2);
|
724 |
+
maxdim = (dim > maxdim) ? dim : maxdim;
|
725 |
+
}
|
726 |
+
}
|
727 |
+
|
728 |
+
// draw the gauge label
|
729 |
+
if (this.label && this.labelPosition == 'inside') {
|
730 |
+
var l = this._center[0] + this.canvas._offsets.left;
|
731 |
+
var tp = this.tickPadding * (1 - 1/(this.diameter/80+1));
|
732 |
+
var t = 0.5*(this._center[1] + this.canvas._offsets.top - this.hubRadius) + 0.5*(this._center[1] + this.canvas._offsets.top - this.tickOuterRadius + this.tickLength + tp) + this.labelHeightAdjust;
|
733 |
+
// this._labelElem = $('<div class="jqplot-meterGauge-label" style="position:absolute;">'+this.label+'</div>');
|
734 |
+
// this.canvas._elem.after(this._labelElem);
|
735 |
+
l -= this._labelElem.outerWidth(true)/2;
|
736 |
+
t -= this._labelElem.outerHeight(true)/2;
|
737 |
+
this._labelElem.css({left:l, top:t});
|
738 |
+
}
|
739 |
+
|
740 |
+
else if (this.label && this.labelPosition == 'bottom') {
|
741 |
+
var l = this._center[0] + this.canvas._offsets.left - this._labelElem.outerWidth(true)/2;
|
742 |
+
var t = this._center[1] + this.canvas._offsets.top + this.innerPad + + this.ringWidth + this.padding + this.labelHeightAdjust;
|
743 |
+
this._labelElem.css({left:l, top:t});
|
744 |
+
|
745 |
+
}
|
746 |
+
|
747 |
+
// draw the intervals
|
748 |
+
|
749 |
+
ctx.save();
|
750 |
+
var inner = this.intervalInnerRadius || this.hubRadius * 1.5;
|
751 |
+
if (this.intervalOuterRadius == null) {
|
752 |
+
if (this.showTickLabels) {
|
753 |
+
var outer = (this.tickOuterRadius - this.tickLength - this.tickPadding - this.diameter/8);
|
754 |
+
}
|
755 |
+
else {
|
756 |
+
var outer = (this.tickOuterRadius - this.tickLength - this.diameter/16);
|
757 |
+
}
|
758 |
+
}
|
759 |
+
else {
|
760 |
+
var outer = this.intervalOuterRadius;
|
761 |
+
}
|
762 |
+
var range = this.max - this.min;
|
763 |
+
var intrange = this.intervals[this.intervals.length-1] - this.min;
|
764 |
+
var start, end, span = this.span*Math.PI/180;
|
765 |
+
for (i=0; i<this.intervals.length; i++) {
|
766 |
+
start = (i == 0) ? sa : sa + (this.intervals[i-1][0] - this.min)*span/range;
|
767 |
+
if (start < 0) {
|
768 |
+
start = 0;
|
769 |
+
}
|
770 |
+
end = sa + (this.intervals[i][0] - this.min)*span/range;
|
771 |
+
if (end < 0) {
|
772 |
+
end = 0;
|
773 |
+
}
|
774 |
+
ctx.beginPath();
|
775 |
+
ctx.fillStyle = this.intervals[i][2];
|
776 |
+
ctx.arc(0, 0, inner, start, end, false);
|
777 |
+
ctx.lineTo(outer*Math.cos(end), outer*Math.sin(end));
|
778 |
+
ctx.arc(0, 0, outer, end, start, true);
|
779 |
+
ctx.lineTo(inner*Math.cos(start), inner*Math.sin(start));
|
780 |
+
ctx.closePath();
|
781 |
+
ctx.fill();
|
782 |
+
}
|
783 |
+
ctx.restore();
|
784 |
+
|
785 |
+
// draw the needle
|
786 |
+
var datapoint = this.data[0][1];
|
787 |
+
var dataspan = this.max - this.min;
|
788 |
+
if (this.pegNeedle) {
|
789 |
+
if (this.data[0][1] > this.max + dataspan*3/this.span) {
|
790 |
+
datapoint = this.max + dataspan*3/this.span;
|
791 |
+
}
|
792 |
+
if (this.data[0][1] < this.min - dataspan*3/this.span) {
|
793 |
+
datapoint = this.min - dataspan*3/this.span;
|
794 |
+
}
|
795 |
+
}
|
796 |
+
var dataang = (datapoint - this.min)/dataspan * this.span * Math.PI/180 + this.startAngle;
|
797 |
+
|
798 |
+
|
799 |
+
ctx.save();
|
800 |
+
ctx.beginPath();
|
801 |
+
ctx.fillStyle = this.ringColor;
|
802 |
+
ctx.strokeStyle = this.ringColor;
|
803 |
+
this.needleLength = (this.tickOuterRadius - this.tickLength) * 0.85;
|
804 |
+
this.needleThickness = (this.needleThickness < 2) ? 2 : this.needleThickness;
|
805 |
+
var endwidth = this.needleThickness * 0.4;
|
806 |
+
|
807 |
+
|
808 |
+
var dl = this.needleLength/10;
|
809 |
+
var dt = (this.needleThickness - endwidth)/10;
|
810 |
+
var templ;
|
811 |
+
for (var i=0; i<10; i++) {
|
812 |
+
templ = this.needleThickness - i*dt;
|
813 |
+
ctx.moveTo(dl*i*Math.cos(dataang), dl*i*Math.sin(dataang));
|
814 |
+
ctx.lineWidth = templ;
|
815 |
+
ctx.lineTo(dl*(i+1)*Math.cos(dataang), dl*(i+1)*Math.sin(dataang));
|
816 |
+
ctx.stroke();
|
817 |
+
}
|
818 |
+
|
819 |
+
ctx.restore();
|
820 |
+
}
|
821 |
+
else {
|
822 |
+
this._center = [(cw - trans * offx)/2 + trans * offx, (ch - trans*offy)/2 + trans * offy];
|
823 |
+
}
|
824 |
+
};
|
825 |
+
|
826 |
+
$.jqplot.MeterGaugeAxisRenderer = function() {
|
827 |
+
$.jqplot.LinearAxisRenderer.call(this);
|
828 |
+
};
|
829 |
+
|
830 |
+
$.jqplot.MeterGaugeAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer();
|
831 |
+
$.jqplot.MeterGaugeAxisRenderer.prototype.constructor = $.jqplot.MeterGaugeAxisRenderer;
|
832 |
+
|
833 |
+
|
834 |
+
// There are no traditional axes on a gauge chart. We just need to provide
|
835 |
+
// dummy objects with properties so the plot will render.
|
836 |
+
// called with scope of axis object.
|
837 |
+
$.jqplot.MeterGaugeAxisRenderer.prototype.init = function(options){
|
838 |
+
//
|
839 |
+
this.tickRenderer = $.jqplot.MeterGaugeTickRenderer;
|
840 |
+
$.extend(true, this, options);
|
841 |
+
// I don't think I'm going to need _dataBounds here.
|
842 |
+
// have to go Axis scaling in a way to fit chart onto plot area
|
843 |
+
// and provide u2p and p2u functionality for mouse cursor, etc.
|
844 |
+
// for convienence set _dataBounds to 0 and 100 and
|
845 |
+
// set min/max to 0 and 100.
|
846 |
+
this._dataBounds = {min:0, max:100};
|
847 |
+
this.min = 0;
|
848 |
+
this.max = 100;
|
849 |
+
this.showTicks = false;
|
850 |
+
this.ticks = [];
|
851 |
+
this.showMark = false;
|
852 |
+
this.show = false;
|
853 |
+
};
|
854 |
+
|
855 |
+
$.jqplot.MeterGaugeLegendRenderer = function(){
|
856 |
+
$.jqplot.TableLegendRenderer.call(this);
|
857 |
+
};
|
858 |
+
|
859 |
+
$.jqplot.MeterGaugeLegendRenderer.prototype = new $.jqplot.TableLegendRenderer();
|
860 |
+
$.jqplot.MeterGaugeLegendRenderer.prototype.constructor = $.jqplot.MeterGaugeLegendRenderer;
|
861 |
+
|
862 |
+
/**
|
863 |
+
* Class: $.jqplot.MeterGaugeLegendRenderer
|
864 |
+
*Meter gauges don't typically have a legend, this overrides the default legend renderer.
|
865 |
+
*/
|
866 |
+
$.jqplot.MeterGaugeLegendRenderer.prototype.init = function(options) {
|
867 |
+
// Maximum number of rows in the legend. 0 or null for unlimited.
|
868 |
+
this.numberRows = null;
|
869 |
+
// Maximum number of columns in the legend. 0 or null for unlimited.
|
870 |
+
this.numberColumns = null;
|
871 |
+
$.extend(true, this, options);
|
872 |
+
};
|
873 |
+
|
874 |
+
// called with context of legend
|
875 |
+
$.jqplot.MeterGaugeLegendRenderer.prototype.draw = function() {
|
876 |
+
if (this.show) {
|
877 |
+
var series = this._series;
|
878 |
+
var ss = 'position:absolute;';
|
879 |
+
ss += (this.background) ? 'background:'+this.background+';' : '';
|
880 |
+
ss += (this.border) ? 'border:'+this.border+';' : '';
|
881 |
+
ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
|
882 |
+
ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
|
883 |
+
ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
|
884 |
+
ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : '';
|
885 |
+
ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : '';
|
886 |
+
ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : '';
|
887 |
+
ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : '';
|
888 |
+
this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>');
|
889 |
+
// MeterGauge charts legends don't go by number of series, but by number of data points
|
890 |
+
// in the series. Refactor things here for that.
|
891 |
+
|
892 |
+
var pad = false,
|
893 |
+
reverse = false,
|
894 |
+
nr, nc;
|
895 |
+
var s = series[0];
|
896 |
+
|
897 |
+
if (s.show) {
|
898 |
+
var pd = s.data;
|
899 |
+
if (this.numberRows) {
|
900 |
+
nr = this.numberRows;
|
901 |
+
if (!this.numberColumns){
|
902 |
+
nc = Math.ceil(pd.length/nr);
|
903 |
+
}
|
904 |
+
else{
|
905 |
+
nc = this.numberColumns;
|
906 |
+
}
|
907 |
+
}
|
908 |
+
else if (this.numberColumns) {
|
909 |
+
nc = this.numberColumns;
|
910 |
+
nr = Math.ceil(pd.length/this.numberColumns);
|
911 |
+
}
|
912 |
+
else {
|
913 |
+
nr = pd.length;
|
914 |
+
nc = 1;
|
915 |
+
}
|
916 |
+
|
917 |
+
var i, j, tr, td1, td2, lt, rs, color;
|
918 |
+
var idx = 0;
|
919 |
+
|
920 |
+
for (i=0; i<nr; i++) {
|
921 |
+
if (reverse){
|
922 |
+
tr = $('<tr class="jqplot-table-legend"></tr>').prependTo(this._elem);
|
923 |
+
}
|
924 |
+
else{
|
925 |
+
tr = $('<tr class="jqplot-table-legend"></tr>').appendTo(this._elem);
|
926 |
+
}
|
927 |
+
for (j=0; j<nc; j++) {
|
928 |
+
if (idx < pd.length){
|
929 |
+
// debugger
|
930 |
+
lt = this.labels[idx] || pd[idx][0].toString();
|
931 |
+
color = s.color;
|
932 |
+
if (!reverse){
|
933 |
+
if (i>0){
|
934 |
+
pad = true;
|
935 |
+
}
|
936 |
+
else{
|
937 |
+
pad = false;
|
938 |
+
}
|
939 |
+
}
|
940 |
+
else{
|
941 |
+
if (i == nr -1){
|
942 |
+
pad = false;
|
943 |
+
}
|
944 |
+
else{
|
945 |
+
pad = true;
|
946 |
+
}
|
947 |
+
}
|
948 |
+
rs = (pad) ? this.rowSpacing : '0';
|
949 |
+
|
950 |
+
td1 = $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+
|
951 |
+
'<div><div class="jqplot-table-legend-swatch" style="border-color:'+color+';"></div>'+
|
952 |
+
'</div></td>');
|
953 |
+
td2 = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>');
|
954 |
+
if (this.escapeHtml){
|
955 |
+
td2.text(lt);
|
956 |
+
}
|
957 |
+
else {
|
958 |
+
td2.html(lt);
|
959 |
+
}
|
960 |
+
if (reverse) {
|
961 |
+
td2.prependTo(tr);
|
962 |
+
td1.prependTo(tr);
|
963 |
+
}
|
964 |
+
else {
|
965 |
+
td1.appendTo(tr);
|
966 |
+
td2.appendTo(tr);
|
967 |
+
}
|
968 |
+
pad = true;
|
969 |
+
}
|
970 |
+
idx++;
|
971 |
+
}
|
972 |
+
}
|
973 |
+
}
|
974 |
+
}
|
975 |
+
return this._elem;
|
976 |
+
};
|
977 |
+
|
978 |
+
|
979 |
+
// setup default renderers for axes and legend so user doesn't have to
|
980 |
+
// called with scope of plot
|
981 |
+
function preInit(target, data, options) {
|
982 |
+
// debugger
|
983 |
+
options = options || {};
|
984 |
+
options.axesDefaults = options.axesDefaults || {};
|
985 |
+
options.legend = options.legend || {};
|
986 |
+
options.seriesDefaults = options.seriesDefaults || {};
|
987 |
+
options.grid = options.grid || {};
|
988 |
+
|
989 |
+
// only set these if there is a gauge series
|
990 |
+
var setopts = false;
|
991 |
+
if (options.seriesDefaults.renderer == $.jqplot.MeterGaugeRenderer) {
|
992 |
+
setopts = true;
|
993 |
+
}
|
994 |
+
else if (options.series) {
|
995 |
+
for (var i=0; i < options.series.length; i++) {
|
996 |
+
if (options.series[i].renderer == $.jqplot.MeterGaugeRenderer) {
|
997 |
+
setopts = true;
|
998 |
+
}
|
999 |
+
}
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
if (setopts) {
|
1003 |
+
options.axesDefaults.renderer = $.jqplot.MeterGaugeAxisRenderer;
|
1004 |
+
options.legend.renderer = $.jqplot.MeterGaugeLegendRenderer;
|
1005 |
+
options.legend.preDraw = true;
|
1006 |
+
options.grid.background = options.grid.background || 'white';
|
1007 |
+
options.grid.drawGridlines = false;
|
1008 |
+
options.grid.borderWidth = (options.grid.borderWidth != null) ? options.grid.borderWidth : 0;
|
1009 |
+
options.grid.shadow = (options.grid.shadow != null) ? options.grid.shadow : false;
|
1010 |
+
}
|
1011 |
+
}
|
1012 |
+
|
1013 |
+
// called with scope of plot
|
1014 |
+
function postParseOptions(options) {
|
1015 |
+
//
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
$.jqplot.preInitHooks.push(preInit);
|
1019 |
+
$.jqplot.postParseOptionsHooks.push(postParseOptions);
|
1020 |
+
|
1021 |
+
$.jqplot.MeterGaugeTickRenderer = function() {
|
1022 |
+
$.jqplot.AxisTickRenderer.call(this);
|
1023 |
+
};
|
1024 |
+
|
1025 |
+
$.jqplot.MeterGaugeTickRenderer.prototype = new $.jqplot.AxisTickRenderer();
|
1026 |
+
$.jqplot.MeterGaugeTickRenderer.prototype.constructor = $.jqplot.MeterGaugeTickRenderer;
|
1027 |
+
|
1028 |
+
})(jQuery);
|
1029 |
+
|
1030 |
+
|
backend/settings/assets/js/jqPlot/plugins/jqplot.meterGaugeRenderer.min.js
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* jqPlot
|
3 |
+
* Pure JavaScript plotting plugin using jQuery
|
4 |
+
*
|
5 |
+
* Version: 1.0.4r1121
|
6 |
+
*
|
7 |
+
* Copyright (c) 2009-2011 Chris Leonello
|
8 |
+
* jqPlot is currently available for use in all personal or commercial projects
|
9 |
+
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
|
10 |
+
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
|
11 |
+
* choose the license that best suits your project and use it accordingly.
|
12 |
+
*
|
13 |
+
* Although not required, the author would appreciate an email letting him
|
14 |
+
* know of any substantial use of jqPlot. You can reach the author at:
|
15 |
+
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
|
16 |
+
*
|
17 |
+
* If you are feeling kind and generous, consider supporting the project by
|
18 |
+
* making a donation at: http://www.jqplot.com/donate.php .
|
19 |
+
*
|
20 |
+
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
|
21 |
+
*
|
22 |
+
* version 2007.04.27
|
23 |
+
* author Ash Searle
|
24 |
+
* http://hexmen.com/blog/2007/03/printf-sprintf/
|
25 |
+
* http://hexmen.com/js/sprintf.js
|
26 |
+
* The author (Ash Searle) has placed this code in the public domain:
|
27 |
+
* "This code is unrestricted: you are free to use it however you like."
|
28 |
+
*
|
29 |
+
* included jsDate library by Chris Leonello:
|
30 |
+
*
|
31 |
+
* Copyright (c) 2010-2011 Chris Leonello
|
32 |
+
*
|
33 |
+
* jsDate is currently available for use in all personal or commercial projects
|
34 |
+
* under both the MIT and GPL version 2.0 licenses. This means that you can
|
35 |
+
* choose the license that best suits your project and use it accordingly.
|
36 |
+
*
|
37 |
+
* jsDate borrows many concepts and ideas from the Date Instance
|
38 |
+
* Methods by Ken Snyder along with some parts of Ken's actual code.
|
39 |
+
*
|
40 |
+
* Ken's origianl Date Instance Methods and copyright notice:
|
41 |
+
*
|
42 |
+
* Ken Snyder (ken d snyder at gmail dot com)
|
43 |
+
* 2008-09-10
|
44 |
+
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
|
45 |
+
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
|
46 |
+
*
|
47 |
+
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
|
48 |
+
* Larry has generously given permission to adapt his code for inclusion
|
49 |
+
* into jqPlot.
|
50 |
+
*
|
51 |
+
* Larry's original code can be found here:
|
52 |
+
*
|
53 |
+
* https://github.com/lsiden/export-jqplot-to-png
|
54 |
+
*
|
55 |
+
*
|
56 |
+
*/
|
57 |
+
(function(c){c.jqplot.MeterGaugeRenderer=function(){c.jqplot.LineRenderer.call(this)};c.jqplot.MeterGaugeRenderer.prototype=new c.jqplot.LineRenderer();c.jqplot.MeterGaugeRenderer.prototype.constructor=c.jqplot.MeterGaugeRenderer;c.jqplot.MeterGaugeRenderer.prototype.init=function(e){this.diameter=null;this.padding=null;this.shadowOffset=2;this.shadowAlpha=0.07;this.shadowDepth=4;this.background="#efefef";this.ringColor="#BBC6D0";this.needleColor="#C3D3E5";this.tickColor="989898";this.ringWidth=null;this.min;this.max;this.ticks=[];this.showTicks=true;this.showTickLabels=true;this.label=null;this.labelHeightAdjust=0;this.labelPosition="inside";this.intervals=[];this.intervalColors=["#4bb2c5","#EAA228","#c5b47f","#579575","#839557","#958c12","#953579","#4b5de4","#d8b83f","#ff5800","#0085cc","#c747a3","#cddf54","#FBD178","#26B4E3","#bd70c7"];this.intervalInnerRadius=null;this.intervalOuterRadius=null;this.tickRenderer=c.jqplot.MeterGaugeTickRenderer;this.tickPositions=[1,2,2.5,5,10];this.tickSpacing=30;this.numberMinorTicks=null;this.hubRadius=null;this.tickPadding=null;this.needleThickness=null;this.needlePad=6;this.pegNeedle=true;this._type="meterGauge";c.extend(true,this,e);this.type=null;this.numberTicks=null;this.tickInterval=null;this.span=180;if(this.type=="circular"){this.semiCircular=false}else{if(this.type!="circular"){this.semiCircular=true}else{this.semiCircular=(this.span<=180)?true:false}}this._tickPoints=[];this._labelElem=null;this.startAngle=(90+(360-this.span)/2)*Math.PI/180;this.endAngle=(90-(360-this.span)/2)*Math.PI/180;this.setmin=!!(this.min==null);this.setmax=!!(this.max==null);if(this.intervals.length){if(this.intervals[0].length==null||this.intervals.length==1){for(var f=0;f<this.intervals.length;f++){this.intervals[f]=[this.intervals[f],this.intervals[f],this.intervalColors[f]]}}else{if(this.intervals[0].length==2){for(f=0;f<this.intervals.length;f++){this.intervals[f]=[this.intervals[f][0],this.intervals[f][1],this.intervalColors[f]]}}}}if(this.ticks.length){if(this.ticks[0].length==null||this.ticks[0].length==1){for(var f=0;f<this.ticks.length;f++){this.ticks[f]=[this.ticks[f],this.ticks[f]]}}this.min=(this.min==null)?this.ticks[0][0]:this.min;this.max=(this.max==null)?this.ticks[this.ticks.length-1][0]:this.max;this.setmin=false;this.setmax=false;this.numberTicks=this.ticks.length;this.tickInterval=this.ticks[1][0]-this.ticks[0][0];this.tickFactor=Math.floor(parseFloat((Math.log(this.tickInterval)/Math.log(10)).toFixed(11)));this.numberMinorTicks=b(this.tickPositions,this.tickInterval,this.tickFactor);if(!this.numberMinorTicks){this.numberMinorTicks=b(this.tickPositions,this.tickInterval,this.tickFactor-1)}if(!this.numberMinorTicks){this.numberMinorTicks=1}}else{if(this.intervals.length){this.min=(this.min==null)?0:this.min;this.setmin=false;if(this.max==null){if(this.intervals[this.intervals.length-1][0]>=this.data[0][1]){this.max=this.intervals[this.intervals.length-1][0];this.setmax=false}}else{this.setmax=false}}else{this.min=(this.min==null)?0:this.min;this.setmin=false;if(this.max==null){this.max=this.data[0][1]*1.25;this.setmax=true}else{this.setmax=false}}}};c.jqplot.MeterGaugeRenderer.prototype.setGridData=function(j){var f=[];var k=[];var e=this.startAngle;for(var h=0;h<this.data.length;h++){f.push(this.data[h][1]);k.push([this.data[h][0]]);if(h>0){f[h]+=f[h-1]}}var g=Math.PI*2/f[f.length-1];for(var h=0;h<f.length;h++){k[h][1]=f[h]*g}this.gridData=k};c.jqplot.MeterGaugeRenderer.prototype.makeGridData=function(j,k){var f=[];var l=[];var e=this.startAngle;for(var h=0;h<j.length;h++){f.push(j[h][1]);l.push([j[h][0]]);if(h>0){f[h]+=f[h-1]}}var g=Math.PI*2/f[f.length-1];for(var h=0;h<f.length;h++){l[h][1]=f[h]*g}return l};function b(j,f,g){var e;for(var h=j.length-1;h>=0;h--){e=f/(j[h]*Math.pow(10,g));if(e==4||e==5){return e-1}}return null}c.jqplot.MeterGaugeRenderer.prototype.draw=function(X,aC,ap){var aa;var aM=(ap!=undefined)?ap:{};var ai=0;var ah=0;var at=1;if(ap.legendInfo&&ap.legendInfo.placement=="inside"){var aI=ap.legendInfo;switch(aI.location){case"nw":ai=aI.width+aI.xoffset;break;case"w":ai=aI.width+aI.xoffset;break;case"sw":ai=aI.width+aI.xoffset;break;case"ne":ai=aI.width+aI.xoffset;at=-1;break;case"e":ai=aI.width+aI.xoffset;at=-1;break;case"se":ai=aI.width+aI.xoffset;at=-1;break;case"n":ah=aI.height+aI.yoffset;break;case"s":ah=aI.height+aI.yoffset;at=-1;break;default:break}}if(this.label){this._labelElem=c('<div class="jqplot-meterGauge-label" style="position:absolute;">'+this.label+"</div>");this.canvas._elem.after(this._labelElem)}var m=(aM.shadow!=undefined)?aM.shadow:this.shadow;var N=(aM.showLine!=undefined)?aM.showLine:this.showLine;var I=(aM.fill!=undefined)?aM.fill:this.fill;var K=X.canvas.width;var S=X.canvas.height;if(this.padding==null){this.padding=Math.round(Math.min(K,S)/30)}var Q=K-ai-2*this.padding;var ab=S-ah-2*this.padding;if(this.labelPosition=="bottom"&&this.label){ab-=this._labelElem.outerHeight(true)}var L=Math.min(Q,ab);var ad=L;if(!this.diameter){if(this.semiCircular){if(Q>=2*ab){if(!this.ringWidth){this.ringWidth=2*ab/35}this.needleThickness=this.needleThickness||2+Math.pow(this.ringWidth,0.8);this.innerPad=this.ringWidth/2+this.needleThickness/2+this.needlePad;this.diameter=2*(ab-2*this.innerPad)}else{if(!this.ringWidth){this.ringWidth=Q/35}this.needleThickness=this.needleThickness||2+Math.pow(this.ringWidth,0.8);this.innerPad=this.ringWidth/2+this.needleThickness/2+this.needlePad;this.diameter=Q-2*this.innerPad-this.ringWidth-this.padding}this._center=[(K-at*ai)/2+at*ai,(S+at*ah-this.padding-this.ringWidth-this.innerPad)]}else{if(!this.ringWidth){this.ringWidth=ad/35}this.needleThickness=this.needleThickness||2+Math.pow(this.ringWidth,0.8);this.innerPad=0;this.diameter=ad-this.ringWidth;this._center=[(K-at*ai)/2+at*ai,(S-at*ah)/2+at*ah]}}if(this._labelElem&&this.labelPosition=="bottom"){this._center[1]-=this._labelElem.outerHeight(true)}this._radius=this.diameter/2;this.tickSpacing=6000/this.diameter;if(!this.hubRadius){this.hubRadius=this.diameter/18}this.shadowOffset=0.5+this.ringWidth/9;this.shadowWidth=this.ringWidth*1;this.tickPadding=3+Math.pow(this.diameter/20,0.7);this.tickOuterRadius=this._radius-this.ringWidth/2-this.tickPadding;this.tickLength=(this.showTicks)?this._radius/13:0;if(this.ticks.length==0){var A=this.max,aL=this.min,q=this.setmax,aG=this.setmin,au=(A-aL)*this.tickSpacing/this.span;var aw=Math.floor(parseFloat((Math.log(au)/Math.log(10)).toFixed(11)));var an=(au/Math.pow(10,aw));(an>2&&an<=2.5)?an=2.5:an=Math.ceil(an);var T=this.tickPositions;var aA,ak;for(aa=0;aa<T.length;aa++){if(an==T[aa]||aa&&T[aa-1]<an&&an<T[aa]){au=T[aa]*Math.pow(10,aw);aA=aa}}for(aa=0;aa<T.length;aa++){if(an==T[aa]||aa&&T[aa-1]<an&&an<T[aa]){au=T[aa]*Math.pow(10,aw);ak=Math.ceil((A-aL)/au)}}if(q&&aG){var aP=(aL>0)?aL-aL%au:aL-aL%au-au;if(!this.forceZero){var D=Math.min(aL-aP,0.8*au);var o=Math.floor(D/T[aA]);if(o>1){aP=aP+T[aA]*(o-1);if(parseInt(aP,10)!=aP&&parseInt(aP-T[aA],10)==aP-T[aA]){aP=aP-T[aA]}}}if(aL==aP){aL-=au}else{if(aL-aP>0.23*au){aL=aP}else{aL=aP-au;ak+=1}}ak+=1;var E=aL+(ak-1)*au;if(A>=E){E+=au;ak+=1}if(E-A<0.23*au){E+=au;ak+=1}this.max=A=E;this.min=aL;this.tickInterval=au;this.numberTicks=ak;var O;for(aa=0;aa<ak;aa++){O=parseFloat((aL+aa*au).toFixed(11));this.ticks.push([O,O])}this.max=this.ticks[ak-1][1];this.tickFactor=aw;this.numberMinorTicks=b(this.tickPositions,this.tickInterval,this.tickFactor);if(!this.numberMinorTicks){this.numberMinorTicks=b(this.tickPositions,this.tickInterval,this.tickFactor-1)}}else{if(q){var E=aL+(ak-1)*au;if(A>=E){A=E+au;ak+=1}else{A=E}this.tickInterval=this.tickInterval||au;this.numberTicks=this.numberTicks||ak;var O;for(aa=0;aa<this.numberTicks;aa++){O=parseFloat((aL+aa*this.tickInterval).toFixed(11));this.ticks.push([O,O])}this.max=this.ticks[this.numberTicks-1][1];this.tickFactor=aw;this.numberMinorTicks=b(this.tickPositions,this.tickInterval,this.tickFactor);if(!this.numberMinorTicks){this.numberMinorTicks=b(this.tickPositions,this.tickInterval,this.tickFactor-1)}}}if(!q&&!aG){var P=this.max-this.min;aw=Math.floor(parseFloat((Math.log(P)/Math.log(10)).toFixed(11)))-1;var aN=[5,6,4,7,3,8,9,10,2],V,C,av=0,M;if(P>1){var aJ=String(P);if(aJ.search(/\./)==-1){var aF=aJ.search(/0+$/);av=(aF>0)?aJ.length-aF-1:0}}M=P/Math.pow(10,av);for(aa=0;aa<aN.length;aa++){V=M/(aN[aa]-1);if(V==parseInt(V,10)){this.numberTicks=aN[aa];this.tickInterval=P/(this.numberTicks-1);this.tickFactor=aw+1;break}}var O;for(aa=0;aa<this.numberTicks;aa++){O=parseFloat((this.min+aa*this.tickInterval).toFixed(11));this.ticks.push([O,O])}this.numberMinorTicks=b(this.tickPositions,this.tickInterval,this.tickFactor);if(!this.numberMinorTicks){this.numberMinorTicks=b(this.tickPositions,this.tickInterval,this.tickFactor-1)}if(!this.numberMinorTicks){this.numberMinorTicks=1;var aH=[4,5,3,6,2];for(aa=0;aa<5;aa++){var ao=this.tickInterval/aH[aa];if(ao==parseInt(ao,10)){this.numberMinorTicks=aH[aa]-1;break}}}}}var U=this._radius,aE=this.startAngle,k=this.endAngle,H=Math.PI,e=Math.PI/2;if(this.semiCircular){var z=Math.atan(this.innerPad/U),ac=this.outerStartAngle=aE-z,aB=this.outerEndAngle=k+z,B=this.hubStartAngle=aE-Math.atan(this.innerPad/this.hubRadius*2),af=this.hubEndAngle=k+Math.atan(this.innerPad/this.hubRadius*2);X.save();X.translate(this._center[0],this._center[1]);X.lineJoin="round";X.lineCap="round";X.save();X.beginPath();X.fillStyle=this.background;X.arc(0,0,U,ac,aB,false);X.closePath();X.fill();X.restore();var aj="rgba(0,0,0,"+this.shadowAlpha+")";X.save();for(var aa=0;aa<this.shadowDepth;aa++){X.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI),this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));X.beginPath();X.strokeStyle=aj;X.lineWidth=this.shadowWidth;X.arc(0,0,U,ac,aB,false);X.closePath();X.stroke()}X.restore();X.save();var az=parseInt((this.shadowDepth+1)/2,10);for(var aa=0;aa<az;aa++){X.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI),this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI));X.beginPath();X.fillStyle=aj;X.arc(0,0,this.hubRadius,B,af,false);X.closePath();X.fill()}X.restore();X.save();X.beginPath();X.strokeStyle=this.ringColor;X.lineWidth=this.ringWidth;X.arc(0,0,U,ac,aB,false);X.closePath();X.stroke();X.restore();X.save();X.beginPath();X.fillStyle=this.ringColor;X.arc(0,0,this.hubRadius,B,af,false);X.closePath();X.fill();X.restore();if(this.showTicks){X.save();var f=this.tickOuterRadius,aq=this.tickLength,v=aq/2,F=this.numberMinorTicks,am=this.span*Math.PI/180/(this.ticks.length-1),p=am/(F+1);for(aa=0;aa<this.ticks.length;aa++){X.beginPath();X.lineWidth=1.5+this.diameter/360;X.strokeStyle=this.ringColor;var ae=am*aa+aE;X.moveTo(-f*Math.cos(am*aa+aE),f*Math.sin(am*aa+aE));X.lineTo(-(f-aq)*Math.cos(am*aa+aE),(f-aq)*Math.sin(am*aa+aE));this._tickPoints.push([(f-aq)*Math.cos(am*aa+aE)+this._center[0]+this.canvas._offsets.left,(f-aq)*Math.sin(am*aa+aE)+this._center[1]+this.canvas._offsets.top,am*aa+aE]);X.stroke();X.lineWidth=1+this.diameter/440;if(aa<this.ticks.length-1){for(var Y=1;Y<=F;Y++){X.beginPath();X.moveTo(-f*Math.cos(am*aa+p*Y+aE),f*Math.sin(am*aa+p*Y+aE));X.lineTo(-(f-v)*Math.cos(am*aa+p*Y+aE),(f-v)*Math.sin(am*aa+p*Y+aE));X.stroke()}}}X.restore()}if(this.showTickLabels){var J,W,T,aO,g,G,n=0;var an=this.tickPadding*(1-1/(this.diameter/80+1));for(aa=0;aa<this.ticks.length;aa++){J=c('<div class="jqplot-meterGauge-tick" style="position:absolute;">'+this.ticks[aa][1]+"</div>");this.canvas._elem.after(J);aO=J.outerWidth(true);g=J.outerHeight(true);W=this._tickPoints[aa][0]-aO*(this._tickPoints[aa][2]-Math.PI)/Math.PI-an*Math.cos(this._tickPoints[aa][2]);T=this._tickPoints[aa][1]-g/2+g/2*Math.pow(Math.abs((Math.sin(this._tickPoints[aa][2]))),0.5)+an/3*Math.pow(Math.abs((Math.sin(this._tickPoints[aa][2]))),0.5);J.css({left:W,top:T});G=aO*Math.cos(this._tickPoints[aa][2])+g*Math.sin(Math.PI/2+this._tickPoints[aa][2]/2);n=(G>n)?G:n}}if(this.label&&this.labelPosition=="inside"){var W=this._center[0]+this.canvas._offsets.left;var an=this.tickPadding*(1-1/(this.diameter/80+1));var T=0.5*(this._center[1]+this.canvas._offsets.top-this.hubRadius)+0.5*(this._center[1]+this.canvas._offsets.top-this.tickOuterRadius+this.tickLength+an)+this.labelHeightAdjust;W-=this._labelElem.outerWidth(true)/2;T-=this._labelElem.outerHeight(true)/2;this._labelElem.css({left:W,top:T})}else{if(this.label&&this.labelPosition=="bottom"){var W=this._center[0]+this.canvas._offsets.left-this._labelElem.outerWidth(true)/2;var T=this._center[1]+this.canvas._offsets.top+this.innerPad+ +this.ringWidth+this.padding+this.labelHeightAdjust;this._labelElem.css({left:W,top:T})}}X.save();var ax=this.intervalInnerRadius||this.hubRadius*1.5;if(this.intervalOuterRadius==null){if(this.showTickLabels){var ag=(this.tickOuterRadius-this.tickLength-this.tickPadding-this.diameter/8)}else{var ag=(this.tickOuterRadius-this.tickLength-this.diameter/16)}}else{var ag=this.intervalOuterRadius}var P=this.max-this.min;var aD=this.intervals[this.intervals.length-1]-this.min;var y,Z,u=this.span*Math.PI/180;for(aa=0;aa<this.intervals.length;aa++){y=(aa==0)?aE:aE+(this.intervals[aa-1][0]-this.min)*u/P;if(y<0){y=0}Z=aE+(this.intervals[aa][0]-this.min)*u/P;if(Z<0){Z=0}X.beginPath();X.fillStyle=this.intervals[aa][2];X.arc(0,0,ax,y,Z,false);X.lineTo(ag*Math.cos(Z),ag*Math.sin(Z));X.arc(0,0,ag,Z,y,true);X.lineTo(ax*Math.cos(y),ax*Math.sin(y));X.closePath();X.fill()}X.restore();var ay=this.data[0][1];var R=this.max-this.min;if(this.pegNeedle){if(this.data[0][1]>this.max+R*3/this.span){ay=this.max+R*3/this.span}if(this.data[0][1]<this.min-R*3/this.span){ay=this.min-R*3/this.span}}var al=(ay-this.min)/R*this.span*Math.PI/180+this.startAngle;X.save();X.beginPath();X.fillStyle=this.ringColor;X.strokeStyle=this.ringColor;this.needleLength=(this.tickOuterRadius-this.tickLength)*0.85;this.needleThickness=(this.needleThickness<2)?2:this.needleThickness;var aK=this.needleThickness*0.4;var x=this.needleLength/10;var s=(this.needleThickness-aK)/10;var ar;for(var aa=0;aa<10;aa++){ar=this.needleThickness-aa*s;X.moveTo(x*aa*Math.cos(al),x*aa*Math.sin(al));X.lineWidth=ar;X.lineTo(x*(aa+1)*Math.cos(al),x*(aa+1)*Math.sin(al));X.stroke()}X.restore()}else{this._center=[(K-at*ai)/2+at*ai,(S-at*ah)/2+at*ah]}};c.jqplot.MeterGaugeAxisRenderer=function(){c.jqplot.LinearAxisRenderer.call(this)};c.jqplot.MeterGaugeAxisR
|