Commits

Chris Leonello  committed 0cff87f

Change linearAxisRenderer to plain old object and now call axis.renderer directly. In options, pass in new object to renderer.

  • Participants
  • Parent commits 0b3843e

Comments (0)

Files changed (1)

 (function($) {
     var debug = 1;
+    
+    function makeClass(klassname, konstructor) {
+        var o = new Object();
+        o.constructor = konstructor;
+        o.classname = klassname;
+        return o;
+    }
     // Axes object which contains all properties needed to draw an axis with 
     // the given renderer
     function Axis(name) {
         this.scale = 1.2;
         this.numberTicks;
         this.tickInterval;
-        this.renderer = 'linearAxisRenderer';
+        this.renderer = new linearAxisRenderer();
         this.label = {text:null, font:null, align:null};
         this.ticks = {labels:[], values:[], styles:[], formatString:'%.1f', font:null};
         this.height = 0;
             axis.gridHeight = this.height;
             axis.gridWidth = this.width;
             var db = axis.dataBounds;
+            log(axis);
             if (axis.ticks && axis.ticks.constructor == Array) {
                 var temp = $.extend(true, [], axis.ticks);
                 // if 2-D array, match them up
             }
             // else call the axis renderer and fill in the labels
             // and values from there.
-            else $.jqplot[axis.renderer].fill.call(axis);
+            else axis.renderer.fill.call(axis);
         };
         
         this.pack = function() {
             for (var name in this.axes) {
                 var axis = this.axes[name];
-                $.jqplot[axis.renderer].pack.call(axis, this.gridOffsets);
+                axis.renderer.pack.call(axis, this.gridOffsets);
             }
         }
     
     
     
         
-    $.jqplot.linearAxisRenderer = function() {
+    function linearAxisRenderer() {
     };
     
-    $.jqplot.linearAxisRenderer.fill = function() {
+    linearAxisRenderer.prototype.fill = function() {
         log('in linearAxisRenderer');
         var name = this.name;
         var db = this.dataBounds;
     
     // Now we know offsets around the grid, we can define conversioning functions
     // and properly lay out the axes.
-    $.jqplot.linearAxisRenderer.pack = function(offsets) {
+    linearAxisRenderer.prototype.pack = function(offsets) {
         log('in packer');;
         var ticks = this.ticks;
         var tickdivs = $(this.elem).children('div');