Commits

Chris Leonello committed 0d4470e

Separated default plugins into own files again. Load dynamically when jquery.jqplot.js loads.

  • Participants
  • Parent commits 6bfef17

Comments (0)

Files changed (9)

jqplot.axisTickRenderer.js

+(function($) {
+    // class: $.jqplot.AxisTickRenderer
+    // A "tick" object showing the value of a tick/gridline on the plot.
+    $.jqplot.AxisTickRenderer = function(options) {
+        // Group: Properties
+        $.jqplot.ElemContainer.call(this);
+        // prop: mark
+        // tick mark on the axis.  One of 'inside', 'outside', 'cross', '' or null.
+        this.mark = 'outside';
+        // prop: showMark
+        // wether or not to show the mark on the axis.
+        this.showMark = true;
+        // prop: showGridline
+        // wether or not to draw the gridline on the grid at this tick.
+        this.showGridline = true;
+        // prop: isMinorTick
+        // if this is a minor tick.
+        this.isMinorTick = false;
+        this.size = 4;
+        // prop:  markSize
+        // Length of the tick marks in pixels.  For 'cross' style, length
+        // will be stoked above and below axis, so total length will be twice this.
+        this.markSize = 4;
+        // prop: show
+        // wether or not to show the tick (mark and label).
+        this.show = true;
+        // prop: showLabel
+        // wether or not to show the label.
+        this.showLabel = true;
+        this.label = '';
+        this.value = null;
+        this._styles = {};
+        // prop: formatter
+        // A class of a formatter for the tick text.  sprintf by default.
+        this.formatter = $.jqplot.DefaultTickFormatter;
+        // prop: formatString
+        // string passed to the formatter.
+        this.formatString = '';
+        // prop: fontFamily
+        // css spec for the font-family css attribute.
+        this.fontFamily='';
+        // prop: fontSize
+        // css spec for the font-size css attribute.
+        this.fontSize = '0.75em';
+        // prop: textColor
+        // css spec for the color attribute.
+        this.textColor = '';
+        this._elem;
+        
+        $.extend(true, this, options);
+    };
+    
+    $.jqplot.AxisTickRenderer.prototype.init = function(options) {
+        $.extend(true, this, options);
+    }
+    
+    $.jqplot.AxisTickRenderer.prototype = new $.jqplot.ElemContainer();
+    $.jqplot.AxisTickRenderer.prototype.constructor = $.jqplot.AxisTickRenderer;
+    
+    $.jqplot.AxisTickRenderer.prototype.setTick = function(value, axisName, isMinor) {
+        this.value = value;
+        var pox = '15px';
+        switch (axisName) {
+            case 'xaxis':
+                this._styles = {position:'absolute', top:'0px', left:pox, paddingTop:'10px'};
+                break;
+            case 'x2axis':
+                this._styles = {position:'absolute', bottom:'0px', left:pox, paddingBottom:'10px'};
+                break;
+            case 'yaxis':
+                this._styles = {position:'absolute', left:'0px', top:pox, paddingRight:'10px'};
+                break;
+            case 'y2axis':
+                this._styles = {position:'absolute', right:'0px', top:pox, paddingLeft:'10px'};
+                break;
+        }
+        if (isMinor) this.isMinorTick = true;
+        return this;
+    };
+    
+    $.jqplot.AxisTickRenderer.prototype.draw = function() {
+        if (!this.label) this.label = this.formatter(this.formatString, this.value);
+        style='';
+        if (Number(this.label)) style='style="white-space:nowrap;" ';
+        this._elem = $('<div '+style+'class="jqplot-axis-tick">'+this.label+'</div>');
+        for (var s in this._styles) {
+            this._elem.css(s, this._styles[s]);
+        }
+        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;
+    };
+        
+    $.jqplot.DefaultTickFormatter = function (format, val) {
+        if (typeof val == 'number') {
+            if (!format) format = '%.1f';
+            return $.jqplot.sprintf(format, val);
+        }
+        else return String(val);
+    }
+})(jQuery);

jqplot.canvasGridRenderer.js

+(function($) {     
+    $.jqplot.CanvasGridRenderer = function(){};
+    
+    // called with context of Grid object
+    $.jqplot.CanvasGridRenderer.prototype.init = function(options) {
+        this._ctx;
+        $.extend(true, this, options);
+    }
+    
+    // called with context of Grid.
+    $.jqplot.CanvasGridRenderer.prototype.createElement = function() {
+        var elem = document.createElement('canvas');
+        var w = this._plotDimensions.width;
+        var h = this._plotDimensions.height;
+        elem.width = w;
+        elem.height = h;
+        if ($.browser.msie) // excanvas hack
+            elem = window.G_vmlCanvasManager.initElement(elem);
+        this._elem = $(elem);
+        this._elem.css({ position: 'absolute', left: 0, top: 0 });
+        this._top = this._offsets.top;
+        this._bottom = h - this._offsets.bottom;
+        this._left = this._offsets.left;
+        this._right = w - this._offsets.right;
+        this._width = this._right - this._left;
+        this._height = this._bottom - this._top;
+        return this._elem;
+    };
+    //     
+    //     this.overlayCanvas = document.createElement('canvas');
+    //     this.overlayCanvas.width = this._width;
+    //     this.overlayCanvas.height = this._height;
+    //     if ($.browser.msie) // excanvas hack
+    //         this.overlayCanvas = window.G_vmlCanvasManager.initElement(this.overlayCanvas);
+    //     $(this.overlayCanvas).css({ position: 'absolute', left: 0, top: 0 });
+    //     this.target.append(this.overlayCanvas);
+    //     this.octx = this.overlayCanvas.getContext("2d");
+    // };
+    
+    $.jqplot.CanvasGridRenderer.prototype.draw = function() {
+        this._ctx = this._elem.get(0).getContext("2d");
+        var ctx = this._ctx;
+        var axes = this._axes;
+        // Add the grid onto the grid canvas.  This is the bottom most layer.
+        ctx.save();
+        ctx.fillStyle = this.background;
+        ctx.fillRect(this._left, this._top, this._width, this._height);
+        
+        if (this.drawGridlines) {
+            ctx.save();
+            ctx.lineJoin = 'miter';
+            ctx.lineCap = 'round';
+            ctx.lineWidth = 1;
+            ctx.strokeStyle = '#cccccc';
+            for (var name in axes) {
+                var axis = axes[name];
+                var ticks = axis._ticks;
+                if (axis.show) {
+                    for (var i=0; i<ticks.length; i++) {
+                        var t = axis._ticks[i];
+                        if (t.show && t.showGridline) {
+                            var pos = Math.round(axis.u2p(t.value)) + 0.5;
+                            switch (name) {
+                                case 'xaxis':
+                                    drawLine(pos, this._top, pos, this._bottom);
+                                    break;
+                                case 'yaxis':
+                                    drawLine(this._right, pos, this._left, pos);
+                                    break;
+                                case 'x2axis':
+                                    drawLine(pos, this._bottom, pos, this._top);
+                                    break;
+                                case 'y2axis':
+                                    drawLine(this._left, pos, this._right, pos);
+                                    break;
+                            }
+                        }
+                    }
+                }
+            }
+            ctx.restore();
+        }
+        
+        function drawLine(bx, by, ex, ey) {
+            ctx.beginPath();
+            ctx.moveTo(bx, by);
+            ctx.lineTo(ex, ey);
+            ctx.stroke();
+        }
+        // Now draw the tick marks.
+        ctx.save();
+        ctx.lineJoin = 'miter';
+        ctx.lineCap = 'round';
+        ctx.lineWidth = 1;
+        ctx.strokeStyle = '#cccccc';
+        for (var name in axes) {
+            var axis = axes[name];
+            if (axis.show) {
+                var t = axis._ticks;
+                for (var i=0; i<t.length; i++) {
+                    if (t[i].show && t[i].showMark && t[i].mark) {
+                        s = t[i].markSize;
+                        m = t[i].mark;
+                        var pos = Math.round(axis.u2p(t[i].value)) + 0.5;
+                        var b, e;
+                        switch (name)     {
+                            case 'xaxis':
+                                switch (m) {
+                                    case 'inside':
+                                        b = this._bottom-s;
+                                        e = this._bottom;
+                                        break;
+                                    case 'outside':
+                                        b = this._bottom;
+                                        e = this._bottom+s;
+                                        break;
+                                    case 'cross':
+                                        b = this._bottom-s;
+                                        e = this._bottom+s;
+                                        break;
+                                    default:
+                                        b = this._bottom;
+                                        e = this._bottom+s;
+                                        break;
+                                }
+                                drawLine(pos, b, pos, e);
+                                break;
+                            case 'yaxis':
+                                switch (m) {
+                                    case 'outside':
+                                        b = this._left-s;
+                                        e = this._left;
+                                        break;
+                                    case 'inside':
+                                        b = this._left;
+                                        e = this._left+s;
+                                        break;
+                                    case 'cross':
+                                        b = this._left-s;
+                                        e = this._left+s;
+                                        break;
+                                    default:
+                                        b = this._left-s;
+                                        e = this._left;
+                                        break;
+                                }
+                                drawLine(b, pos, e, pos);
+                                break;
+                            case 'x2axis':
+                                switch (m) {
+                                    case 'outside':
+                                        b = this._top-s;
+                                        e = this._top;
+                                        break;
+                                    case 'inside':
+                                        b = this._top;
+                                        e = this._top+s;
+                                        break;
+                                    case 'cross':
+                                        b = this._top-s;
+                                        e = this._top+s;
+                                        break;
+                                    default:
+                                        b = this._top-s;
+                                        e = this._top;
+                                        break;
+                                }
+                                drawLine(pos, b, pos, e);
+                                break;
+                            case 'y2axis':
+                                switch (m) {
+                                    case 'inside':
+                                        b = this._right-s;
+                                        e = this._right;
+                                        break;
+                                    case 'outside':
+                                        b = this._right;
+                                        e = this._right+s;
+                                        break;
+                                    case 'cross':
+                                        b = this._right-s;
+                                        e = this._right+s;
+                                        break;
+                                    default:
+                                        b = this._right;
+                                        e = this._right+s;
+                                        break;
+                                }
+                                drawLine(b, pos, e, pos);
+                                break;
+                        }
+                    }
+                }
+            }
+        }
+        ctx.restore();
+        ctx.lineWidth = this.borderWidth;
+        ctx.strokeStyle = this.borderColor;
+        ctx.strokeRect(this._left, this._top, this._width, this._height);
+        
+        // now draw the shadow
+        if (this.shadow) {
+            ctx.save();
+            for (var j=0; j<this.shadowDepth; j++) {
+                ctx.translate(Math.cos(this.shadowAngle*Math.PI/180)*this.shadowOffset, Math.sin(this.shadowAngle*Math.PI/180)*this.shadowOffset);
+                ctx.lineWidth = this.shadowWidth;
+                ctx.strokeStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
+                ctx.lineJoin = 'miter';
+                ctx.lineCap = 'round';
+                ctx.beginPath();
+                ctx.moveTo(this._left, this._bottom);
+                ctx.lineTo(this._right, this._bottom);
+                ctx.lineTo(this._right, this._top);
+                ctx.stroke();
+                //ctx.strokeRect(this._left, this._top, this._width, this._height);
+            }
+            ctx.restore();
+        }
+    
+        ctx.restore();
+    };
+})(jQuery); 

