Commits

Chris Leonello committed 6498439

Removed files that have moved into core and other cleanup.

  • Participants
  • Parent commits 68d4cf7

Comments (0)

Files changed (8)

jqplot.axisRenderers.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);
-    };
-    
-    // function: draw
-    // Creates the axis container DOM element and tick DOM elements.
-    // Populates some properties of the elements and figures out
-    // height and width of element.
-    // called with scope of axis
-    $.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'});
-        }  
-    };
-    
-    // function: setAxis
-    // called with scope of an axis
-    // Populate the axis properties, giving a label and value
-    // (corresponding to the user data coordinates, not plot coords.)
-    // for each tick on the axis.
-    $.jqplot.linearAxisRenderer.prototype.createTicks = function() {
-        // we're are operating on an axis here
-        var axis = this;
-        var ticks = axis._ticks;
-        var name = axis.name;
-        // databounds were set on axis initialization.
-        var db = axis._dataBounds;
-        var dim, interval;
-        var min, max;
-        var pos1, pos2;
-        var tt, i;
-        
-        //////////////////////////
-        //////////////////////////
-        // fix me
-        //////////////////////////
-        // if we already have ticks, use them.
-        // ticks must be in order of increasing value.
-        if (ticks.length) {
-            // for (i=0; i<ticks.length; i++){
-            //     var t = ticks[i];
-            //     if (!t.label) t.label = t.value.toString();
-            //     // set iitial css positioning styles for the ticks.
-            //     var pox = i*15+'px';
-            //     switch (name) {
-            //         case 'xaxis':
-            //             t._styles = {position:'absolute', top:'0px', left:pox, paddingTop:'10px'};
-            //             break;
-            //         case 'x2axis':
-            //             t._styles = {position:'absolute', bottom:'0px', left:pox, paddingBottom:'10px'};
-            //             break;
-            //         case 'yaxis':
-            //             t._styles = {position:'absolute', right:'0px', top:pox, paddingRight:'10px'};
-            //             break;
-            //         case 'y2axis':
-            //             t._styles = {position:'absolute', left:'0px', top:pox, paddingLeft:'10px'};
-            //             break;
-            //     }
-            // }
-            // axis.numberTicks = ticks.length;
-            // axis.min = ticks[0].value;
-            // axis.max = ticks[axis.numberTicks-1].value;
-            // axis.tickInterval = (axis.max - axis.min) / (axis.numberTicks - 1);
-        }
-        
-        // we don't have any ticks yet, let's make some!
-        else {
-            if (name == 'xaxis' || name == 'x2axis') {
-                dim = this._plotWidth;
-            }
-            else {
-                dim = this._plotHeight;
-            }
-        
-            min = ((this.min != null) ? this.min : db.min);
-            max = ((this.max != null) ? this.max : db.max);
-
-            var range = max - min;
-            var rmin, rmax;
-        
-            rmin = min - range/2*(this.pad - 1);
-            rmax = 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 $.jqplot.AxisTick(this.tickOptions);
-                if (!this.showTicks) {
-                    t.showLabel = false;
-                    t.showMark = false;
-                }
-                else if (!this.showTickMarks) t.showMark = false;
-                t.setTick(tt, this.name);
-                axis._ticks.push(t);
-            }
-        }
-    };
-    
-    // functions: pack
-    // Define unit <-> coordinate conversions and properly position tick dom elements.
-    // Now we know offsets around the grid, we can define conversioning functions.
-    $.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];
-                    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];
-                    var shim = t.getHeight()/2;
-                    var val = this.u2p(t.value) - shim + 'px';
-                    t._elem.css('top', val);
-                }
-            }
-        }    
-    };
-    
-    // Class: categoryAxisRenderer
-    // Subclass of linearAxisRenderer.  Renderes axis as equally spaced category labels.
-    $.jqplot.categoryAxisRenderer = function() {
-        $.jqplot.linearAxisRenderer.call(this);
-    };
- 
-    // function: setAxis
-    // called with scope of an axis
-    // Populate the axis properties, giving a label and value
-    // (corresponding to the user data coordinates, not plot coords.)
-    // for each tick on the axis.
-    $.jqplot.categoryAxisRenderer.prototype.setAxis = function(plotHeight, plotWidth) {
-        // we're are operating on an axis here
-        var axis = this;
-        var ticks = this._ticks;
-        var name = this.name;
-        var db = this._dataBounds;
-        var dim, interval;
-        var min, max;
-        var pos1, pos2;
-        var tt, i;
-        
-        this._canvasHeight = plotHeight;
-        this._canvasWidth = plotWidth;
-        
-        // if tick
-        
-        // Ticks should have been already specified by the user or set by the line renderer.  Since we
-        // don't have access to the series, there's not much to do if we don't already have ticks.
-        if (ticks.length) {
-            this.numberTicks =ticks.length;
-            for (i=0; i<ticks.length; i++){
-                var t = ticks[i];
-                if (!t.label) t.label = this.formatter(this.formatString, t.value.toString());
-                // databounds should have been set to 0, 2*series length in line renderer
-                this.min = db.min;
-                this.max = db.max;
-                // set iitial css positioning styles for the ticks.
-                var pox = i*15+'px';
-                switch (name) {
-                    case 'xaxis':
-                        t._styles = {position:'absolute', top:'0px', left:pox, paddingTop:'10px'};
-                        break;
-                    case 'x2axis':
-                        t._styles = {position:'absolute', bottom:'0px', left:pox, paddingBottom:'10px'};
-                        break;
-                    case 'yaxis':
-                        t._styles = {position:'absolute', right:'0px', top:pox, paddingRight:'10px'};
-                        break;
-                    case 'y2axis':
-                        t._styles = {position:'absolute', left:'0px', top:pox, paddingLeft:'10px'};
-                        break;
-                }
-            }
-        }
-        
-        // we don't have any ticks yet, try to guess based on the bounds.
-        else {
-            // TBD what to do here.
-        }
-        
-        if (name == 'yaxis' || name == 'y2axis') this.ticks.styles.reverse();
-    };
-    
-    
-})(jQuery);

