/** * jqPlot * Pure JavaScript plotting plugin using jQuery * * Version: 1.0.0b2_r947 * * 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 * * */ (function(a){a.jqplot.DateAxisRenderer=function(){a.jqplot.LinearAxisRenderer.call(this);this.date=new a.jsDate()};a.jqplot.DateAxisRenderer.prototype=new a.jqplot.LinearAxisRenderer();a.jqplot.DateAxisRenderer.prototype.constructor=a.jqplot.DateAxisRenderer;a.jqplot.DateTickFormatter=function(b,c){if(!b){b="%Y/%m/%d"}return a.jsDate.strftime(c,b)};a.jqplot.DateAxisRenderer.prototype.init=function(w){this.tickOptions.formatter=a.jqplot.DateTickFormatter;this.tickInset=0;this.drawBaseline=true;this.baselineWidth=null;this.baselineColor=null;this.daTickInterval=null;this._daTickInterval=null;a.extend(true,this,w);var u=this._dataBounds,h,o,v,p,r,q,b;for(var g=0;gu.max)||u.max==null){u.max=p[f][0]}if(f>0){b=Math.abs(p[f][0]-p[f-1][0]);h.intervals.push(b);if(h.frequencies.hasOwnProperty(b)){h.frequencies[b]+=1}else{h.frequencies[b]=1}}o+=b}else{p[f][1]=new a.jsDate(p[f][1]).getTime();r[f][1]=new a.jsDate(p[f][1]).getTime();q[f][1]=new a.jsDate(p[f][1]).getTime();if((p[f][1]!=null&&p[f][1]u.max)||u.max==null){u.max=p[f][1]}if(f>0){b=Math.abs(p[f][1]-p[f-1][1]);h.intervals.push(b);if(h.frequencies.hasOwnProperty(b)){h.frequencies[b]+=1}else{h.frequencies[b]=1}}}o+=b}if(v.renderer.bands){if(v.renderer.bands.hiData.length){var m=v.renderer.bands.hiData;for(var f=0,e=m.length;fu.max)||u.max==null){u.max=m[f][0]}}else{m[f][1]=new a.jsDate(m[f][1]).getTime();if((m[f][1]!=null&&m[f][1]>u.max)||u.max==null){u.max=m[f][1]}}}}if(v.renderer.bands.lowData.length){var m=v.renderer.bands.lowData;for(var f=0,e=m.length;f=r){n=o-k*(this.padMin-1);r=s+k*(this.padMax-1);A=a.jqplot.LinearTickGenerator(n,r)}this.min=A[0];this.max=A[1];this.numberTicks=A[2];this.tickInterval=A[4];this.daTickInterval=[this.tickInterval/1000,"seconds"];for(var u=0;u200){this.numberTicks=parseInt(3+(q-200)/100,10)}else{this.numberTicks=2}}}if(this.daTickInterval==null){this.daTickInterval=[k/(this.numberTicks-1)/1000,"seconds"]}for(var u=0;u