jqplot.divTitleRenderer.js

+(function($) {    
+    $.jqplot.DivTitleRenderer = function() {
+    };
+    
+    $.jqplot.DivTitleRenderer.prototype.init = function(options) {
+        $.extend(true, this, options);
+    };
+    
+    $.jqplot.DivTitleRenderer.prototype.draw = function() {
+        var r = this.renderer;
+        if (!this.text) {
+            this.show = false;
+            this._elem = $('<div style="height:0px;width:0px;"></div>');
+        }
+        else if (this.text) {
+            var styletext = 'padding-bottom:0.5em;position:absolute;top:0px;left:0px;';
+            styletext += (this._plotWidth) ? 'width:'+this._plotWidth+'px;' : '';
+            styletext += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
+            styletext += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
+            styletext += (this.textAlign) ? 'text-align:'+this.textAlign+';' : '';
+            styletext += (this.textColor) ? 'color:'+this.textColor+';' : '';
+            this._elem = $('<div class="jqplot-title" style="'+styletext+'">'+this.text+'</div>');
+        }
+        
+        return this._elem;
+    };
+    
+    $.jqplot.DivTitleRenderer.prototype.pack = function() {
+        // nothing to do here
+    };
+})(jQuery);  

jqplot.lineRenderer.js

+(function($) {
+    $.jqplot.LineRenderer = function(){
+    };
+    
+    // called with scope of series.
+    $.jqplot.LineRenderer.prototype.init = function(options) {
+        $.extend(true, this.renderer, options);
+    };
+    
+    $.jqplot.LineRenderer.prototype.setGridData = function() {
+        // recalculate the grid data
+        var xp = this._xaxis.series_u2p;
+        var yp = this._yaxis.series_u2p;
+        this.gridData = [];
+        this.gridData.push([xp.call(this._xaxis, this.data[0][0]), yp.call(this._yaxis, this.data[0][1])]);
+        for (var i=1; i<this.data.length; i++) {
+            this.gridData.push([xp.call(this._xaxis, this.data[i][0]), yp.call(this._yaxis, this.data[i][1])]);
+        }
+    };
+
+    $.jqplot.LineRenderer.prototype.draw = function(ctx) {
+        var i;
+        var xaxis = this.xaxis;
+        var yaxis = this.yaxis;
+        var d = this.data;
+        var xp = this._xaxis.series_u2p;
+        var yp = this._yaxis.series_u2p;
+        var pointx, pointy;
+        ctx.save();
+        if (this.showLine) {
+            ctx.beginPath();
+            ctx.lineJoin = 'round';
+            ctx.lineCap = 'round';
+            ctx.lineWidth = this.lineWidth;
+            ctx.strokeStyle = this.color;
+            ctx.moveTo(this.gridData[0][0], this.gridData[0][1]);
+            for (var i=1; i<this.data.length; i++) {
+                ctx.lineTo(this.gridData[i][0], this.gridData[i][1]);
+            }
+            ctx.stroke();
+        
+            // now draw the shadows
+            if (this.shadow) {
+                ctx.save();
+                for (var j=0; j<this.shadowDepth; j++) {
+                    ctx.translate(Math.cos(this.shadowAngle*Math.PI/180)*this.shadowOffset, Math.sin(this.shadowAngle*Math.PI/180)*this.shadowOffset);
+                    ctx.beginPath();
+                    ctx.strokeStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
+                    ctx.moveTo(this.gridData[0][0], this.gridData[0][1]);
+                    for (var i=1; i<this.data.length; i++) {
+                        ctx.lineTo(this.gridData[i][0], this.gridData[i][1]);
+                    }
+                    ctx.stroke();
+                }
+                ctx.restore();
+            }
+        }
+        
+        // now draw the markers
+        if (this.markerRenderer.show) {
+            for (i=0; i<this.gridData.length; i++) {
+                this.markerRenderer.draw(this.gridData[i][0], this.gridData[i][1], ctx);
+            }
+        }
+        
+        ctx.restore();
+    };  
+})(jQuery);    

jqplot.linearAxisRenderer.js