jqplot.axisTick.js

-(function($) {    
-    $.jqplot.AxisTick = function(options) {
-        $.jqplot.ElemContainer.call(this);
-        this.mark = 'outside';
-        this.showMark = true;
-        this.isMinorTick = false;
-        this.size = 4;
-        this.markSize = 4;
-        this.show = true;
-        this.showLabel = true;
-        this.label = '';
-        this.value = null;
-        this._styles = {};
-        this.formatter = $.jqplot.sprintf;
-        this.formatString;
-        this.fontFamily='';
-        this.fontSize = '0.75em';
-        this.textColor = '';
-        this._elem;
-        
-        $.extend(true, this, options);
-    };
-    
-    $.jqplot.AxisTick.prototype = new $.jqplot.ElemContainer();
-    $.jqplot.AxisTick.prototype.constructor = $.jqplot.AxisTick;
-    
-    $.jqplot.AxisTick.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.AxisTick.prototype.draw = function() {
-        if (!this.label) this.label = this.formatter(this.formatString, this.value);
-        this._elem = $('<div 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;
-    }
-})(jQuery);

jqplot.canvasGridRenderer.js

-(function($) {    
-    // Class: $.jqplot.canvasGridRenderer
-    // (Public) Rendrer for the jqPlot grid which draws the grid as a canvas element on the page.
-    $.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) {
-                    switch (name) {
-                        case 'xaxis':
-                            for (var i=0; i<ticks.length; i++) {
-                                var pos = Math.round(axis.u2p(axis._ticks[i].value)) + 0.5;
-                                drawLine(pos, this._top, pos, this._bottom);
-                            }
-                            break;
-                        case 'yaxis':
-                            for (var i=0; i<ticks.length; i++) {
-                                var pos = Math.round(axis.u2p(axis._ticks[i].value)) + 0.5;
-                                drawLine(this._right, pos, this._left, pos);
-                            }
-                            break;
-                        case 'x2axis':
-                            for (var i=0; i<ticks.length; i++) {
-                                var pos = Math.round(axis.u2p(axis._ticks[i].value)) + 0.5;
-                                drawLine(pos, this._bottom, pos, this._top);
-                            }
-                            break;
-                        case 'y2axis':
-                            for (var i=0; i<ticks.length; i++) {
-                                var pos = Math.round(axis.u2p(axis._ticks[i].value)) + 0.5;
-                                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];
-            var to = axis.tickOptions;
-            if (axis.show && to.mark) {
-                var ticks = axis._ticks;
-                var s = to.markSize;
-                var m = to.mark;
-                var t = axis._ticks;
-                switch (name) {
-                    case 'xaxis':
-                        for (var i=0; i<t.length; i++) {
-                            var pos = Math.round(axis.u2p(t[i].value)) + 0.5;
-                            var b, e;
-                            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':
-                        for (var i=0; i<t.length; i++) {
-                            var pos = Math.round(axis.u2p(t[i].value)) + 0.5;
-                            var b, e;
-                            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':
-                        for (var i=0; i<t.length; i++) {
-                            var pos = Math.round(axis.u2p(t[i].value)) + 0.5;
-                            var b, e;
-                            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':
-                        for (var i=0; i<t.length; i++) {
-                            var pos = Math.round(axis.u2p(t[i].value)) + 0.5;
-                            var b, e;
-                            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.categoryAxisRenderer.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);
+    };
+    
+    // function: draw
+    // Creates the axis container DOM element and tick DOM elements.
+    // Populates some properties of the elements and figures out
+    // height and width of element.
+    // called with scope of axis
+    $.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'});
+        }  
+    };
+    
+    // function: setAxis
+    // called with scope of an axis
+    // Populate the axis properties, giving a label and value
+    // (corresponding to the user data coordinates, not plot coords.)
+    // for each tick on the axis.
+    $.jqplot.linearAxisRenderer.prototype.createTicks = function() {
+        // we're are operating on an axis here
+        var axis = this;
+        var ticks = axis._ticks;
+        var name = axis.name;
+        // databounds were set on axis initialization.
+        var db = axis._dataBounds;
+        var dim, interval;
+        var min, max;
+        var pos1, pos2;
+        var tt, i;
+        
+        //////////////////////////
+        //////////////////////////
+        // fix me
+        //////////////////////////
+        // if we already have ticks, use them.
+        // ticks must be in order of increasing value.
+        if (ticks.length) {
+            // for (i=0; i<ticks.length; i++){
+            //     var t = ticks[i];
+            //     if (!t.label) t.label = t.value.toString();
+            //     // set iitial css positioning styles for the ticks.
+            //     var pox = i*15+'px';
+            //     switch (name) {
+            //         case 'xaxis':
+            //             t._styles = {position:'absolute', top:'0px', left:pox, paddingTop:'10px'};
+            //             break;
+            //         case 'x2axis':
+            //             t._styles = {position:'absolute', bottom:'0px', left:pox, paddingBottom:'10px'};
+            //             break;
+            //         case 'yaxis':
+            //             t._styles = {position:'absolute', right:'0px', top:pox, paddingRight:'10px'};
+            //             break;
+            //         case 'y2axis':
+            //             t._styles = {position:'absolute', left:'0px', top:pox, paddingLeft:'10px'};
+            //             break;
+            //     }
+            // }
+            // axis.numberTicks = ticks.length;
+            // axis.min = ticks[0].value;
+            // axis.max = ticks[axis.numberTicks-1].value;
+            // axis.tickInterval = (axis.max - axis.min) / (axis.numberTicks - 1);
+        }
+        
+        // we don't have any ticks yet, let's make some!
+        else {
+            if (name == 'xaxis' || name == 'x2axis') {
+                dim = this._plotWidth;
+            }
+            else {
+                dim = this._plotHeight;
+            }
+        
+            min = ((this.min != null) ? this.min : db.min);
+            max = ((this.max != null) ? this.max : db.max);
+
+            var range = max - min;
+            var rmin, rmax;
+        
+            rmin = min - range/2*(this.pad - 1);
+            rmax = 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 $.jqplot.AxisTick(this.tickOptions);
+                if (!this.showTicks) {
+                    t.showLabel = false;
+                    t.showMark = false;
+                }
+                else if (!this.showTickMarks) t.showMark = false;
+                t.setTick(tt, this.name);
+                axis._ticks.push(t);
+            }
+        }
+    };
+    
+    // functions: pack
+    // Define unit <-> coordinate conversions and properly position tick dom elements.
+    // Now we know offsets around the grid, we can define conversioning functions.
+    $.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];
+                    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];
+                    var shim = t.getHeight()/2;
+                    var val = this.u2p(t.value) - shim + 'px';
+                    t._elem.css('top', val);
+                }
+            }
+        }    
+    };
+    
+    // Class: categoryAxisRenderer
+    // Subclass of linearAxisRenderer.  Renderes axis as equally spaced category labels.
+    $.jqplot.categoryAxisRenderer = function() {
+        $.jqplot.linearAxisRenderer.call(this);
+    };
+ 
+    // function: setAxis
+    // called with scope of an axis
+    // Populate the axis properties, giving a label and value
+    // (corresponding to the user data coordinates, not plot coords.)
+    // for each tick on the axis.
+    $.jqplot.categoryAxisRenderer.prototype.setAxis = function(plotHeight, plotWidth) {
+        // we're are operating on an axis here
+        var axis = this;
+        var ticks = this._ticks;
+        var name = this.name;
+        var db = this._dataBounds;
+        var dim, interval;
+        var min, max;
+        var pos1, pos2;
+        var tt, i;
+        
+        this._canvasHeight = plotHeight;
+        this._canvasWidth = plotWidth;
+        
+        // if tick
+        
+        // Ticks should have been already specified by the user or set by the line renderer.  Since we
+        // don't have access to the series, there's not much to do if we don't already have ticks.
+        if (ticks.length) {
+            this.numberTicks =ticks.length;
+            for (i=0; i<ticks.length; i++){
+                var t = ticks[i];
+                if (!t.label) t.label = this.formatter(this.formatString, t.value.toString());
+                // databounds should have been set to 0, 2*series length in line renderer
+                this.min = db.min;
+                this.max = db.max;
+                // set iitial css positioning styles for the ticks.
+                var pox = i*15+'px';
+                switch (name) {
+                    case 'xaxis':
+                        t._styles = {position:'absolute', top:'0px', left:pox, paddingTop:'10px'};
+                        break;
+                    case 'x2axis':
+                        t._styles = {position:'absolute', bottom:'0px', left:pox, paddingBottom:'10px'};
+                        break;
+                    case 'yaxis':
+                        t._styles = {position:'absolute', right:'0px', top:pox, paddingRight:'10px'};
+                        break;
+                    case 'y2axis':
+                        t._styles = {position:'absolute', left:'0px', top:pox, paddingLeft:'10px'};
+                        break;
+                }
+            }
+        }
+        
+        // we don't have any ticks yet, try to guess based on the bounds.
+        else {
+            // TBD what to do here.
+        }
+        
+        if (name == 'yaxis' || name == 'y2axis') this.ticks.styles.reverse();
+    };
+    
+    
+})(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 = null;
-        }
-        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.lineAxisRenderer.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.lineAxisRenderer = function() {
-    };
-    
-    $.jqplot.lineAxisRenderer.prototype.init = function(options){
-        $.extend(true, this, options);
-    };
-    
-    // function: draw
-    // Creates the axis container DOM element and tick DOM elements.
-    // Populates some properties of the elements and figures out
-    // height and width of element.
-    // called with scope of axis
-    $.jqplot.lineAxisRenderer.prototype.draw = function(target, plotHeight, plotWidth) {
-        var axis = this;
-        if (this._mode == 'category') {
-            this.type = 'linear';
-        }
-        if (axis.show) {
-            // populate the axis label and value properties.
-            axis.renderer.setAxis.call(axis, plotHeight, plotWidth);
-            // 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 h, w;
-            
-            axis._elem = $('<div class="jqplot-axis"></div>').appendTo(target).get(0);
-            //for (var s in axis.style) $(axis._elem).css(s, axis.style[s]);
-    
-            if (axis.ticks.showLabels) {
-                for (var i=0; i<axis.ticks.labels.length; i++) {
-                    var elem = $('<div class="jqplot-axis-tick"></div>').appendTo(axis._elem).get(0);
-                    
-                    for (var s in axis.ticks.styles[i]) $(elem).css(s, axis.ticks.styles[i][s]);
-                    $(elem).html(axis.ticks.labels[i]);
-                    
-                    if (axis.ticks.fontFamily) elem.style.fontFamily = axis.ticks.fontFamily;
-                    if (axis.ticks.fontSize) elem.style.fontSize = axis.ticks.fontSize;
-                    
-                    h = $(elem).outerHeight(true);
-                    w = $(elem).outerWidth(true);
-                    
-                    if (axis._height < h) {
-                        axis._height = h;
-                    }
-                    if (axis._width < w) {
-                        axis._width = w;
-                    }
-                }
-            }
-        }
-    };
-    
-    // function: setAxis
-    // called with scope of an axis
-    // Populate the axis properties, giving a label and value
-    // (corresponding to the user data coordinates, not plot coords.)
-    // for each tick on the axis.
-    $.jqplot.lineAxisRenderer.prototype.setAxis = function(plotHeight, plotWidth) {
-        // if a ticks array is specified, use it to fill in
-        // the labels and values.
-        var ticks = this.ticks;
-        if (ticks.values.length) {
-            if (!ticks.labels.length) {
-                for (var i=0; i<ticks.values.length; i++) {
-                    ticks.labels[i] = ticks.values[i].toString();
-                }
-            }
-        }
-        this._canvasHeight = plotHeight;
-        this._canvasWidth = plotWidth;
-        this.renderer.fill.call(this);
-    };
-    
-    // function: fill
-    // Set initial styles on tick dom elements.
-    // figure out numberTicks, min, max, tickInterval and tick values.
-    $.jqplot.lineAxisRenderer.prototype.fill = function() {
-        var name = this.name;
-        var db = this._dataBounds;
-        var dim, interval;
-        var min, max;
-        var pos1, pos2;
-        var tt;
-        
-        if (this._mode == 'category') {
-            var v = this.ticks.values;
-            var l = this.ticks.labels;
-            this.numberTicks = v.length;
-            this.tickInterval = this.max/2;
-            this.min = db.min;
-            this.max = db.max;
-            this.max = 2*this.numberTicks;
-            for (var i=0; i<this.numberTicks; i++) {
-                var pox = i*15+'px';
-                switch (name) {
-                    case 'xaxis':
-                        this.ticks.styles.push({position:'absolute', top:'0px', left:pox, paddingTop:'10px'});
-                        break;
-                    case 'x2axis':
-                        this.ticks.styles.push({position:'absolute', bottom:'0px', left:pox, paddingBottom:'10px'});
-                        break;
-                    case 'yaxis':
-                        this.ticks.styles.push({position:'absolute', right:'0px', top:pox, paddingRight:'10px'});
-                        break;
-                    case 'y2axis':
-                        this.ticks.styles.push({position:'absolute', left:'0px', top:pox, paddingLeft:'10px'});
-                        break;
-                }
-            }
-        }
-        
-        else if (this.ticks.values.length) {
-            var v = this.ticks.values;
-            this.numberTicks = v.length;
-            this.min = v[0];
-            this.max = v[this.numberTicks-1];
-            this.tickInterval = (this.max - this.min) / (this.numberTicks - 1);
-            for (var i=0; i<this.numberTicks; i++) {
-                var pox = i*15+'px';
-                switch (name) {
-                    case 'xaxis':
-                        this.ticks.styles.push({position:'absolute', top:'0px', left:pox, paddingTop:'10px'});
-                        break;
-                    case 'x2axis':
-                        this.ticks.styles.push({position:'absolute', bottom:'0px', left:pox, paddingBottom:'10px'});
-                        break;
-                    case 'yaxis':
-                        this.ticks.styles.push({position:'absolute', right:'0px', top:pox, paddingRight:'10px'});
-                        break;
-                    case 'y2axis':
-                        this.ticks.styles.push({position:'absolute', left:'0px', top:pox, paddingLeft:'10px'});
-                        break;
-                }
-            }
-        }
-        
-        else {
-            if (name == 'xaxis' || name == 'x2axis') {
-                dim = this._canvasWidth;
-            }
-            else {
-                dim = this._canvasHeight;
-            }
-        
-            min = ((this.min != null) ? this.min : db.min);
-            max = ((this.max != null) ? this.max : db.max);
-            // perform some checks
-            if (min < 1e-9) min = 1e-9;
-            if (max < 1e-8) max = 1e-8;
-            if (this.pad >1.99) this.pad = 1.99;
-            var range = max - min;
-            var rmin, rmax;
-
-            function fillLog() {
-                if (this.logStyle == 'even') {                    
-                    // for log axes, open up range to get a nice power of this.logBase.
-                    rmin = min - min*((this.pad-1)/2);
-                    rmax = max + max*((this.pad-1)/2);
-                    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;
-                        }
-                    }
-        
-                    var u = Math.pow(this.logBase, (1/(this.numberTicks-1)*Math.log(this.max/this.min)/Math.log(this.logBase)));
-                    for (var i=0; i<this.numberTicks; i++){
-                        tt = this.min * Math.pow(u, i);
-                        fillTick.call(this, tt);
-                
-                    }
-                    
-                }
-                
-                else {
-                    
-                    // for log axes, open up range to get a nice power of this.logBase.
-                    rmin = Math.pow(this.logBase, Math.ceil(Math.log(min*(2-this.pad))/Math.log(this.logBase))-1);
-                    rmax = Math.pow(this.logBase, Math.floor(Math.log(max*this.pad)/Math.log(this.logBase))+1);
-                    this.min = rmin;
-                    this.max = rmax;
-                    range = this.max - this.min;            
-            
-                    var fittedTicks = 0;
-                    var minorTicks = 0;
-                    if (this.numberTicks == null){
-                        if (dim > 100) {
-                            this.numberTicks = Math.round(Math.log(this.max/this.min)/Math.log(this.logBase) + 1);
-                            if (this.numberTicks < 2) this.numberTicks = 2;
-                            fittedTicks = parseInt(3+(dim-100)/75);
-                        }
-                        else {
-                            this.numberTicks = 2;
-                            fittedTicks = 2;
-                        }
-                        // if we don't have enough ticks, add some intermediate ticks
-                        // how many to have between major ticks.
-                        if (this.numberTicks < fittedTicks-1) {
-                            minorTicks = 1 + Math.floor(fittedTicks/this.numberTicks);
-                        }
-                    }
-
-                    for (var i=0; i<this.numberTicks; i++){
-                        tt = Math.pow(this.logBase, i - this.numberTicks + 1) * this.max;
-
-                        fillTick.call(this, tt);
-                
-                        if (minorTicks) {
-                            var tt1 = Math.pow(this.logBase, i - this.numberTicks + 2) * this.max;
-                            var spread = tt1 - tt;
-                            var interval = spread / (minorTicks+1);
-                            for (var j=0; j<minorTicks; j++) {
-                                fillTick.call(this, tt+interval*(j+1));
-                            }
-                        }       
-                    }                    
-                }
-            
-                function fillTick(tt) {
-                    this.ticks.labels.push(this.tickFormatter(this.ticks.formatString, tt));
-                    this.ticks.values.push(tt);
-                    var pox = i*15+'px';
-                    switch (name) {
-                        case 'xaxis':
-                            this.ticks.styles.push({position:'absolute', top:'0px', left:pox, paddingTop:'10px'});
-                            break;
-                        case 'x2axis':
-                            this.ticks.styles.push({position:'absolute', bottom:'0px', left:pox, paddingBottom:'10px'});
-                            break;
-                        case 'yaxis':
-                            this.ticks.styles.push({position:'absolute', right:'0px', top:pox, paddingRight:'10px'});
-                            break;
-                        case 'y2axis':
-                            this.ticks.styles.push({position:'absolute', left:'0px', top:pox, paddingLeft:'10px'});
-                            break;
-                    }
-                };
-        
-            };
-        
-            function fillLinear() {
-                rmin = min - range/2*(this.pad - 1);
-                rmax = 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);
-                    this.ticks.labels.push(this.tickFormatter(this.ticks.formatString, tt));
-                    this.ticks.values.push(tt);
-                    var pox = i*15+'px';
-                    switch (name) {
-                        case 'xaxis':
-                            this.ticks.styles.push({position:'absolute', top:'0px', left:pox, paddingTop:'10px'});
-                            break;
-                        case 'x2axis':
-                            this.ticks.styles.push({position:'absolute', bottom:'0px', left:pox, paddingBottom:'10px'});
-                            break;
-                        case 'yaxis':
-                            this.ticks.styles.push({position:'absolute', right:'0px', top:pox, paddingRight:'10px'});
-                            break;
-                        case 'y2axis':
-                            this.ticks.styles.push({position:'absolute', left:'0px', top:pox, paddingLeft:'10px'});
-                            break;
-                    
-                    }
-                }
-            };
-            if (this.type == 'log' || this.type == 'logarithmic') fillLog.call(this);
-            else fillLinear.call(this);
-        }
-        
-        if (name == 'yaxis' || name == 'y2axis') this.ticks.styles.reverse();
-    };
-    
-    // functions: pack
-    // Define unit <-> coordinate conversions and properly position tick dom elements.
-    // Now we know offsets around the grid, we can define conversioning functions.
-    $.jqplot.lineAxisRenderer.prototype.pack = function(offsets, gridwidth, gridheight) {
-        var lb = parseInt(this.logBase);
-        var ticks = this.ticks;
-        var tickdivs = $(this._elem).children('div');
-        // linear or log axis.  All it changes is the transformation functions from units to coordinates
-        var trans = function(v) { return v };
-        var logtrans = function (v) { return Math.log(v)/Math.log(lb); };
-        var max = this.max;
-        var min = this.min;
-        if (this.type == 'log' || this.type == 'logarithmic') {
-            trans = logtrans;
-            max = Math.log(this.max)/Math.log(this.logBase);
-            min = Math.log(this.min)/Math.log(this.logBase);
-        }
-        
-        if (this.name == 'xaxis' || this.name == 'x2axis') {
-            this._offsets = {min:offsets.left, max:offsets.right};
-            
-            this.p2u = function(p) {
-                return (p - this._offsets.min)*(this.max - this.min)/(this._canvasWidth - this._offsets.max - this._offsets.min) + this.min;
-            }
-            
-            this.u2p = function(u) {
-                return (u - this.min) * (this._canvasWidth - this._offsets.max - this._offsets.min) / (this.max - this.min) + this._offsets.min;
-            }
-            
-            this.series_u2p = function(u) {
-                return (u - this.min) * gridwidth / (this.max - this.min);
-            }
-            
-            this.series_p2u = function(p) {
-                return p * (this.max - this.min) / gridwidth + this.min;
-            }
-            
-            if (this.show) {
-                // set the position
-                if (this.name == 'xaxis') {
-                    $(this._elem).css({position:'absolute', left:'0px', top:(this._canvasHeight-offsets.bottom)+'px'});
-                }
-                else {
-                    $(this._elem).css({position:'absolute', left:'0px', bottom:(this._canvasHeight-offsets.top)+'px'});
-                }
-                for (i=0; i<tickdivs.length; i++) {
-                    var shim = $(tickdivs[i]).outerWidth(true)/2;
-                    var val = this.u2p(ticks.values[i]) - shim + 'px';
-                    $(tickdivs[i]).css('left', val);
-                    // remember, could have done it this way
-                    //tickdivs[i].style.left = val;
-                }
-            }
-        }  
-        else {
-            this._offsets = {min:offsets.bottom, max:offsets.top};
-            
-            this.p2u = function(p) {
-                return (trans(p) - this._canvasHeight + this._offsets.min)*(max - min)/(this._canvasHeight - this._offsets.min - this._offsets.max) + min;
-            }
-            
-            this.u2p = function(u) {
-                return -(trans(u) - min) * (this._canvasHeight - this._offsets.min - this._offsets.max) / (max - min) + this._canvasHeight - this._offsets.min;
-            }
-            
-            this.series_u2p = function(u) {
-                return (max - trans(u)) * gridheight /(max - min);
-            }
-            
-            this.series_p2u = function(p) {
-                return -trans(p) * (max - min) / gridheight + max;
-            }
-            
-            if (this.show) {
-                // set the position
-                if (this.name == 'yaxis') {
-                    $(this._elem).css({position:'absolute', right:(this._canvasWidth-offsets.left)+'px', top:'0px'});
-                }
-                else {
-                    $(this._elem).css({position:'absolute', left:(this._canvasWidth - offsets.right)+'px', top:'0px'});
-                }
-                for (i=0; i<tickdivs.length; i++) {
-                    var shim = $(tickdivs[i]).outerHeight(true)/2;
-                    var val = this.u2p(ticks.values[i]) - shim + 'px';
-                    $(tickdivs[i]).css('top', val);
-                }
-            }
-        }    
-        
-    };
-})(jQuery);

