egroupware/phpgwapi/js/jquery/jqplot/jquery.jqplot.min.js

57 lines
155 KiB
JavaScript
Raw Normal View History

2011-08-10 01:10:50 +02:00
/**
* jqPlot
* Pure JavaScript plotting plugin using jQuery
*
* Version: 1.0.0b2_r947
2011-08-10 01:10:50 +02:00
*
* Copyright (c) 2009-2011 Chris Leonello
* jqPlot is currently available for use in all personal or commercial projects
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* Although not required, the author would appreciate an email letting him
* know of any substantial use of jqPlot. You can reach the author at:
* chris at jqplot dot com or see http://www.jqplot.com/info.php .
*
* If you are feeling kind and generous, consider supporting the project by
* making a donation at: http://www.jqplot.com/donate.php .
*
* sprintf functions contained in jqplot.sprintf.js by Ash Searle:
*
* version 2007.04.27
* author Ash Searle
* http://hexmen.com/blog/2007/03/printf-sprintf/
* http://hexmen.com/js/sprintf.js
* The author (Ash Searle) has placed this code in the public domain:
* "This code is unrestricted: you are free to use it however you like."
*
* included jsDate library by Chris Leonello:
*
* Copyright (c) 2010-2011 Chris Leonello
*
* jsDate is currently available for use in all personal or commercial projects
* under both the MIT and GPL version 2.0 licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* jsDate borrows many concepts and ideas from the Date Instance
* Methods by Ken Snyder along with some parts of Ken's actual code.
*
* Ken's origianl Date Instance Methods and copyright notice:
*
* Ken Snyder (ken d snyder at gmail dot com)
* 2008-09-10
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
* Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
*
* jqplotToImage function based on Larry Siden's export-jqplot-to-png.js.
* Larry has generously given permission to adapt his code for inclusion
* into jqPlot.
*
* Larry's original code can be found here:
*
* https://github.com/lsiden/export-jqplot-to-png
*
2011-08-10 01:10:50 +02:00
*
*/
(function(G){var q;G.fn.emptyForce=function(){for(var aa=0,ab;(ab=G(this)[aa])!=null;aa++){if(ab.nodeType===1){jQuery.cleanData(ab.getElementsByTagName("*"))}if(G.jqplot_use_excanvas){ab.outerHTML=""}else{while(ab.firstChild){ab.removeChild(ab.firstChild)}}ab=null}return G(this)};G.fn.removeChildForce=function(aa){while(aa.firstChild){this.removeChildForce(aa.firstChild);aa.removeChild(aa.firstChild)}};G.jqplot=function(ag,ad,ab){var ac,aa;if(ab==null){if(jQuery.isArray(ad)){ac=ad;aa=null}else{if(typeof(ad)==="object"){ac=null;aa=ad}}}else{ac=ad;aa=ab}var af=new M();G("#"+ag).removeClass("jqplot-error");if(G.jqplot.config.catchErrors){try{af.init(ag,ac,aa);af.draw();af.themeEngine.init.call(af);return af}catch(ae){var ah=G.jqplot.config.errorMessage||ae.message;G("#"+ag).append('<div class="jqplot-error-message">'+ah+"</div>");G("#"+ag).addClass("jqplot-error");document.getElementById(ag).style.background=G.jqplot.config.errorBackground;document.getElementById(ag).style.border=G.jqplot.config.errorBorder;document.getElementById(ag).style.fontFamily=G.jqplot.config.errorFontFamily;document.getElementById(ag).style.fontSize=G.jqplot.config.errorFontSize;document.getElementById(ag).style.fontStyle=G.jqplot.config.errorFontStyle;document.getElementById(ag).style.fontWeight=G.jqplot.config.errorFontWeight}}else{af.init(ag,ac,aa);af.draw();af.themeEngine.init.call(af);return af}};G.jqplot.version="1.0.0b2_r947";G.jqplot.CanvasManager=function(){if(typeof G.jqplot.CanvasManager.canvases=="undefined"){G.jqplot.CanvasManager.canvases=[];G.jqplot.CanvasManager.free=[]}var aa=[];this.getCanvas=function(){var ad;var ac=true;if(!G.jqplot.use_excanvas){for(var ae=0,ab=G.jqplot.CanvasManager.canvases.length;ae<ab;ae++){if(G.jqplot.CanvasManager.free[ae]===true){ac=false;ad=G.jqplot.CanvasManager.canvases[ae];G.jqplot.CanvasManager.free[ae]=false;aa.push(ae);break}}}if(ac){ad=document.createElement("canvas");aa.push(G.jqplot.CanvasManager.canvases.length);G.jqplot.CanvasManager.canvases.push(ad);G.jqplot.CanvasManager.free.push(false)}return ad};this.initCanvas=function(ab){if(G.jqplot.use_excanvas){return window.G_vmlCanvasManager.initElement(ab)}return ab};this.freeAllCanvases=function(){for(var ac=0,ab=aa.length;ac<ab;ac++){this.freeCanvas(aa[ac])}aa=[]};this.freeCanvas=function(ab){if(G.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==q){window.G_vmlCanvasManager.uninitElement(G.jqplot.CanvasManager.canvases[ab]);G.jqplot.CanvasManager.canvases[ab]=null}else{var ac=G.jqplot.CanvasManager.canvases[ab];ac.getContext("2d").clearRect(0,0,ac.width,ac.height);G(ac).unbind().removeAttr("class").removeAttr("style");G(ac).css({left:"",top:"",position:""});ac.width=0;ac.height=0;G.jqplot.CanvasManager.free[ab]=true}}};G.jqplot.log=function(){if(window.console){window.console.log.apply(window.console,arguments)}};G.jqplot.config={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/"};G.jqplot.arrayMax=function(aa){return Math.max.apply(Math,aa)};G.jqplot.arrayMin=function(aa){return Math.min.apply(Math,aa)};G.jqplot.enablePlugins=G.jqplot.config.enablePlugins;G.jqplot.support_canvas=function(){if(typeof G.jqplot.support_canvas.result=="undefined"){G.jqplot.support_canvas.result=!!document.createElement("canvas").getContext}return G.jqplot.support_canvas.result};G.jqplot.support_canvas_text=function(){if(typeof G.jqplot.support