+(function($) {
+    var debug = 1;
+        
+	// Convienence function that won't hang IE.
+	function log() {
+	    if (window.console && debug) {
+	       if (arguments.length == 1) console.log (arguments[0]);
+	       else console.log(arguments);
+	    }
+	};
+
+    $.jqplot.LinearAxisRenderer = function() {
+    };
+    
+    $.jqplot.LinearAxisRenderer.prototype.init = function(options){
+        $.extend(true, this, options);
+        var db = this._dataBounds;
+        // Go through all the series attached to this axis and find
+        // the min/max bounds for this axis.
+        for (var i=0; i<this._series.length; i++) {
+            var s = this._series[i];
+            var d = s.data;
+            
+            for (var j=0; j<d.length; j++) { 
+                if (this.name == 'xaxis' || this.name == 'x2axis') {
+                    if (d[j][0] < db.min || db.min == null) db.min = d[j][0];
+                    if (d[j][0] > db.max || db.max == null) db.max = d[j][0];
+                }              
+                else {
+                    if (d[j][1] < db.min || db.min == null) db.min = d[j][1];
+                    if (d[j][1] > db.max || db.max == null) db.max = d[j][1];
+                }              
+            }
+        }
+    };
+    
+
+    $.jqplot.LinearAxisRenderer.prototype.draw = function() {
+        if (this.show) {
+            // populate the axis label and value properties.
+            this.renderer.createTicks.call(this);
+            // fill a div with axes labels in the right direction.
+            // Need to pregenerate each axis to get it's bounds and
+            // position it and the labels correctly on the plot.
+            var dim=0;
+            var temp;
+            
+            this._elem = $('<div class="jqplot-axis jqplot-'+this.name+'" style="position:absolute;"></div>');
+            //for (var s in axis.style) $(axis._elem).css(s, axis.style[s]);
+    
+            if (this.showTicks) {
+                var t = this._ticks;
+                for (var i=0; i<t.length; i++) {
+                    var tick = t[i];
+                    if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
+                        var elem = tick.draw();
+                        //var elem = $(frag).appendTo(axis._elem).get(0);
+                        elem.appendTo(this._elem);
+                    }
+                }
+            }
+        }
+        return this._elem;
+    };
+    
+    $.jqplot.LinearAxisRenderer.prototype.set = function() { 
+        var dim = 0;
+        var temp; 
+        if (this.show && this.showTicks) {
+            var t = this._ticks;
+            for (var i=0; i<t.length; i++) {
+                var tick = t[i];
+                if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
+                    if (this.name == 'xaxis' || this.name == 'x2axis') {
+                        temp = tick._elem.outerHeight(true);
+                    }
+                    else {
+                        temp = tick._elem.outerWidth(true);
+                    }
+                    if (temp > dim) dim = temp;
+                }
+            }
+            if (this.name == 'xaxis') this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'});
+            else if (this.name == 'x2axis') this._elem.css({'height':dim+'px', left:'0px', top:'0px'});
+            else if (this.name == 'yaxis') this._elem.css({'width':dim+'px', left:'0px', top:'0px'});
+            else if (this.name == 'y2axis') this._elem.css({'width':dim+'px', right:'0px', top:'0px'});
+        }  
+    };
+    
+
+    $.jqplot.LinearAxisRenderer.prototype.createTicks = function() {
+        // we're are operating on an axis here
+        var ticks = this._ticks;
+        var userTicks = this.ticks;
+        var name = this.name;
+        // databounds were set on axis initialization.
+        var db = this._dataBounds;
+        var dim, interval;
+        var min, max;
+        var pos1, pos2;
+        var tt, i;
+        
+        // if we already have ticks, use them.
+        // ticks must be in order of increasing value.
+        
+        if (userTicks.length) {
+            // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
+            for (i=0; i<userTicks.length; i++){
+                var ut = userTicks[i];
+                var t = new this.tickRenderer(this.tickOptions);
+                if (ut.constructor == Array) {
+                    t.value = ut[0];
+                    t.label = ut[1];
+                    if (!this.showTicks) {
+                        t.showLabel = false;
+                        t.showMark = false;
+                    }
+                    else if (!this.showTickMarks) t.showMark = false;
+                    t.setTick(ut[0], this.name);
+                    this._ticks.push(t);
+                }
+                
+                else {
+                    t.value = ut;
+                    if (!this.showTicks) {
+                        t.showLabel = false;
+                        t.showMark = false;
+                    }
+                    else if (!this.showTickMarks) t.showMark = false;
+                    t.setTick(ut, this.name);
+                    this._ticks.push(t);
+                }
+            }
+            this.numberTicks = userTicks.length;
+            this.min = this._ticks[0].value;
+            this.max = this._ticks[this.numberTicks-1].value;
+            this.tickInterval = (this.max - this.min) / (this.numberTicks - 1);
+        }
+        
+        // we don't have any ticks yet, let's make some!
+        else {
+            if (name == 'xaxis' || name == 'x2axis') {
+                dim = this._plotDimensions.width;
+            }
+            else {
+                dim = this._plotDimensions.height;
+            }
+        
+            min = ((this.min != null) ? this.min : db.min);
+            max = ((this.max != null) ? this.max : db.max);
+
+            var range = max - min;
+            var rmin, rmax;
+        
+            rmin = (this.min != null) ? this.min : min - range/2*(this.pad - 1);
+            rmax = (this.max != null) ? this.max : max + range/2*(this.pad - 1);
+            this.min = rmin;
+            this.max = rmax;
+            range = this.max - this.min;
+    
+            if (this.numberTicks == null){
+                if (dim > 100) {
+                    this.numberTicks = parseInt(3+(dim-100)/75);
+                }
+                else this.numberTicks = 2;
+            }
+    
+            this.tickInterval = range / (this.numberTicks-1);
+            for (var i=0; i<this.numberTicks; i++){
+                tt = this.min + i * range / (this.numberTicks-1);
+                var t = new this.tickRenderer(this.tickOptions);
+                // var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
+                if (!this.showTicks) {
+                    t.showLabel = false;
+                    t.showMark = false;
+                }
+                else if (!this.showTickMarks) t.showMark = false;
+                t.setTick(tt, this.name);
+                this._ticks.push(t);
+            }
+        }
+    };
+    
+    $.jqplot.LinearAxisRenderer.prototype.pack = function(pos, offsets) {
+        var ticks = this._ticks;
+        var max = this.max;
+        var min = this.min;
+        var offmax = offsets.max;
+        var offmin = offsets.min;
+        
+        for (var p in pos) {
+            this._elem.css(p, pos[p]);
+        }
+        
+        this._offsets = offsets;
+        // pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
+        var pixellength = offmax - offmin;
+        var unitlength = max - min;
+        
+        // point to unit and unit to point conversions references to Plot DOM element top left corner.
+        this.p2u = function(p){
+            return (p - offmin) * unitlength / pixellength + min;
+        };
+        
+        this.u2p = function(u){
+            return (u - min) * pixellength / unitlength + offmin;
+        };
+        
+        // point to unit and unit to point conversions references to Grid DOM element top left corner.
+        this.series_p2u = function(p){
+            return p * unitlength / pixellength + min;
+        };
+        
+        if (this.name == 'xaxis' || this.name == 'x2axis'){
+            this.series_u2p = function(u){
+                return (u - min) * pixellength / unitlength;
+            };
+        }
+        
+        else {
+            this.series_u2p = function(u){
+                return (u - max) * pixellength / unitlength;
+            };
+        }
+        
+        if (this.show) {
+            if (this.name == 'xaxis' || this.name == 'x2axis') {
+                for (i=0; i<ticks.length; i++) {
+                    var t = ticks[i];
+                    if (t.show && t.showLabel) {
+                        var shim = t.getWidth()/2;
+                        var val = this.u2p(t.value) - shim + 'px';
+                        t._elem.css('left', val);
+                    }
+                }
+            }
+            else {
+                for (i=0; i<ticks.length; i++) {
+                    var t = ticks[i];
+                    if (t.show && t.showLabel) {
+                        var shim = t.getHeight()/2;
+                        var val = this.u2p(t.value) - shim + 'px';
+                        t._elem.css('top', val);
+                    }
+                }
+            }
+        }
+    };
+})(jQuery);

jqplot.markerRenderer.js

+(function($) {
+    $.jqplot.MarkerRenderer = function(){
+        // prop: show
+        // wether or not to show the marker.
+        this.show = true;
+        // prop: style
+        // One of diamond, circle, square, x, plus, dash, filledDiamond, filledCircle, filledSquare
+        this.style = 'filledCircle';
+        // prop: lineWidth
+        // size of the line for non-filled markers.
+        this.lineWidth = 2;
+        // prop: size
+        // Size of the marker (diameter or circle, length of edge of square, etc.)
+        this.size = 9.0;
+        // prop: color
+        // color of marker.  Will be set to color of series by default on init.
+        this.color = '#666666';
+        // prop: shadow
+        // wether or not to draw a shadow on the line
+        this.shadow = true;
+        // prop: shadowAngle
+        // Shadow angle in degrees
+        this.shadowAngle = 45;
+        // prop: shadowOffset
+        // Shadow offset from line in pixels
+        this.shadowOffset = 1;
+        // prop: shadowDepth
+        // Number of times shadow is stroked, each stroke offset shadowOffset from the last.
+        this.shadowDepth = 3;
+        // prop: shadowAlpha
+        // Alpha channel transparency of shadow.  0 = transparent.
+        this.shadowAlpha = '0.07';
+    };
+    
+    $.jqplot.MarkerRenderer.prototype.init = function(options) {
+        $.extend(true, this, options);
+    }
+    
+    $.jqplot.MarkerRenderer.prototype.drawDiamond = function(x, y, ctx, fill) {
+        ctx.save();
+        ctx.lineJoin = 'miter';
+        ctx.lineWidth = this.lineWidth;
+        ctx.strokeStyle = this.color;
+        ctx.fillStyle = this.color;
+        ctx.beginPath();
+        var stretch = 1.2;
+        var dx = this.size/2/stretch;
+        var dy = this.size/2*stretch;
+        ctx.moveTo(x-dx, y);
+        ctx.lineTo(x, y+dy);
+        ctx.lineTo(x+dx, y);
+        ctx.lineTo(x, y-dy);
+        ctx.closePath();
+        if (fill) ctx.fill();
+        else ctx.stroke();
+        
+        if (this.shadow) { ctx.save();
+            ctx.save();
+            for (var j=0; j<this.shadowDepth; j++) {
+                ctx.translate(Math.cos(this.shadowAngle*Math.PI/180)*this.shadowOffset, Math.sin(this.shadowAngle*Math.PI/180)*this.shadowOffset);
+                ctx.beginPath();
+                ctx.strokeStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
+                ctx.fillStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
+                ctx.moveTo(x-dx, y);
+                ctx.lineTo(x, y+dy);
+                ctx.lineTo(x+dx, y);
+                ctx.lineTo(x, y-dy);
+                ctx.closePath();
+                if (fill) ctx.fill();
+                else ctx.stroke();
+            }
+            ctx.restore();
+        }
+        
+        ctx.restore();
+    };
+    
+    $.jqplot.MarkerRenderer.prototype.drawSquare = function(x, y, ctx, fill) {
+        ctx.save();
+        ctx.lineJoin = 'miter';
+        ctx.lineWidth = this.lineWidth;
+        ctx.strokeStyle = this.color;
+        ctx.fillStyle = this.color;
+        ctx.beginPath();
+        var stretch = 1.0;
+        var dx = this.size/2/stretch;
+        var dy = this.size/2*stretch;
+        ctx.moveTo(x-dx, y-dy);
+        ctx.lineTo(x-dx, y+dy);
+        ctx.lineTo(x+dx, y+dy);
+        ctx.lineTo(x+dx, y-dy);
+        ctx.closePath();
+        if (fill) ctx.fill();
+        else ctx.stroke();
+        
+        if (this.shadow) { ctx.save();
+            ctx.save();
+            for (var j=0; j<this.shadowDepth; j++) {
+                ctx.translate(Math.cos(this.shadowAngle*Math.PI/180)*this.shadowOffset, Math.sin(this.shadowAngle*Math.PI/180)*this.shadowOffset);
+                ctx.beginPath();
+                ctx.strokeStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
+                ctx.fillStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
+                ctx.moveTo(x-dx, y-dy);
+                ctx.lineTo(x-dx, y+dy);
+                ctx.lineTo(x+dx, y+dy);
+                ctx.lineTo(x+dx, y-dy);
+                ctx.closePath();
+                if (fill) ctx.fill();
+                else ctx.stroke();
+            }
+            ctx.restore();
+        }
+        
+        ctx.restore();
+    };
+    
+    $.jqplot.MarkerRenderer.prototype.drawCircle = function(x, y, ctx, fill) {
+        ctx.save();
+        ctx.lineJoin = 'miter';
+        ctx.lineWidth = this.lineWidth;
+        ctx.strokeStyle = this.color;
+        ctx.fillStyle = this.color;
+        var radius = this.size/2;
+        var end = 2*Math.PI;
+        ctx.beginPath();
+        ctx.arc(x, y, radius, 0, end, true);
+        if (fill) ctx.fill();
+        else ctx.stroke();
+        
+        if (this.shadow) {
+            ctx.save();
+            for (var j=0; j<this.shadowDepth; j++) {
+                ctx.translate(Math.cos(this.shadowAngle*Math.PI/180)*this.shadowOffset, Math.sin(this.shadowAngle*Math.PI/180)*this.shadowOffset);
+                ctx.beginPath();
+                ctx.strokeStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
+                ctx.fillStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
+                ctx.arc(x, y, radius, 0, end, true);
+                if (fill) ctx.fill();
+                else ctx.stroke();
+            }
+            ctx.restore();
+        }
+        ctx.restore();
+    };
+    
+    $.jqplot.MarkerRenderer.prototype.draw = function(x, y, ctx) {
+        switch (this.style) {
+            case 'diamond':
+                this.drawDiamond(x,y,ctx, false);
+                break;
+            case 'filledDiamond':
+                this.drawDiamond(x,y,ctx, true);
+                break;
+            case 'circle':
+                this.drawCircle(x,y,ctx, false);
+                break;
+            case 'filledCircle':
+                this.drawCircle(x,y,ctx, true);
+                break;
+            case 'square':
+                this.drawSquare(x,y,ctx, false);
+                break;
+            case 'filledSquare':
+                this.drawSquare(x,y,ctx, true);
+                break;
+            default:
+                this.drawDiamond(x,y,ctx, false);
+                break;
+        }
+    };
+})(jQuery);    