jqplot.lineRenderer.js

-(function($) {
-    $.jqplot.lineRenderer = function(){
-    };
-    
-    // called with scope of series.
-    $.jqplot.lineRenderer.prototype.init = function(options) {
-        $.extend(true, this.renderer, options);
-        if (!this.markerOptions.color) this.markerOptions.color = this.color;
-        this.marker.init(this.markerOptions);
-    }
-
-    $.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;
-            // recalculate the grid data
-            this.gridData = [];
-            this.gridData.push([xp.call(this._xaxis, this.data[0][0]), yp.call(this._yaxis, this.data[0][1])]);
-            ctx.moveTo(this.gridData[0][0], this.gridData[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])]);
-                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.marker.show) {
-            for (i=0; i<this.gridData.length; i++) {
-                this.marker.draw(this.gridData[i][0], this.gridData[i][1], ctx);
-            }
-        }
-        
-        ctx.restore();
-    };
-    
-    ///////////////////////////
-    //////////////////////////
-    // Don't need this anymore.
-    // $.jqplot.lineRenderer.prototype.processData = function() { 
-    //     // don't have axes conversion functions yet, all we can do is look for bad
-    //     // points and set the axes bounds.  
-    //     var d = this.data;
-    //     var i;
-    //     var xaxis = this._xaxis;
-    //     var yaxis = this._yaxis;
-    //     var dbx = xaxis._dataBounds;
-    //     var dby = yaxis._dataBounds;
-    // 
-    //     // weed out any null points and set the axes bounds
-    //     for (i=0; i<d.length; i++) {
-    //         if (d[i] == null || d[i][0] == null || d[i][1] == null) {
-    //             // if line breaking on null values is set, keep the null in the data
-    //             // if (this.renderer.breakOnNull && this.renderer.mode == 'scatter') d[i] = null;
-    //             // else delete the null to skip the point.
-    //             // else d.splice(i,1);
-    //             // For the time being, just delete null values
-    //             d.splice(i,1);
-    //             continue;
-    //         }
-    //         // Set the initial axes databounds.  May be overriden later by axis padding or by
-    //         // specific types of axes which call for different bounds.
-    //         else {                
-    //             if (d[i][0] < dbx.min || dbx.min == null) dbx.min = d[i][0];
-    //             if (d[i][0] > dbx.max || dbx.max == null) dbx.max = d[i][0];
-    //             if (d[i][1] < dby.min || dby.min == null) dby.min = d[i][1];
-    //             if (d[i][1] > dby.max || dby.max == null) dby.max = d[i][1];
-    //         }
-    //     }
-    //     
-    //     // Maybe don't do any of this.  Handle category intelligence within Axis.
-    //     // 
-    //     // // if the xaxis is a category axis, modify the databounds and ticks.
-    //     // if (xaxis.renderer.prototype == $.jqplot.categoryAxisRenderer) {
-    //     //     // A category line (or just line) plot.
-    //     //     // Populate the axis values if none were given.
-    //     //     // Each axis values will start at 1 and increment by 2 so
-    //     //     // that we can have nice "bins" for data and ticks.
-    //     //     // set the databaounds to 1 less and greater than number of bins.
-    //     //     dbx.min = 0;
-    //     //     dbx.max = d.length*2;
-    //     //     var ticks = xaxis._ticks;
-    //     //     if (!ticks.length) {
-    //     //         ticks = [];
-    //     //         for (i=0; i<d.length; i++) {
-    //     //             var t = new $.jqplot.AxisTick();
-    //     //             // set the tick value to it's position on the axis
-    //     //             // and set its label to the x value of the line.
-    //     //             ticks.push(t.init(2*i+1, d[i][0].toString(), xaxis.name));
-    //     //             // now reassign the x value to the right bin.
-    //     //             d[i][0] = 2*i+1;
-    //     //         }
-    //     //     }
-    //     // }
-    //     // 
-    //     // // Don't know if this makes sense, but allow it anyway.
-    //     // // if the yaxis is a category axis, modify the databounds and ticks.
-    //     // if (yaxis.renderer.prototype == $.jqplot.categoryAxisRenderer) {
-    //     //     // A category line (or just line) plot.
-    //     //     // Populate the axis values if none were given.
-    //     //     // Each axis values will start at 1 and increment by 2 so
-    //     //     // that we can have nice "bins" for data and ticks.
-    //     //     // set the databaounds to 1 less and greater than number of bins.
-    //     //     dby.min = 0;
-    //     //     dby.max = d.length*2;
-    //     //     var ticks = yaxis._ticks;
-    //     //     if (!ticks.length) {
-    //     //         ticks = [];
-    //     //         for (i=0; i<d.length; i++) {
-    //     //             var t = new $.jqplot.AxisTick();
-    //     //             // set the tick value to it's position on the axis
-    //     //             // and set its label to the y value of the line.
-    //     //             ticks.push(t.init(2*i+1, d[i][1].toString(), xaxis.name));
-    //     //             // now reassign the y value to the right bin.
-    //     //             d[i][1] = 2*i+1;
-    //     //         }
-    //     //     }
-    //     // }
-    // };
-})(jQuery);

jqplot.markRenderer.js

-(function($) {
-    // Class: $.jqplot.markRenderer
-    // (Public) Rendrer for the series marks.
-    $.jqplot.markRenderer = function(){
-        this.show = true;
-        // prop: style
-        // One of diamond, circle, square, x, plus, dash, filledDiamond, filledCircle, filledSquare
-        this.style = 'filledDiamond';
-        this.lineWidth = 2;
-        this.size = 9.0;
-        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.markRenderer.prototype.init = function(options) {
-        $.extend(true, this, options);
-    }
-    
-    $.jqplot.markRenderer.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.markRenderer.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.markRenderer.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.markRenderer.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);