14 lines
67 KiB
JavaScript
14 lines
67 KiB
JavaScript
![]() |
/**
|
||
|
* Copyright (c) 2009 Chris Leonello
|
||
|
* jqPlot 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.
|
||
|
*
|
||
|
* 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 dot leonello at gmail 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 .
|
||
|
*/
|
||
|
(function(h){var c;h.jqplot=function(A,y,w){var x,v;if(y==null){throw"No data specified"}if(y.constructor==Array&&y.length==0||y[0].constructor!=Array){throw"Improper Data Array"}if(w==null){if(y instanceof Array){x=y;v=null}else{if(y.constructor==Object){x=null;v=y}}}else{x=y;v=w}var z=new n();z.init(A,x,v);z.draw();return z};h.jqplot.debug=1;h.jqplot.config={debug:1,enablePlugins:true,defaultHeight:300,defaultWidth:400};h.jqplot.enablePlugins=h.jqplot.config.enablePlugins;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.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 l(v){h.jqplot.ElemContainer.call(this);this.name=v;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.useSeriesColor=false;this.borderWidth=null;this.borderColor=null;this._dataBounds={min:null,max:null};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}l.prototype=new h.jqplot.ElemContainer();l.prototype.constructor=l;l.prototype.init=function(){this.renderer=new this.renderer();this.tickOptions.axis=this.name;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)};l.prototype.draw=function(v){return this.renderer.draw.call(this,v)};l.prototype.set=function(){this.renderer.set.call(this)};l.prototype.pack=function(w,v){if(this.show){this.renderer.pack.call(this,w,v)}if(this._min==null){this._min=this.min;this._max=this.max;this._tickInterval=this.tickInterval;this._numberTicks=this.numberTicks;this.__ticks=this._ticks}};l.prototype.reset=function(){this.renderer.reset.call(this)};l.prototype.resetScale=function(){this.min=null;this.max=null;this.numberTicks=null;this.tickInterval=null};function b(v){h.jqplot.ElemContainer.call(this);this.sh
|