jqplot.sprintf.js

+(function($) {    	
+    /**
+     * sprintf() for JavaScript v.0.4
+     *
+     * Copyright (c) 2007 Alexandru Marasteanu <http://alexei.417.ro/>
+     * Thanks to David Baird (unit test and patch).
+     *
+     * This program is free software; you can redistribute it and/or modify it under
+     * the terms of the GNU General Public License as published by the Free Software
+     * Foundation; either version 2 of the License, or (at your option) any later
+     * version.
+     *
+     * This program is distributed in the hope that it will be useful, but WITHOUT
+     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+     * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+     * details.
+     *
+     * You should have received a copy of the GNU General Public License along with
+     * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+     * Place, Suite 330, Boston, MA 02111-1307 USA
+     */
+
+    // 
+    // It's prototype is simple:
+    // 
+    // string sprintf(string format[mixed arg1[, mixed arg2[,...]]])
+    // The placeholders in the format string are marked by "%" and are followed by one or more of these elements, in this order:
+    // 
+    // An optional "+" sign that forces to preceed the result with a plus or minus 
+    //   sign on numeric values. By default, only the "-" sign is used on negative numbers.
+    // An optional padding specifier that says what character to use for padding (if specified). 
+    //   Possible values are 0 or any other character precedeed by a '. The default is to pad with spaces.
+    // An optional "-" sign, that causes sprintf to left-align the result of this placeholder. 
+    //   The default is to right-align the result.
+    // An optional number, that says how many characters the result should have. If the value 
+    //   to be returned is shorter than this number, the result will be padded.
+    // An optional precision modifier, consisting of a "." (dot) followed by a number, that says 
+    //   how many digits should be displayed for floating point numbers. When used on a string, 
+    //   it causes the result to be truncated.
+    // 
+    // A type specifier that can be any of:
+    // % - print a literal "%" character
+    // b - print an integer as a binary number
+    // c - print an integer as the character with that ASCII value
+    // d - print an integer as a signed decimal number
+    // e - print a float as scientific notation
+    // u - print an integer as an unsigned decimal number
+    // f - print a float as is
+    // p - print a float of given significant digits instead of precision
+    // P - print a float of given significant digits instead of precision without padding out trailing zeros.
+    // o - print an integer as an octal number
+    // s - print a string as is
+    // x - print an integer as a hexadecimal number (lower-case)
+    // X - print an integer as a hexadecimal number (upper-case)
+    // 
+
+    function str_repeat(i, m) { for (var o = []; m > 0; o[--m] = i); return(o.join('')); }
+
+    function calcSigDigits(num, keepint) {
+        // keepint = true will force non-significant zeros before a
+        // decimal point to be counted as significant.
+        keepint = (keepint) ? true : false;
+        var count = 0;
+        var parts = String(num).split('.');
+        var part, i, p;
+
+        if (parts.length == 2) {
+            part = parts[1];
+            for (i=part.length-1; i>-1; i--) {
+                p = part[i];
+                if (count == 0) {
+                    if (p != '0') count++;
+                }
+                else count++;
+            }
+            part = parts[0];
+            for (var i=part.length-1; i>-1; i--) {
+                p = part[i];
+                if (count == 0) {
+                    if (!keepint && p != '0') count++;
+                    else count++;
+                }
+                else if (part.length == 1) {
+                    if (!keepint && p != '0') count++;
+                    else count++;
+                }
+                else count++;
+            }
+        }
+
+        else if (parts.length == 1) {
+            part = parts[0];
+            for (var i=part.length-1; i>-1; i--) {
+                p = part[i];
+                if (count == 0) {
+                    if (!keepint && p != '0') count++;
+                    else count++;
+                }
+                else count++;
+            }
+        }
+        
+        if (count<1) count = 1;
+
+        return count;
+    };
+
+    $.jqplot.sprintf = function() {
+      var i = 0, a, f = arguments[i++], o = [], m, p, c, x;
+      while (f) {
+        if (m = /^[^\x25]+/.exec(f)) o.push(m[0]);
+        else if (m = /^\x25{2}/.exec(f)) o.push('%');
+        else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fopPsuxX])/.exec(f)) {
+          if (((a = arguments[m[1] || i++]) == null) || (a == undefined)) throw("Too few arguments.");
+          if (/[^s]/.test(m[7]) && (typeof(a) != 'number'))
+            throw("Expecting number but found " + typeof(a));
+          switch (m[7]) {
+            case 'b': a = a.toString(2); break;
+            case 'c': a = String.fromCharCode(a); break;
+            case 'd': a = parseInt(a); break;
+            case 'e': a = m[6] ? a.toExponential(m[6]) : a.toExponential(); break;
+            case 'f': a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a); break;
+            case 'p': a = m[6] ? parseFloat(a).toPrecision(m[6]) : parseFloat(a); break;
+            case 'P':
+                var np = m[6];
+                if (np) {
+                    var b = parseFloat(a).toPrecision(np);
+                    var sig = calcSigDigits(b, true);
+                    if (sig < np) np = sig;
+                    a = parseFloat(a).toPrecision(np);
+                }
+                else a = parseFloat(a);
+                break;
+            case 'o': a = a.toString(8); break;
+            case 's': a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a); break;
+            case 'u': a = Math.abs(a); break;
+            case 'x': a = a.toString(16); break;
+            case 'X': a = a.toString(16).toUpperCase(); break;
+          }
+          a = (/[def]/.test(m[7]) && m[2] && a > 0 ? '+' + a : a);
+          c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' ';
+          x = m[5] - String(a).length;
+          p = m[5] ? str_repeat(c, x) : '';
+          o.push(m[4] ? a + p : p + a);
+        }
+        else throw ("Huh ?!");
+        f = f.substring(m[0].length);
+      }
+      return o.join('');
+    };
+})(jQuery);  

jqplot.tableLegendRenderer.js

