onModuleLoad()
.
*/
public class Resource_ishealth_monitor implements EntryPoint {
public void onModuleLoad() {
+ /**
+ * This inject the needed javascript modules for drawing highcharts automatically
+ */
+ HighchartsBundle bundle = GWT.create(HighchartsBundle.class);
+ HighChartJSInjector.inject(bundle.jQueryJS().getText());
+ HighChartJSInjector.inject(bundle.highchartsJS().getText());
+ HighChartJSInjector.inject(bundle.gxtAdapaterJS().getText());
/*
* just for running standalone uncomment this line and
*
diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/client/highchartsjs/HighChartJSInjector.java b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/client/highchartsjs/HighChartJSInjector.java
new file mode 100644
index 0000000..38d3dbe
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/client/highchartsjs/HighChartJSInjector.java
@@ -0,0 +1,41 @@
+package org.gcube.portlets.admin.ishealthmonitor.client.highchartsjs;
+
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.HeadElement;
+import com.google.gwt.dom.client.ScriptElement;
+import com.google.gwt.dom.client.Element;
+
+/**
+ * Used to inject external Javascript code into the application.
+ *
+ * @author Massimiliano Assante
+ */
+public class HighChartJSInjector {
+
+ private static HeadElement head;
+
+ public static void inject(String javascript) {
+ HeadElement head = getHead();
+ ScriptElement element = createScriptElement();
+ element.setText(javascript);
+ head.appendChild(element);
+ }
+
+ private static ScriptElement createScriptElement() {
+ ScriptElement script = Document.get().createScriptElement();
+ script.setAttribute("language", "javascript");
+ return script;
+ }
+
+ private static HeadElement getHead() {
+ if (head == null) {
+ Element element = Document.get().getElementsByTagName("head")
+ .getItem(0);
+ assert element != null : "HTML Head element required";
+ HeadElement head = HeadElement.as(element);
+ HighChartJSInjector.head = head;
+ }
+ return HighChartJSInjector.head;
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/client/highchartsjs/HighchartsBundle.java b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/client/highchartsjs/HighchartsBundle.java
new file mode 100644
index 0000000..e70f8f5
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/client/highchartsjs/HighchartsBundle.java
@@ -0,0 +1,20 @@
+package org.gcube.portlets.admin.ishealthmonitor.client.highchartsjs;
+
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.TextResource;
+
+/**
+ * Extend the {@link ClientBundle} to provide JS resource link.
+ *
+ * @author Massimiliano Assante
+ */
+public interface HighchartsBundle extends ClientBundle {
+ @Source("jquery.min.js")
+ TextResource jQueryJS();
+
+ @Source("highcharts.js")
+ TextResource highchartsJS();
+
+ @Source("gxt-adapter.js")
+ TextResource gxtAdapaterJS();
+}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/gxt-adapter.js b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/client/highchartsjs/gxt-adapter.js
similarity index 100%
rename from src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/gxt-adapter.js
rename to src/main/java/org/gcube/portlets/admin/ishealthmonitor/client/highchartsjs/gxt-adapter.js
diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/highcharts.js b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/client/highchartsjs/highcharts.js
similarity index 100%
rename from src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/highcharts.js
rename to src/main/java/org/gcube/portlets/admin/ishealthmonitor/client/highchartsjs/highcharts.js
diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/jquery.min.js b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/client/highchartsjs/jquery.min.js
similarity index 100%
rename from src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/jquery.min.js
rename to src/main/java/org/gcube/portlets/admin/ishealthmonitor/client/highchartsjs/jquery.min.js
diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/adapters/mootools-adapter.js b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/adapters/mootools-adapter.js
deleted file mode 100644
index 82ecb13..0000000
--- a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/adapters/mootools-adapter.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- Highcharts JS v2.1.2 (2011-01-12)
- MooTools adapter
-
- (c) 2010 Torstein H?nsi
-
- License: www.highcharts.com/license
-*/
-var HighchartsAdapter={init:function(){var a=Fx.prototype,b=a.start,c=Fx.Morph.prototype,d=c.compute;a.start=function(f){var e=this.element;if(f.d)this.paths=Highcharts.pathAnim.init(e,e.d,this.toD);b.apply(this,arguments)};c.compute=function(f,e,h){var g=this.paths;if(g)this.element.attr("d",Highcharts.pathAnim.step(g[0],g[1],h,this.toD));else return d.apply(this,arguments)}},animate:function(a,b,c){var d=a.attr,f=c&&c.complete;if(d&&!a.setStyle){a.getStyle=a.attr;a.setStyle=function(){var e=arguments;
-a.attr.call(a,e[0],e[1][0])};a.$family=a.uid=true}HighchartsAdapter.stop(a);c=new Fx.Morph(d?a:$(a),$extend({transition:Fx.Transitions.Quad.easeInOut},c));if(b.d)c.toD=b.d;f&&c.addEvent("complete",f);c.start(b);a.fx=c},each:$each,map:function(a,b){return a.map(b)},grep:function(a,b){return a.filter(b)},merge:$merge,hyphenate:function(a){return a.hyphenate()},addEvent:function(a,b,c){if(typeof b=="string"){if(b=="unload")b="beforeunload";if(!a.addEvent)if(a.nodeName)a=$(a);else $extend(a,new Events);
-a.addEvent(b,c)}},removeEvent:function(a,b,c){if(b){if(b=="unload")b="beforeunload";a.removeEvent(b,c)}},fireEvent:function(a,b,c,d){b=new Event({type:b,target:a});b=$extend(b,c);b.preventDefault=function(){d=null};a.fireEvent&&a.fireEvent(b.type,b);d&&d(b)},stop:function(a){a.fx&&a.fx.cancel()}};
diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/adapters/mootools-adapter.src.js b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/adapters/mootools-adapter.src.js
deleted file mode 100644
index 32082ae..0000000
--- a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/adapters/mootools-adapter.src.js
+++ /dev/null
@@ -1,214 +0,0 @@
-/**
- * @license Highcharts JS v2.1.2 (2011-01-12)
- * MooTools adapter
- *
- * (c) 2010 Torstein Hønsi
- *
- * License: www.highcharts.com/license
- */
-
-// JSLint options:
-/*global Highcharts, Fx, $, $extend, $each, $merge, Events, Event */
-
-var HighchartsAdapter = {
- /**
- * Initialize the adapter. This is run once as Highcharts is first run.
- */
- init: function() {
- var fxProto = Fx.prototype,
- fxStart = fxProto.start,
- morphProto = Fx.Morph.prototype,
- morphCompute = morphProto.compute;
-
- // override Fx.start to allow animation of SVG element wrappers
- fxProto.start = function(from, to) {
- var fx = this,
- elem = fx.element;
-
- // special for animating paths
- if (from.d) {
- //this.fromD = this.element.d.split(' ');
- fx.paths = Highcharts.pathAnim.init(
- elem,
- elem.d,
- fx.toD
- );
- }
- fxStart.apply(fx, arguments);
- };
-
- // override Fx.step to allow animation of SVG element wrappers
- morphProto.compute = function(from, to, delta) {
- var fx = this,
- paths = fx.paths;
-
- if (paths) {
- fx.element.attr(
- 'd',
- Highcharts.pathAnim.step(paths[0], paths[1], delta, fx.toD)
- );
- } else {
- return morphCompute.apply(fx, arguments);
- }
- };
-
- },
-
- /**
- * Animate a HTML element or SVG element wrapper
- * @param {Object} el
- * @param {Object} params
- * @param {Object} options jQuery-like animation options: duration, easing, callback
- */
- animate: function (el, params, options) {
- var isSVGElement = el.attr,
- effect,
- complete = options && options.complete;
-
- if (isSVGElement && !el.setStyle) {
- // add setStyle and getStyle methods for internal use in Moo
- el.getStyle = el.attr;
- el.setStyle = function() { // property value is given as array in Moo - break it down
- var args = arguments;
- el.attr.call(el, args[0], args[1][0]);
- }
- // dirty hack to trick Moo into handling el as an element wrapper
- el.$family = el.uid = true;
- }
-
- // stop running animations
- HighchartsAdapter.stop(el);
-
- // define and run the effect
- effect = new Fx.Morph(
- isSVGElement ? el : $(el),
- $extend({
- transition: Fx.Transitions.Quad.easeInOut
- }, options)
- );
-
- // special treatment for paths
- if (params.d) {
- effect.toD = params.d;
- }
-
- // jQuery-like events
- if (complete) {
- effect.addEvent('complete', complete);
- }
-
- // run
- effect.start(params);
-
- // record for use in stop method
- el.fx = effect;
- },
-
- /**
- * MooTool's each function
- *
- */
- each: $each,
-
- /**
- * Map an array
- * @param {Array} arr
- * @param {Function} fn
- */
- map: function (arr, fn){
- return arr.map(fn);
- },
-
- /**
- * Grep or filter an array
- * @param {Array} arr
- * @param {Function} fn
- */
- grep: function(arr, fn) {
- return arr.filter(fn);
- },
-
- /**
- * Deep merge two objects and return a third
- */
- merge: $merge,
-
- /**
- * Hyphenate a string, like minWidth becomes min-width
- * @param {Object} str
- */
- hyphenate: function (str){
- return str.hyphenate();
- },
-
- /**
- * Add an event listener
- * @param {Object} el HTML element or custom object
- * @param {String} type Event type
- * @param {Function} fn Event handler
- */
- addEvent: function (el, type, fn) {
- if (typeof type == 'string') { // chart broke due to el being string, type function
-
- if (type == 'unload') { // Moo self destructs before custom unload events
- type = 'beforeunload';
- }
-
- // if the addEvent method is not defined, el is a custom Highcharts object
- // like series or point
- if (!el.addEvent) {
- if (el.nodeName) {
- el = $(el); // a dynamically generated node
- } else {
- $extend(el, new Events()); // a custom object
- }
- }
-
- el.addEvent(type, fn);
- }
- },
-
- removeEvent: function(el, type, fn) {
- if (type) {
- if (type == 'unload') { // Moo self destructs before custom unload events
- type = 'beforeunload';
- }
-
-
- el.removeEvent(type, fn);
- }
- },
-
- fireEvent: function(el, event, eventArguments, defaultFunction) {
- // create an event object that keeps all functions
- event = new Event({
- type: event,
- target: el
- });
- event = $extend(event, eventArguments);
- // override the preventDefault function to be able to use
- // this for custom events
- event.preventDefault = function() {
- defaultFunction = null;
- };
- // if fireEvent is not available on the object, there hasn't been added
- // any events to it above
- if (el.fireEvent) {
- el.fireEvent(event.type, event);
- }
-
- // fire the default if it is passed and it is not prevented above
- if (defaultFunction) {
- defaultFunction(event);
- }
- },
-
- /**
- * Stop running animations on the object
- */
- stop: function (el) {
- if (el.fx) {
- el.fx.cancel();
- }
- }
-};
\ No newline at end of file
diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/adapters/prototype-adapter.js b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/adapters/prototype-adapter.js
deleted file mode 100644
index 6040fe3..0000000
--- a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/adapters/prototype-adapter.js
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- Highcharts JS v2.1.2 (2011-01-12)
- Prototype adapter
-
- @author Michael Nelson, Torstein H?nsi.
-
- Feel free to use and modify this script.
- Highcharts license: www.highcharts.com/license.
-*/
-var HighchartsAdapter=function(){var l=typeof Effect!="undefined";return{init:function(){if(l)Effect.HighchartsTransition=Class.create(Effect.Base,{initialize:function(a,b,c,d){var e;this.element=a;e=a.attr(b);if(b=="d"){this.paths=Highcharts.pathAnim.init(a,a.d,c);this.toD=c;e=0;c=1}this.start(Object.extend(d||{},{from:e,to:c,attribute:b}))},setup:function(){HighchartsAdapter._extend(this.element);this.element._highchart_animation=this},update:function(a){var b=this.paths;if(b)a=Highcharts.pathAnim.step(b[0],
-b[1],a,this.toD);this.element.attr(this.options.attribute,a)},finish:function(){this.element._highchart_animation=null}})},addEvent:function(a,b,c){if(a.addEventListener||a.attachEvent)Event.observe($(a),b,c);else{HighchartsAdapter._extend(a);a._highcharts_observe(b,c)}},animate:function(a,b,c){var d;c=c||{};c.delay=0;c.duration=(c.duration||500)/1E3;if(l)for(d in b)new Effect.HighchartsTransition($(a),d,b[d],c);else for(d in b)a.attr(d,b[d]);if(!a.attr)throw"Todo: implement animate DOM objects";
-},stop:function(a){a._highcharts_extended&&a._highchart_animation&&a._highchart_animation.cancel()},each:function(a,b){$A(a).each(b)},fireEvent:function(a,b,c,d){if(b.preventDefault)d=null;if(a.fire)a.fire(b,c);else a._highcharts_extended&&a._highcharts_fire(b,c);d&&d(c)},removeEvent:function(a,b,c){if($(a).stopObserving)a.stopObserving(a,b,c);else{HighchartsAdapter._extend(a);a._highcharts_stop_observing(b,c)}},grep:function(a,b){return a.findAll(b)},hyphenate:function(a){return a.replace(/([A-Z])/g,
-function(b,c){return"-"+c.toLowerCase()})},map:function(a,b){return a.map(b)},merge:function(){function a(e,i){var f,g,h,j,k;for(g in i){f=i[g];h=typeof f==="undefined";j=f===null;k=i===e[g];if(!(h||j||k)){h=typeof f==="object";j=f&&h&&f.constructor==Array;k=!!f.nodeType;e[g]=h&&!j&&!k?a(typeof e[g]=="object"?e[g]:{},f):i[g]}}return e}for(var b=arguments,c={},d=0;d'+ svg +''; - } - }*/] - - }, - printButton: { - //enabled: true, - symbol: 'printIcon', - x: -36, - symbolFill: '#B5C9DF', - hoverSymbolFill: '#779ABF', - _titleKey: 'printButtonTitle', - onclick: function() { - this.print(); - } - } - } -}; - - - -extend(Chart.prototype, { - /** - * Return an SVG representation of the chart - * - * @param additionalOptions {Object} Additional chart options for the generated SVG representation - */ - getSVG: function(additionalOptions) { - var chart = this, - chartCopy, - sandbox, - svg, - seriesOptions, - config, - pointOptions, - pointMarker, - options = merge(chart.options, additionalOptions); // copy the options and add extra options - - // IE compatibility hack for generating SVG content that it doesn't really understand - if (!doc.createElementNS) { - doc.createElementNS = function(ns, tagName) { - var elem = doc.createElement(tagName); - elem.getBBox = function() { - return chart.renderer.Element.prototype.getBBox.apply({ element: elem }); - }; - return elem; - }; - } - - // create a sandbox where a new chart will be generated - sandbox = createElement(DIV, null, { - position: ABSOLUTE, - top: '-9999em', - width: chart.chartWidth + PX, - height: chart.chartHeight + PX - }, doc.body); - - // override some options - extend(options.chart, { - renderTo: sandbox, - renderer: 'SVG' - }); - options.exporting.enabled = false; // hide buttons in print - options.chart.plotBackgroundImage = null; // the converter doesn't handle images - // prepare for replicating the chart - options.series = []; - each(chart.series, function(serie) { - seriesOptions = serie.options; - - seriesOptions.animation = false; // turn off animation - seriesOptions.showCheckbox = false; - - // remove image markers - if (seriesOptions && seriesOptions.marker && /^url\(/.test(seriesOptions.marker.symbol)) { - seriesOptions.marker.symbol = 'circle'; - } - - seriesOptions.data = []; - - each(serie.data, function(point) { - /*pointOptions = point.config === null || typeof point.config == 'number' ? - { y: point.y } : - point.config; - pointOptions.x = point.x;*/ - - // extend the options by those values that can be expressed in a number or array config - config = point.config; - pointOptions = extend( - typeof config == 'object' && config.constructor != Array && point.config, { - x: point.x, - y: point.y, - name: point.name - } - ); - seriesOptions.data.push(pointOptions); // copy fresh updated data - - // remove image markers - pointMarker = point.config && point.config.marker; - if (pointMarker && /^url\(/.test(pointMarker.symbol)) { - delete pointMarker.symbol; - } - }); - - options.series.push(seriesOptions); - }); - - // generate the chart copy - chartCopy = new Highcharts.Chart(options); - - // get the SVG from the container's innerHTML - svg = chartCopy.container.innerHTML; - - // free up memory - options = null; - chartCopy.destroy(); - discardElement(sandbox); - - // sanitize - svg = svg - .replace(/zIndex="[^"]+"/g, '') - .replace(/isShadow="[^"]+"/g, '') - .replace(/symbolName="[^"]+"/g, '') - .replace(/jQuery[0-9]+="[^"]+"/g, '') - .replace(/isTracker="[^"]+"/g, '') - .replace(/url\([^#]+#/g, 'url(#') - /* This fails in IE < 8 - .replace(/([0-9]+)\.([0-9]+)/g, function(s1, s2, s3) { // round off to save weight - return s2 +'.'+ s3[0]; - })*/ - - // IE specific - .replace(/id=([^" >]+)/g, 'id="$1"') - .replace(/class=([^" ]+)/g, 'class="$1"') - .replace(/ transform /g, ' ') - .replace(/:(path|rect)/g, '$1') - .replace(/style="([^"]+)"/g, function(s) { - return s.toLowerCase(); - }); - - // IE9 beta bugs with innerHTML. Test again with final IE9. - svg = svg.replace(/(url\(#highcharts-[0-9]+)"/g, '$1') - .replace(/"/g, "'"); - if (svg.match(/ xmlns="/g).length == 2) { - svg = svg.replace(/xmlns="[^"]+"/, ''); - } - - return svg; - }, - - /** - * Submit the SVG representation of the chart to the server - * @param {Object} options Exporting options. Possible members are url, type and width. - * @param {Object} chartOptions Additional chart options for the SVG representation of the chart - */ - exportChart: function(options, chartOptions) { - var form, - chart = this, - svg = chart.getSVG(chartOptions); - - // merge the options - options = merge(chart.options.exporting, options); - - // create the form - form = createElement('form', { - method: 'post', - action: options.url - }, { - display: NONE - }, doc.body); - - // add the values - each(['filename', 'type', 'width', 'svg'], function(name) { - createElement('input', { - type: HIDDEN, - name: name, - value: { - filename: options.filename || 'chart', - type: options.type, - width: options.width, - svg: svg - }[name] - }, null, form); - }); - - // submit - form.submit(); - - // clean up - discardElement(form); - }, - - /** - * Print the chart - */ - print: function() { - - var chart = this, - container = chart.container, - origDisplay = [], - origParent = container.parentNode, - body = doc.body, - childNodes = body.childNodes; - - if (chart.isPrinting) { // block the button while in printing mode - return; - } - - chart.isPrinting = true; - - // hide all body content - each(childNodes, function(node, i) { - if (node.nodeType == 1) { - origDisplay[i] = node.style.display; - node.style.display = NONE; - } - }); - - // pull out the chart - body.appendChild(container); - - // print - win.print(); - - // allow the browser to prepare before reverting - setTimeout(function() { - - // put the chart back in - origParent.appendChild(container); - - // restore all body content - each(childNodes, function(node, i) { - if (node.nodeType == 1) { - node.style.display = origDisplay[i]; - } - }); - - chart.isPrinting = false; - - }, 1000); - - }, - - /** - * Display a popup menu for choosing the export type - * - * @param {String} name An identifier for the menu - * @param {Array} items A collection with text and onclicks for the items - * @param {Number} x The x position of the opener button - * @param {Number} y The y position of the opener button - * @param {Number} width The width of the opener button - * @param {Number} height The height of the opener button - */ - contextMenu: function(name, items, x, y, width, height) { - var chart = this, - navOptions = chart.options.navigation, - menuItemStyle = navOptions.menuItemStyle, - chartWidth = chart.chartWidth, - chartHeight = chart.chartHeight, - cacheName = 'cache-'+ name, - menu = chart[cacheName], - menuPadding = mathMax(width, height), // for mouse leave detection - boxShadow = '3px 3px 10px #888', - innerMenu, - hide, - menuStyle; - - // create the menu only the first time - if (!menu) { - - // create a HTML element above the SVG - chart[cacheName] = menu = createElement(DIV, { - className: PREFIX + name - }, { - position: ABSOLUTE, - zIndex: 1000, - padding: menuPadding + PX - }, chart.container); - - innerMenu = createElement(DIV, null, - extend({ - MozBoxShadow: boxShadow, - WebkitBoxShadow: boxShadow, - boxShadow: boxShadow - }, navOptions.menuStyle) , menu); - - // hide on mouse out - hide = function() { - css(menu, { display: NONE }); - }; - - addEvent(menu, 'mouseleave', hide); - - - // create the items - each(items, function(item) { - if (item) { - var div = createElement(DIV, { - onmouseover: function() { - css(this, navOptions.menuItemHoverStyle); - }, - onmouseout: function() { - css(this, menuItemStyle); - }, - innerHTML: item.text || HC.getOptions().lang[item.textKey] - }, extend({ - cursor: 'pointer' - }, menuItemStyle), innerMenu); - - div[hasTouch ? 'ontouchstart' : 'onclick'] = function() { - hide(); - item.onclick.apply(chart, arguments); - }; - - } - }); - - chart.exportMenuWidth = menu.offsetWidth; - chart.exportMenuHeight = menu.offsetHeight; - } - - menuStyle = { display: 'block' }; - - // if outside right, right align it - if (x + chart.exportMenuWidth > chartWidth) { - menuStyle.right = (chartWidth - x - width - menuPadding) + PX; - } else { - menuStyle.left = (x - menuPadding) + PX; - } - // if outside bottom, bottom align it - if (y + height + chart.exportMenuHeight > chartHeight) { - menuStyle.bottom = (chartHeight - y - menuPadding) + PX; - } else { - menuStyle.top = (y + height - menuPadding) + PX; - } - - css(menu, menuStyle); - }, - - /** - * Add the export button to the chart - */ - addButton: function(options) { - var chart = this, - renderer = chart.renderer, - btnOptions = merge(chart.options.navigation.buttonOptions, options), - onclick = btnOptions.onclick, - menuItems = btnOptions.menuItems, - /*position = chart.getAlignment(btnOptions), - buttonLeft = position.x, - buttonTop = position.y,*/ - buttonWidth = btnOptions.width, - buttonHeight = btnOptions.height, - box, - symbol, - button, - borderWidth = btnOptions.borderWidth, - boxAttr = { - stroke: btnOptions.borderColor - - }, - symbolAttr = { - stroke: btnOptions.symbolStroke, - fill: btnOptions.symbolFill - }; - - if (btnOptions.enabled === false) { - return; - } - - // element to capture the click - function revert() { - symbol.attr(symbolAttr); - box.attr(boxAttr); - } - - // the box border - box = renderer.rect( - 0, - 0, - buttonWidth, - buttonHeight, - btnOptions.borderRadius, - borderWidth - ) - //.translate(buttonLeft, buttonTop) // to allow gradients - .align(btnOptions, true) - .attr(extend({ - fill: btnOptions.backgroundColor, - 'stroke-width': borderWidth, - zIndex: 19 - }, boxAttr)).add(); - - // the invisible element to track the clicks - button = renderer.rect( - 0, - 0, - buttonWidth, - buttonHeight, - 0 - ) - .align(btnOptions) - .attr({ - fill: 'rgba(255, 255, 255, 0.001)', - title: HC.getOptions().lang[btnOptions._titleKey], - zIndex: 21 - }).css({ - cursor: 'pointer' - }) - .on('mouseover', function() { - symbol.attr({ - stroke: btnOptions.hoverSymbolStroke, - fill: btnOptions.hoverSymbolFill - }); - box.attr({ - stroke: btnOptions.hoverBorderColor - }); - }) - .on('mouseout', revert) - .on('click', revert) - .add(); - - //addEvent(button.element, 'click', revert); - - // add the click event - if (menuItems) { - onclick = function(e) { - revert(); - var bBox = button.getBBox(); - chart.contextMenu('export-menu', menuItems, bBox.x, bBox.y, buttonWidth, buttonHeight); - }; - } - /*addEvent(button.element, 'click', function() { - onclick.apply(chart, arguments); - });*/ - button.on('click', function() { - onclick.apply(chart, arguments); - }); - - // the icon - symbol = renderer.symbol( - btnOptions.symbol, - btnOptions.symbolX, - btnOptions.symbolY, - (btnOptions.symbolSize || 12) / 2 - ) - .align(btnOptions, true) - .attr(extend(symbolAttr, { - 'stroke-width': btnOptions.symbolStrokeWidth || 1, - zIndex: 20 - })).add(); - - - - } -}); - -// Create the export icon -HC.Renderer.prototype.symbols.exportIcon = function(x, y, radius) { - return [ - M, // the disk - x - radius, y + radius, - L, - x + radius, y + radius, - x + radius, y + radius * 0.5, - x - radius, y + radius * 0.5, - 'Z', - M, // the arrow - x, y + radius * 0.5, - L, - x - radius * 0.5, y - radius / 3, - x - radius / 6, y - radius / 3, - x - radius / 6, y - radius, - x + radius / 6, y - radius, - x + radius / 6, y - radius / 3, - x + radius * 0.5, y - radius / 3, - 'Z' - ]; -}; -// Create the print icon -HC.Renderer.prototype.symbols.printIcon = function(x, y, radius) { - return [ - M, // the printer - x - radius, y + radius * 0.5, - L, - x + radius, y + radius * 0.5, - x + radius, y - radius / 3, - x - radius, y - radius / 3, - 'Z', - M, // the upper sheet - x - radius * 0.5, y - radius / 3, - L, - x - radius * 0.5, y - radius, - x + radius * 0.5, y - radius, - x + radius * 0.5, y - radius / 3, - 'Z', - M, // the lower sheet - x - radius * 0.5, y + radius * 0.5, - L, - x - radius * 0.75, y + radius, - x + radius * 0.75, y + radius, - x + radius * 0.5, y + radius * 0.5, - 'Z' - ]; -}; - - -// Add the buttons on chart load -Chart.prototype.callbacks.push(function(chart) { - var n, - exportingOptions = chart.options.exporting, - buttons = exportingOptions.buttons; - - if (exportingOptions.enabled !== false) { - - for (n in buttons) { - chart.addButton(buttons[n]); - } - } -}); - - -})(); \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/themes/dark-blue.js b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/themes/dark-blue.js deleted file mode 100644 index a39d6ca..0000000 --- a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/themes/dark-blue.js +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Dark blue theme for Highcharts JS - * @author Torstein Hønsi - */ - -Highcharts.theme = { - colors: ["#DDDF0D", "#55BF3B", "#DF5353", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee", - "#55BF3B", "#DF5353", "#7798BF", "#aaeeee"], - chart: { - backgroundColor: { - linearGradient: [0, 0, 250, 500], - stops: [ - [0, 'rgb(48, 48, 96)'], - [1, 'rgb(0, 0, 0)'] - ] - }, - borderColor: '#000000', - borderWidth: 2, - className: 'dark-container', - plotBackgroundColor: 'rgba(255, 255, 255, .1)', - plotBorderColor: '#CCCCCC', - plotBorderWidth: 1 - }, - title: { - style: { - color: '#C0C0C0', - font: 'bold 16px "Trebuchet MS", Verdana, sans-serif' - } - }, - subtitle: { - style: { - color: '#666666', - font: 'bold 12px "Trebuchet MS", Verdana, sans-serif' - } - }, - xAxis: { - gridLineColor: '#333333', - gridLineWidth: 1, - labels: { - style: { - color: '#A0A0A0' - } - }, - lineColor: '#A0A0A0', - tickColor: '#A0A0A0', - title: { - style: { - color: '#CCC', - fontWeight: 'bold', - fontSize: '12px', - fontFamily: 'Trebuchet MS, Verdana, sans-serif' - - } - } - }, - yAxis: { - gridLineColor: '#333333', - labels: { - style: { - color: '#A0A0A0' - } - }, - lineColor: '#A0A0A0', - minorTickInterval: null, - tickColor: '#A0A0A0', - tickWidth: 1, - title: { - style: { - color: '#CCC', - fontWeight: 'bold', - fontSize: '12px', - fontFamily: 'Trebuchet MS, Verdana, sans-serif' - } - } - }, - legend: { - itemStyle: { - font: '9pt Trebuchet MS, Verdana, sans-serif', - color: '#A0A0A0' - } - }, - tooltip: { - backgroundColor: 'rgba(0, 0, 0, 0.75)', - style: { - color: '#F0F0F0' - } - }, - toolbar: { - itemStyle: { - color: 'silver' - } - }, - plotOptions: { - line: { - dataLabels: { - color: '#CCC' - }, - marker: { - lineColor: '#333' - } - }, - spline: { - marker: { - lineColor: '#333' - } - }, - scatter: { - marker: { - lineColor: '#333' - } - } - }, - legend: { - itemStyle: { - color: '#CCC' - }, - itemHoverStyle: { - color: '#FFF' - }, - itemHiddenStyle: { - color: '#444' - } - }, - credits: { - style: { - color: '#666' - } - }, - labels: { - style: { - color: '#CCC' - } - }, - - navigation: { - buttonOptions: { - backgroundColor: { - linearGradient: [0, 0, 0, 20], - stops: [ - [0.4, '#606060'], - [0.6, '#333333'] - ] - }, - borderColor: '#000000', - symbolStroke: '#C0C0C0', - hoverSymbolStroke: '#FFFFFF' - } - }, - - exporting: { - buttons: { - exportButton: { - symbolFill: '#55BE3B' - }, - printButton: { - symbolFill: '#7797BE' - } - } - }, - - // special colors for some of the - legendBackgroundColor: 'rgba(0, 0, 0, 0.5)', - legendBackgroundColorSolid: 'rgb(35, 35, 70)', - dataLabelsColor: '#444', - textColor: '#C0C0C0', - maskColor: 'rgba(255,255,255,0.3)' -}; - -// Apply the theme -var highchartsOptions = Highcharts.setOptions(Highcharts.theme); \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/themes/dark-green.js b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/themes/dark-green.js deleted file mode 100644 index cec50e7..0000000 --- a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/themes/dark-green.js +++ /dev/null @@ -1,170 +0,0 @@ -/** - * Dark blue theme for Highcharts JS - * @author Torstein Hønsi - */ - -Highcharts.theme = { - colors: ["#DDDF0D", "#55BF3B", "#DF5353", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee", - "#55BF3B", "#DF5353", "#7798BF", "#aaeeee"], - chart: { - backgroundColor: { - linearGradient: [0, 0, 250, 500], - stops: [ - [0, 'rgb(48, 96, 48)'], - [1, 'rgb(0, 0, 0)'] - ] - }, - borderColor: '#000000', - borderWidth: 2, - className: 'dark-container', - plotBackgroundColor: 'rgba(255, 255, 255, .1)', - plotBorderColor: '#CCCCCC', - plotBorderWidth: 1 - }, - title: { - style: { - color: '#C0C0C0', - font: 'bold 16px "Trebuchet MS", Verdana, sans-serif' - } - }, - subtitle: { - style: { - color: '#666666', - font: 'bold 12px "Trebuchet MS", Verdana, sans-serif' - } - }, - xAxis: { - gridLineColor: '#333333', - gridLineWidth: 1, - labels: { - style: { - color: '#A0A0A0' - } - }, - lineColor: '#A0A0A0', - tickColor: '#A0A0A0', - title: { - style: { - color: '#CCC', - fontWeight: 'bold', - fontSize: '12px', - fontFamily: 'Trebuchet MS, Verdana, sans-serif' - - } - } - }, - yAxis: { - gridLineColor: '#333333', - labels: { - style: { - color: '#A0A0A0' - } - }, - lineColor: '#A0A0A0', - minorTickInterval: null, - tickColor: '#A0A0A0', - tickWidth: 1, - title: { - style: { - color: '#CCC', - fontWeight: 'bold', - fontSize: '12px', - fontFamily: 'Trebuchet MS, Verdana, sans-serif' - } - } - }, - legend: { - itemStyle: { - font: '9pt Trebuchet MS, Verdana, sans-serif', - color: '#A0A0A0' - } - }, - tooltip: { - backgroundColor: 'rgba(0, 0, 0, 0.75)', - style: { - color: '#F0F0F0' - } - }, - toolbar: { - itemStyle: { - color: 'silver' - } - }, - plotOptions: { - line: { - dataLabels: { - color: '#CCC' - }, - marker: { - lineColor: '#333' - } - }, - spline: { - marker: { - lineColor: '#333' - } - }, - scatter: { - marker: { - lineColor: '#333' - } - } - }, - legend: { - itemStyle: { - color: '#CCC' - }, - itemHoverStyle: { - color: '#FFF' - }, - itemHiddenStyle: { - color: '#444' - } - }, - credits: { - style: { - color: '#666' - } - }, - labels: { - style: { - color: '#CCC' - } - }, - - navigation: { - buttonOptions: { - backgroundColor: { - linearGradient: [0, 0, 0, 20], - stops: [ - [0.4, '#606060'], - [0.6, '#333333'] - ] - }, - borderColor: '#000000', - symbolStroke: '#C0C0C0', - hoverSymbolStroke: '#FFFFFF' - } - }, - - exporting: { - buttons: { - exportButton: { - symbolFill: '#55BE3B' - }, - printButton: { - symbolFill: '#7797BE' - } - } - }, - - // special colors for some of the - legendBackgroundColor: 'rgba(0, 0, 0, 0.5)', - legendBackgroundColorSolid: 'rgb(35, 35, 70)', - dataLabelsColor: '#444', - textColor: '#C0C0C0', - maskColor: 'rgba(255,255,255,0.3)' -}; - -// Apply the theme -var highchartsOptions = Highcharts.setOptions(Highcharts.theme); \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/themes/gray.js b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/themes/gray.js deleted file mode 100644 index a292a76..0000000 --- a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/themes/gray.js +++ /dev/null @@ -1,164 +0,0 @@ -/** - * Gray theme for Highcharts JS - * @author Torstein Hønsi - */ - -Highcharts.theme = { - colors: ["#DDDF0D", "#7798BF", "#55BF3B", "#DF5353", "#aaeeee", "#ff0066", "#eeaaee", - "#55BF3B", "#DF5353", "#7798BF", "#aaeeee"], - chart: { - backgroundColor: { - linearGradient: [0, 0, 0, 400], - stops: [ - [0, 'rgb(96, 96, 96)'], - [1, 'rgb(16, 16, 16)'] - ] - }, - borderWidth: 0, - borderRadius: 15, - plotBackgroundColor: null, - plotShadow: false, - plotBorderWidth: 0 - }, - title: { - style: { - color: '#FFF', - font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' - } - }, - subtitle: { - style: { - color: '#DDD', - font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' - } - }, - xAxis: { - gridLineWidth: 0, - lineColor: '#999', - tickColor: '#999', - labels: { - style: { - color: '#999', - fontWeight: 'bold' - } - }, - title: { - style: { - color: '#AAA', - font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' - } - } - }, - yAxis: { - alternateGridColor: null, - minorTickInterval: null, - gridLineColor: 'rgba(255, 255, 255, .1)', - lineWidth: 0, - tickWidth: 0, - labels: { - style: { - color: '#999', - fontWeight: 'bold' - } - }, - title: { - style: { - color: '#AAA', - font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif' - } - } - }, - legend: { - itemStyle: { - color: '#CCC' - }, - itemHoverStyle: { - color: '#FFF' - }, - itemHiddenStyle: { - color: '#333' - } - }, - labels: { - style: { - color: '#CCC' - } - }, - tooltip: { - backgroundColor: { - linearGradient: [0, 0, 0, 50], - stops: [ - [0, 'rgba(96, 96, 96, .8)'], - [1, 'rgba(16, 16, 16, .8)'] - ] - }, - borderWidth: 0, - style: { - color: '#FFF' - } - }, - - - plotOptions: { - line: { - dataLabels: { - color: '#CCC' - }, - marker: { - lineColor: '#333' - } - }, - spline: { - marker: { - lineColor: '#333' - } - }, - scatter: { - marker: { - lineColor: '#333' - } - } - }, - - toolbar: { - itemStyle: { - color: '#CCC' - } - }, - - navigation: { - buttonOptions: { - backgroundColor: { - linearGradient: [0, 0, 0, 20], - stops: [ - [0.4, '#606060'], - [0.6, '#333333'] - ] - }, - borderColor: '#000000', - symbolStroke: '#C0C0C0', - hoverSymbolStroke: '#FFFFFF' - } - }, - - exporting: { - buttons: { - exportButton: { - symbolFill: '#55BE3B' - }, - printButton: { - symbolFill: '#7797BE' - } - } - }, - - // special colors for some of the demo examples - legendBackgroundColor: 'rgba(48, 48, 48, 0.8)', - legendBackgroundColorSolid: 'rgb(70, 70, 70)', - dataLabelsColor: '#444', - textColor: '#E0E0E0', - maskColor: 'rgba(255,255,255,0.3)' -}; - -// Apply the theme -var highchartsOptions = Highcharts.setOptions(Highcharts.theme); diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/themes/grid.js b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/themes/grid.js deleted file mode 100644 index ab2011b..0000000 --- a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/public/highcharts/js/themes/grid.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Grid theme for Highcharts JS - * @author Torstein Hønsi - */ - -Highcharts.theme = { - colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'], - chart: { - backgroundColor: { - linearGradient: [0, 0, 500, 500], - stops: [ - [0, 'rgb(255, 255, 255)'], - [1, 'rgb(240, 240, 255)'] - ] - } -, - borderWidth: 2, - plotBackgroundColor: 'rgba(255, 255, 255, .9)', - plotShadow: true, - plotBorderWidth: 1 - }, - title: { - style: { - color: '#000', - font: 'bold 16px "Trebuchet MS", Verdana, sans-serif' - } - }, - subtitle: { - style: { - color: '#666666', - font: 'bold 12px "Trebuchet MS", Verdana, sans-serif' - } - }, - xAxis: { - gridLineWidth: 1, - lineColor: '#000', - tickColor: '#000', - labels: { - style: { - color: '#000', - font: '11px Trebuchet MS, Verdana, sans-serif' - } - }, - title: { - style: { - color: '#333', - fontWeight: 'bold', - fontSize: '12px', - fontFamily: 'Trebuchet MS, Verdana, sans-serif' - - } - } - }, - yAxis: { - minorTickInterval: 'auto', - lineColor: '#000', - lineWidth: 1, - tickWidth: 1, - tickColor: '#000', - labels: { - style: { - color: '#000', - font: '11px Trebuchet MS, Verdana, sans-serif' - } - }, - title: { - style: { - color: '#333', - fontWeight: 'bold', - fontSize: '12px', - fontFamily: 'Trebuchet MS, Verdana, sans-serif' - } - } - }, - legend: { - itemStyle: { - font: '9pt Trebuchet MS, Verdana, sans-serif', - color: 'black' - - }, - itemHoverStyle: { - color: '#039' - }, - itemHiddenStyle: { - color: 'gray' - } - }, - labels: { - style: { - color: '#99b' - } - } -}; - -// Apply the theme -var highchartsOptions = Highcharts.setOptions(Highcharts.theme); - diff --git a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/server/ISMonitorServiceImpl.java b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/server/ISMonitorServiceImpl.java index 793a1ba..4969c2b 100644 --- a/src/main/java/org/gcube/portlets/admin/ishealthmonitor/server/ISMonitorServiceImpl.java +++ b/src/main/java/org/gcube/portlets/admin/ishealthmonitor/server/ISMonitorServiceImpl.java @@ -27,6 +27,7 @@ public class ISMonitorServiceImpl extends RemoteServiceServlet implements ISMoni cm.setUseCache(false); try { GCUBEScope gscope = ScopeManager.getScope(scope); + //GCUBEScope gscope = GCUBEScope.getScope(scope); HashMap
p&&pa.shift();if(h.endOnTick)Q=r;else QEb[I])Eb[I]=pa.length}}function Da(){var l,p;fb=J;cc=Q;P();da();ha=F;F=B/(Q-J||1);if(!ka)for(l in ca)for(p in ca[l])ca[l][p].cum=ca[l][p].total;if(!s.isDirty)s.isDirty=J!=fb||Q!=cc}function sa(l){l= -(new w(l)).render();Ob.push(l);return l}function Ya(){var l=h.title,p=h.alternateGridColor,r=h.lineWidth,o,U,X=m.hasRendered,H=X&&L(fb)&&!isNaN(fb);o=Y.length&&L(J)&&L(Q);B=O?Ca:ra;F=B/(Q-J||1);va=O?W:pb;if(o||Nb){if(Jc&&!bb)for(o=J+(pa[0]-J)%Jc;o<=Q;o+=Jc){Xb[o]||(Xb[o]=new x(o,true));H&&Xb[o].isNew&&Xb[o].render(null,true);Xb[o].isActive=true;Xb[o].render()}t(pa,function(C,fa){if(!Nb||C>=J&&C<=Q){H&&qb[C].isNew&&qb[C].render(fa,true);qb[C].isActive=true;qb[C].render(fa)}});p&&t(pa,function(C,fa){if(fa% -2===0&&C =1E3?Gd(l,0):l},Nc=O&&h.labels.staggerLines,Yb=h.reversed,Zb=bb&&h.tickmarkPlacement=="between"?0.5:0;x.prototype={addLabel:function(){var l=this.pos,p=h.labels,r=!(l== -J&&!y(h.showFirstLabel,1)||l==Q&&!y(h.showLastLabel,0)),o,U=this.label;l=Zd.call({isFirst:l==pa[0],isLast:l==pa[pa.length-1],dateTimeLabelFormat:Kc,value:bb&&bb[l]?bb[l]:l});o=o&&{width:o-2*(p.padding||10)+Za};if(U===Qa)this.label=L(l)&&r&&p.enabled?$.text(l,0,0).attr({align:p.align,rotation:p.rotation}).css(ma(o,p.style)).add(rb):null;else U&&U.attr({text:l}).css(o)},getLabelSize:function(){var l=this.label;return l?(this.labelBBox=l.getBBox())[O?"height":"width"]:0},render:function(l,p){var r=!this.minor, -o=this.label,U=this.pos,X=h.labels,H=this.gridLine,C=r?h.gridLineWidth:h.minorGridLineWidth,fa=r?h.gridLineColor:h.minorGridLineColor,ja=r?h.gridLineDashStyle:h.minorGridLineDashStyle,D=this.mark,la=r?h.tickLength:h.minorTickLength,S=r?h.tickWidth:h.minorTickWidth||0,Z=r?h.tickColor:h.minorTickColor,pc=r?h.tickPosition:h.minorTickPosition;r=X.step;var gb=p&&Oc||Oa,Pb;Pb=O?ta(U+Zb,null,null,p)+va:W+R+(Na?(p&&hd||Va)-zb-W:0);gb=O?gb-pb+R-(Na?ra:0):gb-ta(U+Zb,null,null,p)-va;if(C){U=Ia(U+Zb,C,p);if(H=== -Qa){H={stroke:fa,"stroke-width":C};if(ja)H.dashstyle=ja;this.gridLine=H=C?$.path(U).attr(H).add(Fb):null}H&&U&&H.animate({d:U})}if(S){if(pc=="inside")la=-la;if(Na)la=-la;C=$.crispLine([Wa,Pb,gb,Ba,Pb+(O?0:-la),gb+(O?la:0)],S);if(D)D.animate({d:C});else this.mark=$.path(C).attr({stroke:Z,"stroke-width":S}).add(rb)}if(o){Pb=Pb+X.x-(Zb&&O?Zb*F*(Yb?-1:1):0);gb=gb+X.y-(Zb&&!O?Zb*F*(Yb?1:-1):0);L(X.y)||(gb+=parseInt(o.styles.lineHeight)*0.9-o.getBBox().height/2);if(Nc)gb+=l%Nc*16;if(r)o[l%r?"hide":"show"](); -o[this.isNew?"attr":"animate"]({x:Pb,y:gb})}this.isNew=false},destroy:function(){for(var l in this)this[l]&&this[l].destroy&&this[l].destroy()}};w.prototype={render:function(){var l=this,p=l.options,r=p.label,o=l.label,U=p.width,X=p.to,H,C=p.from,fa=p.dashStyle,ja=l.svgElem,D=[],la,S,Z=p.color;S=p.zIndex;var pc=p.events;if(U){D=Ia(p.value,U);p={stroke:Z,"stroke-width":U};if(fa)p.dashstyle=fa}else if(L(C)&&L(X)){C=Ga(C,J);X=nb(X,Q);H=Ia(X);if((D=Ia(C))&&H)D.push(H[4],H[5],H[1],H[2]);else D=null;p= -{fill:Z}}else return;if(L(S))p.zIndex=S;if(ja)if(D)ja.animate({d:D},null,ja.onGetPath);else{ja.hide();ja.onGetPath=function(){ja.show()}}else if(D&&D.length){l.svgElem=ja=$.path(D).attr(p).add();if(pc){fa=function(gb){ja.on(gb,function(Pb){pc[gb].apply(l,[Pb])})};for(la in pc)fa(la)}}if(r&&L(r.text)&&D&&D.length&&Ca>0&&ra>0){r=wa({align:O&&H&&"center",x:O?!H&&4:10,verticalAlign:!O&&H&&"middle",y:O?H?16:10:H?6:-4,rotation:O&&!H&&90},r);if(!o)l.label=o=$.text(r.text,0,0).attr({align:r.textAlign||r.align, -rotation:r.rotation,zIndex:S}).css(r.style).add();H=[D[1],D[4],D[6]||D[1]];D=[D[2],D[5],D[7]||D[2]];la=nb.apply(Ta,H);S=nb.apply(Ta,D);o.align(r,false,{x:la,y:S,width:Ga.apply(Ta,H)-la,height:Ga.apply(Ta,D)-S});o.show()}else o&&o.hide();return l},destroy:function(){for(var l in this){this[l]&&this[l].destroy&&this[l].destroy();delete this[l]}mc(Ob,this)}};ta=function(l,p,r,o){var U=1,X=0,H=o?ha:F;o=o?fb:J;H||(H=F);if(r){U*=-1;X=B}if(Yb){U*=-1;X-=U*B}if(p){if(Yb)l=B-l;l=l/H+o}else l=U*(l-o)*H+X;return l}; -Ia=function(l,p,r){var o,U,X;l=ta(l,null,null,r);var H=r&&Oc||Oa,C=r&&hd||Va,fa;r=U=V(l+va);o=X=V(H-l-va);if(isNaN(l))fa=true;else if(O){o=aa;X=H-pb;if(rW+Ca)fa=true}else{r=W;U=C-zb;if(o aa+ra)fa=true}return fa?null:$.crispLine([Wa,r,o,Ba,U,X],p||0)};if(Fa&&ka&&Yb===Qa)Yb=true;ma(s,{addPlotBand:sa,addPlotLine:sa,adjustTickAmount:function(){if(Eb&&!N&&!bb&&!Nb){var l=ec,p=pa.length;ec=Eb[I];if(p l)l=J;else if(Q ',B?Mc("%A, %b %e, %Y",F):F,"
=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, -CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, -g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, -text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, -setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= -h[3];l=0;for(m=h.length;l =0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== -"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, -h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l ";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& -q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; -if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); -(function(){var g=s.createElement("div");g.innerHTML="";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: -function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q =0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f
0)for(var j=d;j 0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= -{},i;if(f&&a.length){e=0;for(var o=a.length;e -1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== -"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", -d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? -a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== -1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"+d+">"},F={option:[1,""],legend:[1,""],thead:[1," ","
"],tr:[2,"","
"],td:[3,""],col:[2,"
"," "],area:[1,""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
"," ",""];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, -""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); -return this}else{e=0;for(var j=d.length;e 0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", -""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===" "&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= -c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? -c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= -function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= -Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, -"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= -a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= -a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/