+(function($) {
+    $.jqplot.TableLegendRenderer.prototype.init = function(options) {
+        $.extend(true, this, options);
+    }
+    
+    $.jqplot.TableLegendRenderer.prototype.draw = function() {
+        var legend = this;
+        if (this.show) {
+            var series = this._series;
+            // make a table.  one line label per row.
+            var ss = 'background:'+this.background+';border:'+this.border+';position:absolute;';
+            ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
+            ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
+            ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
+            this._elem = $('<table class="jqplot-legend" style="'+ss+'"></table>');
+        
+            var pad = false;
+            for (var i = 0; i< series.length; i++) {
+                s = series[i];
+                if (s.show) {
+                    var lt = s.label.toString();
+                    if (lt) {
+                        addrow.call(this, lt, s.color, pad);
+                        pad = true;
+                    }
+                    for (var j=0; j<$.jqplot.drawLegendHooks.length; j++) {
+                        var item = $.jqplot.drawLegendHooks[j].call(this, s);
+                        if (item) {
+                            addrow(item.label, item.color, pad);
+                            pad = true;
+                        } 
+                    }
+                }
+            }
+        }
+        
+        function addrow(label, color, pad) {
+            var rs = (pad) ? this.rowSpacing : '0';
+            var tr = $('<tr class="jqplot-legend"></tr>').appendTo(this._elem);
+            $('<td class="jqplot-legend" style="vertical-align:middle;text-align:center;padding-top:'+rs+';">'+
+                '<div style="border:1px solid #cccccc;padding:0.2em;">'+
+                '<div style="width:1.2em;height:0.7em;background-color:'+color+';"></div>'+
+                '</div></td>').appendTo(tr);
+            $('<td class="jqplot-legend" style="vertical-align:middle;padding-top:'+rs+';">'+label+'</td>').appendTo(tr);
+        };
+        return this._elem;
+    };
+    
+    $.jqplot.TableLegendRenderer.prototype.pack = function(offsets) {
+        if (this.show) {
+            // fake a grid for positioning
+            var grid = {_top:offsets.top, _left:offsets.left, _right:offsets.right, _bottom:this._plotDimensions.height - offsets.bottom}        
+            switch (this.location) {
+                case 'nw':
+                    var a = grid._left + this.xoffset;
+                    var b = grid._top + this.yoffset;
+                    this._elem.css('left', a);
+                    this._elem.css('top', b);
+                    break;
+                case 'n':
+                    var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+                    var b = grid._top + this.yoffset;
+                    this._elem.css('left', a);
+                    this._elem.css('top', b);
+                    break;
+                case 'ne':
+                    var a = offsets.right + this.xoffset;
+                    var b = grid._top + this.yoffset;
+                    this._elem.css({right:a, top:b});
+                    break;
+                case 'e':
+                    var a = offsets.right + this.xoffset;
+                    var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+                    this._elem.css({right:a, top:b});
+                    break;
+                case 'se':
+                    var a = offsets.right + this.xoffset;
+                    var b = offsets.bottom + this.yoffset;
+                    this._elem.css({right:a, bottom:b});
+                    break;
+                case 's':
+                    var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
+                    var b = offsets.bottom + this.yoffset;
+                    this._elem.css({left:a, bottom:b});
+                    break;
+                case 'sw':
+                    var a = grid._left + this.xoffset;
+                    var b = offsets.bottom + this.yoffset;
+                    this._elem.css({left:a, bottom:b});
+                    break;
+                case 'w':
+                    var a = grid._left + this.xoffset;
+                    var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
+                    this._elem.css({left:a, top:b});
+                    break;
+                default:  // same as 'se'
+                    var a = grid._right - this.xoffset;
+                    var b = grid._bottom + this.yoffset;
+                    this._elem.css({right:a, bottom:b});
+                    break;
+            }
+        } 
+    };
+})(jQuery);
 (function($) {
     var debug = 1;
     
+    var defaultPlugins = ['jqplot.linearAxisRenderer.js', 'jqplot.axisTickRenderer.js', 'jqplot.tableLegendRenderer.js', 'jqplot.lineRenderer.js', 'jqplot.markerRenderer.js', 'jqplot.divTitleRenderer.js', 'jqplot.canvasGridRenderer.js', 'jqplot.sprintf.js'];
+    for (var i=0; i<defaultPlugins.length; i++) {
+        var pp = defaultPlugins[i];
+        try {
+            document.write("<scr"+"ipt type='text/javascript' src='"+pp+"'></scr"+"ipt>");
+        } catch (e) {
+            var script = document.createElement("script");
+            script.src = pp;
+            document.getElementsByTagName("head")[0].appendChild(script);
+        }
+    }
+
+    
     // Class: $.jqplot
     // jQuery extension called by user to create plot.
     //
     Axis.prototype.pack = function(pos, offsets) {
         if (this.show) this.renderer.pack.call(this, pos, offsets);
     };
-    
-    $.jqplot.LinearAxisRenderer = function() {
-    };
-    
-    $.jqplot.LinearAxisRenderer.prototype.init = function(options){
-        $.extend(true, this, options);
-        var db = this._dataBounds;
-        // Go through all the series attached to this axis and find
-        // the min/max bounds for this axis.
-        for (var i=0; i<this._series.length; i++) {
-            var s = this._series[i];
-            var d = s.data;
-            
-            for (var j=0; j<d.length; j++) { 
-                if (this.name == 'xaxis' || this.name == 'x2axis') {
-                    if (d[j][0] < db.min || db.min == null) db.min = d[j][0];
-                    if (d[j][0] > db.max || db.max == null) db.max = d[j][0];
-                }              
-                else {
-                    if (d[j][1] < db.min || db.min == null) db.min = d[j][1];
-                    if (d[j][1] > db.max || db.max == null) db.max = d[j][1];
-                }              
-            }
-        }
-    };
-    
-
-    $.jqplot.LinearAxisRenderer.prototype.draw = function() {
-        if (this.show) {
-            // populate the axis label and value properties.
-            this.renderer.createTicks.call(this);
-            // fill a div with axes labels in the right direction.
-            // Need to pregenerate each axis to get it's bounds and
-            // position it and the labels correctly on the plot.
-            var dim=0;
-            var temp;
-            
-            this._elem = $('<div class="jqplot-axis jqplot-'+this.name+'" style="position:absolute;"></div>');
-            //for (var s in axis.style) $(axis._elem).css(s, axis.style[s]);
-    
-            if (this.showTicks) {
-                var t = this._ticks;
-                for (var i=0; i<t.length; i++) {
-                    var tick = t[i];
-                    if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
-                        var elem = tick.draw();
-                        //var elem = $(frag).appendTo(axis._elem).get(0);
-                        elem.appendTo(this._elem);
-                    }
-                }
-            }
-        }
-        return this._elem;
-    };
-    
-    $.jqplot.LinearAxisRenderer.prototype.set = function() { 
-        var dim = 0;
-        var temp; 
-        if (this.show && this.showTicks) {
-            var t = this._ticks;
-            for (var i=0; i<t.length; i++) {
-                var tick = t[i];
-                if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) {
-                    if (this.name == 'xaxis' || this.name == 'x2axis') {
-                        temp = tick._elem.outerHeight(true);
-                    }
-                    else {
-                        temp = tick._elem.outerWidth(true);
-                    }
-                    if (temp > dim) dim = temp;
-                }
-            }
-            if (this.name == 'xaxis') this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'});
-            else if (this.name == 'x2axis') this._elem.css({'height':dim+'px', left:'0px', top:'0px'});
-            else if (this.name == 'yaxis') this._elem.css({'width':dim+'px', left:'0px', top:'0px'});
-            else if (this.name == 'y2axis') this._elem.css({'width':dim+'px', right:'0px', top:'0px'});
-        }  
-    };
-    
-
-    $.jqplot.LinearAxisRenderer.prototype.createTicks = function() {
-        // we're are operating on an axis here
-        var ticks = this._ticks;
-        var userTicks = this.ticks;
-        var name = this.name;
-        // databounds were set on axis initialization.
-        var db = this._dataBounds;
-        var dim, interval;
-        var min, max;
-        var pos1, pos2;
-        var tt, i;
-        
-        // if we already have ticks, use them.
-        // ticks must be in order of increasing value.
-        
-        if (userTicks.length) {
-            // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed
-            for (i=0; i<userTicks.length; i++){
-                var ut = userTicks[i];
-                var t = new this.tickRenderer(this.tickOptions);
-                if (ut.constructor == Array) {
-                    t.value = ut[0];
-                    t.label = ut[1];
-                    if (!this.showTicks) {
-                        t.showLabel = false;
-                        t.showMark = false;
-                    }
-                    else if (!this.showTickMarks) t.showMark = false;
-                    t.setTick(ut[0], this.name);
-                    this._ticks.push(t);
-                }
-                
-                else {
-                    t.value = ut;
-                    if (!this.showTicks) {
-                        t.showLabel = false;
-                        t.showMark = false;
-                    }
-                    else if (!this.showTickMarks) t.showMark = false;
-                    t.setTick(ut, this.name);
-                    this._ticks.push(t);
-                }
-            }
-            this.numberTicks = userTicks.length;
-            this.min = this._ticks[0].value;
-            this.max = this._ticks[this.numberTicks-1].value;
-            this.tickInterval = (this.max - this.min) / (this.numberTicks - 1);
-        }
-        
-        // we don't have any ticks yet, let's make some!
-        else {
-            if (name == 'xaxis' || name == 'x2axis') {
-                dim = this._plotDimensions.width;
-            }
-            else {
-                dim = this._plotDimensions.height;
-            }
-        
-            min = ((this.min != null) ? this.min : db.min);
-            max = ((this.max != null) ? this.max : db.max);
-
-            var range = max - min;
-            var rmin, rmax;
-        
-            rmin = (this.min != null) ? this.min : min - range/2*(this.pad - 1);
-            rmax = (this.max != null) ? this.max : max + range/2*(this.pad - 1);
-            this.min = rmin;
-            this.max = rmax;
-            range = this.max - this.min;
-    
-            if (this.numberTicks == null){
-                if (dim > 100) {
-                    this.numberTicks = parseInt(3+(dim-100)/75);
-                }
-                else this.numberTicks = 2;
-            }
-    
-            this.tickInterval = range / (this.numberTicks-1);
-            for (var i=0; i<this.numberTicks; i++){
-                tt = this.min + i * range / (this.numberTicks-1);
-                var t = new this.tickRenderer(this.tickOptions);
-                // var t = new $.jqplot.AxisTickRenderer(this.tickOptions);
-                if (!this.showTicks) {
-                    t.showLabel = false;
-                    t.showMark = false;
-                }
-                else if (!this.showTickMarks) t.showMark = false;
-                t.setTick(tt, this.name);
-                this._ticks.push(t);
-            }
-        }
-    };
-    
-    $.jqplot.LinearAxisRenderer.prototype.pack = function(pos, offsets) {
-        var ticks = this._ticks;
-        var max = this.max;
-        var min = this.min;
-        var offmax = offsets.max;
-        var offmin = offsets.min;
-        
-        for (var p in pos) {
-            this._elem.css(p, pos[p]);
-        }
-        
-        this._offsets = offsets;
-        // pixellength will be + for x axes and - for y axes becasue pixels always measured from top left.
-        var pixellength = offmax - offmin;
-        var unitlength = max - min;
-        
-        // point to unit and unit to point conversions references to Plot DOM element top left corner.
-        this.p2u = function(p){
-            return (p - offmin) * unitlength / pixellength + min;
-        };
-        
-        this.u2p = function(u){
-            return (u - min) * pixellength / unitlength + offmin;
-        };
-        
-        // point to unit and unit to point conversions references to Grid DOM element top left corner.
-        this.series_p2u = function(p){
-            return p * unitlength / pixellength + min;
-        };
-        
-        if (this.name == 'xaxis' || this.name == 'x2axis'){
-            this.series_u2p = function(u){
-                return (u - min) * pixellength / unitlength;
-            };
-        }
-        
-        else {
-            this.series_u2p = function(u){
-                return (u - max) * pixellength / unitlength;
-            };
-        }
-        
-        if (this.show) {
-            if (this.name == 'xaxis' || this.name == 'x2axis') {
-                for (i=0; i<ticks.length; i++) {
-                    var t = ticks[i];
-                    if (t.show && t.showLabel) {
-                        var shim = t.getWidth()/2;
-                        var val = this.u2p(t.value) - shim + 'px';
-                        t._elem.css('left', val);
-                    }
-                }
-            }
-            else {
-                for (i=0; i<ticks.length; i++) {
-                    var t = ticks[i];
-                    if (t.show && t.showLabel) {
-                        var shim = t.getHeight()/2;
-                        var val = this.u2p(t.value) - shim + 'px';
-                        t._elem.css('top', val);
-                    }
-                }
-            }
-        }
-    };
-
-    // class: $.jqplot.AxisTickRenderer
-    // A "tick" object showing the value of a tick/gridline on the plot.
-    $.jqplot.AxisTickRenderer = function(options) {
-        // Group: Properties
-        $.jqplot.ElemContainer.call(this);
-        // prop: mark
-        // tick mark on the axis.  One of 'inside', 'outside', 'cross', '' or null.
-        this.mark = 'outside';
-        // prop: showMark
-        // wether or not to show the mark on the axis.
-        this.showMark = true;
-        // prop: showGridline
-        // wether or not to draw the gridline on the grid at this tick.
-        this.showGridline = true;
-        // prop: isMinorTick
-        // if this is a minor tick.
-        this.isMinorTick = false;
-        this.size = 4;
-        // prop:  markSize
-        // Length of the tick marks in pixels.  For 'cross' style, length
-        // will be stoked above and below axis, so total length will be twice this.
-        this.markSize = 4;
-        // prop: show
-        // wether or not to show the tick (mark and label).
-        this.show = true;
-        // prop: showLabel
-        // wether or not to show the label.
-        this.showLabel = true;
-        this.label = '';
-        this.value = null;
-        this._styles = {};
-        // prop: formatter
-        // A class of a formatter for the tick text.  sprintf by default.
-        this.formatter = $.jqplot.DefaultTickFormatter;
-        // prop: formatString
-        // string passed to the formatter.
-        this.formatString = '';
-        // prop: fontFamily
-        // css spec for the font-family css attribute.
-        this.fontFamily='';
-        // prop: fontSize
-        // css spec for the font-size css attribute.
-        this.fontSize = '0.75em';
-        // prop: textColor
-        // css spec for the color attribute.
-        this.textColor = '';
-        this._elem;
-        
-        $.extend(true, this, options);
-    };
-    
-    $.jqplot.AxisTickRenderer.prototype.init = function(options) {
-        $.extend(true, this, options);
-    }
-    
-    $.jqplot.AxisTickRenderer.prototype = new $.jqplot.ElemContainer();
-    $.jqplot.AxisTickRenderer.prototype.constructor = $.jqplot.AxisTickRenderer;
-    
-    $.jqplot.AxisTickRenderer.prototype.setTick = function(value, axisName, isMinor) {
-        this.value = value;
-        var pox = '15px';
-        switch (axisName) {
-            case 'xaxis':
-                this._styles = {position:'absolute', top:'0px', left:pox, paddingTop:'10px'};
-                break;
-            case 'x2axis':
-                this._styles = {position:'absolute', bottom:'0px', left:pox, paddingBottom:'10px'};
-                break;
-            case 'yaxis':
-                this._styles = {position:'absolute', left:'0px', top:pox, paddingRight:'10px'};
-                break;
-            case 'y2axis':
-                this._styles = {position:'absolute', right:'0px', top:pox, paddingLeft:'10px'};
-                break;
-        }
-        if (isMinor) this.isMinorTick = true;
-        return this;
-    };
-    
-    $.jqplot.AxisTickRenderer.prototype.draw = function() {
-        if (!this.label) this.label = this.formatter(this.formatString, this.value);
-        style='';
-        if (Number(this.label)) style='style="white-space:nowrap;" ';
-        this._elem = $('<div '+style+'class="jqplot-axis-tick">'+this.label+'</div>');
-        for (var s in this._styles) {
-            this._elem.css(s, this._styles[s]);
-        }
-        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;
-    };
 
     // Class: Legend
     // Legend object.  Cannot be instantiated directly, but created
         //
     };
 
-    $.jqplot.TableLegendRenderer.prototype.init = function(options) {
-        $.extend(true, this, options);
-    }
-    
-    $.jqplot.TableLegendRenderer.prototype.draw = function() {
-        var legend = this;
-        if (this.show) {
-            var series = this._series;
-            // make a table.  one line label per row.
-            var ss = 'background:'+this.background+';border:'+this.border+';position:absolute;';
-            ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
-            ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
-            ss += (this.textColor) ? 'color:'+this.textColor+';' : '';
-            this._elem = $('<table class="jqplot-legend" style="'+ss+'"></table>');
-        
-            var pad = false;
-            for (var i = 0; i< series.length; i++) {
-                s = series[i];
-                if (s.show) {
-                    var lt = s.label.toString();
-                    if (lt) {
-                        addrow.call(this, lt, s.color, pad);
-                        pad = true;
-                    }
-                    for (var j=0; j<$.jqplot.drawLegendHooks.length; j++) {
-                        var item = $.jqplot.drawLegendHooks[j].call(this, s);
-                        if (item) {
-                            addrow(item.label, item.color, pad);
-                            pad = true;
-                        } 
-                    }
-                }
-            }
-        }
-        
-        function addrow(label, color, pad) {
-            var rs = (pad) ? this.rowSpacing : '0';
-            var tr = $('<tr class="jqplot-legend"></tr>').appendTo(this._elem);
-            $('<td class="jqplot-legend" style="vertical-align:middle;text-align:center;padding-top:'+rs+';">'+
-                '<div style="border:1px solid #cccccc;padding:0.2em;">'+
-                '<div style="width:1.2em;height:0.7em;background-color:'+color+';"></div>'+
-                '</div></td>').appendTo(tr);
-            $('<td class="jqplot-legend" style="vertical-align:middle;padding-top:'+rs+';">'+label+'</td>').appendTo(tr);
-        };
-        return this._elem;
-    };
-    
-    $.jqplot.TableLegendRenderer.prototype.pack = function(offsets) {
-        if (this.show) {
-            // fake a grid for positioning
-            var grid = {_top:offsets.top, _left:offsets.left, _right:offsets.right, _bottom:this._plotDimensions.height - offsets.bottom}        
-            switch (this.location) {
-                case 'nw':
-                    var a = grid._left + this.xoffset;
-                    var b = grid._top + this.yoffset;
-                    this._elem.css('left', a);
-                    this._elem.css('top', b);
-                    break;
-                case 'n':
-                    var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
-                    var b = grid._top + this.yoffset;
-                    this._elem.css('left', a);
-                    this._elem.css('top', b);
-                    break;
-                case 'ne':
-                    var a = offsets.right + this.xoffset;
-                    var b = grid._top + this.yoffset;
-                    this._elem.css({right:a, top:b});
-                    break;
-                case 'e':
-                    var a = offsets.right + this.xoffset;
-                    var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
-                    this._elem.css({right:a, top:b});
-                    break;
-                case 'se':
-                    var a = offsets.right + this.xoffset;
-                    var b = offsets.bottom + this.yoffset;
-                    this._elem.css({right:a, bottom:b});
-                    break;
-                case 's':
-                    var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2;
-                    var b = offsets.bottom + this.yoffset;
-                    this._elem.css({left:a, bottom:b});
-                    break;
-                case 'sw':
-                    var a = grid._left + this.xoffset;
-                    var b = offsets.bottom + this.yoffset;
-                    this._elem.css({left:a, bottom:b});
-                    break;
-                case 'w':
-                    var a = grid._left + this.xoffset;
-                    var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2;
-                    this._elem.css({left:a, top:b});
-                    break;
-                default:  // same as 'se'
-                    var a = grid._right - this.xoffset;
-                    var b = grid._bottom + this.yoffset;
-                    this._elem.css({right:a, bottom:b});
-                    break;
-            }
-        } 
-    };
-
     // Class: Title
     // Plot Title object.  Cannot be instantiated directly, but created
     // by the Plot oject.  Title properties can be set or overriden by the 
     Title.prototype.pack = function() {
         this.renderer.pack.call(this);
     };
-    
-    $.jqplot.DivTitleRenderer = function() {
-    };
-    
-    $.jqplot.DivTitleRenderer.prototype.init = function(options) {
-        $.extend(true, this, options);
-    };
-    
-    $.jqplot.DivTitleRenderer.prototype.draw = function() {
-        var r = this.renderer;
-        if (!this.text) {
-            this.show = false;
-            this._elem = $('<div style="height:0px;width:0px;"></div>');
-        }
-        else if (this.text) {
-            var styletext = 'padding-bottom:0.5em;position:absolute;top:0px;left:0px;';
-            styletext += (this._plotWidth) ? 'width:'+this._plotWidth+'px;' : '';
-            styletext += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : '';
-            styletext += (this.fontSize) ? 'font-size:'+this.fontSize+';' : '';
-            styletext += (this.textAlign) ? 'text-align:'+this.textAlign+';' : '';
-            styletext += (this.textColor) ? 'color:'+this.textColor+';' : '';
-            this._elem = $('<div class="jqplot-title" style="'+styletext+'">'+this.text+'</div>');
-        }
-        
-        return this._elem;
-    };
-    
-    $.jqplot.DivTitleRenderer.prototype.pack = function() {
-        // nothing to do here
-    };
+
 
     // Class: Series
     // An individual data series object.  Cannot be instantiated directly, but created
         this.renderer.draw.call(this, sctx);
     }
     
-    $.jqplot.LineRenderer = function(){
-    };
-    
-    // called with scope of series.
-    $.jqplot.LineRenderer.prototype.init = function(options) {
-        $.extend(true, this.renderer, options);
-    };
-    
-    $.jqplot.LineRenderer.prototype.setGridData = function() {
-        // recalculate the grid data
-        var xp = this._xaxis.series_u2p;
-        var yp = this._yaxis.series_u2p;
-        this.gridData = [];
-        this.gridData.push([xp.call(this._xaxis, this.data[0][0]), yp.call(this._yaxis, this.data[0][1])]);
-        for (var i=1; i<this.data.length; i++) {
-            this.gridData.push([xp.call(this._xaxis, this.data[i][0]), yp.call(this._yaxis, this.data[i][1])]);
-        }
-    };
 
-    $.jqplot.LineRenderer.prototype.draw = function(ctx) {
-        var i;
-        var xaxis = this.xaxis;
-        var yaxis = this.yaxis;
-        var d = this.data;
-        var xp = this._xaxis.series_u2p;
-        var yp = this._yaxis.series_u2p;
-        var pointx, pointy;
-        ctx.save();
-        if (this.showLine) {
-            ctx.beginPath();
-            ctx.lineJoin = 'round';
-            ctx.lineCap = 'round';
-            ctx.lineWidth = this.lineWidth;
-            ctx.strokeStyle = this.color;
-            ctx.moveTo(this.gridData[0][0], this.gridData[0][1]);
-            for (var i=1; i<this.data.length; i++) {
-                ctx.lineTo(this.gridData[i][0], this.gridData[i][1]);
-            }
-            ctx.stroke();
-        
-            // now draw the shadows
-            if (this.shadow) {
-                ctx.save();
-                for (var j=0; j<this.shadowDepth; j++) {
-                    ctx.translate(Math.cos(this.shadowAngle*Math.PI/180)*this.shadowOffset, Math.sin(this.shadowAngle*Math.PI/180)*this.shadowOffset);
-                    ctx.beginPath();
-                    ctx.strokeStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
-                    ctx.moveTo(this.gridData[0][0], this.gridData[0][1]);
-                    for (var i=1; i<this.data.length; i++) {
-                        ctx.lineTo(this.gridData[i][0], this.gridData[i][1]);
-                    }
-                    ctx.stroke();
-                }
-                ctx.restore();
-            }
-        }
-        
-        // now draw the markers
-        if (this.markerRenderer.show) {
-            for (i=0; i<this.gridData.length; i++) {
-                this.markerRenderer.draw(this.gridData[i][0], this.gridData[i][1], ctx);
-            }
-        }
-        
-        ctx.restore();
-    };      
-    $.jqplot.MarkerRenderer = function(){
-        // prop: show
-        // wether or not to show the marker.
-        this.show = true;
-        // prop: style
-        // One of diamond, circle, square, x, plus, dash, filledDiamond, filledCircle, filledSquare
-        this.style = 'filledCircle';
-        // prop: lineWidth
-        // size of the line for non-filled markers.
-        this.lineWidth = 2;
-        // prop: size
-        // Size of the marker (diameter or circle, length of edge of square, etc.)
-        this.size = 9.0;
-        // prop: color
-        // color of marker.  Will be set to color of series by default on init.
-        this.color = '#666666';
-        // prop: shadow
-        // wether or not to draw a shadow on the line
-        this.shadow = true;
-        // prop: shadowAngle
-        // Shadow angle in degrees
-        this.shadowAngle = 45;
-        // prop: shadowOffset
-        // Shadow offset from line in pixels
-        this.shadowOffset = 1;
-        // prop: shadowDepth
-        // Number of times shadow is stroked, each stroke offset shadowOffset from the last.
-        this.shadowDepth = 3;
-        // prop: shadowAlpha
-        // Alpha channel transparency of shadow.  0 = transparent.
-        this.shadowAlpha = '0.07';
-    };
-    
-    $.jqplot.MarkerRenderer.prototype.init = function(options) {
-        $.extend(true, this, options);
-    }
-    
-    $.jqplot.MarkerRenderer.prototype.drawDiamond = function(x, y, ctx, fill) {
-        ctx.save();
-        ctx.lineJoin = 'miter';
-        ctx.lineWidth = this.lineWidth;
-        ctx.strokeStyle = this.color;
-        ctx.fillStyle = this.color;
-        ctx.beginPath();
-        var stretch = 1.2;
-        var dx = this.size/2/stretch;
-        var dy = this.size/2*stretch;
-        ctx.moveTo(x-dx, y);
-        ctx.lineTo(x, y+dy);
-        ctx.lineTo(x+dx, y);
-        ctx.lineTo(x, y-dy);
-        ctx.closePath();
-        if (fill) ctx.fill();
-        else ctx.stroke();
-        
-        if (this.shadow) { ctx.save();
-            ctx.save();
-            for (var j=0; j<this.shadowDepth; j++) {
-                ctx.translate(Math.cos(this.shadowAngle*Math.PI/180)*this.shadowOffset, Math.sin(this.shadowAngle*Math.PI/180)*this.shadowOffset);
-                ctx.beginPath();
-                ctx.strokeStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
-                ctx.fillStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
-                ctx.moveTo(x-dx, y);
-                ctx.lineTo(x, y+dy);
-                ctx.lineTo(x+dx, y);
-                ctx.lineTo(x, y-dy);
-                ctx.closePath();
-                if (fill) ctx.fill();
-                else ctx.stroke();
-            }
-            ctx.restore();
-        }
-        
-        ctx.restore();
-    };
-    
-    $.jqplot.MarkerRenderer.prototype.drawSquare = function(x, y, ctx, fill) {
-        ctx.save();
-        ctx.lineJoin = 'miter';
-        ctx.lineWidth = this.lineWidth;
-        ctx.strokeStyle = this.color;
-        ctx.fillStyle = this.color;
-        ctx.beginPath();
-        var stretch = 1.0;
-        var dx = this.size/2/stretch;
-        var dy = this.size/2*stretch;
-        ctx.moveTo(x-dx, y-dy);
-        ctx.lineTo(x-dx, y+dy);
-        ctx.lineTo(x+dx, y+dy);
-        ctx.lineTo(x+dx, y-dy);
-        ctx.closePath();
-        if (fill) ctx.fill();
-        else ctx.stroke();
-        
-        if (this.shadow) { ctx.save();
-            ctx.save();
-            for (var j=0; j<this.shadowDepth; j++) {
-                ctx.translate(Math.cos(this.shadowAngle*Math.PI/180)*this.shadowOffset, Math.sin(this.shadowAngle*Math.PI/180)*this.shadowOffset);
-                ctx.beginPath();
-                ctx.strokeStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
-                ctx.fillStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
-                ctx.moveTo(x-dx, y-dy);
-                ctx.lineTo(x-dx, y+dy);
-                ctx.lineTo(x+dx, y+dy);
-                ctx.lineTo(x+dx, y-dy);
-                ctx.closePath();
-                if (fill) ctx.fill();
-                else ctx.stroke();
-            }
-            ctx.restore();
-        }
-        
-        ctx.restore();
-    };
-    
-    $.jqplot.MarkerRenderer.prototype.drawCircle = function(x, y, ctx, fill) {
-        ctx.save();
-        ctx.lineJoin = 'miter';
-        ctx.lineWidth = this.lineWidth;
-        ctx.strokeStyle = this.color;
-        ctx.fillStyle = this.color;
-        var radius = this.size/2;
-        var end = 2*Math.PI;
-        ctx.beginPath();
-        ctx.arc(x, y, radius, 0, end, true);
-        if (fill) ctx.fill();
-        else ctx.stroke();
-        
-        if (this.shadow) {
-            ctx.save();
-            for (var j=0; j<this.shadowDepth; j++) {
-                ctx.translate(Math.cos(this.shadowAngle*Math.PI/180)*this.shadowOffset, Math.sin(this.shadowAngle*Math.PI/180)*this.shadowOffset);
-                ctx.beginPath();
-                ctx.strokeStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
-                ctx.fillStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
-                ctx.arc(x, y, radius, 0, end, true);
-                if (fill) ctx.fill();
-                else ctx.stroke();
-            }
-            ctx.restore();
-        }
-        ctx.restore();
-    };
-    
-    $.jqplot.MarkerRenderer.prototype.draw = function(x, y, ctx) {
-        switch (this.style) {
-            case 'diamond':
-                this.drawDiamond(x,y,ctx, false);
-                break;
-            case 'filledDiamond':
-                this.drawDiamond(x,y,ctx, true);
-                break;
-            case 'circle':
-                this.drawCircle(x,y,ctx, false);
-                break;
-            case 'filledCircle':
-                this.drawCircle(x,y,ctx, true);
-                break;
-            case 'square':
-                this.drawSquare(x,y,ctx, false);
-                break;
-            case 'filledSquare':
-                this.drawSquare(x,y,ctx, true);
-                break;
-            default:
-                this.drawDiamond(x,y,ctx, false);
-                break;
-        }
-    };
-    
     /* 
         Class: Grid
         (Private) Object representing the grid on which the plot is drawn.  The grid in this
     Grid.prototype.draw = function() {
         this.renderer.draw.call(this);
     }
-    
-    $.jqplot.CanvasGridRenderer = function(){};
-    
-    // called with context of Grid object
-    $.jqplot.CanvasGridRenderer.prototype.init = function(options) {
-        this._ctx;
-        $.extend(true, this, options);
-    }
-    
-    // called with context of Grid.
-    $.jqplot.CanvasGridRenderer.prototype.createElement = function() {
-        var elem = document.createElement('canvas');
-        var w = this._plotDimensions.width;
-        var h = this._plotDimensions.height;
-        elem.width = w;
-        elem.height = h;
-        if ($.browser.msie) // excanvas hack
-            elem = window.G_vmlCanvasManager.initElement(elem);
-        this._elem = $(elem);
-        this._elem.css({ position: 'absolute', left: 0, top: 0 });
-        this._top = this._offsets.top;
-        this._bottom = h - this._offsets.bottom;
-        this._left = this._offsets.left;
-        this._right = w - this._offsets.right;
-        this._width = this._right - this._left;
-        this._height = this._bottom - this._top;
-        return this._elem;
-    };
-    //     
-    //     this.overlayCanvas = document.createElement('canvas');
-    //     this.overlayCanvas.width = this._width;
-    //     this.overlayCanvas.height = this._height;
-    //     if ($.browser.msie) // excanvas hack
-    //         this.overlayCanvas = window.G_vmlCanvasManager.initElement(this.overlayCanvas);
-    //     $(this.overlayCanvas).css({ position: 'absolute', left: 0, top: 0 });
-    //     this.target.append(this.overlayCanvas);
-    //     this.octx = this.overlayCanvas.getContext("2d");
-    // };
-    
-    $.jqplot.CanvasGridRenderer.prototype.draw = function() {
-        this._ctx = this._elem.get(0).getContext("2d");
-        var ctx = this._ctx;
-        var axes = this._axes;
-        // Add the grid onto the grid canvas.  This is the bottom most layer.
-        ctx.save();
-        ctx.fillStyle = this.background;
-        ctx.fillRect(this._left, this._top, this._width, this._height);
-        
-        if (this.drawGridlines) {
-            ctx.save();
-            ctx.lineJoin = 'miter';
-            ctx.lineCap = 'round';
-            ctx.lineWidth = 1;
-            ctx.strokeStyle = '#cccccc';
-            for (var name in axes) {
-                var axis = axes[name];
-                var ticks = axis._ticks;
-                if (axis.show) {
-                    for (var i=0; i<ticks.length; i++) {
-                        var t = axis._ticks[i];
-                        if (t.show && t.showGridline) {
-                            var pos = Math.round(axis.u2p(t.value)) + 0.5;
-                            switch (name) {
-                                case 'xaxis':
-                                    drawLine(pos, this._top, pos, this._bottom);
-                                    break;
-                                case 'yaxis':
-                                    drawLine(this._right, pos, this._left, pos);
-                                    break;
-                                case 'x2axis':
-                                    drawLine(pos, this._bottom, pos, this._top);
-                                    break;
-                                case 'y2axis':
-                                    drawLine(this._left, pos, this._right, pos);
-                                    break;
-                            }
-                        }
-                    }
-                }
-            }
-            ctx.restore();
-        }
-        
-        function drawLine(bx, by, ex, ey) {
-            ctx.beginPath();
-            ctx.moveTo(bx, by);
-            ctx.lineTo(ex, ey);
-            ctx.stroke();
-        }
-        // Now draw the tick marks.
-        ctx.save();
-        ctx.lineJoin = 'miter';
-        ctx.lineCap = 'round';
-        ctx.lineWidth = 1;
-        ctx.strokeStyle = '#cccccc';
-        for (var name in axes) {
-            var axis = axes[name];
-            if (axis.show) {
-                var t = axis._ticks;
-                for (var i=0; i<t.length; i++) {
-                    if (t[i].show && t[i].showMark && t[i].mark) {
-                        s = t[i].markSize;
-                        m = t[i].mark;
-                        var pos = Math.round(axis.u2p(t[i].value)) + 0.5;
-                        var b, e;
-                        switch (name)     {
-                            case 'xaxis':
-                                switch (m) {
-                                    case 'inside':
-                                        b = this._bottom-s;
-                                        e = this._bottom;
-                                        break;
-                                    case 'outside':
-                                        b = this._bottom;
-                                        e = this._bottom+s;
-                                        break;
-                                    case 'cross':
-                                        b = this._bottom-s;
-                                        e = this._bottom+s;
-                                        break;
-                                    default:
-                                        b = this._bottom;
-                                        e = this._bottom+s;
-                                        break;
-                                }
-                                drawLine(pos, b, pos, e);
-                                break;
-                            case 'yaxis':
-                                switch (m) {
-                                    case 'outside':
-                                        b = this._left-s;
-                                        e = this._left;
-                                        break;
-                                    case 'inside':
-                                        b = this._left;
-                                        e = this._left+s;
-                                        break;
-                                    case 'cross':
-                                        b = this._left-s;
-                                        e = this._left+s;
-                                        break;
-                                    default:
-                                        b = this._left-s;
-                                        e = this._left;
-                                        break;
-                                }
-                                drawLine(b, pos, e, pos);
-                                break;
-                            case 'x2axis':
-                                switch (m) {
-                                    case 'outside':
-                                        b = this._top-s;
-                                        e = this._top;
-                                        break;
-                                    case 'inside':
-                                        b = this._top;
-                                        e = this._top+s;
-                                        break;
-                                    case 'cross':
-                                        b = this._top-s;
-                                        e = this._top+s;
-                                        break;
-                                    default:
-                                        b = this._top-s;
-                                        e = this._top;
-                                        break;
-                                }
-                                drawLine(pos, b, pos, e);
-                                break;
-                            case 'y2axis':
-                                switch (m) {
-                                    case 'inside':
-                                        b = this._right-s;
-                                        e = this._right;
-                                        break;
-                                    case 'outside':
-                                        b = this._right;
-                                        e = this._right+s;
-                                        break;
-                                    case 'cross':
-                                        b = this._right-s;
-                                        e = this._right+s;
-                                        break;
-                                    default:
-                                        b = this._right;
-                                        e = this._right+s;
-                                        break;
-                                }
-                                drawLine(b, pos, e, pos);
-                                break;
-                        }
-                    }
-                }
-            }
-        }
-        ctx.restore();
-        ctx.lineWidth = this.borderWidth;
-        ctx.strokeStyle = this.borderColor;
-        ctx.strokeRect(this._left, this._top, this._width, this._height);
-        
-        // now draw the shadow
-        if (this.shadow) {
-            ctx.save();
-            for (var j=0; j<this.shadowDepth; j++) {
-                ctx.translate(Math.cos(this.shadowAngle*Math.PI/180)*this.shadowOffset, Math.sin(this.shadowAngle*Math.PI/180)*this.shadowOffset);
-                ctx.lineWidth = this.shadowWidth;
-                ctx.strokeStyle = 'rgba(0,0,0,'+this.shadowAlpha+')';
-                ctx.lineJoin = 'miter';
-                ctx.lineCap = 'round';
-                ctx.beginPath();
-                ctx.moveTo(this._left, this._bottom);
-                ctx.lineTo(this._right, this._bottom);
-                ctx.lineTo(this._right, this._top);
-                ctx.stroke();
-                //ctx.strokeRect(this._left, this._top, this._width, this._height);
-            }
-            ctx.restore();
-        }
-    
-        ctx.restore();
-    };
+
     
     function SeriesCanvas() {
         $.jqplot.ElemContainer.call(this);
         return this._ctx;
     }
 
-    
     // Class: jqPlot
     // Plot object returned to call to $.jqplot.  Handles parsing user options,
     // creating sub objects (Axes, legend, title, series) and rendering the plot.
                 }    
             }